^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) .. _v4l2-meta-fmt-params:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _v4l2-meta-fmt-stat-3a:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ******************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) V4L2_META_FMT_IPU3_PARAMS ('ip3p'), V4L2_META_FMT_IPU3_3A ('ip3s')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ******************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) .. ipu3_uapi_stats_3a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 3A statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) The IPU3 ImgU 3A statistics accelerators collect different statistics over
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) an input Bayer frame. Those statistics are obtained from the "ipu3-imgu [01] 3a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) stat" metadata capture video nodes, using the :c:type:`v4l2_meta_format`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) interface. They are formatted as described by the :c:type:`ipu3_uapi_stats_3a`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) The statistics collected are AWB (Auto-white balance) RGBS (Red, Green, Blue and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Saturation measure) cells, AWB filter response, AF (Auto-focus) filter response,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) and AE (Auto-exposure) histogram.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) The struct :c:type:`ipu3_uapi_4a_config` saves all configurable parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct ipu3_uapi_stats_3a {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct ipu3_uapi_awb_raw_buffer awb_raw_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct ipu3_uapi_ae_raw_buffer_aligned ae_raw_buffer[IPU3_UAPI_MAX_STRIPES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct ipu3_uapi_af_raw_buffer af_raw_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct ipu3_uapi_awb_fr_raw_buffer awb_fr_raw_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct ipu3_uapi_4a_config stats_4a_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __u32 ae_join_buffers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) __u8 padding[28];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct ipu3_uapi_stats_3a_bubble_info_per_stripe stats_3a_bubble_per_stripe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct ipu3_uapi_ff_status stats_3a_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) .. ipu3_uapi_params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Pipeline parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) The pipeline parameters are passed to the "ipu3-imgu [01] parameters" metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) output video nodes, using the :c:type:`v4l2_meta_format` interface. They are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) formatted as described by the :c:type:`ipu3_uapi_params` structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Both 3A statistics and pipeline parameters described here are closely tied to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) the underlying camera sub-system (CSS) APIs. They are usually consumed and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) produced by dedicated user space libraries that comprise the important tuning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) tools, thus freeing the developers from being bothered with the low level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) hardware and algorithm details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) struct ipu3_uapi_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) /* Flags which of the settings below are to be applied */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) struct ipu3_uapi_flags use;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /* Accelerator cluster parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct ipu3_uapi_acc_param acc_param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /* ISP vector address space parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct ipu3_uapi_isp_lin_vmem_params lin_vmem_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct ipu3_uapi_isp_tnr3_vmem_params tnr3_vmem_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) struct ipu3_uapi_isp_xnr3_vmem_params xnr3_vmem_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) /* ISP data memory (DMEM) parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct ipu3_uapi_isp_tnr3_params tnr3_dmem_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) struct ipu3_uapi_isp_xnr3_params xnr3_dmem_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) /* Optical black level compensation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) struct ipu3_uapi_obgrid_param obgrid_param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) Intel IPU3 ImgU uAPI data types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) .. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h