Debian Codegraph @

Documentation/userspace-api/media/v4l/metafmt-c3-isp.rst

raw
1 .. SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2 .. c:namespace:: V4L
3
4 .. _v4l2-meta-fmt-c3isp-stats:
5 .. _v4l2-meta-fmt-c3isp-params:
6
7 ***********************************************************************
8 V4L2_META_FMT_C3ISP_STATS ('C3ST'), V4L2_META_FMT_C3ISP_PARAMS ('C3PM')
9 ***********************************************************************
10
11 .. c3_isp_stats_info
12
13 3A Statistics
14 =============
15
16 The C3 ISP can collect different statistics over an input Bayer frame.
17 Those statistics are obtained from the "c3-isp-stats" metadata capture video nodes,
18 using the :c:type:`v4l2_meta_format` interface.
19 They are formatted as described by the :c:type:`c3_isp_stats_info` structure.
20
21 The statistics collected are Auto-white balance,
22 Auto-exposure and Auto-focus information.
23
24 .. c3_isp_params_cfg
25
26 Configuration Parameters
27 ========================
28
29 The configuration parameters are passed to the c3-isp-params metadata output video node,
30 using the :c:type:`v4l2_meta_format` interface. Rather than a single struct containing
31 sub-structs for each configurable area of the ISP, parameters for the C3-ISP
32 are defined as distinct structs or "blocks" which may be added to the data
33 member of :c:type:`c3_isp_params_cfg`. Userspace is responsible for
34 populating the data member with the blocks that need to be configured by the driver, but
35 need not populate it with **all** the blocks, or indeed with any at all if there
36 are no configuration changes to make. Populated blocks **must** be consecutive
37 in the buffer. To assist both userspace and the driver in identifying the
38 blocks each block-specific struct embeds
39 :c:type:`c3_isp_params_block_header` as its first member and userspace
40 must populate the type member with a value from
41 :c:type:`c3_isp_params_block_type`. Once the blocks have been populated
42 into the data buffer, the combined size of all populated blocks shall be set in
43 the data_size member of :c:type:`c3_isp_params_cfg`. For example:
44
45 .. code-block:: c
46
47 struct c3_isp_params_cfg *params =
48 (struct c3_isp_params_cfg *)buffer;
49
50 params->version = C3_ISP_PARAM_BUFFER_V0;
51 params->data_size = 0;
52
53 void *data = (void *)params->data;
54
55 struct c3_isp_params_awb_gains *gains =
56 (struct c3_isp_params_awb_gains *)data;
57
58 gains->header.type = C3_ISP_PARAMS_BLOCK_AWB_GAINS;
59 gains->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
60 gains->header.size = sizeof(struct c3_isp_params_awb_gains);
61
62 gains->gr_gain = 256;
63 gains->r_gain = 256;
64 gains->b_gain = 256;
65 gains->gb_gain = 256;
66
67 data += sizeof(struct c3_isp__params_awb_gains);
68 params->data_size += sizeof(struct c3_isp_params_awb_gains);
69
70 struct c3_isp_params_awb_config *awb_cfg =
71 (struct c3_isp_params_awb_config *)data;
72
73 awb_cfg->header.type = C3_ISP_PARAMS_BLOCK_AWB_CONFIG;
74 awb_cfg->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
75 awb_cfg->header.size = sizeof(struct c3_isp_params_awb_config);
76
77 awb_cfg->tap_point = C3_ISP_AWB_STATS_TAP_BEFORE_WB;
78 awb_cfg->satur = 1;
79 awb_cfg->horiz_zones_num = 32;
80 awb_cfg->vert_zones_num = 24;
81
82 params->data_size += sizeof(struct c3_isp_params_awb_config);
83
84 Amlogic C3 ISP uAPI data types
85 ===============================
86
87 .. kernel-doc:: include/uapi/linux/media/amlogic/c3-isp-config.h