Patch Detail
Show a patch.
GET /api/patches/11175/?format=api
{ "id": 11175, "url": "https://patchwork.libcamera.org/api/patches/11175/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11175/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210205131044.512128-2-helen.koike@collabora.com>", "date": "2021-02-05T13:10:42", "name": "[libcamera-devel,RFC,1/3] include: uapi: Add header definitions for V4L2 Ext API", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "51ffaeb93dec85d57c47667c262c38b90e645369", "submitter": { "id": 20, "url": "https://patchwork.libcamera.org/api/people/20/?format=api", "name": "Helen Koike", "email": "helen.koike@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11175/mbox/", "series": [ { "id": 1657, "url": "https://patchwork.libcamera.org/api/series/1657/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1657", "date": "2021-02-05T13:10:41", "name": "libcamera: Use extended fmt and buffer ioctls API", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1657/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11175/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11175/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1E048BD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 5 Feb 2021 13:11:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EE45B614B4;\n\tFri, 5 Feb 2021 14:11:00 +0100 (CET)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1BADC614B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 5 Feb 2021 14:11:00 +0100 (CET)", "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: koike) with ESMTPSA id 7B22D1F466AD" ], "From": "Helen Koike <helen.koike@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 5 Feb 2021 10:10:42 -0300", "Message-Id": "<20210205131044.512128-2-helen.koike@collabora.com>", "X-Mailer": "git-send-email 2.30.0", "In-Reply-To": "<20210205131044.512128-1-helen.koike@collabora.com>", "References": "<20210205131044.512128-1-helen.koike@collabora.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH 1/3] include: uapi: Add header\n\tdefinitions for V4L2 Ext API", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Cc": "kieran.bingham+renesas@ideasonboard.com, frkoenig@chromium.org,\n\tkernel@collabora.com", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add definitions for format and buffer Ext API.\n\nThe Ext API unifies multi vs single planar handling, allows color\nplanes to be placed in different offset in the same buffer, allow\npixel modifiers to be used and enable some other features.\n\nSigned-of-by: Helen Koike <helen.koike@collabora.com>\n---\n include/linux/videodev2.h | 96 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 96 insertions(+)", "diff": "diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\nindex c70d7661..4b7b8000 100644\n--- a/include/linux/videodev2.h\n+++ b/include/linux/videodev2.h\n@@ -1013,6 +1013,59 @@ struct v4l2_buffer {\n \t};\n };\n \n+/**\n+ * struct v4l2_ext_plane - extended plane buffer info\n+ * @offset:\t\toffset in the memory buffer where the plane starts.\n+ * @bytesused:\t\tnumber of bytes occupied by data in the plane (payload).\n+ * @mmap_offset:\tIf V4L2_MEMORY_MMAP is used, then it can be a \"cookie\"\n+ *\t\t\tthat should be passed to mmap() called on the video node.\n+ * @userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer pointing\n+ *\t\t\tto this plane.\n+ * @dmabuf_fd:\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file descriptor\n+ *\t\t\tassociated with this plane.\n+ * @reserved:\t\textra space reserved for future fields, must be set to 0.\n+ */\n+struct v4l2_ext_plane {\n+\t__u32 offset;\n+\t__u32 bytesused;\n+\tunion {\n+\t\t__u32 mmap_offset;\n+\t\t__u64 userptr;\n+\t\t__s32 dmabuf_fd;\n+\t} m;\n+\t__u32 reserved[6];\n+};\n+\n+/**\n+ * struct v4l2_ext_buffer - extended video buffer info\n+ * @index:\tid number of the buffer\n+ * @type:\tV4L2_BUF_TYPE_VIDEO_CAPTURE or V4L2_BUF_TYPE_VIDEO_OUTPUT\n+ * @field:\tenum v4l2_field; field order of the image in the buffer\n+ * @sequence:\tsequence count of this frame\n+ * @flags:\tbuffer informational flags\n+ * @timestamp:\tframe timestamp\n+ * @memory:\tenum v4l2_memory; the method, in which the actual video\n+ *\t\tdata is passed\n+ * @request_fd:\tfd of the request that this buffer should use\n+ * @planes:\tper-plane buffer information\n+ * @reserved:\textra space reserved for future fields, must be set to 0\n+ *\n+ * Contains data exchanged by application and driver using one of the Streaming\n+ * I/O methods.\n+ */\n+struct v4l2_ext_buffer {\n+\t__u32 index;\n+\t__u32 type;\n+\t__u32 field;\n+\t__u32 sequence;\n+\t__u64 flags;\n+\t__u64 timestamp;\n+\t__u32 memory;\n+\t__s32 request_fd;\n+\tstruct v4l2_ext_plane planes[VIDEO_MAX_PLANES];\n+\t__u32 reserved[10];\n+};\n+\n /**\n * v4l2_timeval_to_ns - Convert timeval to nanoseconds\n * @ts:\t\tpointer to the timeval variable to be converted\n@@ -2195,6 +2248,43 @@ struct v4l2_pix_format_mplane {\n \t__u8\t\t\t\treserved[7];\n } __attribute__ ((packed));\n \n+/**\n+ * struct v4l2_ext_pix_format - extended single/multiplanar format definition\n+ * @type:\t\ttype of the data stream; V4L2_BUF_TYPE_VIDEO_CAPTURE or\n+ *\t\t\tV4L2_BUF_TYPE_VIDEO_OUTPUT\n+ * @width:\t\timage width in pixels\n+ * @height:\t\timage height in pixels\n+ * @field:\t\tenum v4l2_field; field order (for interlaced video)\n+ * @plane_fmt:\t\tper-plane information\n+ * @pixelformat:\tlittle endian four character code (fourcc)\n+ * @modifier:\t\tmodifier applied to the format (used for tiled formats\n+ *\t\t\tand other kind of HW-specific formats, like compressed\n+ *\t\t\tformats) as defined in drm_fourcc.h\n+ * @colorspace:\t\tenum v4l2_colorspace; supplemental to pixelformat\n+ * @xfer_func:\t\tenum v4l2_xfer_func, colorspace transfer function\n+ * @ycbcr_enc:\t\tenum v4l2_ycbcr_encoding, Y'CbCr encoding\n+ * @hsv_enc:\t\tenum v4l2_hsv_encoding, HSV encoding\n+ * @quantization:\tenum v4l2_quantization, colorspace quantization\n+ * @reserved:\t\textra space reserved for future fields, must be set to 0\n+ */\n+struct v4l2_ext_pix_format {\n+\t__u32 type;\n+\t__u32 width;\n+\t__u32 height;\n+\t__u32 field;\n+\tstruct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];\n+\t__u32 pixelformat;\n+\t__u64 modifier;\n+\t__u32 colorspace;\n+\t__u32 xfer_func;\n+\tunion {\n+\t\t__u32 ycbcr_enc;\n+\t\t__u32 hsv_enc;\n+\t};\n+\t__u32 quantization;\n+\t__u32 reserved[9];\n+};\n+\n /**\n * struct v4l2_sdr_format - SDR format definition\n * @pixelformat:\tlittle endian four character code (fourcc)\n@@ -2504,6 +2594,12 @@ struct v4l2_create_buffers {\n \n #define VIDIOC_QUERY_EXT_CTRL\t_IOWR('V', 103, struct v4l2_query_ext_ctrl)\n \n+#define VIDIOC_G_EXT_PIX_FMT\t_IOWR('V', 104, struct v4l2_ext_pix_format)\n+#define VIDIOC_S_EXT_PIX_FMT\t_IOWR('V', 105, struct v4l2_ext_pix_format)\n+#define VIDIOC_TRY_EXT_PIX_FMT\t_IOWR('V', 106, struct v4l2_ext_pix_format)\n+#define VIDIOC_EXT_QBUF\t\t_IOWR('V', 107, struct v4l2_ext_buffer)\n+#define VIDIOC_EXT_DQBUF\t_IOWR('V', 118, struct v4l2_ext_buffer)\n+\n /* Reminder: when adding new ioctls please add support for them to\n drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */\n \n", "prefixes": [ "libcamera-devel", "RFC", "1/3" ] }