Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorri...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-meta-intel-ipu3.rst
1 .. This file is dual-licensed: you can use it either under the terms
2 .. of the GPL 2.0 or the GFDL 1.1+ license, at your option. Note that this
3 .. dual licensing only applies to this file, and not this project as a
4 .. whole.
5 ..
6 .. a) This file is free software; you can redistribute it and/or
7 ..    modify it under the terms of the GNU General Public License version
8 ..    2.0 as published by the Free Software Foundation.
9 ..
10 ..    This file is distributed in the hope that it will be useful,
11 ..    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ..    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ..    GNU General Public License version 2.0 for more details.
14 ..
15 .. Or, alternatively,
16 ..
17 .. b) Permission is granted to copy, distribute and/or modify this
18 ..    document under the terms of the GNU Free Documentation License,
19 ..    Version 1.1 or any later version published by the Free Software
20 ..    Foundation, with no Invariant Sections, no Front-Cover Texts
21 ..    and no Back-Cover Texts. A copy of the license is included at
22 ..    Documentation/media/uapi/fdl-appendix.rst.
23 ..
24 .. TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
25
26 .. _v4l2-meta-fmt-params:
27 .. _v4l2-meta-fmt-stat-3a:
28
29 ******************************************************************
30 V4L2_META_FMT_IPU3_PARAMS ('ip3p'), V4L2_META_FMT_IPU3_3A ('ip3s')
31 ******************************************************************
32
33 .. ipu3_uapi_stats_3a
34
35 3A statistics
36 =============
37
38 The IPU3 ImgU 3A statistics accelerators collect different statistics over
39 an input Bayer frame. Those statistics are obtained from the "ipu3-imgu [01] 3a
40 stat" metadata capture video nodes, using the :c:type:`v4l2_meta_format`
41 interface. They are formatted as described by the :c:type:`ipu3_uapi_stats_3a`
42 structure.
43
44 The statistics collected are AWB (Auto-white balance) RGBS (Red, Green, Blue and
45 Saturation measure) cells, AWB filter response, AF (Auto-focus) filter response,
46 and AE (Auto-exposure) histogram.
47
48 The struct :c:type:`ipu3_uapi_4a_config` saves all configurable parameters.
49
50 .. code-block:: c
51
52         struct ipu3_uapi_stats_3a {
53                 struct ipu3_uapi_awb_raw_buffer awb_raw_buffer;
54                 struct ipu3_uapi_ae_raw_buffer_aligned ae_raw_buffer[IPU3_UAPI_MAX_STRIPES];
55                 struct ipu3_uapi_af_raw_buffer af_raw_buffer;
56                 struct ipu3_uapi_awb_fr_raw_buffer awb_fr_raw_buffer;
57                 struct ipu3_uapi_4a_config stats_4a_config;
58                 __u32 ae_join_buffers;
59                 __u8 padding[28];
60                 struct ipu3_uapi_stats_3a_bubble_info_per_stripe stats_3a_bubble_per_stripe;
61                 struct ipu3_uapi_ff_status stats_3a_status;
62         };
63
64 .. ipu3_uapi_params
65
66 Pipeline parameters
67 ===================
68
69 The pipeline parameters are passed to the "ipu3-imgu [01] parameters" metadata
70 output video nodes, using the :c:type:`v4l2_meta_format` interface. They are
71 formatted as described by the :c:type:`ipu3_uapi_params` structure.
72
73 Both 3A statistics and pipeline parameters described here are closely tied to
74 the underlying camera sub-system (CSS) APIs. They are usually consumed and
75 produced by dedicated user space libraries that comprise the important tuning
76 tools, thus freeing the developers from being bothered with the low level
77 hardware and algorithm details.
78
79 .. code-block:: c
80
81         struct ipu3_uapi_params {
82                 /* Flags which of the settings below are to be applied */
83                 struct ipu3_uapi_flags use;
84
85                 /* Accelerator cluster parameters */
86                 struct ipu3_uapi_acc_param acc_param;
87
88                 /* ISP vector address space parameters */
89                 struct ipu3_uapi_isp_lin_vmem_params lin_vmem_params;
90                 struct ipu3_uapi_isp_tnr3_vmem_params tnr3_vmem_params;
91                 struct ipu3_uapi_isp_xnr3_vmem_params xnr3_vmem_params;
92
93                 /* ISP data memory (DMEM) parameters */
94                 struct ipu3_uapi_isp_tnr3_params tnr3_dmem_params;
95                 struct ipu3_uapi_isp_xnr3_params xnr3_dmem_params;
96
97                 /* Optical black level compensation */
98                 struct ipu3_uapi_obgrid_param obgrid_param;
99         };
100
101 Intel IPU3 ImgU uAPI data types
102 ===============================
103
104 .. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h