Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: media: Add documentation file metafmt-c3-isp.rst

Add the file 'metafmt-c3-isp.rst' that documents
the meta format of c3-isp.

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Keke Li and committed by
Hans Verkuil
f0d3a857 fb2e1352

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