{"id":25563,"url":"https://patchwork.libcamera.org/api/1.1/patches/25563/?format=json","web_url":"https://patchwork.libcamera.org/patch/25563/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251215-v4l2-params-v7-3-be2b8c75ad09@ideasonboard.com>","date":"2025-12-15T15:11:23","name":"[v7,3/5] ipa: mali-c55: Update header file and adjust IPA","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"11bd6e0dabd6884413286de38779ae2d626164de","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/1.1/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25563/mbox/","series":[{"id":5665,"url":"https://patchwork.libcamera.org/api/1.1/series/5665/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5665","date":"2025-12-15T15:11:20","name":"ipa: libipa: Introduce V4L2Params","version":7,"mbox":"https://patchwork.libcamera.org/series/5665/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25563/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25563/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 085A6C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 Dec 2025 15:11:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1147F619E4;\n\tMon, 15 Dec 2025 16:11:45 +0100 (CET)","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 D4E6D615B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Dec 2025 16:11:40 +0100 (CET)","from [192.168.0.172] (mob-5-90-49-39.net.vodafone.it [5.90.49.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B7B0F165B; \n\tMon, 15 Dec 2025 16:11:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NBQIyuVC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765811495;\n\tbh=kscUuhqGV+ekncMjccKslZcem/9EFkh68uL5PqhgnR0=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=NBQIyuVCilZUYKMZKs/hv17fxV/C5A1uzf4tuiSNH+R64hkpzvAKENVmIyzZ/9EKh\n\t17dCpIkLoT8CL2uDnQgYcRFWSEgb/TsGOxL6gDWI5mJ6VFzzdq7t+inBKkF0+O3tJU\n\tp+xFsSdiMS9nmjQLLRrpH24Y9C6rzy8xzb/x9iG4=","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Date":"Mon, 15 Dec 2025 16:11:23 +0100","Subject":"[PATCH v7 3/5] ipa: mali-c55: Update header file and adjust IPA","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20251215-v4l2-params-v7-3-be2b8c75ad09@ideasonboard.com>","References":"<20251215-v4l2-params-v7-0-be2b8c75ad09@ideasonboard.com>","In-Reply-To":"<20251215-v4l2-params-v7-0-be2b8c75ad09@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tAntoine Bouyer <antoine.bouyer@nxp.com>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tDaniel Scally <dan.scally@ideasonboard.com>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=openpgp-sha256; l=27013;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=kscUuhqGV+ekncMjccKslZcem/9EFkh68uL5PqhgnR0=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpQCUnKL/T3SrG39cLe8zDoN/FQTHFjXP8IYF3Y\n\tysz2M/UdoWJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaUAlJwAKCRByNAaPFqFW\n\tPMYQEACUsYTfUnR+7NEd4dkq/hCq9iG4YlKB9ny3aqfvuhijNnTcAnAB032RfaevCPalXkzQARY\n\tkUI/J8Xb94HoTweMoeroFwW8CMgj2k4yOUhrvdlKmOUEC0KdQosnnWDOrObT75B4orEyqaPEj3f\n\tzdWCSN5ibc1ZO+aBJn59sTNjLCnOr0Gk161sHGqVeG5Ud68JIkzb9W0dCTLxSZyr7fOOoI2lEM2\n\th7ItKVqz6bqSj8EJZ8Wzh+3nRAF5eTmYYMFW/pIK7bDWLoVUfYQ9WDgtF1pABrU240NjCGHxD6T\n\t7ftS2s8gtlFmNHQTJ4hfE7VEiU54+xY9UB1/wByucwKaPWobbze3iOVJ7epYtyzrlv8iP4YKGYk\n\tV3vzDKxjeSminPibvaXyCaxKs4cl8AIh9xuLMrd9C8zEL45jGytXVqdDpN9dNSlIxdkjU8PjmuH\n\tAEAW3y8cNVLn/l0D2lyjvcjCFxVZ04ewgyFMkrHRJxpToOzcJ+HPClpp//hZEaxfLk7mm4d0GE7\n\tVKfw5QrU8ngC4Wrzk/qCPXiAO3AwXONJ4rWpqwBZChE5TRtG9fWYsDOguDjDZbsf5Hb1Wb32Wny\n\tkbC8sOM645pSBT/E15+ySy0895lZcvqi8akVksWXc0rt6/ruO6Y5dRmreDCDgy+z304RCidg5n4\n\tPeMfctwmpC3qBbw==","X-Developer-Key":"i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B","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>"},"content":"Update Mali C55 header file to the version merged in Linux v6.19-rc1 at\nrevision 08a99369f44e (\"media: uapi: Add parameters structs to\nmali-c55-config.h\") with applied on top the in-review patch:\nhttps://lore.kernel.org/all/20251215-mali-c55-header-update-for-v6-19-rc1-v1-3-69f56dee3c71@ideasonboard.com/\n\nAdjust the IPA module to use the new header version which uses the\nv4l2-isp framework.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nTested-by: Antoine Bouyer <antoine.bouyer@nxp.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n include/linux/mali-c55-config.h         | 170 +++++---------------------------\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           |  13 +--\n src/ipa/mali-c55/module.h               |   2 +-\n 12 files changed, 68 insertions(+), 191 deletions(-)","diff":"diff --git a/include/linux/mali-c55-config.h b/include/linux/mali-c55-config.h\nindex b31415597e886496b65f8fb396c095618467f1ac..3d335f950eeb1e58ed3cbb556752996f16441e55 100644\n--- a/include/linux/mali-c55-config.h\n+++ b/include/linux/mali-c55-config.h\n@@ -9,6 +9,21 @@\n #define __UAPI_MALI_C55_CONFIG_H\n \n #include <linux/types.h>\n+#include <linux/v4l2-controls.h>\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@@ -179,15 +194,6 @@ struct mali_c55_stats_buffer {\n \t__u32 reserved3[15];\n } __attribute__((packed));\n \n-/**\n- * enum mali_c55_param_buffer_version - Mali-C55 parameters block versioning\n- *\n- * @MALI_C55_PARAM_BUFFER_V1: First version of Mali-C55 parameters block\n- */\n-enum mali_c55_param_buffer_version {\n-\tMALI_C55_PARAM_BUFFER_V1,\n-};\n-\n /**\n  * enum mali_c55_param_block_type - Enumeration of Mali-C55 parameter blocks\n  *\n@@ -228,65 +234,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 +252,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_isp_params_block_header header;\n \t__u32 chan00;\n \t__u32 chan01;\n \t__u32 chan10;\n@@ -470,7 +417,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_isp_params_block_header header;\n \t__u8 skip_x;\n \t__u8 offset_x;\n \t__u8 skip_y;\n@@ -502,7 +449,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_isp_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 +467,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_isp_params_block_header header;\n \t__u16 gain;\n };\n \n@@ -560,7 +507,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_isp_params_block_header header;\n \t__u16 gain00;\n \t__u16 gain01;\n \t__u16 gain10;\n@@ -635,7 +582,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_isp_params_block_header header;\n \t__u8 tap_point;\n \t__u8 stats_mode;\n \t__u16 white_level;\n@@ -745,7 +692,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_isp_params_block_header header;\n \t__u8 mesh_show;\n \t__u8 mesh_scale;\n \t__u8 mesh_page_r;\n@@ -800,7 +747,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_isp_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 +782,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 */\ndiff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\nindex f60fddac3f04fd6f09dc782e929ff1593758c29b..78e7e07b2348a711e6261bac45e006f49a59513a 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_isp_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 \ndiff --git a/src/ipa/mali-c55/algorithms/agc.h b/src/ipa/mali-c55/algorithms/agc.h\nindex 0b4bf7eda1c2a7c9894f6932452fea5f53699b30..4325ef5a9b7dcef36107b64a65db993f194d4167 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_isp_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,\ndiff --git a/src/ipa/mali-c55/algorithms/algorithm.h b/src/ipa/mali-c55/algorithms/algorithm.h\nindex ec8dd3973eaf2d804d8de8620840f716340e9cfd..e61115f6c2d6c911c15a1d877833d3f2b06a0db8 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_isp_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;\ndiff --git a/src/ipa/mali-c55/algorithms/awb.cpp b/src/ipa/mali-c55/algorithms/awb.cpp\nindex 3d546e5a854b8aa02987c44f57109a6171e3794b..694c0aaa9c6804bb58e380ba9c744f11c39224fe 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_isp_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,\ndiff --git a/src/ipa/mali-c55/algorithms/awb.h b/src/ipa/mali-c55/algorithms/awb.h\nindex 2351d405553058dbff569e9e09e265a56baaa23f..647525ff700e8281e3cce63e64ba56a91294bcc2 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_isp_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,\ndiff --git a/src/ipa/mali-c55/algorithms/blc.cpp b/src/ipa/mali-c55/algorithms/blc.cpp\nindex 2a54c86a91f83d24183cb7236fcd5181302eb622..543ba96cb57ac0cca2b8f822180d8d8b42f21fc7 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_isp_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,\ndiff --git a/src/ipa/mali-c55/algorithms/blc.h b/src/ipa/mali-c55/algorithms/blc.h\nindex 9696e8e9f2aa8b9076a3a41fb8f5ea356e32be12..ee6c889ed89ac2230b231cb58a9fe4412c0ce164 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_isp_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,\ndiff --git a/src/ipa/mali-c55/algorithms/lsc.cpp b/src/ipa/mali-c55/algorithms/lsc.cpp\nindex c43d034a181edb7559706189f8d75edd67a2dc08..cb915c5efd3c22952035f2b03ee659f293942ec9 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_isp_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\")\ndiff --git a/src/ipa/mali-c55/algorithms/lsc.h b/src/ipa/mali-c55/algorithms/lsc.h\nindex d11e23bc7c34fa3e1f45ccf015b50f3d390d7159..c287900502528ca82ab6c62d732b6ffc28ad8df6 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_isp_params_buffer *params) override;\n private:\n \tstatic constexpr unsigned int kRedOffset = 0;\n \tstatic constexpr unsigned int kGreenOffset = 1024;\ndiff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\nindex 4eaedabb47b8226f3cfef109836dfb978dae2ec9..3f56604a0488dc853800ad54a54378166d7a112b 100644\n--- a/src/ipa/mali-c55/mali-c55.cpp\n+++ b/src/ipa/mali-c55/mali-c55.cpp\n@@ -333,22 +333,23 @@ 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_isp_params_buffer *params;\n \tIPAFrameContext &frameContext = context_.frameContexts.get(request);\n \n-\tparams = reinterpret_cast<mali_c55_params_buffer *>(\n+\tparams = reinterpret_cast<v4l2_isp_params_buffer *>(\n \t\tbuffers_.at(bufferId).planes()[0].data());\n-\tmemset(params, 0, sizeof(mali_c55_params_buffer));\n+\tmemset(params, 0,\n+\t       buffers_.at(bufferId).planes()[0].size());\n \n-\tparams->version = MALI_C55_PARAM_BUFFER_V1;\n+\tparams->version = V4L2_ISP_PARAMS_VERSION_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_isp_params_buffer, data) + params->data_size;\n \tparamsComputed.emit(request, bytesused);\n }\n \ndiff --git a/src/ipa/mali-c55/module.h b/src/ipa/mali-c55/module.h\nindex 4f6a4f18bfaf83263ccb5b7eb1723da9b655cc3c..a8dcb20841a4ebd7bde22cae4ff1f8eef530d8bb 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_isp_params_buffer, mali_c55_stats_buffer>;\n \n } /* namespace ipa::mali_c55 */\n \n","prefixes":["v7","3/5"]}