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: John Stultz X-Patchwork-Id: 158546 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1112754jaa; Fri, 15 Feb 2019 12:24:17 -0800 (PST) X-Received: by 2002:a62:109b:: with SMTP id 27mr11393895pfq.227.1550262257317; Fri, 15 Feb 2019 12:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550262257; cv=none; d=google.com; s=arc-20160816; b=PR6heY7PAQOG+DWw/ZF6/VEs0y2QQDtNJEb64lMoYQ1nRMRjBH8mC0n7/eHbTs0uks Vw4WclFcniYUJ5iySotuDRt7a+UZYo9kg9ZX1zfv7oXZEPfrC0qTJI6POtEhglIJ5YwF CrrpFEkDiYi2Juo2zU4Mwt0RVdxlL0OAk2IKI6m4qsa6GHBT4P8kayQdOX56hWrC9nFt oFVyeKXRIO6/mOeXpehNkqNsjvupNB+Sot6BUnMnE9RyIsJL6KVWHkGJtB7tPaBalIeT 5/XaiGjtpPqAewT5ACCUPDncAejwQ1m91YLSc6McmaFgmvXv4BEQaA8mLlxD6fE/bsMW dVGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l8LmucLfEKB+cfAfRLnCfkwfcUHBvOoCjWKFJEb2a4A=; b=XV3lqmwfRz7Hb1yuC9PJWFlL21WZ3o6EUHKSv/7udyNKNl9m4uzBlXcny0rT+N3XGe i0L9GuLiEMJk9fWEz2NZ6Sge+iLgJ77Lde4ri92ZIiuwBD9im42IL6e54+PKJ0TcR6BJ LxkAtjS9CU7+Eh/1aTsB2HjMk7XBoP9C/23gCdPELCBD2I/k32BuCl2QyLbK9Az/kSjz rHnMUATTabO5WE6RC2WoqAiw69L0Hl3baqwMg66PAe0AWkfVGo2sDY15s6s9AVgJAmDj ypFarYfEHN3kxu0oCDIPoCiiMNAQKoexDPb1AFE9xvX8z2YQk7qD0XPGXRHrb3Lhldgx Kujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W+qEui45; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z13sor10213294pgp.62.2019.02.15.12.24.17 for (Google Transport Security); Fri, 15 Feb 2019 12:24:17 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W+qEui45; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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=NGNRr/zV3zv0jq9HSbdyIrVRrpMsDBOo1thdgaWs1cK7jVRLGsPULx77xnqMYwskCO 2+VdfxiJC8AKduLRvXeHYysQL3cSTrr4lkijvhOUcg52Ay7b13kaJFQLxVIc07UonpU4 gLbwv+/rx8z7A7GJApzAU49hZjox1/+9hv/osCEq0lTdRThUhiT3lfxd7zR2diWsptSu UBEH2yDi1MDHuR5Hlp70aRBsuqTt6hGEnOyY+vdP22S85iML3LXB98bxz+tAf3Q33XCt v20yE0dutyxVyDPJcOiWjs/ef9tnxLqt2irPMG1lfZsBCcEQ0W2nnohWDuwq4pMR4w1X HIww== X-Gm-Message-State: AHQUAubJ95HAkHCnpydz1mZqeBuveFdaaYvcZtPVRZcDt7LSzld+oEfJ ob7kC/zt1c+Pc39nSUYs2tFms5Yn 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) Return-Path: 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) From: John Stultz To: Laura Abbott Cc: John Stultz , Sumit Semwal , Liam Mark , Brian Starkey , "Andrew F . Davis" , Alistair Strachan , dri-devel@lists.freedesktop.org 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> 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(+) -- 2.7.4 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 */