[{"id":29681,"web_url":"https://patchwork.libcamera.org/comment/29681/","msgid":"<171710563868.372008.8570179057837747789@ping.linuxembedded.co.uk>","date":"2024-05-30T21:47:18","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Hans de Goede (2024-05-30 18:15:57)\n> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n> and re-instating libcamera local modifications.\n> \n> This includes adding include/linux/udmabuf.h which was not part\n> of libcamera's include/linux headers before.\n> \n> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n\nI thought I recalled we added something locally before it got merged for\nRPi formats - but there's nothing being lost / removed here so I think\nwe're all good.\n\nAnd the checkstyle warnings you mentioned are fine here. We should\nfigure out how to exclude this directory.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  include/linux/README             |  2 +-\n>  include/linux/drm_fourcc.h       | 10 ++---\n>  include/linux/media-bus-format.h |  9 ++++\n>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n>  include/linux/udmabuf.h          | 33 +++++++++++++++\n>  include/linux/v4l2-controls.h    |  6 +++\n>  include/linux/v4l2-mediabus.h    | 18 +++++---\n>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n>  9 files changed, 172 insertions(+), 63 deletions(-)\n>  create mode 100644 include/linux/udmabuf.h\n> \n> diff --git a/include/linux/README b/include/linux/README\n> index 101e4997..b7795309 100644\n> --- a/include/linux/README\n> +++ b/include/linux/README\n> @@ -1,4 +1,4 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n>  modify them manually.\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index b4e1a092..d8e99940 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -54,7 +54,7 @@ extern \"C\" {\n>   * Format modifiers may change any property of the buffer, including the number\n>   * of planes and/or the required allocation size. Format modifiers are\n>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n> - * modifier is specific to the modifer being used. For example, some modifiers\n> + * modifier is specific to the modifier being used. For example, some modifiers\n>   * may preserve meaning - such as number of planes - from the fourcc code,\n>   * whereas others may not.\n>   *\n> @@ -79,7 +79,7 @@ extern \"C\" {\n>   *   format.\n>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n>   *   see modifiers as opaque tokens they can check for equality and intersect.\n> - *   These users musn't need to know to reason about the modifier value\n> + *   These users mustn't need to know to reason about the modifier value\n>   *   (i.e. they are not expected to extract information out of the modifier).\n>   *\n>   * Vendors should document their modifier usage in as much detail as\n> @@ -610,7 +610,7 @@ extern \"C\" {\n>   * This is a tiled layout using 4Kb tiles in row-major layout.\n>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n>   * are arranged in four groups (two wide, two high) with column-major layout.\n> - * Each group therefore consits out of four 256 byte units, which are also laid\n> + * Each group therefore consists out of four 256 byte units, which are also laid\n>   * out as 2x2 column-major.\n>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n>   * either a square block or a 2:1 unit.\n> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   */\n>  \n>  /*\n> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n>   * modifiers) denote the category for modifiers. Currently we have three\n>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n>   * sixteen different categories.\n> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   * Amlogic FBC Memory Saving mode\n>   *\n>   * Indicates the storage is packed when pixel size is multiple of word\n> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n>   * memory.\n>   *\n>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n> index f05f747e..d4c1d991 100644\n> --- a/include/linux/media-bus-format.h\n> +++ b/include/linux/media-bus-format.h\n> @@ -174,4 +174,13 @@\n>   */\n>  #define MEDIA_BUS_FMT_METADATA_FIXED           0x7001\n>  \n> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n> +#define MEDIA_BUS_FMT_META_8                   0x8001\n> +#define MEDIA_BUS_FMT_META_10                  0x8002\n> +#define MEDIA_BUS_FMT_META_12                  0x8003\n> +#define MEDIA_BUS_FMT_META_14                  0x8004\n> +#define MEDIA_BUS_FMT_META_16                  0x8005\n> +#define MEDIA_BUS_FMT_META_20                  0x8006\n> +#define MEDIA_BUS_FMT_META_24                  0x8007\n> +\n>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n> index 2d1c448a..f87c6bd4 100644\n> --- a/include/linux/rkisp1-config.h\n> +++ b/include/linux/rkisp1-config.h\n> @@ -4,8 +4,8 @@\n>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n>   */\n>  \n> -#ifndef _UAPI_RKISP1_CONFIG_H\n> -#define _UAPI_RKISP1_CONFIG_H\n> +#ifndef _RKISP1_CONFIG_H\n> +#define _RKISP1_CONFIG_H\n>  \n>  #include <linux/types.h>\n>  \n> @@ -175,11 +175,14 @@\n>  /**\n>   * enum rkisp1_cif_isp_version - ISP variants\n>   *\n> - * @RKISP1_V10: used at least in rk3288 and rk3399\n> - * @RKISP1_V11: declared in the original vendor code, but not used\n> - * @RKISP1_V12: used at least in rk3326 and px30\n> - * @RKISP1_V13: used at least in rk1808\n> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n> + *     of entries in grids and histogram as v10.\n> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n> + *     histogram as v12.\n> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n> + *     and histogram as v10.\n>   */\n>  enum rkisp1_cif_isp_version {\n>         RKISP1_V10 = 10,\n> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_goc_config {\n>         __u32 mode;\n> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n> + * two.\n>   */\n>  struct rkisp1_cif_isp_hst_config {\n>         __u32 mode;\n> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n> + * to the maximum of the two.\n>   *\n>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n>   */\n> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n>   *            integer part.\n>   *\n>   * The window of the measurements area is divided to 5x5 sub-windows for\n> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n> - * each sub-window independently and the final result is a weighted average of\n> - * the histogram measurements on all sub-windows. The window of the\n> - * measurements area and the weight of each sub-window are configurable using\n> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n> + * sub-window independently and the final result is a weighted average of the\n> + * histogram measurements on all sub-windows. The window of the measurements\n> + * area and the weight of each sub-window are configurable using\n>   * struct @rkisp1_cif_isp_hst_config.\n>   *\n> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n>   *\n>   * The number of entries of @hist_bins depends on the hardware revision\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n> + * equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_hist_stat {\n>         __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n>         struct rkisp1_cif_isp_stat params;\n>  };\n>  \n> -#endif /* _UAPI_RKISP1_CONFIG_H */\n> +#endif /* _RKISP1_CONFIG_H */\n> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n> new file mode 100644\n> index 00000000..76cc7de9\n> --- /dev/null\n> +++ b/include/linux/udmabuf.h\n> @@ -0,0 +1,33 @@\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> +#ifndef _LINUX_UDMABUF_H\n> +#define _LINUX_UDMABUF_H\n> +\n> +#include <linux/types.h>\n> +#include <linux/ioctl.h>\n> +\n> +#define UDMABUF_FLAGS_CLOEXEC  0x01\n> +\n> +struct udmabuf_create {\n> +       __u32 memfd;\n> +       __u32 flags;\n> +       __u64 offset;\n> +       __u64 size;\n> +};\n> +\n> +struct udmabuf_create_item {\n> +       __u32 memfd;\n> +       __u32 __pad;\n> +       __u64 offset;\n> +       __u64 size;\n> +};\n> +\n> +struct udmabuf_create_list {\n> +       __u32 flags;\n> +       __u32 count;\n> +       struct udmabuf_create_item list[];\n> +};\n> +\n> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n> +\n> +#endif /* _LINUX_UDMABUF_H */\n> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n> index b9f64810..1e6e816b 100644\n> --- a/include/linux/v4l2-controls.h\n> +++ b/include/linux/v4l2-controls.h\n> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n>   */\n>  #define V4L2_CID_USER_NPCM_BASE                        (V4L2_CID_USER_BASE + 0x11b0)\n>  \n> +/*\n> + * The base for THine THP7312 driver controls.\n> + * We reserve 32 controls for this driver.\n> + */\n> +#define V4L2_CID_USER_THP7312_BASE             (V4L2_CID_USER_BASE + 0x11c0)\n> +\n>  /* MPEG-class control IDs */\n>  /* The MPEG controls are applicable to all codec controls\n>   * and the 'MPEG' part of the define is historical */\n> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n> index 2c318de1..097ef739 100644\n> --- a/include/linux/v4l2-mediabus.h\n> +++ b/include/linux/v4l2-mediabus.h\n> @@ -19,12 +19,18 @@\n>   * @width:     image width\n>   * @height:    image height\n>   * @code:      data format code (from enum v4l2_mbus_pixelcode)\n> - * @field:     used interlacing type (from enum v4l2_field)\n> - * @colorspace:        colorspace of the data (from enum v4l2_colorspace)\n> - * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n> - * @hsv_enc:   HSV encoding of the data (from enum v4l2_hsv_encoding)\n> - * @quantization: quantization of the data (from enum v4l2_quantization)\n> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n> + * @field:     used interlacing type (from enum v4l2_field), zero for metadata\n> + *             mbus codes\n> + * @colorspace:        colorspace of the data (from enum v4l2_colorspace), zero on\n> + *             metadata mbus codes\n> + * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n> + *             for metadata mbus codes\n> + * @hsv_enc:   HSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n> + *             metadata mbus codes\n> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n> + *             for metadata mbus codes\n> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n> + *             for metadata mbus codes\n>   * @flags:     flags (V4L2_MBUS_FRAMEFMT_*)\n>   * @reserved:  reserved bytes that can be later used\n>   */\n> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n> index b383c2fe..2347e266 100644\n> --- a/include/linux/v4l2-subdev.h\n> +++ b/include/linux/v4l2-subdev.h\n> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n>   * @rect: pad crop rectangle boundaries\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n> + *\n> + * The subdev crop API is an obsolete interface and may be removed in the\n> + * future. It is superseded by the selection API. No new extensions to this\n> + * structure will be accepted.\n>   */\n>  struct v4l2_subdev_crop {\n>         __u32 which;\n> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n>   * @pad: pad number, as reported by the media API\n>   * @interval: frame interval in seconds\n>   * @stream: stream number, defined in subdev routing\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_frame_interval {\n>         __u32 pad;\n>         struct v4l2_fract interval;\n>         __u32 stream;\n> -       __u32 reserved[8];\n> +       __u32 which;\n> +       __u32 reserved[7];\n>  };\n>  \n>  /**\n> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n>   * @width: frame width in pixels\n>   * @height: frame height in pixels\n>   * @interval: frame interval in seconds\n> - * @which: format type (from enum v4l2_subdev_format_whence)\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n>   */\n> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n>   * struct v4l2_subdev_routing - Subdev routing information\n>   *\n>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n> - * @num_routes: the total number of routes in the routes array\n> + * @len_routes: the length of the routes array, in routes; set by the user, not\n> + *             modified by the kernel\n>   * @routes: pointer to the routes array\n> + * @num_routes: the total number of routes, possibly more than fits in the\n> + *             routes array\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_routing {\n>         __u32 which;\n> -       __u32 num_routes;\n> +       __u32 len_routes;\n>         __u64 routes;\n> -       __u32 reserved[6];\n> +       __u32 num_routes;\n> +       __u32 reserved[11];\n>  };\n>  \n>  /*\n> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n>   * kernel.\n>   */\n> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS                (1ULL << 0)\n> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS                 (1ULL << 0)\n> +\n> +/*\n> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n> + * this is not set (which is the default), the which field is forced to\n> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n> + */\n> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH     (1ULL << 1)\n>  \n>  /**\n>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 0b5482a0..7fe522e8 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n>  #define V4L2_PIX_FMT_IPU3_Y10          v4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n>  \n>  /* Palette formats */\n>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC            0x0080\n>  #define V4L2_FMT_FLAG_CSC_HSV_ENC              V4L2_FMT_FLAG_CSC_YCBCR_ENC\n>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION         0x0100\n> +#define V4L2_FMT_FLAG_META_LINE_BASED          0x0200\n>  \n>         /* Frame Size and frame rate enumeration */\n>  /*\n> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS            (1 << 4)\n>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF     (1 << 5)\n>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS         (1 << 6)\n> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS          (1 << 7)\n> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS              (1 << 8)\n>  \n>  /**\n>   * struct v4l2_plane - plane info for multi-planar buffers\n>   * @bytesused:         number of bytes occupied by data in the plane (payload)\n>   * @length:            size of this plane (NOT the payload) in bytes\n> - * @mem_offset:                when memory in the associated struct v4l2_buffer is\n> + * @m.mem_offset:      when memory in the associated struct v4l2_buffer is\n>   *                     V4L2_MEMORY_MMAP, equals the offset from the start of\n>   *                     the device memory for this plane (or is a \"cookie\" that\n>   *                     should be passed to mmap() called on the video node)\n> - * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer\n> + * @m.userptr:         when memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>   *                     pointing to this plane\n> - * @fd:                        when memory is V4L2_MEMORY_DMABUF, a userspace file\n> + * @m.fd:              when memory is V4L2_MEMORY_DMABUF, a userspace file\n>   *                     descriptor associated with this plane\n>   * @m:                 union of @mem_offset, @userptr and @fd\n>   * @data_offset:       offset in the plane to the start of data; usually 0,\n> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n>   * @sequence:  sequence count of this frame\n>   * @memory:    enum v4l2_memory; the method, in which the actual video data is\n>   *             passed\n> - * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n> + * @m.offset:  for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>   *             offset from the start of the device memory for this plane,\n>   *             (or a \"cookie\" that should be passed to mmap() as offset)\n> - * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n> + * @m.userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>   *             a userspace pointer pointing to this buffer\n> - * @fd:                for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n> + * @m.fd:              for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>   *             a userspace file descriptor associated with this buffer\n> - * @planes:    for multiplanar buffers; userspace pointer to the array of plane\n> + * @m.planes:  for multiplanar buffers; userspace pointer to the array of plane\n>   *             info structs for this buffer\n>   * @m:         union of @offset, @userptr, @planes and @fd\n>   * @length:    size in bytes of the buffer (NOT its payload) for single-plane\n> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n>                 struct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n>                 struct v4l2_ctrl_av1_frame *p_av1_frame;\n>                 struct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n> +               struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n> +               struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n>                 void *ptr;\n> -       };\n> +       } __attribute__ ((packed));\n>  } __attribute__ ((packed));\n>  \n>  struct v4l2_ext_controls {\n> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n>   * struct v4l2_meta_format - metadata format definition\n>   * @dataformat:                little endian four character code (fourcc)\n>   * @buffersize:                maximum size in bytes required for data\n> + * @width:             number of data units of data per line (valid for line\n> + *                     based formats only, see format documentation)\n> + * @height:            number of lines of data per buffer (valid for line based\n> + *                     formats only)\n> + * @bytesperline:      offset between the beginnings of two adjacent lines in\n> + *                     bytes (valid for line based formats only)\n>   */\n>  struct v4l2_meta_format {\n>         __u32                           dataformat;\n>         __u32                           buffersize;\n> +       __u32                           width;\n> +       __u32                           height;\n> +       __u32                           bytesperline;\n>  } __attribute__ ((packed));\n>  \n>  /**\n>   * struct v4l2_format - stream data format\n> - * @type:      enum v4l2_buf_type; type of the data stream\n> - * @pix:       definition of an image format\n> - * @pix_mp:    definition of a multiplanar image format\n> - * @win:       definition of an overlaid image\n> - * @vbi:       raw VBI capture or output parameters\n> - * @sliced:    sliced VBI capture or output parameters\n> - * @raw_data:  placeholder for future extensions and custom formats\n> - * @fmt:       union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n> - *             and @raw_data\n> + * @type:              enum v4l2_buf_type; type of the data stream\n> + * @fmt.pix:           definition of an image format\n> + * @fmt.pix_mp:                definition of a multiplanar image format\n> + * @fmt.win:           definition of an overlaid image\n> + * @fmt.vbi:           raw VBI capture or output parameters\n> + * @fmt.sliced:                sliced VBI capture or output parameters\n> + * @fmt.raw_data:      placeholder for future extensions and custom formats\n> + * @fmt:               union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n> + *                     @meta and @raw_data\n>   */\n>  struct v4l2_format {\n>         __u32    type;\n> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n>   * @flags:     additional buffer management attributes (ignored unless the\n>   *             queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n>   *             and configured for MMAP streaming I/O).\n> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n> + *             this field indicate the maximum possible number of buffers\n> + *             for this queue.\n>   * @reserved:  future extensions\n>   */\n>  struct v4l2_create_buffers {\n> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n>         struct v4l2_format      format;\n>         __u32                   capabilities;\n>         __u32                   flags;\n> -       __u32                   reserved[6];\n> +       __u32                   max_num_buffers;\n> +       __u32                   reserved[5];\n> +};\n> +\n> +/**\n> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n> + * @index:     the first buffer to be removed\n> + * @count:     number of buffers to removed\n> + * @type:      enum v4l2_buf_type\n> + * @reserved:  future extensions\n> + */\n> +struct v4l2_remove_buffers {\n> +       __u32                   index;\n> +       __u32                   count;\n> +       __u32                   type;\n> +       __u32                   reserved[13];\n>  };\n>  \n>  /*\n> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n>  \n>  #define VIDIOC_QUERY_EXT_CTRL  _IOWR('V', 103, struct v4l2_query_ext_ctrl)\n> +#define VIDIOC_REMOVE_BUFS     _IOWR('V', 104, struct v4l2_remove_buffers)\n> +\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> 2.45.1\n>","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 17F68BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 May 2024 21:47:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 38D5D634AF;\n\tThu, 30 May 2024 23:47:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D459A634AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 May 2024 23:47:21 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2904D2DCE;\n\tThu, 30 May 2024 23:47:17 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sdvuzC45\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717105637;\n\tbh=1NsTqG40PXQNhEvVYd7LMGeV+ISc/Jm16Y0dVlH3WNU=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=sdvuzC45GlOvtMAN7eB565d6GMbApzP0Zzt6r5VI0JQqczq6UNogdh4nBh/HNlHQq\n\toBipHL8i4MiJBghky02uEhSc3VblW3SPbPR1aq3N+qDAH/cH6oKkrr2CzNJo9eh4tA\n\tj7hEGMQQl2O6ewYJZaMgDhVscwIvAIfH56PyZcC0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240530171600.259495-3-hdegoede@redhat.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Andrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>, \n\tHans de Goede <hdegoede@redhat.com>","To":"Hans de Goede <hdegoede@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Thu, 30 May 2024 22:47:18 +0100","Message-ID":"<171710563868.372008.8570179057837747789@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29687,"web_url":"https://patchwork.libcamera.org/comment/29687/","msgid":"<fbd52e7a-0ee7-4ce4-94d2-c404f225963e@redhat.com>","date":"2024-05-31T07:27:55","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":102,"url":"https://patchwork.libcamera.org/api/people/102/","name":"Hans de Goede","email":"hdegoede@redhat.com"},"content":"Hi,\n\nOn 5/30/24 11:47 PM, Kieran Bingham wrote:\n> Quoting Hans de Goede (2024-05-30 18:15:57)\n>> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n>> and re-instating libcamera local modifications.\n>>\n>> This includes adding include/linux/udmabuf.h which was not part\n>> of libcamera's include/linux headers before.\n>>\n>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n> \n> I thought I recalled we added something locally before it got merged for\n> RPi formats\n\nThat is correct.\n\n> - but there's nothing being lost / removed here so I think\n> we're all good.\n\nRight I manually re-applied local changes that is what the \"re-instating\nlibcamera local modifications.\" part in the commit message refers to.\n\n> And the checkstyle warnings you mentioned are fine here. We should\n> figure out how to exclude this directory.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nThank you for the reviews.\n\nRegards,\n\nHans\n\n\n\n\n> \n>> ---\n>>  include/linux/README             |  2 +-\n>>  include/linux/drm_fourcc.h       | 10 ++---\n>>  include/linux/media-bus-format.h |  9 ++++\n>>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n>>  include/linux/udmabuf.h          | 33 +++++++++++++++\n>>  include/linux/v4l2-controls.h    |  6 +++\n>>  include/linux/v4l2-mediabus.h    | 18 +++++---\n>>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n>>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n>>  9 files changed, 172 insertions(+), 63 deletions(-)\n>>  create mode 100644 include/linux/udmabuf.h\n>>\n>> diff --git a/include/linux/README b/include/linux/README\n>> index 101e4997..b7795309 100644\n>> --- a/include/linux/README\n>> +++ b/include/linux/README\n>> @@ -1,4 +1,4 @@\n>>  # SPDX-License-Identifier: CC0-1.0\n>>  \n>> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n>> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n>>  modify them manually.\n>> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n>> index b4e1a092..d8e99940 100644\n>> --- a/include/linux/drm_fourcc.h\n>> +++ b/include/linux/drm_fourcc.h\n>> @@ -54,7 +54,7 @@ extern \"C\" {\n>>   * Format modifiers may change any property of the buffer, including the number\n>>   * of planes and/or the required allocation size. Format modifiers are\n>>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n>> - * modifier is specific to the modifer being used. For example, some modifiers\n>> + * modifier is specific to the modifier being used. For example, some modifiers\n>>   * may preserve meaning - such as number of planes - from the fourcc code,\n>>   * whereas others may not.\n>>   *\n>> @@ -79,7 +79,7 @@ extern \"C\" {\n>>   *   format.\n>>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n>>   *   see modifiers as opaque tokens they can check for equality and intersect.\n>> - *   These users musn't need to know to reason about the modifier value\n>> + *   These users mustn't need to know to reason about the modifier value\n>>   *   (i.e. they are not expected to extract information out of the modifier).\n>>   *\n>>   * Vendors should document their modifier usage in as much detail as\n>> @@ -610,7 +610,7 @@ extern \"C\" {\n>>   * This is a tiled layout using 4Kb tiles in row-major layout.\n>>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n>>   * are arranged in four groups (two wide, two high) with column-major layout.\n>> - * Each group therefore consits out of four 256 byte units, which are also laid\n>> + * Each group therefore consists out of four 256 byte units, which are also laid\n>>   * out as 2x2 column-major.\n>>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n>>   * either a square block or a 2:1 unit.\n>> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>>   */\n>>  \n>>  /*\n>> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n>> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n>>   * modifiers) denote the category for modifiers. Currently we have three\n>>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n>>   * sixteen different categories.\n>> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>>   * Amlogic FBC Memory Saving mode\n>>   *\n>>   * Indicates the storage is packed when pixel size is multiple of word\n>> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n>> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n>>   * memory.\n>>   *\n>>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n>> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n>> index f05f747e..d4c1d991 100644\n>> --- a/include/linux/media-bus-format.h\n>> +++ b/include/linux/media-bus-format.h\n>> @@ -174,4 +174,13 @@\n>>   */\n>>  #define MEDIA_BUS_FMT_METADATA_FIXED           0x7001\n>>  \n>> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n>> +#define MEDIA_BUS_FMT_META_8                   0x8001\n>> +#define MEDIA_BUS_FMT_META_10                  0x8002\n>> +#define MEDIA_BUS_FMT_META_12                  0x8003\n>> +#define MEDIA_BUS_FMT_META_14                  0x8004\n>> +#define MEDIA_BUS_FMT_META_16                  0x8005\n>> +#define MEDIA_BUS_FMT_META_20                  0x8006\n>> +#define MEDIA_BUS_FMT_META_24                  0x8007\n>> +\n>>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n>> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n>> index 2d1c448a..f87c6bd4 100644\n>> --- a/include/linux/rkisp1-config.h\n>> +++ b/include/linux/rkisp1-config.h\n>> @@ -4,8 +4,8 @@\n>>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n>>   */\n>>  \n>> -#ifndef _UAPI_RKISP1_CONFIG_H\n>> -#define _UAPI_RKISP1_CONFIG_H\n>> +#ifndef _RKISP1_CONFIG_H\n>> +#define _RKISP1_CONFIG_H\n>>  \n>>  #include <linux/types.h>\n>>  \n>> @@ -175,11 +175,14 @@\n>>  /**\n>>   * enum rkisp1_cif_isp_version - ISP variants\n>>   *\n>> - * @RKISP1_V10: used at least in rk3288 and rk3399\n>> - * @RKISP1_V11: declared in the original vendor code, but not used\n>> - * @RKISP1_V12: used at least in rk3326 and px30\n>> - * @RKISP1_V13: used at least in rk1808\n>> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n>> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n>> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n>> + *     of entries in grids and histogram as v10.\n>> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n>> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n>> + *     histogram as v12.\n>> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n>> + *     and histogram as v10.\n>>   */\n>>  enum rkisp1_cif_isp_version {\n>>         RKISP1_V10 = 10,\n>> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n>> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n>> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n>> - * of the two.\n>> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n>> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n>>   */\n>>  struct rkisp1_cif_isp_goc_config {\n>>         __u32 mode;\n>> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n>> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n>> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n>> - * of the two.\n>> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n>> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n>> + * two.\n>>   */\n>>  struct rkisp1_cif_isp_hst_config {\n>>         __u32 mode;\n>> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n>> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n>> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n>> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n>> + * to the maximum of the two.\n>>   *\n>>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n>>   */\n>> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n>>   *            integer part.\n>>   *\n>>   * The window of the measurements area is divided to 5x5 sub-windows for\n>> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n>> - * each sub-window independently and the final result is a weighted average of\n>> - * the histogram measurements on all sub-windows. The window of the\n>> - * measurements area and the weight of each sub-window are configurable using\n>> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n>> + * sub-window independently and the final result is a weighted average of the\n>> + * histogram measurements on all sub-windows. The window of the measurements\n>> + * area and the weight of each sub-window are configurable using\n>>   * struct @rkisp1_cif_isp_hst_config.\n>>   *\n>> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n>> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n>>   *\n>>   * The number of entries of @hist_bins depends on the hardware revision\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n>> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n>> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n>> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n>> + * equal to the maximum of the two.\n>>   */\n>>  struct rkisp1_cif_isp_hist_stat {\n>>         __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n>> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n>>         struct rkisp1_cif_isp_stat params;\n>>  };\n>>  \n>> -#endif /* _UAPI_RKISP1_CONFIG_H */\n>> +#endif /* _RKISP1_CONFIG_H */\n>> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n>> new file mode 100644\n>> index 00000000..76cc7de9\n>> --- /dev/null\n>> +++ b/include/linux/udmabuf.h\n>> @@ -0,0 +1,33 @@\n>> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n>> +#ifndef _LINUX_UDMABUF_H\n>> +#define _LINUX_UDMABUF_H\n>> +\n>> +#include <linux/types.h>\n>> +#include <linux/ioctl.h>\n>> +\n>> +#define UDMABUF_FLAGS_CLOEXEC  0x01\n>> +\n>> +struct udmabuf_create {\n>> +       __u32 memfd;\n>> +       __u32 flags;\n>> +       __u64 offset;\n>> +       __u64 size;\n>> +};\n>> +\n>> +struct udmabuf_create_item {\n>> +       __u32 memfd;\n>> +       __u32 __pad;\n>> +       __u64 offset;\n>> +       __u64 size;\n>> +};\n>> +\n>> +struct udmabuf_create_list {\n>> +       __u32 flags;\n>> +       __u32 count;\n>> +       struct udmabuf_create_item list[];\n>> +};\n>> +\n>> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n>> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n>> +\n>> +#endif /* _LINUX_UDMABUF_H */\n>> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n>> index b9f64810..1e6e816b 100644\n>> --- a/include/linux/v4l2-controls.h\n>> +++ b/include/linux/v4l2-controls.h\n>> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n>>   */\n>>  #define V4L2_CID_USER_NPCM_BASE                        (V4L2_CID_USER_BASE + 0x11b0)\n>>  \n>> +/*\n>> + * The base for THine THP7312 driver controls.\n>> + * We reserve 32 controls for this driver.\n>> + */\n>> +#define V4L2_CID_USER_THP7312_BASE             (V4L2_CID_USER_BASE + 0x11c0)\n>> +\n>>  /* MPEG-class control IDs */\n>>  /* The MPEG controls are applicable to all codec controls\n>>   * and the 'MPEG' part of the define is historical */\n>> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n>> index 2c318de1..097ef739 100644\n>> --- a/include/linux/v4l2-mediabus.h\n>> +++ b/include/linux/v4l2-mediabus.h\n>> @@ -19,12 +19,18 @@\n>>   * @width:     image width\n>>   * @height:    image height\n>>   * @code:      data format code (from enum v4l2_mbus_pixelcode)\n>> - * @field:     used interlacing type (from enum v4l2_field)\n>> - * @colorspace:        colorspace of the data (from enum v4l2_colorspace)\n>> - * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n>> - * @hsv_enc:   HSV encoding of the data (from enum v4l2_hsv_encoding)\n>> - * @quantization: quantization of the data (from enum v4l2_quantization)\n>> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n>> + * @field:     used interlacing type (from enum v4l2_field), zero for metadata\n>> + *             mbus codes\n>> + * @colorspace:        colorspace of the data (from enum v4l2_colorspace), zero on\n>> + *             metadata mbus codes\n>> + * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n>> + *             for metadata mbus codes\n>> + * @hsv_enc:   HSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n>> + *             metadata mbus codes\n>> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n>> + *             for metadata mbus codes\n>> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n>> + *             for metadata mbus codes\n>>   * @flags:     flags (V4L2_MBUS_FRAMEFMT_*)\n>>   * @reserved:  reserved bytes that can be later used\n>>   */\n>> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n>> index b383c2fe..2347e266 100644\n>> --- a/include/linux/v4l2-subdev.h\n>> +++ b/include/linux/v4l2-subdev.h\n>> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n>>   * @rect: pad crop rectangle boundaries\n>>   * @stream: stream number, defined in subdev routing\n>>   * @reserved: drivers and applications must zero this array\n>> + *\n>> + * The subdev crop API is an obsolete interface and may be removed in the\n>> + * future. It is superseded by the selection API. No new extensions to this\n>> + * structure will be accepted.\n>>   */\n>>  struct v4l2_subdev_crop {\n>>         __u32 which;\n>> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n>>   * @pad: pad number, as reported by the media API\n>>   * @interval: frame interval in seconds\n>>   * @stream: stream number, defined in subdev routing\n>> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>>  struct v4l2_subdev_frame_interval {\n>>         __u32 pad;\n>>         struct v4l2_fract interval;\n>>         __u32 stream;\n>> -       __u32 reserved[8];\n>> +       __u32 which;\n>> +       __u32 reserved[7];\n>>  };\n>>  \n>>  /**\n>> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n>>   * @width: frame width in pixels\n>>   * @height: frame height in pixels\n>>   * @interval: frame interval in seconds\n>> - * @which: format type (from enum v4l2_subdev_format_whence)\n>> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>>   * @stream: stream number, defined in subdev routing\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n>>   * struct v4l2_subdev_routing - Subdev routing information\n>>   *\n>>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n>> - * @num_routes: the total number of routes in the routes array\n>> + * @len_routes: the length of the routes array, in routes; set by the user, not\n>> + *             modified by the kernel\n>>   * @routes: pointer to the routes array\n>> + * @num_routes: the total number of routes, possibly more than fits in the\n>> + *             routes array\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>>  struct v4l2_subdev_routing {\n>>         __u32 which;\n>> -       __u32 num_routes;\n>> +       __u32 len_routes;\n>>         __u64 routes;\n>> -       __u32 reserved[6];\n>> +       __u32 num_routes;\n>> +       __u32 reserved[11];\n>>  };\n>>  \n>>  /*\n>> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n>>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n>>   * kernel.\n>>   */\n>> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS                (1ULL << 0)\n>> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS                 (1ULL << 0)\n>> +\n>> +/*\n>> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n>> + * this is not set (which is the default), the which field is forced to\n>> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n>> + */\n>> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH     (1ULL << 1)\n>>  \n>>  /**\n>>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n>> index 0b5482a0..7fe522e8 100644\n>> --- a/include/linux/videodev2.h\n>> +++ b/include/linux/videodev2.h\n>> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n>>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n>>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n>>  #define V4L2_PIX_FMT_IPU3_Y10          v4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n>> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n>> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n>>  \n>>  /* Palette formats */\n>>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n>> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n>>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC            0x0080\n>>  #define V4L2_FMT_FLAG_CSC_HSV_ENC              V4L2_FMT_FLAG_CSC_YCBCR_ENC\n>>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION         0x0100\n>> +#define V4L2_FMT_FLAG_META_LINE_BASED          0x0200\n>>  \n>>         /* Frame Size and frame rate enumeration */\n>>  /*\n>> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n>>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS            (1 << 4)\n>>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF     (1 << 5)\n>>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS         (1 << 6)\n>> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS          (1 << 7)\n>> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS              (1 << 8)\n>>  \n>>  /**\n>>   * struct v4l2_plane - plane info for multi-planar buffers\n>>   * @bytesused:         number of bytes occupied by data in the plane (payload)\n>>   * @length:            size of this plane (NOT the payload) in bytes\n>> - * @mem_offset:                when memory in the associated struct v4l2_buffer is\n>> + * @m.mem_offset:      when memory in the associated struct v4l2_buffer is\n>>   *                     V4L2_MEMORY_MMAP, equals the offset from the start of\n>>   *                     the device memory for this plane (or is a \"cookie\" that\n>>   *                     should be passed to mmap() called on the video node)\n>> - * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>> + * @m.userptr:         when memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>>   *                     pointing to this plane\n>> - * @fd:                        when memory is V4L2_MEMORY_DMABUF, a userspace file\n>> + * @m.fd:              when memory is V4L2_MEMORY_DMABUF, a userspace file\n>>   *                     descriptor associated with this plane\n>>   * @m:                 union of @mem_offset, @userptr and @fd\n>>   * @data_offset:       offset in the plane to the start of data; usually 0,\n>> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n>>   * @sequence:  sequence count of this frame\n>>   * @memory:    enum v4l2_memory; the method, in which the actual video data is\n>>   *             passed\n>> - * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>> + * @m.offset:  for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>>   *             offset from the start of the device memory for this plane,\n>>   *             (or a \"cookie\" that should be passed to mmap() as offset)\n>> - * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>> + * @m.userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>>   *             a userspace pointer pointing to this buffer\n>> - * @fd:                for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>> + * @m.fd:              for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>>   *             a userspace file descriptor associated with this buffer\n>> - * @planes:    for multiplanar buffers; userspace pointer to the array of plane\n>> + * @m.planes:  for multiplanar buffers; userspace pointer to the array of plane\n>>   *             info structs for this buffer\n>>   * @m:         union of @offset, @userptr, @planes and @fd\n>>   * @length:    size in bytes of the buffer (NOT its payload) for single-plane\n>> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n>>                 struct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n>>                 struct v4l2_ctrl_av1_frame *p_av1_frame;\n>>                 struct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n>> +               struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n>> +               struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n>>                 void *ptr;\n>> -       };\n>> +       } __attribute__ ((packed));\n>>  } __attribute__ ((packed));\n>>  \n>>  struct v4l2_ext_controls {\n>> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n>>   * struct v4l2_meta_format - metadata format definition\n>>   * @dataformat:                little endian four character code (fourcc)\n>>   * @buffersize:                maximum size in bytes required for data\n>> + * @width:             number of data units of data per line (valid for line\n>> + *                     based formats only, see format documentation)\n>> + * @height:            number of lines of data per buffer (valid for line based\n>> + *                     formats only)\n>> + * @bytesperline:      offset between the beginnings of two adjacent lines in\n>> + *                     bytes (valid for line based formats only)\n>>   */\n>>  struct v4l2_meta_format {\n>>         __u32                           dataformat;\n>>         __u32                           buffersize;\n>> +       __u32                           width;\n>> +       __u32                           height;\n>> +       __u32                           bytesperline;\n>>  } __attribute__ ((packed));\n>>  \n>>  /**\n>>   * struct v4l2_format - stream data format\n>> - * @type:      enum v4l2_buf_type; type of the data stream\n>> - * @pix:       definition of an image format\n>> - * @pix_mp:    definition of a multiplanar image format\n>> - * @win:       definition of an overlaid image\n>> - * @vbi:       raw VBI capture or output parameters\n>> - * @sliced:    sliced VBI capture or output parameters\n>> - * @raw_data:  placeholder for future extensions and custom formats\n>> - * @fmt:       union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n>> - *             and @raw_data\n>> + * @type:              enum v4l2_buf_type; type of the data stream\n>> + * @fmt.pix:           definition of an image format\n>> + * @fmt.pix_mp:                definition of a multiplanar image format\n>> + * @fmt.win:           definition of an overlaid image\n>> + * @fmt.vbi:           raw VBI capture or output parameters\n>> + * @fmt.sliced:                sliced VBI capture or output parameters\n>> + * @fmt.raw_data:      placeholder for future extensions and custom formats\n>> + * @fmt:               union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n>> + *                     @meta and @raw_data\n>>   */\n>>  struct v4l2_format {\n>>         __u32    type;\n>> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n>>   * @flags:     additional buffer management attributes (ignored unless the\n>>   *             queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n>>   *             and configured for MMAP streaming I/O).\n>> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n>> + *             this field indicate the maximum possible number of buffers\n>> + *             for this queue.\n>>   * @reserved:  future extensions\n>>   */\n>>  struct v4l2_create_buffers {\n>> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n>>         struct v4l2_format      format;\n>>         __u32                   capabilities;\n>>         __u32                   flags;\n>> -       __u32                   reserved[6];\n>> +       __u32                   max_num_buffers;\n>> +       __u32                   reserved[5];\n>> +};\n>> +\n>> +/**\n>> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n>> + * @index:     the first buffer to be removed\n>> + * @count:     number of buffers to removed\n>> + * @type:      enum v4l2_buf_type\n>> + * @reserved:  future extensions\n>> + */\n>> +struct v4l2_remove_buffers {\n>> +       __u32                   index;\n>> +       __u32                   count;\n>> +       __u32                   type;\n>> +       __u32                   reserved[13];\n>>  };\n>>  \n>>  /*\n>> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n>>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n>>  \n>>  #define VIDIOC_QUERY_EXT_CTRL  _IOWR('V', 103, struct v4l2_query_ext_ctrl)\n>> +#define VIDIOC_REMOVE_BUFS     _IOWR('V', 104, struct v4l2_remove_buffers)\n>> +\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>> 2.45.1\n>>\n>","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 00172BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 May 2024 07:28:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0EC2F634B6;\n\tFri, 31 May 2024 09:28:04 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 15B70634AD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 09:28:01 +0200 (CEST)","from mail-ej1-f69.google.com (mail-ej1-f69.google.com\n\t[209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-632-JBF19GiaPxqJmqMO5k_R3w-1; Fri, 31 May 2024 03:27:58 -0400","by mail-ej1-f69.google.com with SMTP id\n\ta640c23a62f3a-a6552b3c0faso71890666b.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 00:27:58 -0700 (PDT)","from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec?\n\t(2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl.\n\t[2001:1c00:c32:7800:5bfa:a036:83f0:f9ec])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-a67e6f02870sm56672466b.5.2024.05.31.00.27.55\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 31 May 2024 00:27:55 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"LtvUU2o3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1717140480;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=WfrD1hlcwugKKdEBu7wznZfXuCe+Kcr5pvv/5whV4o4=;\n\tb=LtvUU2o3PemvwK0UbibVQnFrLd3U8U8VhID/3bxMAwlvmBvI0df5HztuzRONGStwmv87Na\n\tCKYCpptp5QdU4EtFNCdegBCxMbQNeqLszTUDutcgjTe2v8HbyPJxV7AM1l3p2LsW16omwn\n\tgQxQuJ289Oa2dU2DawomYKXPHwkL0+Q=","X-MC-Unique":"JBF19GiaPxqJmqMO5k_R3w-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1717140477; x=1717745277;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=WfrD1hlcwugKKdEBu7wznZfXuCe+Kcr5pvv/5whV4o4=;\n\tb=Fe8axlnuAAgLiwx0RxEbhfaBt9sMVESpJaFO4ahhe6z1pU8x4z+ZZzaAXZ0WMjQniY\n\tK6XcwQd32QuPUj7oGoaPn1Sywsnk+9mYQ29YnYm1lCqek5SHkSzL9bh/TJ2pwpMgFKVO\n\taIQNsnAh/FvqFux45jZmNAwVdlEDhWG+CQ5RPJ/taHFTZt0x0beRS3aZqH73zFdukvFc\n\tkICZwSR5AyMsKeqKSCRc/RejmYFvxlCTNXDYQyYapNlQOdBnSTNT9RfUvfovjE6PX+dk\n\tWp5M1/Q+ZzapLgfeeqI6E2lHtG4Qo3n5N0VAL2EV5/hceyKt5InWTEaP/IPD/lAUpdt7\n\tyMdQ==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCV7sHD/hn/z4gHgLXVzBYSoAoc+NdWaYXuEf8I9n4egCfw3rxrA/vkSldboHabaRLpY0QSVdSzzKRMPomA8tcgM5ONzcDa7txwouIE5HEZFvcPI8A==","X-Gm-Message-State":"AOJu0YzFgBiByQa2kMEr3CjJnzDiQwOO8ACyFQwzjyHkvUufzrASX8lh\n\tZwMzR5wOvH7KXOfjp1QcRnBPOIgNpqw5wzhGRZeSPPVx53+ewYH/0vjkVLJ0w8NVgMDh7Ihru/8\n\toib2qZFRDnF7Ql4AHoGHWp2WArlYJNVb0EEkcK413f9BsxVygH4/+UlUVXfr9JppDK2BoPaQ=","X-Received":["by 2002:a17:906:d8b7:b0:a59:cb29:3fb5 with SMTP id\n\ta640c23a62f3a-a682022cd50mr76081266b.20.1717140477102; \n\tFri, 31 May 2024 00:27:57 -0700 (PDT)","by 2002:a17:906:d8b7:b0:a59:cb29:3fb5 with SMTP id\n\ta640c23a62f3a-a682022cd50mr76077266b.20.1717140476377; \n\tFri, 31 May 2024 00:27:56 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IHyAznVHn8kE0sHyh487R46gKNHMA1w57J4Xdd3OXbmw9QLsZQVHZ3bH9xzB4QYuGWfPhAlng==","Message-ID":"<fbd52e7a-0ee7-4ce4-94d2-c404f225963e@redhat.com>","Date":"Fri, 31 May 2024 09:27:55 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Andrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>\n\t<171710563868.372008.8570179057837747789@ping.linuxembedded.co.uk>","From":"Hans de Goede <hdegoede@redhat.com>","In-Reply-To":"<171710563868.372008.8570179057837747789@ping.linuxembedded.co.uk>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Language":"en-US, nl","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29718,"web_url":"https://patchwork.libcamera.org/comment/29718/","msgid":"<20240601134551.GC6163@pendragon.ideasonboard.com>","date":"2024-06-01T13:45:51","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hans,\n\nThank you for the patch.\n\nOn Thu, May 30, 2024 at 07:15:57PM +0200, Hans de Goede wrote:\n> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n> and re-instating libcamera local modifications.\n> \n> This includes adding include/linux/udmabuf.h which was not part\n> of libcamera's include/linux headers before.\n> \n> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n> ---\n>  include/linux/README             |  2 +-\n>  include/linux/drm_fourcc.h       | 10 ++---\n>  include/linux/media-bus-format.h |  9 ++++\n>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n>  include/linux/udmabuf.h          | 33 +++++++++++++++\n>  include/linux/v4l2-controls.h    |  6 +++\n>  include/linux/v4l2-mediabus.h    | 18 +++++---\n>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n>  9 files changed, 172 insertions(+), 63 deletions(-)\n>  create mode 100644 include/linux/udmabuf.h\n> \n> diff --git a/include/linux/README b/include/linux/README\n> index 101e4997..b7795309 100644\n> --- a/include/linux/README\n> +++ b/include/linux/README\n> @@ -1,4 +1,4 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n>  modify them manually.\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index b4e1a092..d8e99940 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -54,7 +54,7 @@ extern \"C\" {\n>   * Format modifiers may change any property of the buffer, including the number\n>   * of planes and/or the required allocation size. Format modifiers are\n>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n> - * modifier is specific to the modifer being used. For example, some modifiers\n> + * modifier is specific to the modifier being used. For example, some modifiers\n>   * may preserve meaning - such as number of planes - from the fourcc code,\n>   * whereas others may not.\n>   *\n> @@ -79,7 +79,7 @@ extern \"C\" {\n>   *   format.\n>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n>   *   see modifiers as opaque tokens they can check for equality and intersect.\n> - *   These users musn't need to know to reason about the modifier value\n> + *   These users mustn't need to know to reason about the modifier value\n>   *   (i.e. they are not expected to extract information out of the modifier).\n>   *\n>   * Vendors should document their modifier usage in as much detail as\n> @@ -610,7 +610,7 @@ extern \"C\" {\n>   * This is a tiled layout using 4Kb tiles in row-major layout.\n>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n>   * are arranged in four groups (two wide, two high) with column-major layout.\n> - * Each group therefore consits out of four 256 byte units, which are also laid\n> + * Each group therefore consists out of four 256 byte units, which are also laid\n>   * out as 2x2 column-major.\n>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n>   * either a square block or a 2:1 unit.\n> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   */\n>  \n>  /*\n> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n>   * modifiers) denote the category for modifiers. Currently we have three\n>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n>   * sixteen different categories.\n> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   * Amlogic FBC Memory Saving mode\n>   *\n>   * Indicates the storage is packed when pixel size is multiple of word\n> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n>   * memory.\n>   *\n>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n> index f05f747e..d4c1d991 100644\n> --- a/include/linux/media-bus-format.h\n> +++ b/include/linux/media-bus-format.h\n> @@ -174,4 +174,13 @@\n>   */\n>  #define MEDIA_BUS_FMT_METADATA_FIXED\t\t0x7001\n>  \n> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n> +#define MEDIA_BUS_FMT_META_8\t\t\t0x8001\n> +#define MEDIA_BUS_FMT_META_10\t\t\t0x8002\n> +#define MEDIA_BUS_FMT_META_12\t\t\t0x8003\n> +#define MEDIA_BUS_FMT_META_14\t\t\t0x8004\n> +#define MEDIA_BUS_FMT_META_16\t\t\t0x8005\n> +#define MEDIA_BUS_FMT_META_20\t\t\t0x8006\n> +#define MEDIA_BUS_FMT_META_24\t\t\t0x8007\n> +\n>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n> index 2d1c448a..f87c6bd4 100644\n> --- a/include/linux/rkisp1-config.h\n> +++ b/include/linux/rkisp1-config.h\n> @@ -4,8 +4,8 @@\n>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n>   */\n>  \n> -#ifndef _UAPI_RKISP1_CONFIG_H\n> -#define _UAPI_RKISP1_CONFIG_H\n> +#ifndef _RKISP1_CONFIG_H\n> +#define _RKISP1_CONFIG_H\n>  \n>  #include <linux/types.h>\n>  \n> @@ -175,11 +175,14 @@\n>  /**\n>   * enum rkisp1_cif_isp_version - ISP variants\n>   *\n> - * @RKISP1_V10: used at least in rk3288 and rk3399\n> - * @RKISP1_V11: declared in the original vendor code, but not used\n> - * @RKISP1_V12: used at least in rk3326 and px30\n> - * @RKISP1_V13: used at least in rk1808\n> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n> + *\tof entries in grids and histogram as v10.\n> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n> + *\thistogram as v12.\n> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n> + *\tand histogram as v10.\n>   */\n>  enum rkisp1_cif_isp_version {\n>  \tRKISP1_V10 = 10,\n> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_goc_config {\n>  \t__u32 mode;\n> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n> + * two.\n>   */\n>  struct rkisp1_cif_isp_hst_config {\n>  \t__u32 mode;\n> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n> + * to the maximum of the two.\n>   *\n>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n>   */\n> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n>   *\t       integer part.\n>   *\n>   * The window of the measurements area is divided to 5x5 sub-windows for\n> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n> - * each sub-window independently and the final result is a weighted average of\n> - * the histogram measurements on all sub-windows. The window of the\n> - * measurements area and the weight of each sub-window are configurable using\n> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n> + * sub-window independently and the final result is a weighted average of the\n> + * histogram measurements on all sub-windows. The window of the measurements\n> + * area and the weight of each sub-window are configurable using\n>   * struct @rkisp1_cif_isp_hst_config.\n>   *\n> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n>   *\n>   * The number of entries of @hist_bins depends on the hardware revision\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n> + * equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_hist_stat {\n>  \t__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n>  \tstruct rkisp1_cif_isp_stat params;\n>  };\n>  \n> -#endif /* _UAPI_RKISP1_CONFIG_H */\n> +#endif /* _RKISP1_CONFIG_H */\n> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n> new file mode 100644\n> index 00000000..76cc7de9\n> --- /dev/null\n> +++ b/include/linux/udmabuf.h\n> @@ -0,0 +1,33 @@\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> +#ifndef _LINUX_UDMABUF_H\n> +#define _LINUX_UDMABUF_H\n> +\n> +#include <linux/types.h>\n> +#include <linux/ioctl.h>\n> +\n> +#define UDMABUF_FLAGS_CLOEXEC\t0x01\n> +\n> +struct udmabuf_create {\n> +\t__u32 memfd;\n> +\t__u32 flags;\n> +\t__u64 offset;\n> +\t__u64 size;\n> +};\n> +\n> +struct udmabuf_create_item {\n> +\t__u32 memfd;\n> +\t__u32 __pad;\n> +\t__u64 offset;\n> +\t__u64 size;\n> +};\n> +\n> +struct udmabuf_create_list {\n> +\t__u32 flags;\n> +\t__u32 count;\n> +\tstruct udmabuf_create_item list[];\n> +};\n> +\n> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n> +\n> +#endif /* _LINUX_UDMABUF_H */\n> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n> index b9f64810..1e6e816b 100644\n> --- a/include/linux/v4l2-controls.h\n> +++ b/include/linux/v4l2-controls.h\n> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n>   */\n>  #define V4L2_CID_USER_NPCM_BASE\t\t\t(V4L2_CID_USER_BASE + 0x11b0)\n>  \n> +/*\n> + * The base for THine THP7312 driver controls.\n> + * We reserve 32 controls for this driver.\n> + */\n> +#define V4L2_CID_USER_THP7312_BASE\t\t(V4L2_CID_USER_BASE + 0x11c0)\n> +\n>  /* MPEG-class control IDs */\n>  /* The MPEG controls are applicable to all codec controls\n>   * and the 'MPEG' part of the define is historical */\n> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n> index 2c318de1..097ef739 100644\n> --- a/include/linux/v4l2-mediabus.h\n> +++ b/include/linux/v4l2-mediabus.h\n> @@ -19,12 +19,18 @@\n>   * @width:\timage width\n>   * @height:\timage height\n>   * @code:\tdata format code (from enum v4l2_mbus_pixelcode)\n> - * @field:\tused interlacing type (from enum v4l2_field)\n> - * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace)\n> - * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n> - * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding)\n> - * @quantization: quantization of the data (from enum v4l2_quantization)\n> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n> + * @field:\tused interlacing type (from enum v4l2_field), zero for metadata\n> + *\t\tmbus codes\n> + * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace), zero on\n> + *\t\tmetadata mbus codes\n> + * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n> + *\t\tfor metadata mbus codes\n> + * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n> + *\t\tmetadata mbus codes\n> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n> + *\t\tfor metadata mbus codes\n> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n> + *\t\tfor metadata mbus codes\n>   * @flags:\tflags (V4L2_MBUS_FRAMEFMT_*)\n>   * @reserved:  reserved bytes that can be later used\n>   */\n> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n> index b383c2fe..2347e266 100644\n> --- a/include/linux/v4l2-subdev.h\n> +++ b/include/linux/v4l2-subdev.h\n> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n>   * @rect: pad crop rectangle boundaries\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n> + *\n> + * The subdev crop API is an obsolete interface and may be removed in the\n> + * future. It is superseded by the selection API. No new extensions to this\n> + * structure will be accepted.\n>   */\n>  struct v4l2_subdev_crop {\n>  \t__u32 which;\n> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n>   * @pad: pad number, as reported by the media API\n>   * @interval: frame interval in seconds\n>   * @stream: stream number, defined in subdev routing\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_frame_interval {\n>  \t__u32 pad;\n>  \tstruct v4l2_fract interval;\n>  \t__u32 stream;\n> -\t__u32 reserved[8];\n> +\t__u32 which;\n> +\t__u32 reserved[7];\n>  };\n>  \n>  /**\n> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n>   * @width: frame width in pixels\n>   * @height: frame height in pixels\n>   * @interval: frame interval in seconds\n> - * @which: format type (from enum v4l2_subdev_format_whence)\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n>   */\n> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n>   * struct v4l2_subdev_routing - Subdev routing information\n>   *\n>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n> - * @num_routes: the total number of routes in the routes array\n> + * @len_routes: the length of the routes array, in routes; set by the user, not\n> + *\t\tmodified by the kernel\n>   * @routes: pointer to the routes array\n> + * @num_routes: the total number of routes, possibly more than fits in the\n> + *\t\troutes array\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_routing {\n>  \t__u32 which;\n> -\t__u32 num_routes;\n> +\t__u32 len_routes;\n>  \t__u64 routes;\n> -\t__u32 reserved[6];\n> +\t__u32 num_routes;\n> +\t__u32 reserved[11];\n\nThis will cause some issues. The routing API has changed, we need to\nhandle it in a backward-compatible way. I have patches for that, I think\nI have even posted them. I'll rebase on top of this patch and repost.\nThe two series will need to be merged together.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  };\n>  \n>  /*\n> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n>   * kernel.\n>   */\n> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t(1ULL << 0)\n> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t\t(1ULL << 0)\n> +\n> +/*\n> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n> + * this is not set (which is the default), the which field is forced to\n> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n> + */\n> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH\t(1ULL << 1)\n>  \n>  /**\n>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 0b5482a0..7fe522e8 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n>  #define V4L2_PIX_FMT_IPU3_Y10\t\tv4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n>  \n>  /* Palette formats */\n>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC\t\t0x0080\n>  #define V4L2_FMT_FLAG_CSC_HSV_ENC\t\tV4L2_FMT_FLAG_CSC_YCBCR_ENC\n>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION\t\t0x0100\n> +#define V4L2_FMT_FLAG_META_LINE_BASED\t\t0x0200\n>  \n>  \t/* Frame Size and frame rate enumeration */\n>  /*\n> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS\t\t(1 << 4)\n>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF\t(1 << 5)\n>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS\t\t(1 << 6)\n> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS\t\t(1 << 7)\n> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS\t\t(1 << 8)\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>   * @length:\t\tsize of this plane (NOT the payload) in bytes\n> - * @mem_offset:\t\twhen memory in the associated struct v4l2_buffer is\n> + * @m.mem_offset:\twhen memory in the associated struct v4l2_buffer is\n>   *\t\t\tV4L2_MEMORY_MMAP, equals the offset from the start of\n>   *\t\t\tthe device memory for this plane (or is a \"cookie\" that\n>   *\t\t\tshould be passed to mmap() called on the video node)\n> - * @userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n> + * @m.userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>   *\t\t\tpointing to this plane\n> - * @fd:\t\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n> + * @m.fd:\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n>   *\t\t\tdescriptor associated with this plane\n>   * @m:\t\t\tunion of @mem_offset, @userptr and @fd\n>   * @data_offset:\toffset in the plane to the start of data; usually 0,\n> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n>   * @sequence:\tsequence count of this frame\n>   * @memory:\tenum v4l2_memory; the method, in which the actual video data is\n>   *\t\tpassed\n> - * @offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n> + * @m.offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>   *\t\toffset from the start of the device memory for this plane,\n>   *\t\t(or a \"cookie\" that should be passed to mmap() as offset)\n> - * @userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n> + * @m.userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>   *\t\ta userspace pointer pointing to this buffer\n> - * @fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n> + * @m.fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>   *\t\ta userspace file descriptor associated with this buffer\n> - * @planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n> + * @m.planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n>   *\t\tinfo structs for this buffer\n>   * @m:\t\tunion of @offset, @userptr, @planes and @fd\n>   * @length:\tsize in bytes of the buffer (NOT its payload) for single-plane\n> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n>  \t\tstruct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n>  \t\tstruct v4l2_ctrl_av1_frame *p_av1_frame;\n>  \t\tstruct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n> +\t\tstruct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n> +\t\tstruct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n>  \t\tvoid *ptr;\n> -\t};\n> +\t} __attribute__ ((packed));\n>  } __attribute__ ((packed));\n>  \n>  struct v4l2_ext_controls {\n> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n>   * struct v4l2_meta_format - metadata format definition\n>   * @dataformat:\t\tlittle endian four character code (fourcc)\n>   * @buffersize:\t\tmaximum size in bytes required for data\n> + * @width:\t\tnumber of data units of data per line (valid for line\n> + *\t\t\tbased formats only, see format documentation)\n> + * @height:\t\tnumber of lines of data per buffer (valid for line based\n> + *\t\t\tformats only)\n> + * @bytesperline:\toffset between the beginnings of two adjacent lines in\n> + *\t\t\tbytes (valid for line based formats only)\n>   */\n>  struct v4l2_meta_format {\n>  \t__u32\t\t\t\tdataformat;\n>  \t__u32\t\t\t\tbuffersize;\n> +\t__u32\t\t\t\twidth;\n> +\t__u32\t\t\t\theight;\n> +\t__u32\t\t\t\tbytesperline;\n>  } __attribute__ ((packed));\n>  \n>  /**\n>   * struct v4l2_format - stream data format\n> - * @type:\tenum v4l2_buf_type; type of the data stream\n> - * @pix:\tdefinition of an image format\n> - * @pix_mp:\tdefinition of a multiplanar image format\n> - * @win:\tdefinition of an overlaid image\n> - * @vbi:\traw VBI capture or output parameters\n> - * @sliced:\tsliced VBI capture or output parameters\n> - * @raw_data:\tplaceholder for future extensions and custom formats\n> - * @fmt:\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n> - *\t\tand @raw_data\n> + * @type:\t\tenum v4l2_buf_type; type of the data stream\n> + * @fmt.pix:\t\tdefinition of an image format\n> + * @fmt.pix_mp:\t\tdefinition of a multiplanar image format\n> + * @fmt.win:\t\tdefinition of an overlaid image\n> + * @fmt.vbi:\t\traw VBI capture or output parameters\n> + * @fmt.sliced:\t\tsliced VBI capture or output parameters\n> + * @fmt.raw_data:\tplaceholder for future extensions and custom formats\n> + * @fmt:\t\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n> + *\t\t\t@meta and @raw_data\n>   */\n>  struct v4l2_format {\n>  \t__u32\t type;\n> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n>   * @flags:\tadditional buffer management attributes (ignored unless the\n>   *\t\tqueue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n>   *\t\tand configured for MMAP streaming I/O).\n> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n> + *\t\tthis field indicate the maximum possible number of buffers\n> + *\t\tfor this queue.\n>   * @reserved:\tfuture extensions\n>   */\n>  struct v4l2_create_buffers {\n> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n>  \tstruct v4l2_format\tformat;\n>  \t__u32\t\t\tcapabilities;\n>  \t__u32\t\t\tflags;\n> -\t__u32\t\t\treserved[6];\n> +\t__u32\t\t\tmax_num_buffers;\n> +\t__u32\t\t\treserved[5];\n> +};\n> +\n> +/**\n> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n> + * @index:\tthe first buffer to be removed\n> + * @count:\tnumber of buffers to removed\n> + * @type:\tenum v4l2_buf_type\n> + * @reserved:\tfuture extensions\n> + */\n> +struct v4l2_remove_buffers {\n> +\t__u32\t\t\tindex;\n> +\t__u32\t\t\tcount;\n> +\t__u32\t\t\ttype;\n> +\t__u32\t\t\treserved[13];\n>  };\n>  \n>  /*\n> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n>  \n>  #define VIDIOC_QUERY_EXT_CTRL\t_IOWR('V', 103, struct v4l2_query_ext_ctrl)\n> +#define VIDIOC_REMOVE_BUFS\t_IOWR('V', 104, struct v4l2_remove_buffers)\n> +\n>  \n>  /* Reminder: when adding new ioctls please add support for them to\n>     drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */","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 6E340BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Jun 2024 13:46:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B968634B8;\n\tSat,  1 Jun 2024 15:46:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22B7261A45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Jun 2024 15:46:05 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2624122A;\n\tSat,  1 Jun 2024 15:45:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EQwDjabg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717249559;\n\tbh=lF3hCFwN6h4o16WMnuSEENF/HtpKSVxsYcZ4hn4yg7U=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EQwDjabgvwEJcGhNMiobpHVdLYZqAPwZyFplU4S8MFlrNjHIHcSQljGaAlETgYQ2E\n\tU3pZbuHX76Jm1Dzhfn48lM4saZkrgtBF9gFWewBzuV+a656ALsxmB2j39Vg+ePxIE8\n\tZD/BZLpeNA6obakNL56IJ4IKx53U4PLeI+4oCYxY=","Date":"Sat, 1 Jun 2024 16:45:51 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hans de Goede <hdegoede@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tAndrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","Message-ID":"<20240601134551.GC6163@pendragon.ideasonboard.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240530171600.259495-3-hdegoede@redhat.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29720,"web_url":"https://patchwork.libcamera.org/comment/29720/","msgid":"<014b395f-7782-4bda-82c1-a92b5090554a@redhat.com>","date":"2024-06-01T14:16:04","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":102,"url":"https://patchwork.libcamera.org/api/people/102/","name":"Hans de Goede","email":"hdegoede@redhat.com"},"content":"Hi Laurent,\n\nOn 6/1/24 3:45 PM, Laurent Pinchart wrote:\n> Hi Hans,\n> \n> Thank you for the patch.\n> \n> On Thu, May 30, 2024 at 07:15:57PM +0200, Hans de Goede wrote:\n>> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n>> and re-instating libcamera local modifications.\n>>\n>> This includes adding include/linux/udmabuf.h which was not part\n>> of libcamera's include/linux headers before.\n>>\n>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n>> ---\n>>  include/linux/README             |  2 +-\n>>  include/linux/drm_fourcc.h       | 10 ++---\n>>  include/linux/media-bus-format.h |  9 ++++\n>>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n>>  include/linux/udmabuf.h          | 33 +++++++++++++++\n>>  include/linux/v4l2-controls.h    |  6 +++\n>>  include/linux/v4l2-mediabus.h    | 18 +++++---\n>>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n>>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n>>  9 files changed, 172 insertions(+), 63 deletions(-)\n>>  create mode 100644 include/linux/udmabuf.h\n>>\n>> diff --git a/include/linux/README b/include/linux/README\n>> index 101e4997..b7795309 100644\n>> --- a/include/linux/README\n>> +++ b/include/linux/README\n>> @@ -1,4 +1,4 @@\n>>  # SPDX-License-Identifier: CC0-1.0\n>>  \n>> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n>> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n>>  modify them manually.\n>> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n>> index b4e1a092..d8e99940 100644\n>> --- a/include/linux/drm_fourcc.h\n>> +++ b/include/linux/drm_fourcc.h\n>> @@ -54,7 +54,7 @@ extern \"C\" {\n>>   * Format modifiers may change any property of the buffer, including the number\n>>   * of planes and/or the required allocation size. Format modifiers are\n>>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n>> - * modifier is specific to the modifer being used. For example, some modifiers\n>> + * modifier is specific to the modifier being used. For example, some modifiers\n>>   * may preserve meaning - such as number of planes - from the fourcc code,\n>>   * whereas others may not.\n>>   *\n>> @@ -79,7 +79,7 @@ extern \"C\" {\n>>   *   format.\n>>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n>>   *   see modifiers as opaque tokens they can check for equality and intersect.\n>> - *   These users musn't need to know to reason about the modifier value\n>> + *   These users mustn't need to know to reason about the modifier value\n>>   *   (i.e. they are not expected to extract information out of the modifier).\n>>   *\n>>   * Vendors should document their modifier usage in as much detail as\n>> @@ -610,7 +610,7 @@ extern \"C\" {\n>>   * This is a tiled layout using 4Kb tiles in row-major layout.\n>>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n>>   * are arranged in four groups (two wide, two high) with column-major layout.\n>> - * Each group therefore consits out of four 256 byte units, which are also laid\n>> + * Each group therefore consists out of four 256 byte units, which are also laid\n>>   * out as 2x2 column-major.\n>>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n>>   * either a square block or a 2:1 unit.\n>> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>>   */\n>>  \n>>  /*\n>> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n>> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n>>   * modifiers) denote the category for modifiers. Currently we have three\n>>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n>>   * sixteen different categories.\n>> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>>   * Amlogic FBC Memory Saving mode\n>>   *\n>>   * Indicates the storage is packed when pixel size is multiple of word\n>> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n>> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n>>   * memory.\n>>   *\n>>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n>> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n>> index f05f747e..d4c1d991 100644\n>> --- a/include/linux/media-bus-format.h\n>> +++ b/include/linux/media-bus-format.h\n>> @@ -174,4 +174,13 @@\n>>   */\n>>  #define MEDIA_BUS_FMT_METADATA_FIXED\t\t0x7001\n>>  \n>> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n>> +#define MEDIA_BUS_FMT_META_8\t\t\t0x8001\n>> +#define MEDIA_BUS_FMT_META_10\t\t\t0x8002\n>> +#define MEDIA_BUS_FMT_META_12\t\t\t0x8003\n>> +#define MEDIA_BUS_FMT_META_14\t\t\t0x8004\n>> +#define MEDIA_BUS_FMT_META_16\t\t\t0x8005\n>> +#define MEDIA_BUS_FMT_META_20\t\t\t0x8006\n>> +#define MEDIA_BUS_FMT_META_24\t\t\t0x8007\n>> +\n>>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n>> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n>> index 2d1c448a..f87c6bd4 100644\n>> --- a/include/linux/rkisp1-config.h\n>> +++ b/include/linux/rkisp1-config.h\n>> @@ -4,8 +4,8 @@\n>>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n>>   */\n>>  \n>> -#ifndef _UAPI_RKISP1_CONFIG_H\n>> -#define _UAPI_RKISP1_CONFIG_H\n>> +#ifndef _RKISP1_CONFIG_H\n>> +#define _RKISP1_CONFIG_H\n>>  \n>>  #include <linux/types.h>\n>>  \n>> @@ -175,11 +175,14 @@\n>>  /**\n>>   * enum rkisp1_cif_isp_version - ISP variants\n>>   *\n>> - * @RKISP1_V10: used at least in rk3288 and rk3399\n>> - * @RKISP1_V11: declared in the original vendor code, but not used\n>> - * @RKISP1_V12: used at least in rk3326 and px30\n>> - * @RKISP1_V13: used at least in rk1808\n>> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n>> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n>> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n>> + *\tof entries in grids and histogram as v10.\n>> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n>> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n>> + *\thistogram as v12.\n>> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n>> + *\tand histogram as v10.\n>>   */\n>>  enum rkisp1_cif_isp_version {\n>>  \tRKISP1_V10 = 10,\n>> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n>> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n>> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n>> - * of the two.\n>> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n>> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n>>   */\n>>  struct rkisp1_cif_isp_goc_config {\n>>  \t__u32 mode;\n>> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n>> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n>> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n>> - * of the two.\n>> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n>> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n>> + * two.\n>>   */\n>>  struct rkisp1_cif_isp_hst_config {\n>>  \t__u32 mode;\n>> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n>> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n>> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n>> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n>> + * to the maximum of the two.\n>>   *\n>>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n>>   */\n>> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n>>   *\t       integer part.\n>>   *\n>>   * The window of the measurements area is divided to 5x5 sub-windows for\n>> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n>> - * each sub-window independently and the final result is a weighted average of\n>> - * the histogram measurements on all sub-windows. The window of the\n>> - * measurements area and the weight of each sub-window are configurable using\n>> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n>> + * sub-window independently and the final result is a weighted average of the\n>> + * histogram measurements on all sub-windows. The window of the measurements\n>> + * area and the weight of each sub-window are configurable using\n>>   * struct @rkisp1_cif_isp_hst_config.\n>>   *\n>> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n>> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n>>   *\n>>   * The number of entries of @hist_bins depends on the hardware revision\n>>   * as is reported by the hw_revision field of the struct media_device_info\n>>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>>   *\n>> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n>> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n>> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n>> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n>> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n>> + * equal to the maximum of the two.\n>>   */\n>>  struct rkisp1_cif_isp_hist_stat {\n>>  \t__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n>> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n>>  \tstruct rkisp1_cif_isp_stat params;\n>>  };\n>>  \n>> -#endif /* _UAPI_RKISP1_CONFIG_H */\n>> +#endif /* _RKISP1_CONFIG_H */\n>> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n>> new file mode 100644\n>> index 00000000..76cc7de9\n>> --- /dev/null\n>> +++ b/include/linux/udmabuf.h\n>> @@ -0,0 +1,33 @@\n>> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n>> +#ifndef _LINUX_UDMABUF_H\n>> +#define _LINUX_UDMABUF_H\n>> +\n>> +#include <linux/types.h>\n>> +#include <linux/ioctl.h>\n>> +\n>> +#define UDMABUF_FLAGS_CLOEXEC\t0x01\n>> +\n>> +struct udmabuf_create {\n>> +\t__u32 memfd;\n>> +\t__u32 flags;\n>> +\t__u64 offset;\n>> +\t__u64 size;\n>> +};\n>> +\n>> +struct udmabuf_create_item {\n>> +\t__u32 memfd;\n>> +\t__u32 __pad;\n>> +\t__u64 offset;\n>> +\t__u64 size;\n>> +};\n>> +\n>> +struct udmabuf_create_list {\n>> +\t__u32 flags;\n>> +\t__u32 count;\n>> +\tstruct udmabuf_create_item list[];\n>> +};\n>> +\n>> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n>> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n>> +\n>> +#endif /* _LINUX_UDMABUF_H */\n>> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n>> index b9f64810..1e6e816b 100644\n>> --- a/include/linux/v4l2-controls.h\n>> +++ b/include/linux/v4l2-controls.h\n>> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n>>   */\n>>  #define V4L2_CID_USER_NPCM_BASE\t\t\t(V4L2_CID_USER_BASE + 0x11b0)\n>>  \n>> +/*\n>> + * The base for THine THP7312 driver controls.\n>> + * We reserve 32 controls for this driver.\n>> + */\n>> +#define V4L2_CID_USER_THP7312_BASE\t\t(V4L2_CID_USER_BASE + 0x11c0)\n>> +\n>>  /* MPEG-class control IDs */\n>>  /* The MPEG controls are applicable to all codec controls\n>>   * and the 'MPEG' part of the define is historical */\n>> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n>> index 2c318de1..097ef739 100644\n>> --- a/include/linux/v4l2-mediabus.h\n>> +++ b/include/linux/v4l2-mediabus.h\n>> @@ -19,12 +19,18 @@\n>>   * @width:\timage width\n>>   * @height:\timage height\n>>   * @code:\tdata format code (from enum v4l2_mbus_pixelcode)\n>> - * @field:\tused interlacing type (from enum v4l2_field)\n>> - * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace)\n>> - * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n>> - * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding)\n>> - * @quantization: quantization of the data (from enum v4l2_quantization)\n>> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n>> + * @field:\tused interlacing type (from enum v4l2_field), zero for metadata\n>> + *\t\tmbus codes\n>> + * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace), zero on\n>> + *\t\tmetadata mbus codes\n>> + * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n>> + *\t\tfor metadata mbus codes\n>> + * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n>> + *\t\tmetadata mbus codes\n>> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n>> + *\t\tfor metadata mbus codes\n>> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n>> + *\t\tfor metadata mbus codes\n>>   * @flags:\tflags (V4L2_MBUS_FRAMEFMT_*)\n>>   * @reserved:  reserved bytes that can be later used\n>>   */\n>> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n>> index b383c2fe..2347e266 100644\n>> --- a/include/linux/v4l2-subdev.h\n>> +++ b/include/linux/v4l2-subdev.h\n>> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n>>   * @rect: pad crop rectangle boundaries\n>>   * @stream: stream number, defined in subdev routing\n>>   * @reserved: drivers and applications must zero this array\n>> + *\n>> + * The subdev crop API is an obsolete interface and may be removed in the\n>> + * future. It is superseded by the selection API. No new extensions to this\n>> + * structure will be accepted.\n>>   */\n>>  struct v4l2_subdev_crop {\n>>  \t__u32 which;\n>> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n>>   * @pad: pad number, as reported by the media API\n>>   * @interval: frame interval in seconds\n>>   * @stream: stream number, defined in subdev routing\n>> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>>  struct v4l2_subdev_frame_interval {\n>>  \t__u32 pad;\n>>  \tstruct v4l2_fract interval;\n>>  \t__u32 stream;\n>> -\t__u32 reserved[8];\n>> +\t__u32 which;\n>> +\t__u32 reserved[7];\n>>  };\n>>  \n>>  /**\n>> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n>>   * @width: frame width in pixels\n>>   * @height: frame height in pixels\n>>   * @interval: frame interval in seconds\n>> - * @which: format type (from enum v4l2_subdev_format_whence)\n>> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>>   * @stream: stream number, defined in subdev routing\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n>>   * struct v4l2_subdev_routing - Subdev routing information\n>>   *\n>>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n>> - * @num_routes: the total number of routes in the routes array\n>> + * @len_routes: the length of the routes array, in routes; set by the user, not\n>> + *\t\tmodified by the kernel\n>>   * @routes: pointer to the routes array\n>> + * @num_routes: the total number of routes, possibly more than fits in the\n>> + *\t\troutes array\n>>   * @reserved: drivers and applications must zero this array\n>>   */\n>>  struct v4l2_subdev_routing {\n>>  \t__u32 which;\n>> -\t__u32 num_routes;\n>> +\t__u32 len_routes;\n>>  \t__u64 routes;\n>> -\t__u32 reserved[6];\n>> +\t__u32 num_routes;\n>> +\t__u32 reserved[11];\n> \n> This will cause some issues. The routing API has changed, we need to\n> handle it in a backward-compatible way. I have patches for that, I think\n> I have even posted them. \n\nI thought that this was only exposed to userspace when\nv4l2_subdev_enable_streams_api is set to true in\ndrivers/media/v4l2-core/v4l2-subdev.c\n\nAnd that is never set to true unless the kernel is manually editted\nbecause the API is not stable yet (which is why it was ok\nfor Sakari to make this change upstream) ?\n\nI guess this may be enabled already on some downstream kernels\nand that libcamera needs to handle that ?\n\n> I'll rebase on top of this patch and repost.\n> The two series will need to be merged together.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThank you the review(s) and for rebasing your series.\n\nRegards,\n\nHans\n\n\n\n\n>>  };\n>>  \n>>  /*\n>> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n>>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n>>   * kernel.\n>>   */\n>> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t(1ULL << 0)\n>> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t\t(1ULL << 0)\n>> +\n>> +/*\n>> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n>> + * this is not set (which is the default), the which field is forced to\n>> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n>> + */\n>> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH\t(1ULL << 1)\n>>  \n>>  /**\n>>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n>> index 0b5482a0..7fe522e8 100644\n>> --- a/include/linux/videodev2.h\n>> +++ b/include/linux/videodev2.h\n>> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n>>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n>>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n>>  #define V4L2_PIX_FMT_IPU3_Y10\t\tv4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n>> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n>> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n>>  \n>>  /* Palette formats */\n>>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n>> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n>>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC\t\t0x0080\n>>  #define V4L2_FMT_FLAG_CSC_HSV_ENC\t\tV4L2_FMT_FLAG_CSC_YCBCR_ENC\n>>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION\t\t0x0100\n>> +#define V4L2_FMT_FLAG_META_LINE_BASED\t\t0x0200\n>>  \n>>  \t/* Frame Size and frame rate enumeration */\n>>  /*\n>> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n>>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS\t\t(1 << 4)\n>>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF\t(1 << 5)\n>>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS\t\t(1 << 6)\n>> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS\t\t(1 << 7)\n>> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS\t\t(1 << 8)\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>>   * @length:\t\tsize of this plane (NOT the payload) in bytes\n>> - * @mem_offset:\t\twhen memory in the associated struct v4l2_buffer is\n>> + * @m.mem_offset:\twhen memory in the associated struct v4l2_buffer is\n>>   *\t\t\tV4L2_MEMORY_MMAP, equals the offset from the start of\n>>   *\t\t\tthe device memory for this plane (or is a \"cookie\" that\n>>   *\t\t\tshould be passed to mmap() called on the video node)\n>> - * @userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>> + * @m.userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>>   *\t\t\tpointing to this plane\n>> - * @fd:\t\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n>> + * @m.fd:\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n>>   *\t\t\tdescriptor associated with this plane\n>>   * @m:\t\t\tunion of @mem_offset, @userptr and @fd\n>>   * @data_offset:\toffset in the plane to the start of data; usually 0,\n>> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n>>   * @sequence:\tsequence count of this frame\n>>   * @memory:\tenum v4l2_memory; the method, in which the actual video data is\n>>   *\t\tpassed\n>> - * @offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>> + * @m.offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>>   *\t\toffset from the start of the device memory for this plane,\n>>   *\t\t(or a \"cookie\" that should be passed to mmap() as offset)\n>> - * @userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>> + * @m.userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>>   *\t\ta userspace pointer pointing to this buffer\n>> - * @fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>> + * @m.fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>>   *\t\ta userspace file descriptor associated with this buffer\n>> - * @planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n>> + * @m.planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n>>   *\t\tinfo structs for this buffer\n>>   * @m:\t\tunion of @offset, @userptr, @planes and @fd\n>>   * @length:\tsize in bytes of the buffer (NOT its payload) for single-plane\n>> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n>>  \t\tstruct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n>>  \t\tstruct v4l2_ctrl_av1_frame *p_av1_frame;\n>>  \t\tstruct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n>> +\t\tstruct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n>> +\t\tstruct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n>>  \t\tvoid *ptr;\n>> -\t};\n>> +\t} __attribute__ ((packed));\n>>  } __attribute__ ((packed));\n>>  \n>>  struct v4l2_ext_controls {\n>> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n>>   * struct v4l2_meta_format - metadata format definition\n>>   * @dataformat:\t\tlittle endian four character code (fourcc)\n>>   * @buffersize:\t\tmaximum size in bytes required for data\n>> + * @width:\t\tnumber of data units of data per line (valid for line\n>> + *\t\t\tbased formats only, see format documentation)\n>> + * @height:\t\tnumber of lines of data per buffer (valid for line based\n>> + *\t\t\tformats only)\n>> + * @bytesperline:\toffset between the beginnings of two adjacent lines in\n>> + *\t\t\tbytes (valid for line based formats only)\n>>   */\n>>  struct v4l2_meta_format {\n>>  \t__u32\t\t\t\tdataformat;\n>>  \t__u32\t\t\t\tbuffersize;\n>> +\t__u32\t\t\t\twidth;\n>> +\t__u32\t\t\t\theight;\n>> +\t__u32\t\t\t\tbytesperline;\n>>  } __attribute__ ((packed));\n>>  \n>>  /**\n>>   * struct v4l2_format - stream data format\n>> - * @type:\tenum v4l2_buf_type; type of the data stream\n>> - * @pix:\tdefinition of an image format\n>> - * @pix_mp:\tdefinition of a multiplanar image format\n>> - * @win:\tdefinition of an overlaid image\n>> - * @vbi:\traw VBI capture or output parameters\n>> - * @sliced:\tsliced VBI capture or output parameters\n>> - * @raw_data:\tplaceholder for future extensions and custom formats\n>> - * @fmt:\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n>> - *\t\tand @raw_data\n>> + * @type:\t\tenum v4l2_buf_type; type of the data stream\n>> + * @fmt.pix:\t\tdefinition of an image format\n>> + * @fmt.pix_mp:\t\tdefinition of a multiplanar image format\n>> + * @fmt.win:\t\tdefinition of an overlaid image\n>> + * @fmt.vbi:\t\traw VBI capture or output parameters\n>> + * @fmt.sliced:\t\tsliced VBI capture or output parameters\n>> + * @fmt.raw_data:\tplaceholder for future extensions and custom formats\n>> + * @fmt:\t\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n>> + *\t\t\t@meta and @raw_data\n>>   */\n>>  struct v4l2_format {\n>>  \t__u32\t type;\n>> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n>>   * @flags:\tadditional buffer management attributes (ignored unless the\n>>   *\t\tqueue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n>>   *\t\tand configured for MMAP streaming I/O).\n>> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n>> + *\t\tthis field indicate the maximum possible number of buffers\n>> + *\t\tfor this queue.\n>>   * @reserved:\tfuture extensions\n>>   */\n>>  struct v4l2_create_buffers {\n>> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n>>  \tstruct v4l2_format\tformat;\n>>  \t__u32\t\t\tcapabilities;\n>>  \t__u32\t\t\tflags;\n>> -\t__u32\t\t\treserved[6];\n>> +\t__u32\t\t\tmax_num_buffers;\n>> +\t__u32\t\t\treserved[5];\n>> +};\n>> +\n>> +/**\n>> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n>> + * @index:\tthe first buffer to be removed\n>> + * @count:\tnumber of buffers to removed\n>> + * @type:\tenum v4l2_buf_type\n>> + * @reserved:\tfuture extensions\n>> + */\n>> +struct v4l2_remove_buffers {\n>> +\t__u32\t\t\tindex;\n>> +\t__u32\t\t\tcount;\n>> +\t__u32\t\t\ttype;\n>> +\t__u32\t\t\treserved[13];\n>>  };\n>>  \n>>  /*\n>> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n>>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n>>  \n>>  #define VIDIOC_QUERY_EXT_CTRL\t_IOWR('V', 103, struct v4l2_query_ext_ctrl)\n>> +#define VIDIOC_REMOVE_BUFS\t_IOWR('V', 104, struct v4l2_remove_buffers)\n>> +\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>","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 E6B50BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Jun 2024 14:16:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0EA88634AF;\n\tSat,  1 Jun 2024 16:16:17 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 76B0B61A45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Jun 2024 16:16:14 +0200 (CEST)","from mail-ej1-f70.google.com (mail-ej1-f70.google.com\n\t[209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-209-v6frjw_xOQaWEHCTbcyMdA-1; Sat, 01 Jun 2024 10:16:07 -0400","by mail-ej1-f70.google.com with SMTP id\n\ta640c23a62f3a-a68c8de898aso10804166b.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 01 Jun 2024 07:16:07 -0700 (PDT)","from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec?\n\t(2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl.\n\t[2001:1c00:c32:7800:5bfa:a036:83f0:f9ec])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-a67ea586f45sm204915766b.101.2024.06.01.07.16.04\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tSat, 01 Jun 2024 07:16:05 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"ZDc29NzQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1717251373;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=EYPO2L5Wf99sF6ZDxQ2N7nOmAl5PQ2+zfVAkwK3NNLs=;\n\tb=ZDc29NzQ+PLWfOx3kwMLMaGeLuikAKTcwb41d6XA8Smf8sLgvPv/X7SQgQeykz+yw8/F56\n\taNCyvXLJ7vHYQs9dvbctZDaOwPjIGv6x6aJDPJajEyORtlMEDYXAUbGTJVaPnc4STALPi9\n\tr+r8dS3AZNSYg3do8O7fkHJXyY8SAXE=","X-MC-Unique":"v6frjw_xOQaWEHCTbcyMdA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1717251366; x=1717856166;\n\th=content-transfer-encoding:in-reply-to:from:content-language\n\t:references:cc:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=EYPO2L5Wf99sF6ZDxQ2N7nOmAl5PQ2+zfVAkwK3NNLs=;\n\tb=doxqd7v22yYhdwo5oTkniyq8yxJB5RtLXv/kC1SgnXSAuUZ+42/Fn0ljKfmPCr3t3k\n\tJX+jThuS/1BnltTc2HzB/3xeghSAOfVLuqdChTa6KU9pAERr9RkqKsBRerutu60jZrN7\n\twNPNygdjG9IEjceKPE0EkSbv5U2TFID1+oTaQoX+O680YFX+ilWTqws1i7KeJFATwfMK\n\tj9KEFdJQguG/PmvOY5GjCUwluxboqXsc3wi3KVd5+368Rd1qg75AN24ipCrPMH2T1n9v\n\tA+PMOMxEnwKHEOEl71dN9h8YPsi/NwMNxd1T7sVUsxM1qrxwp0ozUz53F8qSXgogC/TL\n\t9SnA==","X-Gm-Message-State":"AOJu0YyLWTF0u6/Dldb6pE+8uAEvCuUA/u8yZiu8FRV1IkpeQdix+Tcp\n\tpZC1mFjrrkxHaTKOoEA+FVt3HMFa8XM8JOewWw17E2W/seezYfQf+ngdl2DheflFxN5mtEXmZLU\n\trGVc4Nd3FqqAhXjWowm/NN0iPUkmBaWeeBfeLfs+4H1SS5LFTJ5ME1TZssYH+H0GH4Na855E=","X-Received":["by 2002:a17:906:6617:b0:a64:e464:7123 with SMTP id\n\ta640c23a62f3a-a681fb5fa58mr323307766b.7.1717251366207; \n\tSat, 01 Jun 2024 07:16:06 -0700 (PDT)","by 2002:a17:906:6617:b0:a64:e464:7123 with SMTP id\n\ta640c23a62f3a-a681fb5fa58mr323305166b.7.1717251365636; \n\tSat, 01 Jun 2024 07:16:05 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IEBYKHwRAItkkEo1vnTgmZ5KNO/gnTdQ1zfLALGxKToo8AryEwxY3vrfkyXtrcC7mcrqHl6Nw==","Message-ID":"<014b395f-7782-4bda-82c1-a92b5090554a@redhat.com>","Date":"Sat, 1 Jun 2024 16:16:04 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\t\"sakari.ailus@linux.intel.com\" <sakari.ailus@linux.intel.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tAndrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>\n\t<20240601134551.GC6163@pendragon.ideasonboard.com>","From":"Hans de Goede <hdegoede@redhat.com>","In-Reply-To":"<20240601134551.GC6163@pendragon.ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Language":"en-US, nl","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29721,"web_url":"https://patchwork.libcamera.org/comment/29721/","msgid":"<20240601214350.GC8475@pendragon.ideasonboard.com>","date":"2024-06-01T21:43:50","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, May 30, 2024 at 07:15:57PM +0200, Hans de Goede wrote:\n> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n> and re-instating libcamera local modifications.\n\nI think you've dropped the following change from v6.10-rc1:\n\ndiff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\nindex bd771f1b4f6d..8c192f352e13 100644\n--- a/include/linux/intel-ipu3.h\n+++ b/include/linux/intel-ipu3.h\n@@ -2485,11 +2485,9 @@ struct ipu3_uapi_anr_config {\n  *\t\t&ipu3_uapi_yuvp1_y_ee_nr_config\n  * @yds:\ty down scaler config. See &ipu3_uapi_yuvp1_yds_config\n  * @chnr:\tchroma noise reduction config. See &ipu3_uapi_yuvp1_chnr_config\n- * @reserved1: reserved\n  * @yds2:\ty channel down scaler config. See &ipu3_uapi_yuvp1_yds_config\n  * @tcc:\ttotal color correction config as defined in struct\n  *\t\t&ipu3_uapi_yuvp2_tcc_static_config\n- * @reserved2: reserved\n  * @anr:\tadvanced noise reduction config.See &ipu3_uapi_anr_config\n  * @awb_fr:\tAWB filter response config. See ipu3_uapi_awb_fr_config\n  * @ae:\tauto exposure config  As specified by &ipu3_uapi_ae_config\n@@ -2724,7 +2722,6 @@ struct ipu3_uapi_obgrid_param {\n  * @acc_ae: 0 = no update, 1 = update.\n  * @acc_af: 0 = no update, 1 = update.\n  * @acc_awb: 0 = no update, 1 = update.\n- * @__acc_osys: 0 = no update, 1 = update.\n  * @reserved3: Not used.\n  * @lin_vmem_params: 0 = no update, 1 = update.\n  * @tnr3_vmem_params: 0 = no update, 1 = update.\n\nThis isn't a libcamera local modification. I'll add it back.\n\nThe rest looks good,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> This includes adding include/linux/udmabuf.h which was not part\n> of libcamera's include/linux headers before.\n> \n> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n> ---\n>  include/linux/README             |  2 +-\n>  include/linux/drm_fourcc.h       | 10 ++---\n>  include/linux/media-bus-format.h |  9 ++++\n>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n>  include/linux/udmabuf.h          | 33 +++++++++++++++\n>  include/linux/v4l2-controls.h    |  6 +++\n>  include/linux/v4l2-mediabus.h    | 18 +++++---\n>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n>  9 files changed, 172 insertions(+), 63 deletions(-)\n>  create mode 100644 include/linux/udmabuf.h\n> \n> diff --git a/include/linux/README b/include/linux/README\n> index 101e4997..b7795309 100644\n> --- a/include/linux/README\n> +++ b/include/linux/README\n> @@ -1,4 +1,4 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n>  modify them manually.\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index b4e1a092..d8e99940 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -54,7 +54,7 @@ extern \"C\" {\n>   * Format modifiers may change any property of the buffer, including the number\n>   * of planes and/or the required allocation size. Format modifiers are\n>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n> - * modifier is specific to the modifer being used. For example, some modifiers\n> + * modifier is specific to the modifier being used. For example, some modifiers\n>   * may preserve meaning - such as number of planes - from the fourcc code,\n>   * whereas others may not.\n>   *\n> @@ -79,7 +79,7 @@ extern \"C\" {\n>   *   format.\n>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n>   *   see modifiers as opaque tokens they can check for equality and intersect.\n> - *   These users musn't need to know to reason about the modifier value\n> + *   These users mustn't need to know to reason about the modifier value\n>   *   (i.e. they are not expected to extract information out of the modifier).\n>   *\n>   * Vendors should document their modifier usage in as much detail as\n> @@ -610,7 +610,7 @@ extern \"C\" {\n>   * This is a tiled layout using 4Kb tiles in row-major layout.\n>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n>   * are arranged in four groups (two wide, two high) with column-major layout.\n> - * Each group therefore consits out of four 256 byte units, which are also laid\n> + * Each group therefore consists out of four 256 byte units, which are also laid\n>   * out as 2x2 column-major.\n>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n>   * either a square block or a 2:1 unit.\n> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   */\n>  \n>  /*\n> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n>   * modifiers) denote the category for modifiers. Currently we have three\n>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n>   * sixteen different categories.\n> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   * Amlogic FBC Memory Saving mode\n>   *\n>   * Indicates the storage is packed when pixel size is multiple of word\n> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n>   * memory.\n>   *\n>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n> index f05f747e..d4c1d991 100644\n> --- a/include/linux/media-bus-format.h\n> +++ b/include/linux/media-bus-format.h\n> @@ -174,4 +174,13 @@\n>   */\n>  #define MEDIA_BUS_FMT_METADATA_FIXED\t\t0x7001\n>  \n> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n> +#define MEDIA_BUS_FMT_META_8\t\t\t0x8001\n> +#define MEDIA_BUS_FMT_META_10\t\t\t0x8002\n> +#define MEDIA_BUS_FMT_META_12\t\t\t0x8003\n> +#define MEDIA_BUS_FMT_META_14\t\t\t0x8004\n> +#define MEDIA_BUS_FMT_META_16\t\t\t0x8005\n> +#define MEDIA_BUS_FMT_META_20\t\t\t0x8006\n> +#define MEDIA_BUS_FMT_META_24\t\t\t0x8007\n> +\n>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n> index 2d1c448a..f87c6bd4 100644\n> --- a/include/linux/rkisp1-config.h\n> +++ b/include/linux/rkisp1-config.h\n> @@ -4,8 +4,8 @@\n>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n>   */\n>  \n> -#ifndef _UAPI_RKISP1_CONFIG_H\n> -#define _UAPI_RKISP1_CONFIG_H\n> +#ifndef _RKISP1_CONFIG_H\n> +#define _RKISP1_CONFIG_H\n>  \n>  #include <linux/types.h>\n>  \n> @@ -175,11 +175,14 @@\n>  /**\n>   * enum rkisp1_cif_isp_version - ISP variants\n>   *\n> - * @RKISP1_V10: used at least in rk3288 and rk3399\n> - * @RKISP1_V11: declared in the original vendor code, but not used\n> - * @RKISP1_V12: used at least in rk3326 and px30\n> - * @RKISP1_V13: used at least in rk1808\n> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n> + *\tof entries in grids and histogram as v10.\n> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n> + *\thistogram as v12.\n> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n> + *\tand histogram as v10.\n>   */\n>  enum rkisp1_cif_isp_version {\n>  \tRKISP1_V10 = 10,\n> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_goc_config {\n>  \t__u32 mode;\n> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n> - * of the two.\n> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n> + * two.\n>   */\n>  struct rkisp1_cif_isp_hst_config {\n>  \t__u32 mode;\n> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n> + * to the maximum of the two.\n>   *\n>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n>   */\n> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n>   *\t       integer part.\n>   *\n>   * The window of the measurements area is divided to 5x5 sub-windows for\n> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n> - * each sub-window independently and the final result is a weighted average of\n> - * the histogram measurements on all sub-windows. The window of the\n> - * measurements area and the weight of each sub-window are configurable using\n> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n> + * sub-window independently and the final result is a weighted average of the\n> + * histogram measurements on all sub-windows. The window of the measurements\n> + * area and the weight of each sub-window are configurable using\n>   * struct @rkisp1_cif_isp_hst_config.\n>   *\n> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n>   *\n>   * The number of entries of @hist_bins depends on the hardware revision\n>   * as is reported by the hw_revision field of the struct media_device_info\n>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n>   *\n> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n> + * equal to the maximum of the two.\n>   */\n>  struct rkisp1_cif_isp_hist_stat {\n>  \t__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n>  \tstruct rkisp1_cif_isp_stat params;\n>  };\n>  \n> -#endif /* _UAPI_RKISP1_CONFIG_H */\n> +#endif /* _RKISP1_CONFIG_H */\n> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n> new file mode 100644\n> index 00000000..76cc7de9\n> --- /dev/null\n> +++ b/include/linux/udmabuf.h\n> @@ -0,0 +1,33 @@\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> +#ifndef _LINUX_UDMABUF_H\n> +#define _LINUX_UDMABUF_H\n> +\n> +#include <linux/types.h>\n> +#include <linux/ioctl.h>\n> +\n> +#define UDMABUF_FLAGS_CLOEXEC\t0x01\n> +\n> +struct udmabuf_create {\n> +\t__u32 memfd;\n> +\t__u32 flags;\n> +\t__u64 offset;\n> +\t__u64 size;\n> +};\n> +\n> +struct udmabuf_create_item {\n> +\t__u32 memfd;\n> +\t__u32 __pad;\n> +\t__u64 offset;\n> +\t__u64 size;\n> +};\n> +\n> +struct udmabuf_create_list {\n> +\t__u32 flags;\n> +\t__u32 count;\n> +\tstruct udmabuf_create_item list[];\n> +};\n> +\n> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n> +\n> +#endif /* _LINUX_UDMABUF_H */\n> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n> index b9f64810..1e6e816b 100644\n> --- a/include/linux/v4l2-controls.h\n> +++ b/include/linux/v4l2-controls.h\n> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n>   */\n>  #define V4L2_CID_USER_NPCM_BASE\t\t\t(V4L2_CID_USER_BASE + 0x11b0)\n>  \n> +/*\n> + * The base for THine THP7312 driver controls.\n> + * We reserve 32 controls for this driver.\n> + */\n> +#define V4L2_CID_USER_THP7312_BASE\t\t(V4L2_CID_USER_BASE + 0x11c0)\n> +\n>  /* MPEG-class control IDs */\n>  /* The MPEG controls are applicable to all codec controls\n>   * and the 'MPEG' part of the define is historical */\n> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n> index 2c318de1..097ef739 100644\n> --- a/include/linux/v4l2-mediabus.h\n> +++ b/include/linux/v4l2-mediabus.h\n> @@ -19,12 +19,18 @@\n>   * @width:\timage width\n>   * @height:\timage height\n>   * @code:\tdata format code (from enum v4l2_mbus_pixelcode)\n> - * @field:\tused interlacing type (from enum v4l2_field)\n> - * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace)\n> - * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n> - * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding)\n> - * @quantization: quantization of the data (from enum v4l2_quantization)\n> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n> + * @field:\tused interlacing type (from enum v4l2_field), zero for metadata\n> + *\t\tmbus codes\n> + * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace), zero on\n> + *\t\tmetadata mbus codes\n> + * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n> + *\t\tfor metadata mbus codes\n> + * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n> + *\t\tmetadata mbus codes\n> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n> + *\t\tfor metadata mbus codes\n> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n> + *\t\tfor metadata mbus codes\n>   * @flags:\tflags (V4L2_MBUS_FRAMEFMT_*)\n>   * @reserved:  reserved bytes that can be later used\n>   */\n> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n> index b383c2fe..2347e266 100644\n> --- a/include/linux/v4l2-subdev.h\n> +++ b/include/linux/v4l2-subdev.h\n> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n>   * @rect: pad crop rectangle boundaries\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n> + *\n> + * The subdev crop API is an obsolete interface and may be removed in the\n> + * future. It is superseded by the selection API. No new extensions to this\n> + * structure will be accepted.\n>   */\n>  struct v4l2_subdev_crop {\n>  \t__u32 which;\n> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n>   * @pad: pad number, as reported by the media API\n>   * @interval: frame interval in seconds\n>   * @stream: stream number, defined in subdev routing\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_frame_interval {\n>  \t__u32 pad;\n>  \tstruct v4l2_fract interval;\n>  \t__u32 stream;\n> -\t__u32 reserved[8];\n> +\t__u32 which;\n> +\t__u32 reserved[7];\n>  };\n>  \n>  /**\n> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n>   * @width: frame width in pixels\n>   * @height: frame height in pixels\n>   * @interval: frame interval in seconds\n> - * @which: format type (from enum v4l2_subdev_format_whence)\n> + * @which: interval type (from enum v4l2_subdev_format_whence)\n>   * @stream: stream number, defined in subdev routing\n>   * @reserved: drivers and applications must zero this array\n>   */\n> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n>   * struct v4l2_subdev_routing - Subdev routing information\n>   *\n>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n> - * @num_routes: the total number of routes in the routes array\n> + * @len_routes: the length of the routes array, in routes; set by the user, not\n> + *\t\tmodified by the kernel\n>   * @routes: pointer to the routes array\n> + * @num_routes: the total number of routes, possibly more than fits in the\n> + *\t\troutes array\n>   * @reserved: drivers and applications must zero this array\n>   */\n>  struct v4l2_subdev_routing {\n>  \t__u32 which;\n> -\t__u32 num_routes;\n> +\t__u32 len_routes;\n>  \t__u64 routes;\n> -\t__u32 reserved[6];\n> +\t__u32 num_routes;\n> +\t__u32 reserved[11];\n>  };\n>  \n>  /*\n> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n>   * kernel.\n>   */\n> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t(1ULL << 0)\n> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t\t(1ULL << 0)\n> +\n> +/*\n> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n> + * this is not set (which is the default), the which field is forced to\n> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n> + */\n> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH\t(1ULL << 1)\n>  \n>  /**\n>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 0b5482a0..7fe522e8 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n>  #define V4L2_PIX_FMT_IPU3_Y10\t\tv4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n>  \n>  /* Palette formats */\n>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC\t\t0x0080\n>  #define V4L2_FMT_FLAG_CSC_HSV_ENC\t\tV4L2_FMT_FLAG_CSC_YCBCR_ENC\n>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION\t\t0x0100\n> +#define V4L2_FMT_FLAG_META_LINE_BASED\t\t0x0200\n>  \n>  \t/* Frame Size and frame rate enumeration */\n>  /*\n> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS\t\t(1 << 4)\n>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF\t(1 << 5)\n>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS\t\t(1 << 6)\n> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS\t\t(1 << 7)\n> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS\t\t(1 << 8)\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>   * @length:\t\tsize of this plane (NOT the payload) in bytes\n> - * @mem_offset:\t\twhen memory in the associated struct v4l2_buffer is\n> + * @m.mem_offset:\twhen memory in the associated struct v4l2_buffer is\n>   *\t\t\tV4L2_MEMORY_MMAP, equals the offset from the start of\n>   *\t\t\tthe device memory for this plane (or is a \"cookie\" that\n>   *\t\t\tshould be passed to mmap() called on the video node)\n> - * @userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n> + * @m.userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n>   *\t\t\tpointing to this plane\n> - * @fd:\t\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n> + * @m.fd:\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n>   *\t\t\tdescriptor associated with this plane\n>   * @m:\t\t\tunion of @mem_offset, @userptr and @fd\n>   * @data_offset:\toffset in the plane to the start of data; usually 0,\n> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n>   * @sequence:\tsequence count of this frame\n>   * @memory:\tenum v4l2_memory; the method, in which the actual video data is\n>   *\t\tpassed\n> - * @offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n> + * @m.offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n>   *\t\toffset from the start of the device memory for this plane,\n>   *\t\t(or a \"cookie\" that should be passed to mmap() as offset)\n> - * @userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n> + * @m.userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n>   *\t\ta userspace pointer pointing to this buffer\n> - * @fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n> + * @m.fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n>   *\t\ta userspace file descriptor associated with this buffer\n> - * @planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n> + * @m.planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n>   *\t\tinfo structs for this buffer\n>   * @m:\t\tunion of @offset, @userptr, @planes and @fd\n>   * @length:\tsize in bytes of the buffer (NOT its payload) for single-plane\n> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n>  \t\tstruct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n>  \t\tstruct v4l2_ctrl_av1_frame *p_av1_frame;\n>  \t\tstruct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n> +\t\tstruct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n> +\t\tstruct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n>  \t\tvoid *ptr;\n> -\t};\n> +\t} __attribute__ ((packed));\n>  } __attribute__ ((packed));\n>  \n>  struct v4l2_ext_controls {\n> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n>   * struct v4l2_meta_format - metadata format definition\n>   * @dataformat:\t\tlittle endian four character code (fourcc)\n>   * @buffersize:\t\tmaximum size in bytes required for data\n> + * @width:\t\tnumber of data units of data per line (valid for line\n> + *\t\t\tbased formats only, see format documentation)\n> + * @height:\t\tnumber of lines of data per buffer (valid for line based\n> + *\t\t\tformats only)\n> + * @bytesperline:\toffset between the beginnings of two adjacent lines in\n> + *\t\t\tbytes (valid for line based formats only)\n>   */\n>  struct v4l2_meta_format {\n>  \t__u32\t\t\t\tdataformat;\n>  \t__u32\t\t\t\tbuffersize;\n> +\t__u32\t\t\t\twidth;\n> +\t__u32\t\t\t\theight;\n> +\t__u32\t\t\t\tbytesperline;\n>  } __attribute__ ((packed));\n>  \n>  /**\n>   * struct v4l2_format - stream data format\n> - * @type:\tenum v4l2_buf_type; type of the data stream\n> - * @pix:\tdefinition of an image format\n> - * @pix_mp:\tdefinition of a multiplanar image format\n> - * @win:\tdefinition of an overlaid image\n> - * @vbi:\traw VBI capture or output parameters\n> - * @sliced:\tsliced VBI capture or output parameters\n> - * @raw_data:\tplaceholder for future extensions and custom formats\n> - * @fmt:\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n> - *\t\tand @raw_data\n> + * @type:\t\tenum v4l2_buf_type; type of the data stream\n> + * @fmt.pix:\t\tdefinition of an image format\n> + * @fmt.pix_mp:\t\tdefinition of a multiplanar image format\n> + * @fmt.win:\t\tdefinition of an overlaid image\n> + * @fmt.vbi:\t\traw VBI capture or output parameters\n> + * @fmt.sliced:\t\tsliced VBI capture or output parameters\n> + * @fmt.raw_data:\tplaceholder for future extensions and custom formats\n> + * @fmt:\t\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n> + *\t\t\t@meta and @raw_data\n>   */\n>  struct v4l2_format {\n>  \t__u32\t type;\n> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n>   * @flags:\tadditional buffer management attributes (ignored unless the\n>   *\t\tqueue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n>   *\t\tand configured for MMAP streaming I/O).\n> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n> + *\t\tthis field indicate the maximum possible number of buffers\n> + *\t\tfor this queue.\n>   * @reserved:\tfuture extensions\n>   */\n>  struct v4l2_create_buffers {\n> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n>  \tstruct v4l2_format\tformat;\n>  \t__u32\t\t\tcapabilities;\n>  \t__u32\t\t\tflags;\n> -\t__u32\t\t\treserved[6];\n> +\t__u32\t\t\tmax_num_buffers;\n> +\t__u32\t\t\treserved[5];\n> +};\n> +\n> +/**\n> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n> + * @index:\tthe first buffer to be removed\n> + * @count:\tnumber of buffers to removed\n> + * @type:\tenum v4l2_buf_type\n> + * @reserved:\tfuture extensions\n> + */\n> +struct v4l2_remove_buffers {\n> +\t__u32\t\t\tindex;\n> +\t__u32\t\t\tcount;\n> +\t__u32\t\t\ttype;\n> +\t__u32\t\t\treserved[13];\n>  };\n>  \n>  /*\n> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n>  \n>  #define VIDIOC_QUERY_EXT_CTRL\t_IOWR('V', 103, struct v4l2_query_ext_ctrl)\n> +#define VIDIOC_REMOVE_BUFS\t_IOWR('V', 104, struct v4l2_remove_buffers)\n> +\n>  \n>  /* Reminder: when adding new ioctls please add support for them to\n>     drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */","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 DFDC6BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Jun 2024 21:44:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D02CD634BA;\n\tSat,  1 Jun 2024 23:44:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A9C58634AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Jun 2024 23:44:04 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7078CCCC;\n\tSat,  1 Jun 2024 23:43:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"G63CCYoT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717278238;\n\tbh=8csENemQ6T5sBbZudAjE70cVha0aZr5RdhzLSyYkqCw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=G63CCYoTm6HNTzRaKiLhWUdpbqk3NEY8ou/VIOz5QDNfz4wyG2MlVE4Adk9I0R+Oe\n\tt4aYDq7e3u55gBtuRXhsPmQL2bZM20zU3smqwNxIRmGuvaF8Jsjm9he+VNqbDl/Zmb\n\tqI8YCNMuusd/ETk8F9K6mwvCZo7kGE12qaeOUNPc=","Date":"Sun, 2 Jun 2024 00:43:50 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hans de Goede <hdegoede@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tAndrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","Message-ID":"<20240601214350.GC8475@pendragon.ideasonboard.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240530171600.259495-3-hdegoede@redhat.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29722,"web_url":"https://patchwork.libcamera.org/comment/29722/","msgid":"<20240601215033.GA3269@pendragon.ideasonboard.com>","date":"2024-06-01T21:50:33","subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hans,\n\nOn Sat, Jun 01, 2024 at 04:16:04PM +0200, Hans de Goede wrote:\n> On 6/1/24 3:45 PM, Laurent Pinchart wrote:\n> > On Thu, May 30, 2024 at 07:15:57PM +0200, Hans de Goede wrote:\n> >> Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh\n> >> and re-instating libcamera local modifications.\n> >>\n> >> This includes adding include/linux/udmabuf.h which was not part\n> >> of libcamera's include/linux headers before.\n> >>\n> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>\n> >> ---\n> >>  include/linux/README             |  2 +-\n> >>  include/linux/drm_fourcc.h       | 10 ++---\n> >>  include/linux/media-bus-format.h |  9 ++++\n> >>  include/linux/rkisp1-config.h    | 56 +++++++++++++------------\n> >>  include/linux/udmabuf.h          | 33 +++++++++++++++\n> >>  include/linux/v4l2-controls.h    |  6 +++\n> >>  include/linux/v4l2-mediabus.h    | 18 +++++---\n> >>  include/linux/v4l2-subdev.h      | 29 ++++++++++---\n> >>  include/linux/videodev2.h        | 72 ++++++++++++++++++++++++--------\n> >>  9 files changed, 172 insertions(+), 63 deletions(-)\n> >>  create mode 100644 include/linux/udmabuf.h\n> >>\n> >> diff --git a/include/linux/README b/include/linux/README\n> >> index 101e4997..b7795309 100644\n> >> --- a/include/linux/README\n> >> +++ b/include/linux/README\n> >> @@ -1,4 +1,4 @@\n> >>  # SPDX-License-Identifier: CC0-1.0\n> >>  \n> >> -Files in this directory are imported from v6.7 of the Linux kernel. Do not\n> >> +Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not\n> >>  modify them manually.\n> >> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> >> index b4e1a092..d8e99940 100644\n> >> --- a/include/linux/drm_fourcc.h\n> >> +++ b/include/linux/drm_fourcc.h\n> >> @@ -54,7 +54,7 @@ extern \"C\" {\n> >>   * Format modifiers may change any property of the buffer, including the number\n> >>   * of planes and/or the required allocation size. Format modifiers are\n> >>   * vendor-namespaced, and as such the relationship between a fourcc code and a\n> >> - * modifier is specific to the modifer being used. For example, some modifiers\n> >> + * modifier is specific to the modifier being used. For example, some modifiers\n> >>   * may preserve meaning - such as number of planes - from the fourcc code,\n> >>   * whereas others may not.\n> >>   *\n> >> @@ -79,7 +79,7 @@ extern \"C\" {\n> >>   *   format.\n> >>   * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users\n> >>   *   see modifiers as opaque tokens they can check for equality and intersect.\n> >> - *   These users musn't need to know to reason about the modifier value\n> >> + *   These users mustn't need to know to reason about the modifier value\n> >>   *   (i.e. they are not expected to extract information out of the modifier).\n> >>   *\n> >>   * Vendors should document their modifier usage in as much detail as\n> >> @@ -610,7 +610,7 @@ extern \"C\" {\n> >>   * This is a tiled layout using 4Kb tiles in row-major layout.\n> >>   * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which\n> >>   * are arranged in four groups (two wide, two high) with column-major layout.\n> >> - * Each group therefore consits out of four 256 byte units, which are also laid\n> >> + * Each group therefore consists out of four 256 byte units, which are also laid\n> >>   * out as 2x2 column-major.\n> >>   * 256 byte units are made out of four 64 byte blocks of pixels, producing\n> >>   * either a square block or a 2:1 unit.\n> >> @@ -1183,7 +1183,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n> >>   */\n> >>  \n> >>  /*\n> >> - * The top 4 bits (out of the 56 bits alloted for specifying vendor specific\n> >> + * The top 4 bits (out of the 56 bits allotted for specifying vendor specific\n> >>   * modifiers) denote the category for modifiers. Currently we have three\n> >>   * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of\n> >>   * sixteen different categories.\n> >> @@ -1499,7 +1499,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n> >>   * Amlogic FBC Memory Saving mode\n> >>   *\n> >>   * Indicates the storage is packed when pixel size is multiple of word\n> >> - * boudaries, i.e. 8bit should be stored in this mode to save allocation\n> >> + * boundaries, i.e. 8bit should be stored in this mode to save allocation\n> >>   * memory.\n> >>   *\n> >>   * This mode reduces body layout to 3072 bytes per 64x32 superblock with\n> >> diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\n> >> index f05f747e..d4c1d991 100644\n> >> --- a/include/linux/media-bus-format.h\n> >> +++ b/include/linux/media-bus-format.h\n> >> @@ -174,4 +174,13 @@\n> >>   */\n> >>  #define MEDIA_BUS_FMT_METADATA_FIXED\t\t0x7001\n> >>  \n> >> +/* Generic line based metadata formats for serial buses. Next is 0x8008. */\n> >> +#define MEDIA_BUS_FMT_META_8\t\t\t0x8001\n> >> +#define MEDIA_BUS_FMT_META_10\t\t\t0x8002\n> >> +#define MEDIA_BUS_FMT_META_12\t\t\t0x8003\n> >> +#define MEDIA_BUS_FMT_META_14\t\t\t0x8004\n> >> +#define MEDIA_BUS_FMT_META_16\t\t\t0x8005\n> >> +#define MEDIA_BUS_FMT_META_20\t\t\t0x8006\n> >> +#define MEDIA_BUS_FMT_META_24\t\t\t0x8007\n> >> +\n> >>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */\n> >> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n> >> index 2d1c448a..f87c6bd4 100644\n> >> --- a/include/linux/rkisp1-config.h\n> >> +++ b/include/linux/rkisp1-config.h\n> >> @@ -4,8 +4,8 @@\n> >>   * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n> >>   */\n> >>  \n> >> -#ifndef _UAPI_RKISP1_CONFIG_H\n> >> -#define _UAPI_RKISP1_CONFIG_H\n> >> +#ifndef _RKISP1_CONFIG_H\n> >> +#define _RKISP1_CONFIG_H\n> >>  \n> >>  #include <linux/types.h>\n> >>  \n> >> @@ -175,11 +175,14 @@\n> >>  /**\n> >>   * enum rkisp1_cif_isp_version - ISP variants\n> >>   *\n> >> - * @RKISP1_V10: used at least in rk3288 and rk3399\n> >> - * @RKISP1_V11: declared in the original vendor code, but not used\n> >> - * @RKISP1_V12: used at least in rk3326 and px30\n> >> - * @RKISP1_V13: used at least in rk1808\n> >> - * @RKISP1_V_IMX8MP: used in at least imx8mp\n> >> + * @RKISP1_V10: Used at least in RK3288 and RK3399.\n> >> + * @RKISP1_V11: Declared in the original vendor code, but not used. Same number\n> >> + *\tof entries in grids and histogram as v10.\n> >> + * @RKISP1_V12: Used at least in RK3326 and PX30.\n> >> + * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and\n> >> + *\thistogram as v12.\n> >> + * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids\n> >> + *\tand histogram as v10.\n> >>   */\n> >>  enum rkisp1_cif_isp_version {\n> >>  \tRKISP1_V10 = 10,\n> >> @@ -586,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {\n> >>   * as is reported by the hw_revision field of the struct media_device_info\n> >>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n> >>   *\n> >> - * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10\n> >> - * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12\n> >> - * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum\n> >> - * of the two.\n> >> + * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has\n> >> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.\n> >> + * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.\n> >>   */\n> >>  struct rkisp1_cif_isp_goc_config {\n> >>  \t__u32 mode;\n> >> @@ -609,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {\n> >>   * as is reported by the hw_revision field of the struct media_device_info\n> >>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n> >>   *\n> >> - * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10\n> >> - * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12\n> >> - * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum\n> >> - * of the two.\n> >> + * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has\n> >> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.\n> >> + * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the\n> >> + * two.\n> >>   */\n> >>  struct rkisp1_cif_isp_hst_config {\n> >>  \t__u32 mode;\n> >> @@ -904,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {\n> >>   * as is reported by the hw_revision field of the struct media_device_info\n> >>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n> >>   *\n> >> - * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,\n> >> - * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.\n> >> - * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.\n> >> + * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has\n> >> + * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal\n> >> + * to the maximum of the two.\n> >>   *\n> >>   * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.\n> >>   */\n> >> @@ -946,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {\n> >>   *\t       integer part.\n> >>   *\n> >>   * The window of the measurements area is divided to 5x5 sub-windows for\n> >> - * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for\n> >> - * each sub-window independently and the final result is a weighted average of\n> >> - * the histogram measurements on all sub-windows. The window of the\n> >> - * measurements area and the weight of each sub-window are configurable using\n> >> + * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each\n> >> + * sub-window independently and the final result is a weighted average of the\n> >> + * histogram measurements on all sub-windows. The window of the measurements\n> >> + * area and the weight of each sub-window are configurable using\n> >>   * struct @rkisp1_cif_isp_hst_config.\n> >>   *\n> >> - * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.\n> >> + * The histogram contains 16 bins in V10 and 32 bins in V12.\n> >>   *\n> >>   * The number of entries of @hist_bins depends on the hardware revision\n> >>   * as is reported by the hw_revision field of the struct media_device_info\n> >>   * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.\n> >>   *\n> >> - * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,\n> >> - * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.\n> >> - * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.\n> >> + * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has\n> >> + * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is\n> >> + * equal to the maximum of the two.\n> >>   */\n> >>  struct rkisp1_cif_isp_hist_stat {\n> >>  \t__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n> >> @@ -994,4 +996,4 @@ struct rkisp1_stat_buffer {\n> >>  \tstruct rkisp1_cif_isp_stat params;\n> >>  };\n> >>  \n> >> -#endif /* _UAPI_RKISP1_CONFIG_H */\n> >> +#endif /* _RKISP1_CONFIG_H */\n> >> diff --git a/include/linux/udmabuf.h b/include/linux/udmabuf.h\n> >> new file mode 100644\n> >> index 00000000..76cc7de9\n> >> --- /dev/null\n> >> +++ b/include/linux/udmabuf.h\n> >> @@ -0,0 +1,33 @@\n> >> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> >> +#ifndef _LINUX_UDMABUF_H\n> >> +#define _LINUX_UDMABUF_H\n> >> +\n> >> +#include <linux/types.h>\n> >> +#include <linux/ioctl.h>\n> >> +\n> >> +#define UDMABUF_FLAGS_CLOEXEC\t0x01\n> >> +\n> >> +struct udmabuf_create {\n> >> +\t__u32 memfd;\n> >> +\t__u32 flags;\n> >> +\t__u64 offset;\n> >> +\t__u64 size;\n> >> +};\n> >> +\n> >> +struct udmabuf_create_item {\n> >> +\t__u32 memfd;\n> >> +\t__u32 __pad;\n> >> +\t__u64 offset;\n> >> +\t__u64 size;\n> >> +};\n> >> +\n> >> +struct udmabuf_create_list {\n> >> +\t__u32 flags;\n> >> +\t__u32 count;\n> >> +\tstruct udmabuf_create_item list[];\n> >> +};\n> >> +\n> >> +#define UDMABUF_CREATE       _IOW('u', 0x42, struct udmabuf_create)\n> >> +#define UDMABUF_CREATE_LIST  _IOW('u', 0x43, struct udmabuf_create_list)\n> >> +\n> >> +#endif /* _LINUX_UDMABUF_H */\n> >> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\n> >> index b9f64810..1e6e816b 100644\n> >> --- a/include/linux/v4l2-controls.h\n> >> +++ b/include/linux/v4l2-controls.h\n> >> @@ -211,6 +211,12 @@ enum v4l2_colorfx {\n> >>   */\n> >>  #define V4L2_CID_USER_NPCM_BASE\t\t\t(V4L2_CID_USER_BASE + 0x11b0)\n> >>  \n> >> +/*\n> >> + * The base for THine THP7312 driver controls.\n> >> + * We reserve 32 controls for this driver.\n> >> + */\n> >> +#define V4L2_CID_USER_THP7312_BASE\t\t(V4L2_CID_USER_BASE + 0x11c0)\n> >> +\n> >>  /* MPEG-class control IDs */\n> >>  /* The MPEG controls are applicable to all codec controls\n> >>   * and the 'MPEG' part of the define is historical */\n> >> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h\n> >> index 2c318de1..097ef739 100644\n> >> --- a/include/linux/v4l2-mediabus.h\n> >> +++ b/include/linux/v4l2-mediabus.h\n> >> @@ -19,12 +19,18 @@\n> >>   * @width:\timage width\n> >>   * @height:\timage height\n> >>   * @code:\tdata format code (from enum v4l2_mbus_pixelcode)\n> >> - * @field:\tused interlacing type (from enum v4l2_field)\n> >> - * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace)\n> >> - * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding)\n> >> - * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding)\n> >> - * @quantization: quantization of the data (from enum v4l2_quantization)\n> >> - * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func)\n> >> + * @field:\tused interlacing type (from enum v4l2_field), zero for metadata\n> >> + *\t\tmbus codes\n> >> + * @colorspace:\tcolorspace of the data (from enum v4l2_colorspace), zero on\n> >> + *\t\tmetadata mbus codes\n> >> + * @ycbcr_enc:\tYCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero\n> >> + *\t\tfor metadata mbus codes\n> >> + * @hsv_enc:\tHSV encoding of the data (from enum v4l2_hsv_encoding), zero for\n> >> + *\t\tmetadata mbus codes\n> >> + * @quantization: quantization of the data (from enum v4l2_quantization), zero\n> >> + *\t\tfor metadata mbus codes\n> >> + * @xfer_func:  transfer function of the data (from enum v4l2_xfer_func), zero\n> >> + *\t\tfor metadata mbus codes\n> >>   * @flags:\tflags (V4L2_MBUS_FRAMEFMT_*)\n> >>   * @reserved:  reserved bytes that can be later used\n> >>   */\n> >> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h\n> >> index b383c2fe..2347e266 100644\n> >> --- a/include/linux/v4l2-subdev.h\n> >> +++ b/include/linux/v4l2-subdev.h\n> >> @@ -50,6 +50,10 @@ struct v4l2_subdev_format {\n> >>   * @rect: pad crop rectangle boundaries\n> >>   * @stream: stream number, defined in subdev routing\n> >>   * @reserved: drivers and applications must zero this array\n> >> + *\n> >> + * The subdev crop API is an obsolete interface and may be removed in the\n> >> + * future. It is superseded by the selection API. No new extensions to this\n> >> + * structure will be accepted.\n> >>   */\n> >>  struct v4l2_subdev_crop {\n> >>  \t__u32 which;\n> >> @@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {\n> >>   * @pad: pad number, as reported by the media API\n> >>   * @interval: frame interval in seconds\n> >>   * @stream: stream number, defined in subdev routing\n> >> + * @which: interval type (from enum v4l2_subdev_format_whence)\n> >>   * @reserved: drivers and applications must zero this array\n> >>   */\n> >>  struct v4l2_subdev_frame_interval {\n> >>  \t__u32 pad;\n> >>  \tstruct v4l2_fract interval;\n> >>  \t__u32 stream;\n> >> -\t__u32 reserved[8];\n> >> +\t__u32 which;\n> >> +\t__u32 reserved[7];\n> >>  };\n> >>  \n> >>  /**\n> >> @@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {\n> >>   * @width: frame width in pixels\n> >>   * @height: frame height in pixels\n> >>   * @interval: frame interval in seconds\n> >> - * @which: format type (from enum v4l2_subdev_format_whence)\n> >> + * @which: interval type (from enum v4l2_subdev_format_whence)\n> >>   * @stream: stream number, defined in subdev routing\n> >>   * @reserved: drivers and applications must zero this array\n> >>   */\n> >> @@ -222,15 +228,19 @@ struct v4l2_subdev_route {\n> >>   * struct v4l2_subdev_routing - Subdev routing information\n> >>   *\n> >>   * @which: configuration type (from enum v4l2_subdev_format_whence)\n> >> - * @num_routes: the total number of routes in the routes array\n> >> + * @len_routes: the length of the routes array, in routes; set by the user, not\n> >> + *\t\tmodified by the kernel\n> >>   * @routes: pointer to the routes array\n> >> + * @num_routes: the total number of routes, possibly more than fits in the\n> >> + *\t\troutes array\n> >>   * @reserved: drivers and applications must zero this array\n> >>   */\n> >>  struct v4l2_subdev_routing {\n> >>  \t__u32 which;\n> >> -\t__u32 num_routes;\n> >> +\t__u32 len_routes;\n> >>  \t__u64 routes;\n> >> -\t__u32 reserved[6];\n> >> +\t__u32 num_routes;\n> >> +\t__u32 reserved[11];\n> > \n> > This will cause some issues. The routing API has changed, we need to\n> > handle it in a backward-compatible way. I have patches for that, I think\n> > I have even posted them. \n> \n> I thought that this was only exposed to userspace when\n> v4l2_subdev_enable_streams_api is set to true in\n> drivers/media/v4l2-core/v4l2-subdev.c\n> \n> And that is never set to true unless the kernel is manually editted\n> because the API is not stable yet (which is why it was ok\n> for Sakari to make this change upstream) ?\n> \n> I guess this may be enabled already on some downstream kernels\n> and that libcamera needs to handle that ?\n\nYes, that's exactly the reson :-)\n\n> > I'll rebase on top of this patch and repost.\n> > The two series will need to be merged together.\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Thank you the review(s) and for rebasing your series.\n> \n> >>  };\n> >>  \n> >>  /*\n> >> @@ -239,7 +249,14 @@ struct v4l2_subdev_routing {\n> >>   * set (which is the default), the 'stream' fields will be forced to 0 by the\n> >>   * kernel.\n> >>   */\n> >> - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t(1ULL << 0)\n> >> +#define V4L2_SUBDEV_CLIENT_CAP_STREAMS\t\t\t(1ULL << 0)\n> >> +\n> >> +/*\n> >> + * The client is aware of the struct v4l2_subdev_frame_interval which field. If\n> >> + * this is not set (which is the default), the which field is forced to\n> >> + * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.\n> >> + */\n> >> +#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH\t(1ULL << 1)\n> >>  \n> >>  /**\n> >>   * struct v4l2_subdev_client_capability - Capabilities of the client accessing\n> >> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> >> index 0b5482a0..7fe522e8 100644\n> >> --- a/include/linux/videodev2.h\n> >> +++ b/include/linux/videodev2.h\n> >> @@ -574,6 +574,8 @@ struct v4l2_pix_format {\n> >>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */\n> >>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */\n> >>  #define V4L2_PIX_FMT_IPU3_Y10\t\tv4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */\n> >> +#define V4L2_PIX_FMT_Y12P    v4l2_fourcc('Y', '1', '2', 'P') /* 12  Greyscale, MIPI RAW12 packed */\n> >> +#define V4L2_PIX_FMT_Y14P    v4l2_fourcc('Y', '1', '4', 'P') /* 14  Greyscale, MIPI RAW14 packed */\n> >>  \n> >>  /* Palette formats */\n> >>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */\n> >> @@ -867,6 +869,7 @@ struct v4l2_fmtdesc {\n> >>  #define V4L2_FMT_FLAG_CSC_YCBCR_ENC\t\t0x0080\n> >>  #define V4L2_FMT_FLAG_CSC_HSV_ENC\t\tV4L2_FMT_FLAG_CSC_YCBCR_ENC\n> >>  #define V4L2_FMT_FLAG_CSC_QUANTIZATION\t\t0x0100\n> >> +#define V4L2_FMT_FLAG_META_LINE_BASED\t\t0x0200\n> >>  \n> >>  \t/* Frame Size and frame rate enumeration */\n> >>  /*\n> >> @@ -1016,18 +1019,20 @@ struct v4l2_requestbuffers {\n> >>  #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS\t\t(1 << 4)\n> >>  #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF\t(1 << 5)\n> >>  #define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS\t\t(1 << 6)\n> >> +#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS\t\t(1 << 7)\n> >> +#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS\t\t(1 << 8)\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> >>   * @length:\t\tsize of this plane (NOT the payload) in bytes\n> >> - * @mem_offset:\t\twhen memory in the associated struct v4l2_buffer is\n> >> + * @m.mem_offset:\twhen memory in the associated struct v4l2_buffer is\n> >>   *\t\t\tV4L2_MEMORY_MMAP, equals the offset from the start of\n> >>   *\t\t\tthe device memory for this plane (or is a \"cookie\" that\n> >>   *\t\t\tshould be passed to mmap() called on the video node)\n> >> - * @userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n> >> + * @m.userptr:\t\twhen memory is V4L2_MEMORY_USERPTR, a userspace pointer\n> >>   *\t\t\tpointing to this plane\n> >> - * @fd:\t\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n> >> + * @m.fd:\t\twhen memory is V4L2_MEMORY_DMABUF, a userspace file\n> >>   *\t\t\tdescriptor associated with this plane\n> >>   * @m:\t\t\tunion of @mem_offset, @userptr and @fd\n> >>   * @data_offset:\toffset in the plane to the start of data; usually 0,\n> >> @@ -1065,14 +1070,14 @@ struct v4l2_plane {\n> >>   * @sequence:\tsequence count of this frame\n> >>   * @memory:\tenum v4l2_memory; the method, in which the actual video data is\n> >>   *\t\tpassed\n> >> - * @offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n> >> + * @m.offset:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;\n> >>   *\t\toffset from the start of the device memory for this plane,\n> >>   *\t\t(or a \"cookie\" that should be passed to mmap() as offset)\n> >> - * @userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n> >> + * @m.userptr:\tfor non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;\n> >>   *\t\ta userspace pointer pointing to this buffer\n> >> - * @fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n> >> + * @m.fd:\t\tfor non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;\n> >>   *\t\ta userspace file descriptor associated with this buffer\n> >> - * @planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n> >> + * @m.planes:\tfor multiplanar buffers; userspace pointer to the array of plane\n> >>   *\t\tinfo structs for this buffer\n> >>   * @m:\t\tunion of @offset, @userptr, @planes and @fd\n> >>   * @length:\tsize in bytes of the buffer (NOT its payload) for single-plane\n> >> @@ -1810,8 +1815,10 @@ struct v4l2_ext_control {\n> >>  \t\tstruct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;\n> >>  \t\tstruct v4l2_ctrl_av1_frame *p_av1_frame;\n> >>  \t\tstruct v4l2_ctrl_av1_film_grain *p_av1_film_grain;\n> >> +\t\tstruct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;\n> >> +\t\tstruct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;\n> >>  \t\tvoid *ptr;\n> >> -\t};\n> >> +\t} __attribute__ ((packed));\n> >>  } __attribute__ ((packed));\n> >>  \n> >>  struct v4l2_ext_controls {\n> >> @@ -2381,23 +2388,32 @@ struct v4l2_sdr_format {\n> >>   * struct v4l2_meta_format - metadata format definition\n> >>   * @dataformat:\t\tlittle endian four character code (fourcc)\n> >>   * @buffersize:\t\tmaximum size in bytes required for data\n> >> + * @width:\t\tnumber of data units of data per line (valid for line\n> >> + *\t\t\tbased formats only, see format documentation)\n> >> + * @height:\t\tnumber of lines of data per buffer (valid for line based\n> >> + *\t\t\tformats only)\n> >> + * @bytesperline:\toffset between the beginnings of two adjacent lines in\n> >> + *\t\t\tbytes (valid for line based formats only)\n> >>   */\n> >>  struct v4l2_meta_format {\n> >>  \t__u32\t\t\t\tdataformat;\n> >>  \t__u32\t\t\t\tbuffersize;\n> >> +\t__u32\t\t\t\twidth;\n> >> +\t__u32\t\t\t\theight;\n> >> +\t__u32\t\t\t\tbytesperline;\n> >>  } __attribute__ ((packed));\n> >>  \n> >>  /**\n> >>   * struct v4l2_format - stream data format\n> >> - * @type:\tenum v4l2_buf_type; type of the data stream\n> >> - * @pix:\tdefinition of an image format\n> >> - * @pix_mp:\tdefinition of a multiplanar image format\n> >> - * @win:\tdefinition of an overlaid image\n> >> - * @vbi:\traw VBI capture or output parameters\n> >> - * @sliced:\tsliced VBI capture or output parameters\n> >> - * @raw_data:\tplaceholder for future extensions and custom formats\n> >> - * @fmt:\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta\n> >> - *\t\tand @raw_data\n> >> + * @type:\t\tenum v4l2_buf_type; type of the data stream\n> >> + * @fmt.pix:\t\tdefinition of an image format\n> >> + * @fmt.pix_mp:\t\tdefinition of a multiplanar image format\n> >> + * @fmt.win:\t\tdefinition of an overlaid image\n> >> + * @fmt.vbi:\t\traw VBI capture or output parameters\n> >> + * @fmt.sliced:\t\tsliced VBI capture or output parameters\n> >> + * @fmt.raw_data:\tplaceholder for future extensions and custom formats\n> >> + * @fmt:\t\tunion of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,\n> >> + *\t\t\t@meta and @raw_data\n> >>   */\n> >>  struct v4l2_format {\n> >>  \t__u32\t type;\n> >> @@ -2570,6 +2586,9 @@ struct v4l2_dbg_chip_info {\n> >>   * @flags:\tadditional buffer management attributes (ignored unless the\n> >>   *\t\tqueue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability\n> >>   *\t\tand configured for MMAP streaming I/O).\n> >> + * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set\n> >> + *\t\tthis field indicate the maximum possible number of buffers\n> >> + *\t\tfor this queue.\n> >>   * @reserved:\tfuture extensions\n> >>   */\n> >>  struct v4l2_create_buffers {\n> >> @@ -2579,7 +2598,22 @@ struct v4l2_create_buffers {\n> >>  \tstruct v4l2_format\tformat;\n> >>  \t__u32\t\t\tcapabilities;\n> >>  \t__u32\t\t\tflags;\n> >> -\t__u32\t\t\treserved[6];\n> >> +\t__u32\t\t\tmax_num_buffers;\n> >> +\t__u32\t\t\treserved[5];\n> >> +};\n> >> +\n> >> +/**\n> >> + * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument\n> >> + * @index:\tthe first buffer to be removed\n> >> + * @count:\tnumber of buffers to removed\n> >> + * @type:\tenum v4l2_buf_type\n> >> + * @reserved:\tfuture extensions\n> >> + */\n> >> +struct v4l2_remove_buffers {\n> >> +\t__u32\t\t\tindex;\n> >> +\t__u32\t\t\tcount;\n> >> +\t__u32\t\t\ttype;\n> >> +\t__u32\t\t\treserved[13];\n> >>  };\n> >>  \n> >>  /*\n> >> @@ -2681,6 +2715,8 @@ struct v4l2_create_buffers {\n> >>  #define VIDIOC_DBG_G_CHIP_INFO  _IOWR('V', 102, struct v4l2_dbg_chip_info)\n> >>  \n> >>  #define VIDIOC_QUERY_EXT_CTRL\t_IOWR('V', 103, struct v4l2_query_ext_ctrl)\n> >> +#define VIDIOC_REMOVE_BUFS\t_IOWR('V', 104, struct v4l2_remove_buffers)\n> >> +\n> >>  \n> >>  /* Reminder: when adding new ioctls please add support for them to\n> >>     drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */","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 E3999BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 Jun 2024 21:50:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05396634C9;\n\tSat,  1 Jun 2024 23:50:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71A2D634AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Jun 2024 23:50:49 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2378FCCC;\n\tSat,  1 Jun 2024 23:50:43 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"r9Gaj+GL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717278643;\n\tbh=L/ie0ayqvDRjrGGM+Sf/OrGYzmTDbfpGLJBxSIrzkHU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=r9Gaj+GLEgKfmsdka/JQPAWLyhtBybk2WzAu4/Lpu2bu21GBb2B/VvGJnicnG/TRw\n\tmQMHTG8QLJz6xBisJMWLCjjedNOa29N7NcF15p8ohC+oKAaIBi42YIY10+bNfxAL61\n\tsbyo0cThyAe6Tp7dhnfjtrkITAAsXJuS20sKsMQQ=","Date":"Sun, 2 Jun 2024 00:50:33 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hans de Goede <hdegoede@redhat.com>","Cc":"\"sakari.ailus@linux.intel.com\" <sakari.ailus@linux.intel.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tAndrey Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>, Maxime Ripard <mripard@redhat.com>","Subject":"Re: [PATCH v2 2/5] include: linux: Update kernel headers to version\n\tv6.10-rc1","Message-ID":"<20240601215033.GA3269@pendragon.ideasonboard.com>","References":"<20240530171600.259495-1-hdegoede@redhat.com>\n\t<20240530171600.259495-3-hdegoede@redhat.com>\n\t<20240601134551.GC6163@pendragon.ideasonboard.com>\n\t<014b395f-7782-4bda-82c1-a92b5090554a@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<014b395f-7782-4bda-82c1-a92b5090554a@redhat.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]