[PATCH v13 15/15] Documentation: mali-c55: Document the mali-c55 parameter setting
Jacopo Mondi
jacopo.mondi at ideasonboard.com
Thu Nov 13 00:39:37 PST 2025
Hi Dan
On Tue, Nov 11, 2025 at 04:15:59PM +0000, Daniel Scally wrote:
> Document the mali-c55 parameter setting by expanding the relevant
> pages in both admin-guide/ and userspace-api/.
>
> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Acked-by: Nayden Kanchev <nayden.kanchev at arm.com>
> Co-developed-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
> Signed-off-by: Daniel Scally <dan.scally at ideasonboard.com>
> ---
> Changes in v12:
>
> - None
>
> Changes in v11:
>
> - Updated the documentation to account for the use of the
> V4L2 extensible params
>
> Changes in v10:
>
> - None
>
> Changes in v9:
>
> - None
>
> Changes in v8:
>
> - None
>
> Changes in v7:
>
> - None
>
> Changes in v7:
>
> - None
>
> Changes in v6:
>
> - Minor rewording
>
> Changes in v5:
>
> - New patch
> ---
> Documentation/admin-guide/media/mali-c55.rst | 19 ++++++-
> .../media/v4l/metafmt-arm-mali-c55.rst | 66 +++++++++++++++++++++-
> 2 files changed, 80 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/admin-guide/media/mali-c55.rst b/Documentation/admin-guide/media/mali-c55.rst
> index 03723e0e8e43f17a04ede0032b2ddbfdb859d1e3..315f982000c48e46a2be0e7210b657d5af611e14 100644
> --- a/Documentation/admin-guide/media/mali-c55.rst
> +++ b/Documentation/admin-guide/media/mali-c55.rst
> @@ -387,9 +387,24 @@ the processing flow the statistics can be drawn from::
> +-------------+ | +-------------+
> +--> AWB-1
>
> -At present all statistics are drawn from the 0th tap point for each algorithm;
> +By default all statistics are drawn from the 0th tap point for each algorithm;
> I.E. AEXP statistics from AEXP-0 (A), AWB statistics from AWB-0 and AF
> -statistics from AF-0. In the future this will be configurable.
> +statistics from AF-0. This is configurable for AEXP and AWB statsistics through
> +programming the ISP's parameters.
> +
> +.. _mali-c55-3a-params:
> +
> +Programming ISP Parameters
> +==========================
> +
> +The ISP can be programmed with various parameters from userspace to apply to the
> +hardware before and during video stream. This allows userspace to dynamically
> +change values such as black level, white balance and lens shading gains and so
> +on.
> +
> +The buffer format and how to populate it are described by the
> +:ref:`V4L2_META_FMT_MALI_C55_PARAMS <v4l2-meta-fmt-mali-c55-params>` format,
> +which should be set as the data format for the `mali-c55 3a params` video node.
>
> References
> ==========
> diff --git a/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst b/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst
> index 0bda9740a6be20df541ac7cf78e45e510f79ad19..49d6b8080ecec1013a93f5283a00a3fa0d7ebb17 100644
> --- a/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst
> +++ b/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst
> @@ -1,10 +1,11 @@
> .. SPDX-License-Identifier: GPL-2.0
>
> +.. _v4l2-meta-fmt-mali-c55-params:
> .. _v4l2-meta-fmt-mali-c55-stats:
>
> -*************************************
> -V4L2_META_FMT_MALI_C55_STATS ('C55S')
> -*************************************
> +*****************************************************************************
> +V4L2_META_FMT_MALI_C55_STATS ('C55S'), V4L2_META_FMT_MALI_C55_PARAMS ('C55P')
> +*****************************************************************************
>
> 3A Statistics
> =============
> @@ -23,6 +24,65 @@ of the C structure :c:type:`mali_c55_stats_buffer` defined in
>
> For details of the statistics see :c:type:`mali_c55_stats_buffer`.
>
> +Configuration Parameters
> +========================
> +
> +The configuration parameters are passed to the
> +:ref:`mali-c55 3a params <mali-c55-3a-params>` metadata output video node, using
> +the :c:type:`v4l2_meta_format` interface. Rather than a single struct containing
> +sub-structs for each configurable area of the ISP, parameters for the Mali-C55
> +use the V4L2 extensible parameters system, through which groups of parameters
> +are defined as distinct structs or "blocks" which may be added to the data
> +member of :c:type:`v4l2_params_buffer`. Userspace is responsible for populating
This should be updated to the latest v4l2-isp. I'll do so before
sending the PR. I've also shortened it to avoid repeating parts of the
v4l2-isp documentation to:
+Configuration Parameters
+========================
+
+The configuration parameters are passed to the :ref:`mali-c55 3a params
+<mali-c55-3a-params>` metadata output video node, using the
+:c:type:`v4l2_meta_format` interface. Rather than a single struct containing
+sub-structs for each configurable area of the ISP, parameters for the Mali-C55
+use the v4l2-isp parameters system, through which groups of parameters are
+defined as distinct structs or "blocks" which may be added to the data member of
+:c:type:`v4l2_isp_params_buffer`. Userspace is responsible for populating the
+data member with the blocks that need to be configured by the driver. Each
+block-specific struct embeds :c:type:`v4l2_isp_params_block_header` as its first
+member and userspace must populate the type member with a value from
+:c:type:`mali_c55_param_block_type`.
> +the data member with the blocks that need to be configured by the driver, but
> +need not populate it with **all** the blocks, or indeed with any at all if there
> +are no configuration changes to make. Populated blocks **must** be consecutive
> +in the buffer. To assist both userspace and the driver in identifying the
> +blocks each block-specific struct embeds :c:type:`v4l2_params_block_header` as
> +its first member and userspace must populate the type member with a value from
> +:c:type:`mali_c55_param_block_type`. Once the blocks have been populated
> +into the data buffer, the combined size of all populated blocks shall be set in
> +the data_size member of :c:type:`v4l2_params_buffer`. For example:
> +
> +.. code-block:: c
> +
> + struct v4l2_params_buffer *params =
> + (struct v4l2_params_buffer *)buffer;
> +
> + params->version = MALI_C55_PARAM_BUFFER_V1;
> + params->data_size = 0;
> +
> + void *data = (void *)params->data;
> +
> + struct mali_c55_params_awb_gains *gains =
> + (struct mali_c55_params_awb_gains *)data;
> +
> + gains->header.type = MALI_C55_PARAM_BLOCK_AWB_GAINS;
> + gains->header.flags |= V4L2_PARAMS_FL_BLOCK_ENABLE;
> + gains->header.size = sizeof(struct mali_c55_params_awb_gains);
> +
> + gains->gain00 = 256;
> + gains->gain00 = 256;
> + gains->gain00 = 256;
> + gains->gain00 = 256;
> +
> + data += sizeof(struct mali_c55_params_awb_gains);
> + params->data_size += sizeof(struct mali_c55_params_awb_gains);
> +
> + struct mali_c55_params_sensor_off_preshading *blc =
> + (struct mali_c55_params_sensor_off_preshading *)data;
> +
> + blc->header.type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;
> + blc->header.flags |= V4L2_PARAMS_FL_BLOCK_ENABLE;
> + blc->header.size = sizeof(struct mali_c55_params_sensor_off_preshading);
> +
> + blc->chan00 = 51200;
> + blc->chan01 = 51200;
> + blc->chan10 = 51200;
> + blc->chan11 = 51200;
> +
> + params->total_size += sizeof(struct mali_c55_params_sensor_off_preshading);
s/total_size/data_size
And I've also updated it to use the v4l2-isp types
+.. code-block:: c
+
+ struct v4l2_isp_params_buffer *params =
+ (struct v4l2_isp_params_buffer *)buffer;
+
+ params->version = MALI_C55_PARAM_BUFFER_V1;
+ params->data_size = 0;
+
+ void *data = (void *)params->data;
+
+ struct mali_c55_params_awb_gains *gains =
+ (struct mali_c55_params_awb_gains *)data;
+
+ gains->header.type = MALI_C55_PARAM_BLOCK_AWB_GAINS;
+ gains->header.flags |= V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
+ gains->header.size = sizeof(struct mali_c55_params_awb_gains);
+
+ gains->gain00 = 256;
+ gains->gain00 = 256;
+ gains->gain00 = 256;
+ gains->gain00 = 256;
+
+ data += sizeof(struct mali_c55_params_awb_gains);
+ params->data_size += sizeof(struct mali_c55_params_awb_gains);
+
+ struct mali_c55_params_sensor_off_preshading *blc =
+ (struct mali_c55_params_sensor_off_preshading *)data;
+
+ blc->header.type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;
+ blc->header.flags |= V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
+ blc->header.size = sizeof(struct mali_c55_params_sensor_off_preshading);
+
+ blc->chan00 = 51200;
+ blc->chan01 = 51200;
+ blc->chan10 = 51200;
+ blc->chan11 = 51200;
+
+ params->data_size += sizeof(struct mali_c55_params_sensor_off_preshading);
With your ack, I'll apply the following changes before sending the PR.
Thanks
j
> +
> Arm Mali-C55 uAPI data types
> ============================
>
>
> --
> 2.43.0
>
>
More information about the linux-arm-kernel
mailing list