{"id":1286,"url":"https://patchwork.libcamera.org/api/patches/1286/?format=json","web_url":"https://patchwork.libcamera.org/patch/1286/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190524162139.4446-2-jacopo@jmondi.org>","date":"2019-05-24T16:21:34","name":"[libcamera-devel,1/6] include: linux: Update Linux headers to v5.1","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b9ae514e4e67862f82a97303d721e7b0314eae01","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1286/mbox/","series":[{"id":326,"url":"https://patchwork.libcamera.org/api/series/326/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=326","date":"2019-05-24T16:21:33","name":"META_OUTPUT support + IPU3 parameters tuning","version":1,"mbox":"https://patchwork.libcamera.org/series/326/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1286/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1286/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E57B60003\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 May 2019 18:20:39 +0200 (CEST)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id DF835240011;\n\tFri, 24 May 2019 16:20:37 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 May 2019 18:21:34 +0200","Message-Id":"<20190524162139.4446-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190524162139.4446-1-jacopo@jmondi.org>","References":"<20190524162139.4446-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/6] include: linux: Update Linux headers\n\tto v5.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Fri, 24 May 2019 16:20:39 -0000"},"content":"Update kernel headers to v5.1\n\nThe most notable introduction for libcamera is support for\nV4L2_BUF_TYPE_META_OUTPUT.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/linux/media.h         |  8 ++++\n include/linux/v4l2-common.h   | 26 +++++------\n include/linux/v4l2-controls.h |  4 ++\n include/linux/videodev2.h     | 88 ++++++++++++++++++++++++++++++-----\n 4 files changed, 102 insertions(+), 24 deletions(-)","diff":"diff --git a/include/linux/media.h b/include/linux/media.h\nindex c75664617760..29cc82b89ff2 100644\n--- a/include/linux/media.h\n+++ b/include/linux/media.h\n@@ -350,6 +350,14 @@ struct media_v2_topology {\n #define MEDIA_IOC_ENUM_LINKS\t_IOWR('|', 0x02, struct media_links_enum)\n #define MEDIA_IOC_SETUP_LINK\t_IOWR('|', 0x03, struct media_link_desc)\n #define MEDIA_IOC_G_TOPOLOGY\t_IOWR('|', 0x04, struct media_v2_topology)\n+#define MEDIA_IOC_REQUEST_ALLOC\t_IOR ('|', 0x05, int)\n+\n+/*\n+ * These ioctls are called on the request file descriptor as returned\n+ * by MEDIA_IOC_REQUEST_ALLOC.\n+ */\n+#define MEDIA_REQUEST_IOC_QUEUE\t\t_IO('|',  0x80)\n+#define MEDIA_REQUEST_IOC_REINIT\t_IO('|',  0x81)\n \n \n /*\ndiff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h\nindex 4f7b892377cd..14de1731b39c 100644\n--- a/include/linux/v4l2-common.h\n+++ b/include/linux/v4l2-common.h\n@@ -79,24 +79,11 @@\n /* Current composing area plus all padding pixels */\n #define V4L2_SEL_TGT_COMPOSE_PADDED\t0x0103\n \n-/* Backward compatibility target definitions --- to be removed. */\n-#define V4L2_SEL_TGT_CROP_ACTIVE\tV4L2_SEL_TGT_CROP\n-#define V4L2_SEL_TGT_COMPOSE_ACTIVE\tV4L2_SEL_TGT_COMPOSE\n-#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL\tV4L2_SEL_TGT_CROP\n-#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE\n-#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS\tV4L2_SEL_TGT_CROP_BOUNDS\n-#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS\n-\n /* Selection flags */\n #define V4L2_SEL_FLAG_GE\t\t(1 << 0)\n #define V4L2_SEL_FLAG_LE\t\t(1 << 1)\n #define V4L2_SEL_FLAG_KEEP_CONFIG\t(1 << 2)\n \n-/* Backward compatibility flag definitions --- to be removed. */\n-#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE\tV4L2_SEL_FLAG_GE\n-#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE\tV4L2_SEL_FLAG_LE\n-#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG\n-\n struct v4l2_edid {\n \t__u32 pad;\n \t__u32 start_block;\n@@ -105,4 +92,17 @@ struct v4l2_edid {\n \t__u8  *edid;\n };\n \n+/* Backward compatibility target definitions --- to be removed. */\n+#define V4L2_SEL_TGT_CROP_ACTIVE\tV4L2_SEL_TGT_CROP\n+#define V4L2_SEL_TGT_COMPOSE_ACTIVE\tV4L2_SEL_TGT_COMPOSE\n+#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL\tV4L2_SEL_TGT_CROP\n+#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE\n+#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS\tV4L2_SEL_TGT_CROP_BOUNDS\n+#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS\n+\n+/* Backward compatibility flag definitions --- to be removed. */\n+#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE\tV4L2_SEL_FLAG_GE\n+#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE\tV4L2_SEL_FLAG_LE\n+#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG\n+\n #endif /* __V4L2_COMMON__ */\ndiff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\nindex e4ee10ee917d..06479f2fb3ae 100644\n--- a/include/linux/v4l2-controls.h\n+++ b/include/linux/v4l2-controls.h\n@@ -50,6 +50,8 @@\n #ifndef __LINUX_V4L2_CONTROLS_H\n #define __LINUX_V4L2_CONTROLS_H\n \n+#include <linux/types.h>\n+\n /* Control classes */\n #define V4L2_CTRL_CLASS_USER\t\t0x00980000\t/* Old-style 'user' controls */\n #define V4L2_CTRL_CLASS_MPEG\t\t0x00990000\t/* MPEG-compression controls */\n@@ -531,6 +533,8 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type {\n };\n #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER\t(V4L2_CID_MPEG_BASE+381)\n #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP\t(V4L2_CID_MPEG_BASE+382)\n+#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION\t(V4L2_CID_MPEG_BASE+383)\n+#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET\t\t(V4L2_CID_MPEG_BASE+384)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP\t(V4L2_CID_MPEG_BASE+400)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP\t(V4L2_CID_MPEG_BASE+401)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP\t(V4L2_CID_MPEG_BASE+402)\ndiff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\nindex 1a95662f5ad0..5e739270116d 100644\n--- a/include/linux/videodev2.h\n+++ b/include/linux/videodev2.h\n@@ -128,6 +128,13 @@ enum v4l2_field {\n \t((field) == V4L2_FIELD_BOTTOM ||\\\n \t (field) == V4L2_FIELD_TOP ||\\\n \t (field) == V4L2_FIELD_ALTERNATE)\n+#define V4L2_FIELD_IS_INTERLACED(field) \\\n+\t((field) == V4L2_FIELD_INTERLACED ||\\\n+\t (field) == V4L2_FIELD_INTERLACED_TB ||\\\n+\t (field) == V4L2_FIELD_INTERLACED_BT)\n+#define V4L2_FIELD_IS_SEQUENTIAL(field) \\\n+\t((field) == V4L2_FIELD_SEQ_TB ||\\\n+\t (field) == V4L2_FIELD_SEQ_BT)\n \n enum v4l2_buf_type {\n \tV4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,\n@@ -143,6 +150,7 @@ enum v4l2_buf_type {\n \tV4L2_BUF_TYPE_SDR_CAPTURE          = 11,\n \tV4L2_BUF_TYPE_SDR_OUTPUT           = 12,\n \tV4L2_BUF_TYPE_META_CAPTURE         = 13,\n+\tV4L2_BUF_TYPE_META_OUTPUT\t   = 14,\n \t/* Deprecated, do not use */\n \tV4L2_BUF_TYPE_PRIVATE              = 0x80,\n };\n@@ -158,7 +166,8 @@ enum v4l2_buf_type {\n \t || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY\t\\\n \t || (type) == V4L2_BUF_TYPE_VBI_OUTPUT\t\t\t\\\n \t || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT\t\t\\\n-\t || (type) == V4L2_BUF_TYPE_SDR_OUTPUT)\n+\t || (type) == V4L2_BUF_TYPE_SDR_OUTPUT\t\t\t\\\n+\t || (type) == V4L2_BUF_TYPE_META_OUTPUT)\n \n enum v4l2_tuner_type {\n \tV4L2_TUNER_RADIO\t     = 1,\n@@ -223,8 +232,8 @@ enum v4l2_colorspace {\n \t/* For RGB colorspaces such as produces by most webcams. */\n \tV4L2_COLORSPACE_SRGB          = 8,\n \n-\t/* AdobeRGB colorspace */\n-\tV4L2_COLORSPACE_ADOBERGB      = 9,\n+\t/* opRGB colorspace */\n+\tV4L2_COLORSPACE_OPRGB         = 9,\n \n \t/* BT.2020 colorspace, used for UHDTV. */\n \tV4L2_COLORSPACE_BT2020        = 10,\n@@ -256,7 +265,7 @@ enum v4l2_xfer_func {\n \t *\n \t * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB\n \t *\n-\t * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB\n+\t * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB\n \t *\n \t * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M\n \t *\n@@ -267,7 +276,7 @@ enum v4l2_xfer_func {\n \tV4L2_XFER_FUNC_DEFAULT     = 0,\n \tV4L2_XFER_FUNC_709         = 1,\n \tV4L2_XFER_FUNC_SRGB        = 2,\n-\tV4L2_XFER_FUNC_ADOBERGB    = 3,\n+\tV4L2_XFER_FUNC_OPRGB       = 3,\n \tV4L2_XFER_FUNC_SMPTE240M   = 4,\n \tV4L2_XFER_FUNC_NONE        = 5,\n \tV4L2_XFER_FUNC_DCI_P3      = 6,\n@@ -279,7 +288,7 @@ enum v4l2_xfer_func {\n  * This depends on the colorspace.\n  */\n #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \\\n-\t((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \\\n+\t((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \\\n \t ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \\\n \t  ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \\\n \t   ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \\\n@@ -293,7 +302,7 @@ enum v4l2_ycbcr_encoding {\n \t *\n \t * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,\n \t * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB,\n-\t * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601\n+\t * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601\n \t *\n \t * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709\n \t *\n@@ -378,6 +387,15 @@ enum v4l2_quantization {\n \t (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \\\n \t V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))\n \n+/*\n+ * Deprecated names for opRGB colorspace (IEC 61966-2-5)\n+ *\n+ * WARNING: Please don't use these deprecated defines in your code, as\n+ * there is a chance we have to remove them in the future.\n+ */\n+#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB\n+#define V4L2_XFER_FUNC_ADOBERGB  V4L2_XFER_FUNC_OPRGB\n+\n enum v4l2_priority {\n \tV4L2_PRIORITY_UNSET       = 0,  /* not initialized */\n \tV4L2_PRIORITY_BACKGROUND  = 1,\n@@ -454,6 +472,7 @@ struct v4l2_capability {\n #define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */\n #define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */\n #define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */\n+#define V4L2_CAP_META_OUTPUT\t\t0x08000000  /* Is a metadata output device */\n \n #define V4L2_CAP_TOUCH                  0x10000000  /* Is a touch device */\n \n@@ -537,6 +556,10 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */\n #define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */\n #define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */\n+#define V4L2_PIX_FMT_AYUV32  v4l2_fourcc('A', 'Y', 'U', 'V') /* 32  AYUV-8-8-8-8  */\n+#define V4L2_PIX_FMT_XYUV32  v4l2_fourcc('X', 'Y', 'U', 'V') /* 32  XYUV-8-8-8-8  */\n+#define V4L2_PIX_FMT_VUYA32  v4l2_fourcc('V', 'U', 'Y', 'A') /* 32  VUYA-8-8-8-8  */\n+#define V4L2_PIX_FMT_VUYX32  v4l2_fourcc('V', 'U', 'Y', 'X') /* 32  VUYX-8-8-8-8  */\n #define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */\n #define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */\n #define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */\n@@ -631,6 +654,7 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_H263     v4l2_fourcc('H', '2', '6', '3') /* H263          */\n #define V4L2_PIX_FMT_MPEG1    v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES     */\n #define V4L2_PIX_FMT_MPEG2    v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES     */\n+#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */\n #define V4L2_PIX_FMT_MPEG4    v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */\n #define V4L2_PIX_FMT_XVID     v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid           */\n #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */\n@@ -672,6 +696,8 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_Z16      v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */\n #define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode  */\n #define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */\n+#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */\n+#define V4L2_PIX_FMT_CNF4     v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */\n \n /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */\n #define V4L2_PIX_FMT_IPU3_SBGGR10\tv4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */\n@@ -699,6 +725,7 @@ struct v4l2_pix_format {\n #define V4L2_META_FMT_VSP1_HGO    v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */\n #define V4L2_META_FMT_VSP1_HGT    v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */\n #define V4L2_META_FMT_UVC         v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */\n+#define V4L2_META_FMT_D4XX        v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */\n \n /* priv field value to indicates that subsequent fields are valid. */\n #define V4L2_PIX_FMT_PRIV_MAGIC\t\t0xfeedcafe\n@@ -852,9 +879,17 @@ struct v4l2_requestbuffers {\n \t__u32\t\t\tcount;\n \t__u32\t\t\ttype;\t\t/* enum v4l2_buf_type */\n \t__u32\t\t\tmemory;\t\t/* enum v4l2_memory */\n-\t__u32\t\t\treserved[2];\n+\t__u32\t\t\tcapabilities;\n+\t__u32\t\t\treserved[1];\n };\n \n+/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */\n+#define V4L2_BUF_CAP_SUPPORTS_MMAP\t(1 << 0)\n+#define V4L2_BUF_CAP_SUPPORTS_USERPTR\t(1 << 1)\n+#define V4L2_BUF_CAP_SUPPORTS_DMABUF\t(1 << 2)\n+#define V4L2_BUF_CAP_SUPPORTS_REQUESTS\t(1 << 3)\n+#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)\n+\n /**\n  * struct v4l2_plane - plane info for multi-planar buffers\n  * @bytesused:\t\tnumber of bytes occupied by data in the plane (payload)\n@@ -913,6 +948,7 @@ struct v4l2_plane {\n  * @length:\tsize in bytes of the buffer (NOT its payload) for single-plane\n  *\t\tbuffers (when type != *_MPLANE); number of elements in the\n  *\t\tplanes array for multi-plane buffers\n+ * @request_fd: fd of the request that this buffer should use\n  *\n  * Contains data exchanged by application and driver using one of the Streaming\n  * I/O methods.\n@@ -937,9 +973,24 @@ struct v4l2_buffer {\n \t} m;\n \t__u32\t\t\tlength;\n \t__u32\t\t\treserved2;\n-\t__u32\t\t\treserved;\n+\tunion {\n+\t\t__s32\t\trequest_fd;\n+\t\t__u32\t\treserved;\n+\t};\n };\n \n+/**\n+ * v4l2_timeval_to_ns - Convert timeval to nanoseconds\n+ * @ts:\t\tpointer to the timeval variable to be converted\n+ *\n+ * Returns the scalar nanosecond representation of the timeval\n+ * parameter.\n+ */\n+static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv)\n+{\n+\treturn (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000;\n+}\n+\n /*  Flags for 'flags' field */\n /* Buffer is mapped (flag) */\n #define V4L2_BUF_FLAG_MAPPED\t\t\t0x00000001\n@@ -955,6 +1006,8 @@ struct v4l2_buffer {\n #define V4L2_BUF_FLAG_BFRAME\t\t\t0x00000020\n /* Buffer is ready, but the data contained within is corrupted. */\n #define V4L2_BUF_FLAG_ERROR\t\t\t0x00000040\n+/* Buffer is added to an unqueued request */\n+#define V4L2_BUF_FLAG_IN_REQUEST\t\t0x00000080\n /* timecode field is valid */\n #define V4L2_BUF_FLAG_TIMECODE\t\t\t0x00000100\n /* Buffer is prepared for queuing */\n@@ -973,6 +1026,8 @@ struct v4l2_buffer {\n #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE\t\t0x00010000\n /* mem2mem encoder/decoder */\n #define V4L2_BUF_FLAG_LAST\t\t\t0x00100000\n+/* request_fd is valid */\n+#define V4L2_BUF_FLAG_REQUEST_FD\t\t0x00800000\n \n /**\n  * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor\n@@ -1396,6 +1451,13 @@ struct v4l2_bt_timings {\n  * InfoFrame).\n  */\n #define V4L2_DV_FL_HAS_HDMI_VIC\t\t\t(1 << 8)\n+/*\n+ * CEA-861 specific: only valid for video receivers.\n+ * If set, then HW can detect the difference between regular FPS and\n+ * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with\n+ * the V4L2_DV_FL_CAN_REDUCE_FPS flag set.\n+ */\n+#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS\t(1 << 9)\n \n /* A few useful defines to calculate the total blanking and frame sizes */\n #define V4L2_DV_BT_BLANKING_WIDTH(bt) \\\n@@ -1593,7 +1655,8 @@ struct v4l2_ext_controls {\n \t};\n \t__u32 count;\n \t__u32 error_idx;\n-\t__u32 reserved[2];\n+\t__s32 request_fd;\n+\t__u32 reserved[1];\n \tstruct v4l2_ext_control *controls;\n };\n \n@@ -1604,6 +1667,7 @@ struct v4l2_ext_controls {\n #define V4L2_CTRL_MAX_DIMS\t  (4)\n #define V4L2_CTRL_WHICH_CUR_VAL   0\n #define V4L2_CTRL_WHICH_DEF_VAL   0x0f000000\n+#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000\n \n enum v4l2_ctrl_type {\n \tV4L2_CTRL_TYPE_INTEGER\t     = 1,\n@@ -2294,6 +2358,7 @@ struct v4l2_dbg_chip_info {\n  *\t\treturn: number of created buffers\n  * @memory:\tenum v4l2_memory; buffer memory type\n  * @format:\tframe format, for which buffers are requested\n+ * @capabilities: capabilities of this buffer type.\n  * @reserved:\tfuture extensions\n  */\n struct v4l2_create_buffers {\n@@ -2301,7 +2366,8 @@ struct v4l2_create_buffers {\n \t__u32\t\t\tcount;\n \t__u32\t\t\tmemory;\n \tstruct v4l2_format\tformat;\n-\t__u32\t\t\treserved[8];\n+\t__u32\t\t\tcapabilities;\n+\t__u32\t\t\treserved[7];\n };\n \n /*\n","prefixes":["libcamera-devel","1/6"]}