xref: /linux/Documentation/userspace-api/media/v4l/metafmt-rkisp1.rst (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1.. SPDX-License-Identifier: GPL-2.0
2
3.. _v4l2-meta-fmt-rk-isp1-stat-3a:
4
5************************************************************************************************************************
6V4L2_META_FMT_RK_ISP1_PARAMS ('rk1p'), V4L2_META_FMT_RK_ISP1_STAT_3A ('rk1s'), V4L2_META_FMT_RK_ISP1_EXT_PARAMS ('rk1e')
7************************************************************************************************************************
8
9========================
10Configuration parameters
11========================
12
13The configuration of the RkISP1 ISP is performed by userspace by providing
14parameters for the ISP to the driver using the :c:type:`v4l2_meta_format`
15interface.
16
17There are two methods that allow to configure the ISP, the `fixed parameters`
18configuration format and the `extensible parameters` configuration
19format.
20
21.. _v4l2-meta-fmt-rk-isp1-params:
22
23Fixed parameters configuration format
24=====================================
25
26When using the fixed configuration format, parameters are passed to the
27:ref:`rkisp1_params <rkisp1_params>` metadata output video node, using
28the `V4L2_META_FMT_RK_ISP1_PARAMS` meta format.
29
30The buffer contains a single instance of the C structure
31:c:type:`rkisp1_params_cfg` defined in ``rkisp1-config.h``. So the structure can
32be obtained from the buffer by:
33
34.. code-block:: c
35
36	struct rkisp1_params_cfg *params = (struct rkisp1_params_cfg*) buffer;
37
38This method supports a subset of the ISP features only, new applications should
39use the extensible parameters method.
40
41.. _v4l2-meta-fmt-rk-isp1-ext-params:
42
43Extensible parameters configuration format
44==========================================
45
46When using the extensible configuration format, parameters are passed to the
47:ref:`rkisp1_params <rkisp1_params>` metadata output video node, using
48the `V4L2_META_FMT_RK_ISP1_EXT_PARAMS` meta format.
49
50The buffer contains a single instance of the C structure
51:c:type:`rkisp1_ext_params_cfg` defined in ``rkisp1-config.h``. The
52:c:type:`rkisp1_ext_params_cfg` structure is designed to allow userspace to
53populate the data buffer with only the configuration data for the ISP blocks it
54intends to configure. The extensible parameters format design allows developers
55to define new block types to support new configuration parameters, and defines a
56versioning scheme so that it can be extended and versioned without breaking
57compatibility with existing applications.
58
59For these reasons, this configuration method is preferred over the `fixed
60parameters` format alternative.
61
62.. rkisp1_stat_buffer
63
64===========================
653A and histogram statistics
66===========================
67
68The ISP1 device collects different statistics over an input Bayer frame.
69Those statistics are obtained from the :ref:`rkisp1_stats <rkisp1_stats>`
70metadata capture video node,
71using the :c:type:`v4l2_meta_format` interface. The buffer contains a single
72instance of the C structure :c:type:`rkisp1_stat_buffer` defined in
73``rkisp1-config.h``. So the structure can be obtained from the buffer by:
74
75.. code-block:: c
76
77	struct rkisp1_stat_buffer *stats = (struct rkisp1_stat_buffer*) buffer;
78
79The statistics collected are Exposure, AWB (Auto-white balance), Histogram and
80AF (Auto-focus). See :c:type:`rkisp1_stat_buffer` for details of the statistics.
81
82The 3A statistics and configuration parameters described here are usually
83consumed and produced by dedicated user space libraries that comprise the
84important tuning tools using software control loop.
85
86rkisp1 uAPI data types
87======================
88
89.. kernel-doc:: include/uapi/linux/rkisp1-config.h
90