Skip to content

Commit 87b214d

Browse files
djrscallyHans Verkuil
authored andcommitted
Documentation: media: mali-c55: Document the mali-c55 parameter setting
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@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Nayden Kanchev <nayden.kanchev@arm.com> Co-developed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
1 parent 01535ea commit 87b214d

2 files changed

Lines changed: 75 additions & 5 deletions

File tree

Documentation/admin-guide/media/mali-c55.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,24 @@ the processing flow the statistics can be drawn from::
387387
+-------------+ | +-------------+
388388
+--> AWB-1
389389

390-
At present all statistics are drawn from the 0th tap point for each algorithm;
390+
By default all statistics are drawn from the 0th tap point for each algorithm;
391391
I.E. AEXP statistics from AEXP-0 (A), AWB statistics from AWB-0 and AF
392-
statistics from AF-0. In the future this will be configurable.
392+
statistics from AF-0. This is configurable for AEXP and AWB statsistics through
393+
programming the ISP's parameters.
394+
395+
.. _mali-c55-3a-params:
396+
397+
Programming ISP Parameters
398+
==========================
399+
400+
The ISP can be programmed with various parameters from userspace to apply to the
401+
hardware before and during video stream. This allows userspace to dynamically
402+
change values such as black level, white balance and lens shading gains and so
403+
on.
404+
405+
The buffer format and how to populate it are described by the
406+
:ref:`V4L2_META_FMT_MALI_C55_PARAMS <v4l2-meta-fmt-mali-c55-params>` format,
407+
which should be set as the data format for the `mali-c55 3a params` video node.
393408

394409
References
395410
==========

Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
3+
.. _v4l2-meta-fmt-mali-c55-params:
34
.. _v4l2-meta-fmt-mali-c55-stats:
45

5-
*************************************
6-
V4L2_META_FMT_MALI_C55_STATS ('C55S')
7-
*************************************
6+
*****************************************************************************
7+
V4L2_META_FMT_MALI_C55_STATS ('C55S'), V4L2_META_FMT_MALI_C55_PARAMS ('C55P')
8+
*****************************************************************************
89

910
3A Statistics
1011
=============
@@ -23,6 +24,60 @@ of the C structure :c:type:`mali_c55_stats_buffer` defined in
2324
2425
For details of the statistics see :c:type:`mali_c55_stats_buffer`.
2526

27+
Configuration Parameters
28+
========================
29+
30+
The configuration parameters are passed to the :ref:`mali-c55 3a params
31+
<mali-c55-3a-params>` metadata output video node, using the
32+
:c:type:`v4l2_meta_format` interface. Rather than a single struct containing
33+
sub-structs for each configurable area of the ISP, parameters for the Mali-C55
34+
use the v4l2-isp parameters system, through which groups of parameters are
35+
defined as distinct structs or "blocks" which may be added to the data member of
36+
:c:type:`v4l2_isp_params_buffer`. Userspace is responsible for populating the
37+
data member with the blocks that need to be configured by the driver. Each
38+
block-specific struct embeds :c:type:`v4l2_isp_params_block_header` as its first
39+
member and userspace must populate the type member with a value from
40+
:c:type:`mali_c55_param_block_type`.
41+
42+
.. code-block:: c
43+
44+
struct v4l2_isp_params_buffer *params =
45+
(struct v4l2_isp_params_buffer *)buffer;
46+
47+
params->version = MALI_C55_PARAM_BUFFER_V1;
48+
params->data_size = 0;
49+
50+
void *data = (void *)params->data;
51+
52+
struct mali_c55_params_awb_gains *gains =
53+
(struct mali_c55_params_awb_gains *)data;
54+
55+
gains->header.type = MALI_C55_PARAM_BLOCK_AWB_GAINS;
56+
gains->header.flags |= V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
57+
gains->header.size = sizeof(struct mali_c55_params_awb_gains);
58+
59+
gains->gain00 = 256;
60+
gains->gain00 = 256;
61+
gains->gain00 = 256;
62+
gains->gain00 = 256;
63+
64+
data += sizeof(struct mali_c55_params_awb_gains);
65+
params->data_size += sizeof(struct mali_c55_params_awb_gains);
66+
67+
struct mali_c55_params_sensor_off_preshading *blc =
68+
(struct mali_c55_params_sensor_off_preshading *)data;
69+
70+
blc->header.type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;
71+
blc->header.flags |= V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
72+
blc->header.size = sizeof(struct mali_c55_params_sensor_off_preshading);
73+
74+
blc->chan00 = 51200;
75+
blc->chan01 = 51200;
76+
blc->chan10 = 51200;
77+
blc->chan11 = 51200;
78+
79+
params->data_size += sizeof(struct mali_c55_params_sensor_off_preshading);
80+
2681
Arm Mali-C55 uAPI data types
2782
============================
2883

0 commit comments

Comments
 (0)