[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221101100448.66712-3-randy.li@synaptics.com>
Date: Tue, 1 Nov 2022 18:04:46 +0800
From: Hsia-Jun Li <randy.li@...aptics.com>
To: dri-devel@...ts.freedesktop.org
Cc: airlied@...ux.ie, daniel@...ll.ch, ezequiel@...guardiasur.com.ar,
helen.koike@...labora.com, hverkuil-cisco@...all.nl,
jszhang@...nel.org, laurent.pinchart@...asonboard.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, maarten.lankhorst@...ux.intel.com,
mchehab@...nel.org, mripard@...nel.org, nicolas@...fresne.ca,
ribalda@...omium.org, sakari.ailus@...ux.intel.com,
sebastian.hesselbarth@...il.com, tfiga@...omium.org,
tzimmermann@...e.de, "Hsia-Jun(Randy) Li" <randy.li@...aptics.com>
Subject: [PATCH v3 2/4] media: videodev2.h: add pixel format modifiers
From: "Hsia-Jun(Randy) Li" <randy.li@...aptics.com>
Signed-off-by: Hsia-Jun(Randy) Li <randy.li@...aptics.com>
---
include/uapi/linux/videodev2.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 29da1f4b4578..d00b2e9c0c54 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -816,6 +816,26 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001
#define V4L2_PIX_FMT_FLAG_SET_CSC 0x00000002
+/*
+ * F O R M A T M O D I F I E S
+ */
+/* Vendor Ids: */
+#define V4L2_PIX_FMT_RESERVED ((1ULL << 56) - 1)
+
+#define fourcc_mod_get_vendor(modifier) \
+ (((modifier) >> 56) & 0xff)
+
+#define fourcc_mod_is_vendor(modifier, vendor) \
+ (fourcc_mod_get_vendor(modifier) == V4L2_PIX_FMT_MOD_VENDOR_## vendor)
+
+#define fourcc_mod_code(vendor, val) \
+ ((((__u64)V4L2_PIX_FMT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
+
+/* Format Modifier tokens */
+#define V4L2_PIX_FMT_MOD_INVALID fourcc_mod_code(NONE, V4L2_PIX_FMT_RESERVED)
+#define V4L2_PIX_FMT_MOD_LINEAR fourcc_mod_code(NONE, 0)
+
+
/*
* F O R M A T E N U M E R A T I O N
*/
--
2.17.1
Powered by blists - more mailing lists