[{"id":36128,"web_url":"https://patchwork.libcamera.org/comment/36128/","msgid":"<20251006014121.GG13055@pendragon.ideasonboard.com>","date":"2025-10-06T01:41:21","subject":"Re: [PATCH v4 3/5] ipa: Update Mali C55 header file and adjust IPA","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Oct 01, 2025 at 05:42:32PM +0200, Jacopo Mondi wrote:\n> Update Mali C55 header file with the v11 version of the patch series,\n> based on v4l2 extensible parameters, sent to the linux-media mailing list at:\n> https://lore.kernel.org/all/20250714-c55-v11-0-bc20e460e42a@ideasonboard.com/\n> \n> Adjust the IPA module to use the new v4l2-isp.h header file.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Tested-By: Antoine Bouyer <antoine.bouyer@nxp.com>\n> ---\n>  include/linux/mali-c55-config.h         | 162 +++++---------------------------\n>  src/ipa/mali-c55/algorithms/agc.cpp     |  28 +++---\n>  src/ipa/mali-c55/algorithms/agc.h       |   2 +-\n>  src/ipa/mali-c55/algorithms/algorithm.h |   2 +-\n>  src/ipa/mali-c55/algorithms/awb.cpp     |  14 +--\n>  src/ipa/mali-c55/algorithms/awb.h       |   2 +-\n>  src/ipa/mali-c55/algorithms/blc.cpp     |   8 +-\n>  src/ipa/mali-c55/algorithms/blc.h       |   2 +-\n>  src/ipa/mali-c55/algorithms/lsc.cpp     |  14 +--\n>  src/ipa/mali-c55/algorithms/lsc.h       |   2 +-\n>  src/ipa/mali-c55/mali-c55.cpp           |  10 +-\n>  src/ipa/mali-c55/module.h               |   2 +-\n>  12 files changed, 67 insertions(+), 181 deletions(-)\n> \n> diff --git a/include/linux/mali-c55-config.h b/include/linux/mali-c55-config.h\n> index b31415597e886496b65f8fb396c095618467f1ac..3e22a9e50dce85b69fc96f8e6cd03d199430eb8b 100644\n> --- a/include/linux/mali-c55-config.h\n> +++ b/include/linux/mali-c55-config.h\n> @@ -9,6 +9,22 @@\n>  #define __UAPI_MALI_C55_CONFIG_H\n>  \n>  #include <linux/types.h>\n> +#include <linux/v4l2-controls.h>\n> +\n> +#include <linux/media/v4l2-isp.h>\n> +\n> +#define V4L2_CID_MALI_C55_CAPABILITIES\t(V4L2_CID_USER_MALI_C55_BASE + 0x0)\n> +#define MALI_C55_GPS_PONG\t\t(1U << 0)\n> +#define MALI_C55_GPS_WDR\t\t(1U << 1)\n> +#define MALI_C55_GPS_COMPRESSION\t(1U << 2)\n> +#define MALI_C55_GPS_TEMPER\t\t(1U << 3)\n> +#define MALI_C55_GPS_SINTER_LITE\t(1U << 4)\n> +#define MALI_C55_GPS_SINTER\t\t(1U << 5)\n> +#define MALI_C55_GPS_IRIDIX_LTM\t\t(1U << 6)\n> +#define MALI_C55_GPS_IRIDIX_GTM\t\t(1U << 7)\n> +#define MALI_C55_GPS_CNR\t\t(1U << 8)\n> +#define MALI_C55_GPS_FRSCALER\t\t(1U << 9)\n> +#define MALI_C55_GPS_DS_PIPE\t\t(1U << 10)\n>  \n>  /*\n>   * Frames are split into zones of almost equal width and height - a zone is a\n> @@ -228,65 +244,6 @@ enum mali_c55_param_block_type {\n>  \tMALI_C55_PARAM_MESH_SHADING_SELECTION,\n>  };\n>  \n> -#define MALI_C55_PARAM_BLOCK_FL_NONE\t\t\t0\n> -#define MALI_C55_PARAM_BLOCK_FL_DISABLED\t\tBIT(0)\n> -\n> -/**\n> - * struct mali_c55_params_block_header - Mali-C55 parameter block header\n> - *\n> - * This structure represents the common part of all the ISP configuration\n> - * blocks. Each parameters block embeds an instance of this structure type\n> - * as its first member, followed by the block-specific configuration data. The\n> - * driver inspects this common header to discern the block type and its size and\n> - * properly handle the block content by casting it to the correct block-specific\n> - * type.\n> - *\n> - * The @type field is one of the values enumerated by\n> - * :c:type:`mali_c55_param_block_type` and specifies how the data should be\n> - * interpreted by the driver. The @size field specifies the size of the\n> - * parameters block and is used by the driver for validation purposes. The\n> - * @flags field holds a bitmask of per-block flags MALI_C55_PARAM_BLOCK_FL_*.\n> - *\n> - * If userspace wants to disable an ISP block the\n> - * MALI_C55_PARAM_BLOCK_FL_DISABLED bit should be set in the @flags field. In\n> - * that case userspace may optionally omit the remainder of the configuration\n> - * block, which will in any case be ignored by the driver. If a new\n> - * configuration of an ISP block has to be applied userspace shall fully\n> - * populate the ISP block and omit setting the MALI_C55_PARAM_BLOCK_FL_DISABLED\n> - * bit in the @flags field.\n> - *\n> - * Userspace is responsible for correctly populating the parameters block header\n> - * fields (@type, @flags and @size) and correctly populate the block-specific\n> - * parameters.\n> - *\n> - * For example:\n> - *\n> - * .. code-block:: c\n> - *\n> - *\tvoid populate_sensor_offs(struct mali_c55_params_block_header *block) {\n> - *\t\tblock->type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;\n> - *\t\tblock->enabled = MALI_C55_PARAM_BLOCK_FL_NONE;\n> - *\t\tblock->size = sizeof(struct mali_c55_params_sensor_off_preshading);\n> - *\n> - *\t\tstruct mali_c55_params_sensor_off_preshading *sensor_offs =\n> - *\t\t\t(struct mali_c55_params_sensor_off_preshading *)block;\n> - *\n> - *\t\tsensor_offs->chan00 = offset00;\n> - *\t\tsensor_offs->chan01 = offset01;\n> - *\t\tsensor_offs->chan10 = offset10;\n> - *\t\tsensor_offs->chan11 = offset11;\n> - *\t}\n> - *\n> - * @type: The parameters block type from :c:type:`mali_c55_param_block_type`\n> - * @flags: Bitmask of block flags\n> - * @size: Size (in bytes) of the parameters block\n> - */\n> -struct mali_c55_params_block_header {\n> -\t__u16 type;\n> -\t__u16 flags;\n> -\t__u32 size;\n> -} __attribute__((aligned(8)));\n> -\n>  /**\n>   * struct mali_c55_params_sensor_off_preshading - offset subtraction for each\n>   *\t\t\t\t\t\t  color channel\n> @@ -305,7 +262,7 @@ struct mali_c55_params_block_header {\n>   * @chan11: Offset for color channel 11 (default: B)\n>   */\n>  struct mali_c55_params_sensor_off_preshading {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u32 chan00;\n>  \t__u32 chan01;\n>  \t__u32 chan10;\n> @@ -470,7 +427,7 @@ enum mali_c55_aexp_hist_plane_mode {\n>   *\t\t\tThis parameter is unused for the post-Iridix Histogram\n>   */\n>  struct mali_c55_params_aexp_hist {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u8 skip_x;\n>  \t__u8 offset_x;\n>  \t__u8 skip_y;\n> @@ -502,7 +459,7 @@ struct mali_c55_params_aexp_hist {\n>   *\t\t\t@nodes_used_horiz\n>   */\n>  struct mali_c55_params_aexp_weights {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u8 nodes_used_horiz;\n>  \t__u8 nodes_used_vert;\n>  \t__u8 zone_weights[MALI_C55_MAX_ZONES];\n> @@ -520,7 +477,7 @@ struct mali_c55_params_aexp_weights {\n>   * @gain:\tThe digital gain value to apply, in Q5.8 format.\n>   */\n>  struct mali_c55_params_digital_gain {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u16 gain;\n>  };\n>  \n> @@ -560,7 +517,7 @@ enum mali_c55_awb_stats_mode {\n>   * @gain11:\tMultiplier for colour channel 11\n>   */\n>  struct mali_c55_params_awb_gains {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u16 gain00;\n>  \t__u16 gain01;\n>  \t__u16 gain10;\n> @@ -635,7 +592,7 @@ enum mali_c55_params_awb_tap_points {\n>   * @cb_low:\t\tB/G ratio trim low (Q4.8 format)\n>   */\n>  struct mali_c55_params_awb_config {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u8 tap_point;\n>  \t__u8 stats_mode;\n>  \t__u16 white_level;\n> @@ -745,7 +702,7 @@ struct mali_c55_params_awb_config {\n>   * @mesh:\t\tMesh shading correction tables\n>   */\n>  struct mali_c55_params_mesh_shading_config {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u8 mesh_show;\n>  \t__u8 mesh_scale;\n>  \t__u8 mesh_page_r;\n> @@ -800,7 +757,7 @@ enum mali_c55_params_mesh_alpha_bank {\n>   * @mesh_strength:\tMesh strength in Q4.12 format [0..4096]\n>   */\n>  struct mali_c55_params_mesh_shading_selection {\n> -\tstruct mali_c55_params_block_header header;\n> +\tstruct v4l2_params_block_header header;\n>  \t__u8 mesh_alpha_bank_r;\n>  \t__u8 mesh_alpha_bank_g;\n>  \t__u8 mesh_alpha_bank_b;\n> @@ -835,75 +792,4 @@ struct mali_c55_params_mesh_shading_selection {\n>  \tsizeof(struct mali_c55_params_mesh_shading_config) +\t\\\n>  \tsizeof(struct mali_c55_params_mesh_shading_selection))\n>  \n> -/**\n> - * struct mali_c55_params_buffer - 3A configuration parameters\n> - *\n> - * This struct contains the configuration parameters of the Mali-C55 ISP\n> - * algorithms, serialized by userspace into a data buffer. Each configuration\n> - * parameter block is represented by a block-specific structure which contains a\n> - * :c:type:`mali_c55_params_block_header` entry as first member. Userspace\n> - * populates the @data buffer with configuration parameters for the blocks that\n> - * it intends to configure. As a consequence, the data buffer effective size\n> - * changes according to the number of ISP blocks that userspace intends to\n> - * configure.\n> - *\n> - * The parameters buffer is versioned by the @version field to allow modifying\n> - * and extending its definition. Userspace shall populate the @version field to\n> - * inform the driver about the version it intends to use. The driver will parse\n> - * and handle the @data buffer according to the data layout specific to the\n> - * indicated version and return an error if the desired version is not\n> - * supported.\n> - *\n> - * For each ISP block that userspace wants to configure, a block-specific\n> - * structure is appended to the @data buffer, one after the other without gaps\n> - * in between nor overlaps. Userspace shall populate the @total_size field with\n> - * the effective size, in bytes, of the @data buffer.\n> - *\n> - * The expected memory layout of the parameters buffer is::\n> - *\n> - *\t+-------------------- struct mali_c55_params_buffer ------------------+\n> - *\t| version = MALI_C55_PARAM_BUFFER_V1;                                 |\n> - *\t| total_size = sizeof(struct mali_c55_params_sensor_off_preshading)   |\n> - *\t|              sizeof(struct mali_c55_params_aexp_hist);              |\n> - *\t| +------------------------- data  ---------------------------------+ |\n> - *\t| | +--------- struct mali_c55_params_sensor_off_preshading ------+ | |\n> - *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n> - *\t| | | | type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;                | | | |\n> - *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n> - *\t| | | | size =                                                  | | | |\n> - *\t| | | |    sizeof(struct mali_c55_params_sensor_off_preshading);| | | |\n> - *\t| | | +---------------------------------------------------------+ | | |\n> - *\t| | | chan00 = ...;                                               | | |\n> - *\t| | | chan01 = ...;                                               | | |\n> - *\t| | | chan10 = ...;                                               | | |\n> - *\t| | | chan11 = ...;                                               | | |\n> - *\t| | +------------ struct mali_c55_params_aexp_hist ---------------+ | |\n> - *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n> - *\t| | | | type = MALI_C55_PARAM_BLOCK_AEXP_HIST;                  | | | |\n> - *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n> - *\t| | | | size = sizeof(struct mali_c55_params_aexp_hist);        | | | |\n> - *\t| | | +---------------------------------------------------------+ | | |\n> - *\t| | | skip_x = ...;                                               | | |\n> - *\t| | | offset_x = ...;                                             | | |\n> - *\t| | | skip_y = ...;                                               | | |\n> - *\t| | | offset_y = ...;                                             | | |\n> - *\t| | | scale_bottom = ...;                                         | | |\n> - *\t| | | scale_top = ...;                                            | | |\n> - *\t| | | plane_mode = ...;                                           | | |\n> - *\t| | | tap_point = ...;                                            | | |\n> - *\t| | +-------------------------------------------------------------+ | |\n> - *\t| +-----------------------------------------------------------------+ |\n> - *\t+---------------------------------------------------------------------+\n> - *\n> - * @version: The version from :c:type:`mali_c55_param_buffer_version`\n> - * @total_size: The Mali-C55 configuration data effective size, excluding this\n> - *\t\theader\n> - * @data: The Mali-C55 configuration blocks data\n> - */\n> -struct mali_c55_params_buffer {\n> -\t__u8 version;\n> -\t__u32 total_size;\n> -\t__u8 data[MALI_C55_PARAMS_MAX_SIZE];\n> -};\n> -\n>  #endif /* __UAPI_MALI_C55_CONFIG_H */\n> diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\n> index f60fddac3f04fd6f09dc782e929ff1593758c29b..da47cf15be49327a592e850817f2863ab62cb404 100644\n> --- a/src/ipa/mali-c55/algorithms/agc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/agc.cpp\n> @@ -253,7 +253,7 @@ size_t Agc::fillGainParamBlock(IPAContext &context, IPAFrameContext &frameContex\n>  \t\tgain = activeState.agc.manual.ispGain;\n>  \n>  \tblock.header->type = MALI_C55_PARAM_BLOCK_DIGITAL_GAIN;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_digital_gain);\n>  \n>  \tblock.digital_gain->gain = floatingToFixedPoint<5, 8, uint16_t, double>(gain);\n> @@ -266,7 +266,7 @@ size_t Agc::fillParamsBuffer(mali_c55_params_block block,\n>  \t\t\t     enum mali_c55_param_block_type type)\n>  {\n>  \tblock.header->type = type;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_aexp_hist);\n>  \n>  \t/* Collect every 3rd pixel horizontally */\n> @@ -292,7 +292,7 @@ size_t Agc::fillWeightsArrayBuffer(mali_c55_params_block block,\n>  \t\t\t\t   enum mali_c55_param_block_type type)\n>  {\n>  \tblock.header->type = type;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_aexp_weights);\n>  \n>  \t/* We use every zone - a 15x15 grid */\n> @@ -314,30 +314,30 @@ size_t Agc::fillWeightsArrayBuffer(mali_c55_params_block block,\n>  }\n>  \n>  void Agc::prepare(IPAContext &context, const uint32_t frame,\n> -\t\t  IPAFrameContext &frameContext, mali_c55_params_buffer *params)\n> +\t\t  IPAFrameContext &frameContext, v4l2_params_buffer *params)\n>  {\n>  \tmali_c55_params_block block;\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillGainParamBlock(context, frameContext, block);\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillGainParamBlock(context, frameContext, block);\n>  \n>  \tif (frame > 0)\n>  \t\treturn;\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillParamsBuffer(block,\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillParamsBuffer(block,\n>  \t\t\t\t\t       MALI_C55_PARAM_BLOCK_AEXP_HIST);\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillWeightsArrayBuffer(block,\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillWeightsArrayBuffer(block,\n>  \t\t\t\t\t\t     MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS);\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillParamsBuffer(block,\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillParamsBuffer(block,\n>  \t\t\t\t\t       MALI_C55_PARAM_BLOCK_AEXP_IHIST);\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillWeightsArrayBuffer(block,\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillWeightsArrayBuffer(block,\n>  \t\t\t\t\t\t     MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS);\n>  }\n>  \n> diff --git a/src/ipa/mali-c55/algorithms/agc.h b/src/ipa/mali-c55/algorithms/agc.h\n> index 0b4bf7eda1c2a7c9894f6932452fea5f53699b30..64caf99350c1d1835832311a94a88a2bfde5721c 100644\n> --- a/src/ipa/mali-c55/algorithms/agc.h\n> +++ b/src/ipa/mali-c55/algorithms/agc.h\n> @@ -57,7 +57,7 @@ public:\n>  \t\t\t  const ControlList &controls) override;\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n> -\t\t     mali_c55_params_buffer *params) override;\n> +\t\t     v4l2_params_buffer *params) override;\n>  \tvoid process(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     const mali_c55_stats_buffer *stats,\n> diff --git a/src/ipa/mali-c55/algorithms/algorithm.h b/src/ipa/mali-c55/algorithms/algorithm.h\n> index ec8dd3973eaf2d804d8de8620840f716340e9cfd..c28789f6a619cf7fc05ffb705098ed8d1fac93b8 100644\n> --- a/src/ipa/mali-c55/algorithms/algorithm.h\n> +++ b/src/ipa/mali-c55/algorithms/algorithm.h\n> @@ -22,7 +22,7 @@ class Algorithm : public libcamera::ipa::Algorithm<Module>\n>  };\n>  \n>  union mali_c55_params_block {\n> -\tstruct mali_c55_params_block_header *header;\n> +\tstruct v4l2_params_block_header *header;\n>  \tstruct mali_c55_params_sensor_off_preshading *sensor_offs;\n>  \tstruct mali_c55_params_aexp_hist *aexp_hist;\n>  \tstruct mali_c55_params_aexp_weights *aexp_weights;\n> diff --git a/src/ipa/mali-c55/algorithms/awb.cpp b/src/ipa/mali-c55/algorithms/awb.cpp\n> index 3d546e5a854b8aa02987c44f57109a6171e3794b..6b2cbed9de1ebfe9a2466ebe999eceac44fe5deb 100644\n> --- a/src/ipa/mali-c55/algorithms/awb.cpp\n> +++ b/src/ipa/mali-c55/algorithms/awb.cpp\n> @@ -47,7 +47,7 @@ size_t Awb::fillGainsParamBlock(mali_c55_params_block block, IPAContext &context\n>  \t\t\t\tIPAFrameContext &frameContext)\n>  {\n>  \tblock.header->type = MALI_C55_PARAM_BLOCK_AWB_GAINS;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_awb_gains);\n>  \n>  \tdouble rGain = context.activeState.awb.rGain;\n> @@ -77,7 +77,7 @@ size_t Awb::fillGainsParamBlock(mali_c55_params_block block, IPAContext &context\n>  size_t Awb::fillConfigParamBlock(mali_c55_params_block block)\n>  {\n>  \tblock.header->type = MALI_C55_PARAM_BLOCK_AWB_CONFIG;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_awb_config);\n>  \n>  \t/* Tap the stats after the purple fringe block */\n> @@ -126,18 +126,18 @@ size_t Awb::fillConfigParamBlock(mali_c55_params_block block)\n>  }\n>  \n>  void Awb::prepare(IPAContext &context, const uint32_t frame,\n> -\t\t  IPAFrameContext &frameContext, mali_c55_params_buffer *params)\n> +\t\t  IPAFrameContext &frameContext, v4l2_params_buffer *params)\n>  {\n>  \tmali_c55_params_block block;\n> -\tblock.data = &params->data[params->total_size];\n> +\tblock.data = &params->data[params->data_size];\n>  \n> -\tparams->total_size += fillGainsParamBlock(block, context, frameContext);\n> +\tparams->data_size += fillGainsParamBlock(block, context, frameContext);\n>  \n>  \tif (frame > 0)\n>  \t\treturn;\n>  \n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillConfigParamBlock(block);\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillConfigParamBlock(block);\n>  }\n>  \n>  void Awb::process(IPAContext &context, const uint32_t frame,\n> diff --git a/src/ipa/mali-c55/algorithms/awb.h b/src/ipa/mali-c55/algorithms/awb.h\n> index 2351d405553058dbff569e9e09e265a56baaa23f..b5ff121041d1a01e3a51d64b87a90fb2e1d8dd10 100644\n> --- a/src/ipa/mali-c55/algorithms/awb.h\n> +++ b/src/ipa/mali-c55/algorithms/awb.h\n> @@ -22,7 +22,7 @@ public:\n>  \t\t      const IPACameraSensorInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n> -\t\t     mali_c55_params_buffer *params) override;\n> +\t\t     v4l2_params_buffer *params) override;\n>  \tvoid process(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     const mali_c55_stats_buffer *stats,\n> diff --git a/src/ipa/mali-c55/algorithms/blc.cpp b/src/ipa/mali-c55/algorithms/blc.cpp\n> index 2a54c86a91f83d24183cb7236fcd5181302eb622..8fd0f10c3082030a36a256830042d733ed4c8c78 100644\n> --- a/src/ipa/mali-c55/algorithms/blc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/blc.cpp\n> @@ -85,10 +85,10 @@ int BlackLevelCorrection::configure(IPAContext &context,\n>  void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>  \t\t\t\t   const uint32_t frame,\n>  \t\t\t\t   [[maybe_unused]] IPAFrameContext &frameContext,\n> -\t\t\t\t   mali_c55_params_buffer *params)\n> +\t\t\t\t   v4l2_params_buffer *params)\n>  {\n>  \tmali_c55_params_block block;\n> -\tblock.data = &params->data[params->total_size];\n> +\tblock.data = &params->data[params->data_size];\n>  \n>  \tif (frame > 0)\n>  \t\treturn;\n> @@ -97,7 +97,7 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>  \t\treturn;\n>  \n>  \tblock.header->type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(mali_c55_params_sensor_off_preshading);\n>  \n>  \tblock.sensor_offs->chan00 = offset00;\n> @@ -105,7 +105,7 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>  \tblock.sensor_offs->chan10 = offset10;\n>  \tblock.sensor_offs->chan11 = offset11;\n>  \n> -\tparams->total_size += block.header->size;\n> +\tparams->data_size += block.header->size;\n>  }\n>  \n>  void BlackLevelCorrection::process([[maybe_unused]] IPAContext &context,\n> diff --git a/src/ipa/mali-c55/algorithms/blc.h b/src/ipa/mali-c55/algorithms/blc.h\n> index 9696e8e9f2aa8b9076a3a41fb8f5ea356e32be12..cf10505ce2908df0d5e658d3fdce663729c7ea76 100644\n> --- a/src/ipa/mali-c55/algorithms/blc.h\n> +++ b/src/ipa/mali-c55/algorithms/blc.h\n> @@ -22,7 +22,7 @@ public:\n>  \t\t      const IPACameraSensorInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n> -\t\t     mali_c55_params_buffer *params) override;\n> +\t\t     v4l2_params_buffer *params) override;\n>  \tvoid process(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     const mali_c55_stats_buffer *stats,\n> diff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\n> index c43d034a181edb7559706189f8d75edd67a2dc08..35f1d876e60db252a45cadb771e541735749d106 100644\n> --- a/src/ipa/mali-c55/algorithms/lsc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/lsc.cpp\n> @@ -111,7 +111,7 @@ int Lsc::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n>  size_t Lsc::fillConfigParamsBlock(mali_c55_params_block block) const\n>  {\n>  \tblock.header->type = MALI_C55_PARAM_MESH_SHADING_CONFIG;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_mesh_shading_config);\n>  \n>  \tblock.shading_config->mesh_show = false;\n> @@ -131,7 +131,7 @@ size_t Lsc::fillSelectionParamsBlock(mali_c55_params_block block, uint8_t bank,\n>  \t\t\t\t     uint8_t alpha) const\n>  {\n>  \tblock.header->type = MALI_C55_PARAM_MESH_SHADING_SELECTION;\n> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n> +\tblock.header->flags = 0;\n>  \tblock.header->size = sizeof(struct mali_c55_params_mesh_shading_selection);\n>  \n>  \tblock.shading_selection->mesh_alpha_bank_r = bank;\n> @@ -170,7 +170,7 @@ std::tuple<uint8_t, uint8_t> Lsc::findBankAndAlpha(uint32_t ct) const\n>  \n>  void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n> -\t\t  mali_c55_params_buffer *params)\n> +\t\t  v4l2_params_buffer *params)\n>  {\n>  \t/*\n>  \t * For each frame we assess the colour temperature of the **last** frame\n> @@ -194,9 +194,9 @@ void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \t}\n>  \n>  \tmali_c55_params_block block;\n> -\tblock.data = &params->data[params->total_size];\n> +\tblock.data = &params->data[params->data_size];\n>  \n> -\tparams->total_size += fillSelectionParamsBlock(block, bank, alpha);\n> +\tparams->data_size += fillSelectionParamsBlock(block, bank, alpha);\n>  \n>  \tif (frame > 0)\n>  \t\treturn;\n> @@ -205,8 +205,8 @@ void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \t * If this is the first frame, we need to load the parsed coefficient\n>  \t * tables from tuning data to the ISP.\n>  \t */\n> -\tblock.data = &params->data[params->total_size];\n> -\tparams->total_size += fillConfigParamsBlock(block);\n> +\tblock.data = &params->data[params->data_size];\n> +\tparams->data_size += fillConfigParamsBlock(block);\n>  }\n>  \n>  REGISTER_IPA_ALGORITHM(Lsc, \"Lsc\")\n> diff --git a/src/ipa/mali-c55/algorithms/lsc.h b/src/ipa/mali-c55/algorithms/lsc.h\n> index d11e23bc7c34fa3e1f45ccf015b50f3d390d7159..9019a61aa547e41154615eba88547d3eee1634e2 100644\n> --- a/src/ipa/mali-c55/algorithms/lsc.h\n> +++ b/src/ipa/mali-c55/algorithms/lsc.h\n> @@ -23,7 +23,7 @@ public:\n>  \tint init(IPAContext &context, const YamlObject &tuningData) override;\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n> -\t\t     mali_c55_params_buffer *params) override;\n> +\t\t     v4l2_params_buffer *params) override;\n>  private:\n>  \tstatic constexpr unsigned int kRedOffset = 0;\n>  \tstatic constexpr unsigned int kGreenOffset = 1024;\n> diff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\n> index 7d45e7310aecdae0e47655e6d2e8830e776d74cd..a6d3e984a438c01509ed27469d9f20c25bc884cf 100644\n> --- a/src/ipa/mali-c55/mali-c55.cpp\n> +++ b/src/ipa/mali-c55/mali-c55.cpp\n> @@ -331,22 +331,22 @@ void IPAMaliC55::queueRequest(const uint32_t request, const ControlList &control\n>  void IPAMaliC55::fillParams(unsigned int request,\n>  \t\t\t    [[maybe_unused]] uint32_t bufferId)\n>  {\n> -\tstruct mali_c55_params_buffer *params;\n> +\tstruct v4l2_params_buffer *params;\n>  \tIPAFrameContext &frameContext = context_.frameContexts.get(request);\n>  \n> -\tparams = reinterpret_cast<mali_c55_params_buffer *>(\n> +\tparams = reinterpret_cast<v4l2_params_buffer *>(\n>  \t\tbuffers_.at(bufferId).planes()[0].data());\n> -\tmemset(params, 0, sizeof(mali_c55_params_buffer));\n> +\tmemset(params, 0, sizeof(v4l2_params_buffer));\n\nThat's a change in behaviour, it used to memset the whole data area, not\nit only clears the header.\n\n>  \n>  \tparams->version = MALI_C55_PARAM_BUFFER_V1;\n>  \n>  \tfor (auto const &algo : algorithms()) {\n>  \t\talgo->prepare(context_, request, frameContext, params);\n>  \n> -\t\tASSERT(params->total_size <= MALI_C55_PARAMS_MAX_SIZE);\n> +\t\tASSERT(params->data_size <= MALI_C55_PARAMS_MAX_SIZE);\n>  \t}\n>  \n> -\tsize_t bytesused = offsetof(struct mali_c55_params_buffer, data) + params->total_size;\n> +\tsize_t bytesused = offsetof(struct v4l2_params_buffer, data) + params->data_size;\n>  \tparamsComputed.emit(request, bytesused);\n>  }\n>  \n> diff --git a/src/ipa/mali-c55/module.h b/src/ipa/mali-c55/module.h\n> index 4f6a4f18bfaf83263ccb5b7eb1723da9b655cc3c..434d2c585d2f4eb03402c57e87302fc82e82a0f0 100644\n> --- a/src/ipa/mali-c55/module.h\n> +++ b/src/ipa/mali-c55/module.h\n> @@ -20,7 +20,7 @@ namespace libcamera {\n>  namespace ipa::mali_c55 {\n>  \n>  using Module = ipa::Module<IPAContext, IPAFrameContext, IPACameraSensorInfo,\n> -\t\t\t   mali_c55_params_buffer, mali_c55_stats_buffer>;\n> +\t\t\t   v4l2_params_buffer, mali_c55_stats_buffer>;\n>  \n>  } /* namespace ipa::mali_c55 */\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 7E129BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Oct 2025 01:41:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 582BC6B5F3;\n\tMon,  6 Oct 2025 03:41:30 +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 9F479613AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 03:41:27 +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 UTF8SMTPSA id 2DE87C67;\n\tMon,  6 Oct 2025 03:39:55 +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=\"Deyqe3H2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759714795;\n\tbh=n30VjX0XQzah8Iq7RWycIzVdHlnET3En5sqjUBtztMc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Deyqe3H2EwKioFWq7YdXeHb48HBmiaUVXFlDBmW9ZFQHxaA+WCbL/gv0lFfQL2lp4\n\t87Epx4MREGctn3HKWYjNh4rLuabSvLaDuiKSmU1ZpnQMFt6j0SdnOxZf4nO1I10KXm\n\tJ5Y2AbbdxlEezL9iZEDoQmocV4BRhhOdpgsXlmkg=","Date":"Mon, 6 Oct 2025 04:41:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tAntoine Bouyer <antoine.bouyer@nxp.com>","Subject":"Re: [PATCH v4 3/5] ipa: Update Mali C55 header file and adjust IPA","Message-ID":"<20251006014121.GG13055@pendragon.ideasonboard.com>","References":"<20251001-v4l2-params-v4-0-8f2b4779205e@ideasonboard.com>\n\t<20251001-v4l2-params-v4-3-8f2b4779205e@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20251001-v4l2-params-v4-3-8f2b4779205e@ideasonboard.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":36131,"web_url":"https://patchwork.libcamera.org/comment/36131/","msgid":"<4a786a54-c942-4032-b705-9ba2b0f50341@ideasonboard.com>","date":"2025-10-06T08:22:18","subject":"Re: [PATCH v4 3/5] ipa: Update Mali C55 header file and adjust IPA","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Morning Laurent, Jacopo\n\nOn 06/10/2025 02:41, Laurent Pinchart wrote:\n> Hi Jacopo,\n> \n> Thank you for the patch.\n> \n> On Wed, Oct 01, 2025 at 05:42:32PM +0200, Jacopo Mondi wrote:\n>> Update Mali C55 header file with the v11 version of the patch series,\n>> based on v4l2 extensible parameters, sent to the linux-media mailing list at:\n>> https://lore.kernel.org/all/20250714-c55-v11-0-bc20e460e42a@ideasonboard.com/\n>>\n>> Adjust the IPA module to use the new v4l2-isp.h header file.\n>>\n>> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>> Tested-By: Antoine Bouyer <antoine.bouyer@nxp.com>\n>> ---\n>>   include/linux/mali-c55-config.h         | 162 +++++---------------------------\n>>   src/ipa/mali-c55/algorithms/agc.cpp     |  28 +++---\n>>   src/ipa/mali-c55/algorithms/agc.h       |   2 +-\n>>   src/ipa/mali-c55/algorithms/algorithm.h |   2 +-\n>>   src/ipa/mali-c55/algorithms/awb.cpp     |  14 +--\n>>   src/ipa/mali-c55/algorithms/awb.h       |   2 +-\n>>   src/ipa/mali-c55/algorithms/blc.cpp     |   8 +-\n>>   src/ipa/mali-c55/algorithms/blc.h       |   2 +-\n>>   src/ipa/mali-c55/algorithms/lsc.cpp     |  14 +--\n>>   src/ipa/mali-c55/algorithms/lsc.h       |   2 +-\n>>   src/ipa/mali-c55/mali-c55.cpp           |  10 +-\n>>   src/ipa/mali-c55/module.h               |   2 +-\n>>   12 files changed, 67 insertions(+), 181 deletions(-)\n>>\n>> diff --git a/include/linux/mali-c55-config.h b/include/linux/mali-c55-config.h\n>> index b31415597e886496b65f8fb396c095618467f1ac..3e22a9e50dce85b69fc96f8e6cd03d199430eb8b 100644\n>> --- a/include/linux/mali-c55-config.h\n>> +++ b/include/linux/mali-c55-config.h\n>> @@ -9,6 +9,22 @@\n>>   #define __UAPI_MALI_C55_CONFIG_H\n>>   \n>>   #include <linux/types.h>\n>> +#include <linux/v4l2-controls.h>\n>> +\n>> +#include <linux/media/v4l2-isp.h>\n>> +\n>> +#define V4L2_CID_MALI_C55_CAPABILITIES\t(V4L2_CID_USER_MALI_C55_BASE + 0x0)\n>> +#define MALI_C55_GPS_PONG\t\t(1U << 0)\n>> +#define MALI_C55_GPS_WDR\t\t(1U << 1)\n>> +#define MALI_C55_GPS_COMPRESSION\t(1U << 2)\n>> +#define MALI_C55_GPS_TEMPER\t\t(1U << 3)\n>> +#define MALI_C55_GPS_SINTER_LITE\t(1U << 4)\n>> +#define MALI_C55_GPS_SINTER\t\t(1U << 5)\n>> +#define MALI_C55_GPS_IRIDIX_LTM\t\t(1U << 6)\n>> +#define MALI_C55_GPS_IRIDIX_GTM\t\t(1U << 7)\n>> +#define MALI_C55_GPS_CNR\t\t(1U << 8)\n>> +#define MALI_C55_GPS_FRSCALER\t\t(1U << 9)\n>> +#define MALI_C55_GPS_DS_PIPE\t\t(1U << 10)\n>>   \n>>   /*\n>>    * Frames are split into zones of almost equal width and height - a zone is a\n>> @@ -228,65 +244,6 @@ enum mali_c55_param_block_type {\n>>   \tMALI_C55_PARAM_MESH_SHADING_SELECTION,\n>>   };\n>>   \n>> -#define MALI_C55_PARAM_BLOCK_FL_NONE\t\t\t0\n>> -#define MALI_C55_PARAM_BLOCK_FL_DISABLED\t\tBIT(0)\n>> -\n>> -/**\n>> - * struct mali_c55_params_block_header - Mali-C55 parameter block header\n>> - *\n>> - * This structure represents the common part of all the ISP configuration\n>> - * blocks. Each parameters block embeds an instance of this structure type\n>> - * as its first member, followed by the block-specific configuration data. The\n>> - * driver inspects this common header to discern the block type and its size and\n>> - * properly handle the block content by casting it to the correct block-specific\n>> - * type.\n>> - *\n>> - * The @type field is one of the values enumerated by\n>> - * :c:type:`mali_c55_param_block_type` and specifies how the data should be\n>> - * interpreted by the driver. The @size field specifies the size of the\n>> - * parameters block and is used by the driver for validation purposes. The\n>> - * @flags field holds a bitmask of per-block flags MALI_C55_PARAM_BLOCK_FL_*.\n>> - *\n>> - * If userspace wants to disable an ISP block the\n>> - * MALI_C55_PARAM_BLOCK_FL_DISABLED bit should be set in the @flags field. In\n>> - * that case userspace may optionally omit the remainder of the configuration\n>> - * block, which will in any case be ignored by the driver. If a new\n>> - * configuration of an ISP block has to be applied userspace shall fully\n>> - * populate the ISP block and omit setting the MALI_C55_PARAM_BLOCK_FL_DISABLED\n>> - * bit in the @flags field.\n>> - *\n>> - * Userspace is responsible for correctly populating the parameters block header\n>> - * fields (@type, @flags and @size) and correctly populate the block-specific\n>> - * parameters.\n>> - *\n>> - * For example:\n>> - *\n>> - * .. code-block:: c\n>> - *\n>> - *\tvoid populate_sensor_offs(struct mali_c55_params_block_header *block) {\n>> - *\t\tblock->type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;\n>> - *\t\tblock->enabled = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> - *\t\tblock->size = sizeof(struct mali_c55_params_sensor_off_preshading);\n>> - *\n>> - *\t\tstruct mali_c55_params_sensor_off_preshading *sensor_offs =\n>> - *\t\t\t(struct mali_c55_params_sensor_off_preshading *)block;\n>> - *\n>> - *\t\tsensor_offs->chan00 = offset00;\n>> - *\t\tsensor_offs->chan01 = offset01;\n>> - *\t\tsensor_offs->chan10 = offset10;\n>> - *\t\tsensor_offs->chan11 = offset11;\n>> - *\t}\n>> - *\n>> - * @type: The parameters block type from :c:type:`mali_c55_param_block_type`\n>> - * @flags: Bitmask of block flags\n>> - * @size: Size (in bytes) of the parameters block\n>> - */\n>> -struct mali_c55_params_block_header {\n>> -\t__u16 type;\n>> -\t__u16 flags;\n>> -\t__u32 size;\n>> -} __attribute__((aligned(8)));\n>> -\n>>   /**\n>>    * struct mali_c55_params_sensor_off_preshading - offset subtraction for each\n>>    *\t\t\t\t\t\t  color channel\n>> @@ -305,7 +262,7 @@ struct mali_c55_params_block_header {\n>>    * @chan11: Offset for color channel 11 (default: B)\n>>    */\n>>   struct mali_c55_params_sensor_off_preshading {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u32 chan00;\n>>   \t__u32 chan01;\n>>   \t__u32 chan10;\n>> @@ -470,7 +427,7 @@ enum mali_c55_aexp_hist_plane_mode {\n>>    *\t\t\tThis parameter is unused for the post-Iridix Histogram\n>>    */\n>>   struct mali_c55_params_aexp_hist {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u8 skip_x;\n>>   \t__u8 offset_x;\n>>   \t__u8 skip_y;\n>> @@ -502,7 +459,7 @@ struct mali_c55_params_aexp_hist {\n>>    *\t\t\t@nodes_used_horiz\n>>    */\n>>   struct mali_c55_params_aexp_weights {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u8 nodes_used_horiz;\n>>   \t__u8 nodes_used_vert;\n>>   \t__u8 zone_weights[MALI_C55_MAX_ZONES];\n>> @@ -520,7 +477,7 @@ struct mali_c55_params_aexp_weights {\n>>    * @gain:\tThe digital gain value to apply, in Q5.8 format.\n>>    */\n>>   struct mali_c55_params_digital_gain {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u16 gain;\n>>   };\n>>   \n>> @@ -560,7 +517,7 @@ enum mali_c55_awb_stats_mode {\n>>    * @gain11:\tMultiplier for colour channel 11\n>>    */\n>>   struct mali_c55_params_awb_gains {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u16 gain00;\n>>   \t__u16 gain01;\n>>   \t__u16 gain10;\n>> @@ -635,7 +592,7 @@ enum mali_c55_params_awb_tap_points {\n>>    * @cb_low:\t\tB/G ratio trim low (Q4.8 format)\n>>    */\n>>   struct mali_c55_params_awb_config {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u8 tap_point;\n>>   \t__u8 stats_mode;\n>>   \t__u16 white_level;\n>> @@ -745,7 +702,7 @@ struct mali_c55_params_awb_config {\n>>    * @mesh:\t\tMesh shading correction tables\n>>    */\n>>   struct mali_c55_params_mesh_shading_config {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u8 mesh_show;\n>>   \t__u8 mesh_scale;\n>>   \t__u8 mesh_page_r;\n>> @@ -800,7 +757,7 @@ enum mali_c55_params_mesh_alpha_bank {\n>>    * @mesh_strength:\tMesh strength in Q4.12 format [0..4096]\n>>    */\n>>   struct mali_c55_params_mesh_shading_selection {\n>> -\tstruct mali_c55_params_block_header header;\n>> +\tstruct v4l2_params_block_header header;\n>>   \t__u8 mesh_alpha_bank_r;\n>>   \t__u8 mesh_alpha_bank_g;\n>>   \t__u8 mesh_alpha_bank_b;\n>> @@ -835,75 +792,4 @@ struct mali_c55_params_mesh_shading_selection {\n>>   \tsizeof(struct mali_c55_params_mesh_shading_config) +\t\\\n>>   \tsizeof(struct mali_c55_params_mesh_shading_selection))\n>>   \n>> -/**\n>> - * struct mali_c55_params_buffer - 3A configuration parameters\n>> - *\n>> - * This struct contains the configuration parameters of the Mali-C55 ISP\n>> - * algorithms, serialized by userspace into a data buffer. Each configuration\n>> - * parameter block is represented by a block-specific structure which contains a\n>> - * :c:type:`mali_c55_params_block_header` entry as first member. Userspace\n>> - * populates the @data buffer with configuration parameters for the blocks that\n>> - * it intends to configure. As a consequence, the data buffer effective size\n>> - * changes according to the number of ISP blocks that userspace intends to\n>> - * configure.\n>> - *\n>> - * The parameters buffer is versioned by the @version field to allow modifying\n>> - * and extending its definition. Userspace shall populate the @version field to\n>> - * inform the driver about the version it intends to use. The driver will parse\n>> - * and handle the @data buffer according to the data layout specific to the\n>> - * indicated version and return an error if the desired version is not\n>> - * supported.\n>> - *\n>> - * For each ISP block that userspace wants to configure, a block-specific\n>> - * structure is appended to the @data buffer, one after the other without gaps\n>> - * in between nor overlaps. Userspace shall populate the @total_size field with\n>> - * the effective size, in bytes, of the @data buffer.\n>> - *\n>> - * The expected memory layout of the parameters buffer is::\n>> - *\n>> - *\t+-------------------- struct mali_c55_params_buffer ------------------+\n>> - *\t| version = MALI_C55_PARAM_BUFFER_V1;                                 |\n>> - *\t| total_size = sizeof(struct mali_c55_params_sensor_off_preshading)   |\n>> - *\t|              sizeof(struct mali_c55_params_aexp_hist);              |\n>> - *\t| +------------------------- data  ---------------------------------+ |\n>> - *\t| | +--------- struct mali_c55_params_sensor_off_preshading ------+ | |\n>> - *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n>> - *\t| | | | type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;                | | | |\n>> - *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n>> - *\t| | | | size =                                                  | | | |\n>> - *\t| | | |    sizeof(struct mali_c55_params_sensor_off_preshading);| | | |\n>> - *\t| | | +---------------------------------------------------------+ | | |\n>> - *\t| | | chan00 = ...;                                               | | |\n>> - *\t| | | chan01 = ...;                                               | | |\n>> - *\t| | | chan10 = ...;                                               | | |\n>> - *\t| | | chan11 = ...;                                               | | |\n>> - *\t| | +------------ struct mali_c55_params_aexp_hist ---------------+ | |\n>> - *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n>> - *\t| | | | type = MALI_C55_PARAM_BLOCK_AEXP_HIST;                  | | | |\n>> - *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n>> - *\t| | | | size = sizeof(struct mali_c55_params_aexp_hist);        | | | |\n>> - *\t| | | +---------------------------------------------------------+ | | |\n>> - *\t| | | skip_x = ...;                                               | | |\n>> - *\t| | | offset_x = ...;                                             | | |\n>> - *\t| | | skip_y = ...;                                               | | |\n>> - *\t| | | offset_y = ...;                                             | | |\n>> - *\t| | | scale_bottom = ...;                                         | | |\n>> - *\t| | | scale_top = ...;                                            | | |\n>> - *\t| | | plane_mode = ...;                                           | | |\n>> - *\t| | | tap_point = ...;                                            | | |\n>> - *\t| | +-------------------------------------------------------------+ | |\n>> - *\t| +-----------------------------------------------------------------+ |\n>> - *\t+---------------------------------------------------------------------+\n>> - *\n>> - * @version: The version from :c:type:`mali_c55_param_buffer_version`\n>> - * @total_size: The Mali-C55 configuration data effective size, excluding this\n>> - *\t\theader\n>> - * @data: The Mali-C55 configuration blocks data\n>> - */\n>> -struct mali_c55_params_buffer {\n>> -\t__u8 version;\n>> -\t__u32 total_size;\n>> -\t__u8 data[MALI_C55_PARAMS_MAX_SIZE];\n>> -};\n>> -\n>>   #endif /* __UAPI_MALI_C55_CONFIG_H */\n>> diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\n>> index f60fddac3f04fd6f09dc782e929ff1593758c29b..da47cf15be49327a592e850817f2863ab62cb404 100644\n>> --- a/src/ipa/mali-c55/algorithms/agc.cpp\n>> +++ b/src/ipa/mali-c55/algorithms/agc.cpp\n>> @@ -253,7 +253,7 @@ size_t Agc::fillGainParamBlock(IPAContext &context, IPAFrameContext &frameContex\n>>   \t\tgain = activeState.agc.manual.ispGain;\n>>   \n>>   \tblock.header->type = MALI_C55_PARAM_BLOCK_DIGITAL_GAIN;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_digital_gain);\n>>   \n>>   \tblock.digital_gain->gain = floatingToFixedPoint<5, 8, uint16_t, double>(gain);\n>> @@ -266,7 +266,7 @@ size_t Agc::fillParamsBuffer(mali_c55_params_block block,\n>>   \t\t\t     enum mali_c55_param_block_type type)\n>>   {\n>>   \tblock.header->type = type;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_aexp_hist);\n>>   \n>>   \t/* Collect every 3rd pixel horizontally */\n>> @@ -292,7 +292,7 @@ size_t Agc::fillWeightsArrayBuffer(mali_c55_params_block block,\n>>   \t\t\t\t   enum mali_c55_param_block_type type)\n>>   {\n>>   \tblock.header->type = type;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_aexp_weights);\n>>   \n>>   \t/* We use every zone - a 15x15 grid */\n>> @@ -314,30 +314,30 @@ size_t Agc::fillWeightsArrayBuffer(mali_c55_params_block block,\n>>   }\n>>   \n>>   void Agc::prepare(IPAContext &context, const uint32_t frame,\n>> -\t\t  IPAFrameContext &frameContext, mali_c55_params_buffer *params)\n>> +\t\t  IPAFrameContext &frameContext, v4l2_params_buffer *params)\n>>   {\n>>   \tmali_c55_params_block block;\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillGainParamBlock(context, frameContext, block);\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillGainParamBlock(context, frameContext, block);\n>>   \n>>   \tif (frame > 0)\n>>   \t\treturn;\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillParamsBuffer(block,\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillParamsBuffer(block,\n>>   \t\t\t\t\t       MALI_C55_PARAM_BLOCK_AEXP_HIST);\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillWeightsArrayBuffer(block,\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillWeightsArrayBuffer(block,\n>>   \t\t\t\t\t\t     MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS);\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillParamsBuffer(block,\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillParamsBuffer(block,\n>>   \t\t\t\t\t       MALI_C55_PARAM_BLOCK_AEXP_IHIST);\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillWeightsArrayBuffer(block,\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillWeightsArrayBuffer(block,\n>>   \t\t\t\t\t\t     MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS);\n>>   }\n>>   \n>> diff --git a/src/ipa/mali-c55/algorithms/agc.h b/src/ipa/mali-c55/algorithms/agc.h\n>> index 0b4bf7eda1c2a7c9894f6932452fea5f53699b30..64caf99350c1d1835832311a94a88a2bfde5721c 100644\n>> --- a/src/ipa/mali-c55/algorithms/agc.h\n>> +++ b/src/ipa/mali-c55/algorithms/agc.h\n>> @@ -57,7 +57,7 @@ public:\n>>   \t\t\t  const ControlList &controls) override;\n>>   \tvoid prepare(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>> -\t\t     mali_c55_params_buffer *params) override;\n>> +\t\t     v4l2_params_buffer *params) override;\n>>   \tvoid process(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>>   \t\t     const mali_c55_stats_buffer *stats,\n>> diff --git a/src/ipa/mali-c55/algorithms/algorithm.h b/src/ipa/mali-c55/algorithms/algorithm.h\n>> index ec8dd3973eaf2d804d8de8620840f716340e9cfd..c28789f6a619cf7fc05ffb705098ed8d1fac93b8 100644\n>> --- a/src/ipa/mali-c55/algorithms/algorithm.h\n>> +++ b/src/ipa/mali-c55/algorithms/algorithm.h\n>> @@ -22,7 +22,7 @@ class Algorithm : public libcamera::ipa::Algorithm<Module>\n>>   };\n>>   \n>>   union mali_c55_params_block {\n>> -\tstruct mali_c55_params_block_header *header;\n>> +\tstruct v4l2_params_block_header *header;\n>>   \tstruct mali_c55_params_sensor_off_preshading *sensor_offs;\n>>   \tstruct mali_c55_params_aexp_hist *aexp_hist;\n>>   \tstruct mali_c55_params_aexp_weights *aexp_weights;\n>> diff --git a/src/ipa/mali-c55/algorithms/awb.cpp b/src/ipa/mali-c55/algorithms/awb.cpp\n>> index 3d546e5a854b8aa02987c44f57109a6171e3794b..6b2cbed9de1ebfe9a2466ebe999eceac44fe5deb 100644\n>> --- a/src/ipa/mali-c55/algorithms/awb.cpp\n>> +++ b/src/ipa/mali-c55/algorithms/awb.cpp\n>> @@ -47,7 +47,7 @@ size_t Awb::fillGainsParamBlock(mali_c55_params_block block, IPAContext &context\n>>   \t\t\t\tIPAFrameContext &frameContext)\n>>   {\n>>   \tblock.header->type = MALI_C55_PARAM_BLOCK_AWB_GAINS;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_awb_gains);\n>>   \n>>   \tdouble rGain = context.activeState.awb.rGain;\n>> @@ -77,7 +77,7 @@ size_t Awb::fillGainsParamBlock(mali_c55_params_block block, IPAContext &context\n>>   size_t Awb::fillConfigParamBlock(mali_c55_params_block block)\n>>   {\n>>   \tblock.header->type = MALI_C55_PARAM_BLOCK_AWB_CONFIG;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_awb_config);\n>>   \n>>   \t/* Tap the stats after the purple fringe block */\n>> @@ -126,18 +126,18 @@ size_t Awb::fillConfigParamBlock(mali_c55_params_block block)\n>>   }\n>>   \n>>   void Awb::prepare(IPAContext &context, const uint32_t frame,\n>> -\t\t  IPAFrameContext &frameContext, mali_c55_params_buffer *params)\n>> +\t\t  IPAFrameContext &frameContext, v4l2_params_buffer *params)\n>>   {\n>>   \tmali_c55_params_block block;\n>> -\tblock.data = &params->data[params->total_size];\n>> +\tblock.data = &params->data[params->data_size];\n>>   \n>> -\tparams->total_size += fillGainsParamBlock(block, context, frameContext);\n>> +\tparams->data_size += fillGainsParamBlock(block, context, frameContext);\n>>   \n>>   \tif (frame > 0)\n>>   \t\treturn;\n>>   \n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillConfigParamBlock(block);\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillConfigParamBlock(block);\n>>   }\n>>   \n>>   void Awb::process(IPAContext &context, const uint32_t frame,\n>> diff --git a/src/ipa/mali-c55/algorithms/awb.h b/src/ipa/mali-c55/algorithms/awb.h\n>> index 2351d405553058dbff569e9e09e265a56baaa23f..b5ff121041d1a01e3a51d64b87a90fb2e1d8dd10 100644\n>> --- a/src/ipa/mali-c55/algorithms/awb.h\n>> +++ b/src/ipa/mali-c55/algorithms/awb.h\n>> @@ -22,7 +22,7 @@ public:\n>>   \t\t      const IPACameraSensorInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>> -\t\t     mali_c55_params_buffer *params) override;\n>> +\t\t     v4l2_params_buffer *params) override;\n>>   \tvoid process(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>>   \t\t     const mali_c55_stats_buffer *stats,\n>> diff --git a/src/ipa/mali-c55/algorithms/blc.cpp b/src/ipa/mali-c55/algorithms/blc.cpp\n>> index 2a54c86a91f83d24183cb7236fcd5181302eb622..8fd0f10c3082030a36a256830042d733ed4c8c78 100644\n>> --- a/src/ipa/mali-c55/algorithms/blc.cpp\n>> +++ b/src/ipa/mali-c55/algorithms/blc.cpp\n>> @@ -85,10 +85,10 @@ int BlackLevelCorrection::configure(IPAContext &context,\n>>   void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>>   \t\t\t\t   const uint32_t frame,\n>>   \t\t\t\t   [[maybe_unused]] IPAFrameContext &frameContext,\n>> -\t\t\t\t   mali_c55_params_buffer *params)\n>> +\t\t\t\t   v4l2_params_buffer *params)\n>>   {\n>>   \tmali_c55_params_block block;\n>> -\tblock.data = &params->data[params->total_size];\n>> +\tblock.data = &params->data[params->data_size];\n>>   \n>>   \tif (frame > 0)\n>>   \t\treturn;\n>> @@ -97,7 +97,7 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>>   \t\treturn;\n>>   \n>>   \tblock.header->type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(mali_c55_params_sensor_off_preshading);\n>>   \n>>   \tblock.sensor_offs->chan00 = offset00;\n>> @@ -105,7 +105,7 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n>>   \tblock.sensor_offs->chan10 = offset10;\n>>   \tblock.sensor_offs->chan11 = offset11;\n>>   \n>> -\tparams->total_size += block.header->size;\n>> +\tparams->data_size += block.header->size;\n>>   }\n>>   \n>>   void BlackLevelCorrection::process([[maybe_unused]] IPAContext &context,\n>> diff --git a/src/ipa/mali-c55/algorithms/blc.h b/src/ipa/mali-c55/algorithms/blc.h\n>> index 9696e8e9f2aa8b9076a3a41fb8f5ea356e32be12..cf10505ce2908df0d5e658d3fdce663729c7ea76 100644\n>> --- a/src/ipa/mali-c55/algorithms/blc.h\n>> +++ b/src/ipa/mali-c55/algorithms/blc.h\n>> @@ -22,7 +22,7 @@ public:\n>>   \t\t      const IPACameraSensorInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>> -\t\t     mali_c55_params_buffer *params) override;\n>> +\t\t     v4l2_params_buffer *params) override;\n>>   \tvoid process(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>>   \t\t     const mali_c55_stats_buffer *stats,\n>> diff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\n>> index c43d034a181edb7559706189f8d75edd67a2dc08..35f1d876e60db252a45cadb771e541735749d106 100644\n>> --- a/src/ipa/mali-c55/algorithms/lsc.cpp\n>> +++ b/src/ipa/mali-c55/algorithms/lsc.cpp\n>> @@ -111,7 +111,7 @@ int Lsc::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n>>   size_t Lsc::fillConfigParamsBlock(mali_c55_params_block block) const\n>>   {\n>>   \tblock.header->type = MALI_C55_PARAM_MESH_SHADING_CONFIG;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_mesh_shading_config);\n>>   \n>>   \tblock.shading_config->mesh_show = false;\n>> @@ -131,7 +131,7 @@ size_t Lsc::fillSelectionParamsBlock(mali_c55_params_block block, uint8_t bank,\n>>   \t\t\t\t     uint8_t alpha) const\n>>   {\n>>   \tblock.header->type = MALI_C55_PARAM_MESH_SHADING_SELECTION;\n>> -\tblock.header->flags = MALI_C55_PARAM_BLOCK_FL_NONE;\n>> +\tblock.header->flags = 0;\n>>   \tblock.header->size = sizeof(struct mali_c55_params_mesh_shading_selection);\n>>   \n>>   \tblock.shading_selection->mesh_alpha_bank_r = bank;\n>> @@ -170,7 +170,7 @@ std::tuple<uint8_t, uint8_t> Lsc::findBankAndAlpha(uint32_t ct) const\n>>   \n>>   void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>>   \t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n>> -\t\t  mali_c55_params_buffer *params)\n>> +\t\t  v4l2_params_buffer *params)\n>>   {\n>>   \t/*\n>>   \t * For each frame we assess the colour temperature of the **last** frame\n>> @@ -194,9 +194,9 @@ void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>>   \t}\n>>   \n>>   \tmali_c55_params_block block;\n>> -\tblock.data = &params->data[params->total_size];\n>> +\tblock.data = &params->data[params->data_size];\n>>   \n>> -\tparams->total_size += fillSelectionParamsBlock(block, bank, alpha);\n>> +\tparams->data_size += fillSelectionParamsBlock(block, bank, alpha);\n>>   \n>>   \tif (frame > 0)\n>>   \t\treturn;\n>> @@ -205,8 +205,8 @@ void Lsc::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>>   \t * If this is the first frame, we need to load the parsed coefficient\n>>   \t * tables from tuning data to the ISP.\n>>   \t */\n>> -\tblock.data = &params->data[params->total_size];\n>> -\tparams->total_size += fillConfigParamsBlock(block);\n>> +\tblock.data = &params->data[params->data_size];\n>> +\tparams->data_size += fillConfigParamsBlock(block);\n>>   }\n>>   \n>>   REGISTER_IPA_ALGORITHM(Lsc, \"Lsc\")\n>> diff --git a/src/ipa/mali-c55/algorithms/lsc.h b/src/ipa/mali-c55/algorithms/lsc.h\n>> index d11e23bc7c34fa3e1f45ccf015b50f3d390d7159..9019a61aa547e41154615eba88547d3eee1634e2 100644\n>> --- a/src/ipa/mali-c55/algorithms/lsc.h\n>> +++ b/src/ipa/mali-c55/algorithms/lsc.h\n>> @@ -23,7 +23,7 @@ public:\n>>   \tint init(IPAContext &context, const YamlObject &tuningData) override;\n>>   \tvoid prepare(IPAContext &context, const uint32_t frame,\n>>   \t\t     IPAFrameContext &frameContext,\n>> -\t\t     mali_c55_params_buffer *params) override;\n>> +\t\t     v4l2_params_buffer *params) override;\n>>   private:\n>>   \tstatic constexpr unsigned int kRedOffset = 0;\n>>   \tstatic constexpr unsigned int kGreenOffset = 1024;\n>> diff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\n>> index 7d45e7310aecdae0e47655e6d2e8830e776d74cd..a6d3e984a438c01509ed27469d9f20c25bc884cf 100644\n>> --- a/src/ipa/mali-c55/mali-c55.cpp\n>> +++ b/src/ipa/mali-c55/mali-c55.cpp\n>> @@ -331,22 +331,22 @@ void IPAMaliC55::queueRequest(const uint32_t request, const ControlList &control\n>>   void IPAMaliC55::fillParams(unsigned int request,\n>>   \t\t\t    [[maybe_unused]] uint32_t bufferId)\n>>   {\n>> -\tstruct mali_c55_params_buffer *params;\n>> +\tstruct v4l2_params_buffer *params;\n>>   \tIPAFrameContext &frameContext = context_.frameContexts.get(request);\n>>   \n>> -\tparams = reinterpret_cast<mali_c55_params_buffer *>(\n>> +\tparams = reinterpret_cast<v4l2_params_buffer *>(\n>>   \t\tbuffers_.at(bufferId).planes()[0].data());\n>> -\tmemset(params, 0, sizeof(mali_c55_params_buffer));\n>> +\tmemset(params, 0, sizeof(v4l2_params_buffer));\n> \n> That's a change in behaviour, it used to memset the whole data area, not\n> it only clears the header.\n\nThis is the kind of use-case that the v4l2_params_buffer_size() macro was intended to help with.\n\nThanks\nDan\n\n> \n>>   \n>>   \tparams->version = MALI_C55_PARAM_BUFFER_V1;\n>>   \n>>   \tfor (auto const &algo : algorithms()) {\n>>   \t\talgo->prepare(context_, request, frameContext, params);\n>>   \n>> -\t\tASSERT(params->total_size <= MALI_C55_PARAMS_MAX_SIZE);\n>> +\t\tASSERT(params->data_size <= MALI_C55_PARAMS_MAX_SIZE);\n>>   \t}\n>>   \n>> -\tsize_t bytesused = offsetof(struct mali_c55_params_buffer, data) + params->total_size;\n>> +\tsize_t bytesused = offsetof(struct v4l2_params_buffer, data) + params->data_size;\n>>   \tparamsComputed.emit(request, bytesused);\n>>   }\n>>   \n>> diff --git a/src/ipa/mali-c55/module.h b/src/ipa/mali-c55/module.h\n>> index 4f6a4f18bfaf83263ccb5b7eb1723da9b655cc3c..434d2c585d2f4eb03402c57e87302fc82e82a0f0 100644\n>> --- a/src/ipa/mali-c55/module.h\n>> +++ b/src/ipa/mali-c55/module.h\n>> @@ -20,7 +20,7 @@ namespace libcamera {\n>>   namespace ipa::mali_c55 {\n>>   \n>>   using Module = ipa::Module<IPAContext, IPAFrameContext, IPACameraSensorInfo,\n>> -\t\t\t   mali_c55_params_buffer, mali_c55_stats_buffer>;\n>> +\t\t\t   v4l2_params_buffer, mali_c55_stats_buffer>;\n>>   \n>>   } /* namespace ipa::mali_c55 */\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 32D27BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Oct 2025 08:22:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D460D62C35;\n\tMon,  6 Oct 2025 10:22:23 +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 AE79362C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 10:22:21 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B7282273\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 10:20:49 +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=\"CTqNb9hf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759738849;\n\tbh=2jLF1nMFO7ijsjK/jS7QBOKihflI20bxRF/EMVd7UT8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=CTqNb9hfdM6fheG4Q7CQJ8MygHzy9FcX7+UDZ+igxHB8OcKB1MFO0R4jFy9Wz8CwX\n\tw1yMCMQCnU9aw0pDMujaKas1o94tL6r5tvYBOi3dpBJDq71I3N5l+2eaP0UPjgWyoK\n\t+khNJ14sFt2Ee03g21FVf7YWg06sUSFN2/oLLo4I=","Message-ID":"<4a786a54-c942-4032-b705-9ba2b0f50341@ideasonboard.com>","Date":"Mon, 6 Oct 2025 09:22:18 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 3/5] ipa: Update Mali C55 header file and adjust IPA","To":"libcamera-devel@lists.libcamera.org","References":"<20251001-v4l2-params-v4-0-8f2b4779205e@ideasonboard.com>\n\t<20251001-v4l2-params-v4-3-8f2b4779205e@ideasonboard.com>\n\t<20251006014121.GG13055@pendragon.ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","In-Reply-To":"<20251006014121.GG13055@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]