From patchwork Fri Feb 15 20:24:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot via dri-devel X-Patchwork-Id: 10816693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DF3C922 for ; Sat, 16 Feb 2019 20:15:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D73C2ADF3 for ; Sat, 16 Feb 2019 20:15:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 018DE2AE96; Sat, 16 Feb 2019 20:15:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EF362ADF3 for ; Sat, 16 Feb 2019 20:15:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0414E6EC26; Sat, 16 Feb 2019 20:12:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6553F6E100 for ; Fri, 15 Feb 2019 20:24:17 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id j18so5359152pfe.1 for ; Fri, 15 Feb 2019 12:24:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l8LmucLfEKB+cfAfRLnCfkwfcUHBvOoCjWKFJEb2a4A=; b=PjY1SgGVPM0Oq5FOH1phAl3oBvgcwaQJItmeh0HP9Hco09PcwEbxxI+ozH4ki6LAhz F+a5yH0r5BWX4QwWgAve2at1JPtxFIal1zNmy8y4sEyhgfFTBcpc/fMo+zzZ06YhFwrp KKnmhb92enT3jpqg6mjXL/amC2k5tng5D3A3ybBWUGQvqMZX5RiAcbnbWwEj7vFZSFuq Dh1BKNyCHsFCBQKPG8OTDB56ONoNZ3NumghJ7sXeaCpKAEcs5vucPo3GHWn2DIbmMpAh oBbMOc5wxQwk+ELOqO3reOksE+bw+svpVGHpPVOcTeQ+QygOjljIn+f6unsq4sv9nep/ 70CQ== X-Gm-Message-State: AHQUAuZFEpaDoC7hmr5w5gCDnUeZ2eRToqmDE8n/l+9nFubvbQ+3aRTG vrP4nnSYxy/Ax2MSstMOnW8Irg== X-Google-Smtp-Source: AHgI3IZwFDz9ufmc6empzvnFKyBRidpfEM0aaAU1Y497aFf7eV1LiCv/WiOWx0mEPWK7pYrL3osYBA== X-Received: by 2002:a63:545:: with SMTP id 66mr6933595pgf.102.1550262256890; Fri, 15 Feb 2019 12:24:16 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id l2sm7593340pgn.52.2019.02.15.12.24.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Feb 2019 12:24:15 -0800 (PST) To: Laura Abbott Subject: [EARLY RFC][PATCH 1/4] ion: Add ION_VERSION ioctl Date: Fri, 15 Feb 2019 12:24:09 -0800 Message-Id: <1550262252-15558-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550262252-15558-1-git-send-email-john.stultz@linaro.org> References: <1550262252-15558-1-git-send-email-john.stultz@linaro.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l8LmucLfEKB+cfAfRLnCfkwfcUHBvOoCjWKFJEb2a4A=; b=W+qEui45OwZvRtcQVAV/tDyjyqZFIcovPkwDB9aPtRZK5sARVU5W2vJtKKtCLnJP+Q jwtK5ekpa8HCbN/fWCTrn/rW90oPL7+Wvim+nyRFr1GILoyYoKqjHiGgBGy21gdp9G4p Jp3p/Bza+ma4JERyQc3OFFGRJpeiPzz3k9yhJZAMth6J3OGmon2MlWNrmnm6pSbZC2Xy cpmX+QXoH05x37xJMc2RoNU2FbcpPxcE7CvDs/U6tike8Q+g/uq/UsKNzgfOUPnrPyP/ Yu02PRGWmdKIJW1gaDl1v4t5jrwCWOAORWEPcMMMxJdlhXl0+AcQmf20NtOvMItohMq3 EaKg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: John Stultz via dri-devel From: kernel test robot via dri-devel Reply-To: John Stultz Cc: Alistair Strachan , Liam Mark , "Andrew F . Davis" , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With all the slight interface changes ion has had through its time in staging, keeping userland working properly has been a pain. Assuming more churn going forward, provide a proper version interface. Cc: Laura Abbott Cc: Sumit Semwal Cc: Liam Mark Cc: Brian Starkey Cc: Andrew F. Davis Cc: Alistair Strachan Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- drivers/staging/android/ion/ion-ioctl.c | 4 ++++ drivers/staging/android/ion/ion.h | 2 ++ drivers/staging/android/uapi/ion.h | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c index a8d3cc4..458a9f2 100644 --- a/drivers/staging/android/ion/ion-ioctl.c +++ b/drivers/staging/android/ion/ion-ioctl.c @@ -13,6 +13,7 @@ union ion_ioctl_arg { struct ion_allocation_data allocation; struct ion_heap_query query; + u32 version; }; static int validate_ioctl_arg(unsigned int cmd, union ion_ioctl_arg *arg) @@ -86,6 +87,9 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) case ION_IOC_HEAP_QUERY: ret = ion_query_heaps(&data.query); break; + case ION_IOC_VERSION: + data.version = ION_VERSION; + break; default: return -ENOTTY; } diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index 47b594c..439e682 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -21,6 +21,8 @@ #include "../uapi/ion.h" +#define ION_VERSION 3 + /** * struct ion_platform_heap - defines a heap in the given platform * @type: type of the heap from ion_heap_type enum diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h index 5d70098..c480448 100644 --- a/drivers/staging/android/uapi/ion.h +++ b/drivers/staging/android/uapi/ion.h @@ -124,4 +124,11 @@ struct ion_heap_query { #define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, \ struct ion_heap_query) +/** + * DOC: ION_IOC_VERSION - Get ION interface version + * + * Takes a u32 and returns the ION interface version + */ +#define ION_IOC_VERSION _IOR(ION_IOC_MAGIC, 9, u32) + #endif /* _UAPI_LINUX_ION_H */