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