[PATCH v13 15/15] Documentation: mali-c55: Document the mali-c55 parameter setting

Jacopo Mondi jacopo.mondi at ideasonboard.com
Fri Nov 14 06:57:21 PST 2025


Hi Sakari,
   can't say timing is what we excel the most at.

Afaik Hans has applied the PR, and as all comments here are on ...
comments, they will be addressed with patches on top

On Fri, Nov 14, 2025 at 04:49:18PM +0200, Sakari Ailus wrote:
> Hi Jacopo,
>
> On Thu, Nov 13, 2025 at 09:39:37AM +0100, Jacopo Mondi wrote:
> > > +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;
>
> What's the type of buffer here? If it's void, you can drop the cast.
>
> > +
> > +       params->version = MALI_C55_PARAM_BUFFER_V1;
> > +       params->data_size = 0;
> > +
> > +       void *data = (void *)params->data;
>
> No need for a cast here.
>
> > +
> > +       struct mali_c55_params_awb_gains *gains =
> > +               (struct mali_c55_params_awb_gains *)data;
>
> Ditto.
>
> Unless, I guess, you use C++. :-)
>

It was C++ code yes :)

> > +
> > +       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);
>
> 	data += sizeof(*gains);
>
> ?
>
> > +       params->data_size += sizeof(struct mali_c55_params_awb_gains);
>
> Ditto.
>
> > +
> > +       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);
>
> 	... += sizeof(*blc);
>
> ?

Patches will follow after v6.19 has been released


>
> >
> > With your ack, I'll apply the following changes before sending the PR.
> >
> > Thanks
> >   j
> >
> > > +
> > >  Arm Mali-C55 uAPI data types
> > >  ============================
> > >
> > >
>
> --
> Regards,
>
> Sakari Ailus



More information about the linux-arm-kernel mailing list