1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2017 - 2018 Intel Corporation */
7 #include <linux/types.h>
9 /* from /drivers/staging/media/ipu3/include/videodev2.h */
11 /* Vendor specific - used for IPU3 camera sub-system */
12 #define V4L2_META_FMT_IPU3_PARAMS v4l2_fourcc('i', 'p', '3', 'p') /* IPU3 processing parameters */
13 #define V4L2_META_FMT_IPU3_STAT_3A v4l2_fourcc('i', 'p', '3', 's') /* IPU3 3A statistics */
15 /* from include/uapi/linux/v4l2-controls.h */
16 #define V4L2_CID_INTEL_IPU3_BASE (V4L2_CID_USER_BASE + 0x10c0)
17 #define V4L2_CID_INTEL_IPU3_MODE (V4L2_CID_INTEL_IPU3_BASE + 1)
19 /******************* ipu3_uapi_stats_3a *******************/
21 #define IPU3_UAPI_MAX_STRIPES 2
22 #define IPU3_UAPI_MAX_BUBBLE_SIZE 10
24 #define IPU3_UAPI_GRID_START_MASK ((1 << 12) - 1)
25 #define IPU3_UAPI_GRID_Y_START_EN (1 << 15)
27 /* controls generation of meta_data (like FF enable/disable) */
28 #define IPU3_UAPI_AWB_RGBS_THR_B_EN (1 << 14)
29 #define IPU3_UAPI_AWB_RGBS_THR_B_INCL_SAT (1 << 15)
32 * struct ipu3_uapi_grid_config - Grid plane config
34 * @width: Grid horizontal dimensions, in number of grid blocks(cells).
35 * @height: Grid vertical dimensions, in number of grid cells.
36 * @block_width_log2: Log2 of the width of each cell in pixels.
37 * for (2^3, 2^4, 2^5, 2^6, 2^7), values [3, 7].
38 * @block_height_log2: Log2 of the height of each cell in pixels.
39 * for (2^3, 2^4, 2^5, 2^6, 2^7), values [3, 7].
40 * @height_per_slice: The number of blocks in vertical axis per slice.
42 * @x_start: X value of top left corner of Region of Interest(ROI).
43 * @y_start: Y value of top left corner of ROI
44 * @x_end: X value of bottom right corner of ROI
45 * @y_end: Y value of bottom right corner of ROI
47 * Due to the size of total amount of collected data, most statistics
48 * create a grid-based output, and the data is then divided into "slices".
50 struct ipu3_uapi_grid_config {
53 __u16 block_width_log2:3;
54 __u16 block_height_log2:3;
55 __u16 height_per_slice:8;
63 * The grid based data is divided into "slices" called set, each slice of setX
64 * refers to ipu3_uapi_grid_config width * height_per_slice.
66 #define IPU3_UAPI_AWB_MAX_SETS 60
67 /* Based on grid size 80 * 60 and cell size 16 x 16 */
68 #define IPU3_UAPI_AWB_SET_SIZE 1280
69 #define IPU3_UAPI_AWB_MD_ITEM_SIZE 8
70 #define IPU3_UAPI_AWB_SPARE_FOR_BUBBLES \
71 (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \
72 IPU3_UAPI_AWB_MD_ITEM_SIZE)
73 #define IPU3_UAPI_AWB_MAX_BUFFER_SIZE \
74 (IPU3_UAPI_AWB_MAX_SETS * \
75 (IPU3_UAPI_AWB_SET_SIZE + IPU3_UAPI_AWB_SPARE_FOR_BUBBLES))
79 * struct ipu3_uapi_awb_raw_buffer - AWB raw buffer
81 * @meta_data: buffer to hold auto white balance meta data which is
82 * the average values for each color channel.
84 struct ipu3_uapi_awb_raw_buffer {
85 __u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]
86 __attribute__((aligned(32)));
90 * struct ipu3_uapi_awb_config_s - AWB config
92 * @rgbs_thr_gr: gr threshold value.
93 * @rgbs_thr_r: Red threshold value.
94 * @rgbs_thr_gb: gb threshold value.
95 * @rgbs_thr_b: Blue threshold value.
96 * @grid: &ipu3_uapi_grid_config, the default grid resolution is 16x16 cells.
98 * The threshold is a saturation measure range [0, 8191], 8191 is default.
99 * Values over threshold may be optionally rejected for averaging.
101 struct ipu3_uapi_awb_config_s {
106 struct ipu3_uapi_grid_config grid;
107 } __attribute__((aligned(32))) __packed;
110 * struct ipu3_uapi_awb_config - AWB config wrapper
112 * @config: config for auto white balance as defined by &ipu3_uapi_awb_config_s
114 struct ipu3_uapi_awb_config {
115 struct ipu3_uapi_awb_config_s config __attribute__((aligned(32)));
118 #define IPU3_UAPI_AE_COLORS 4 /* R, G, B, Y */
119 #define IPU3_UAPI_AE_BINS 256
120 #define IPU3_UAPI_AE_WEIGHTS 96
123 + * struct ipu3_uapi_ae_raw_buffer - AE global weighted histogram
125 + * @vals: Sum of IPU3_UAPI_AE_COLORS in cell
127 + * Each histogram contains IPU3_UAPI_AE_BINS bins. Each bin has 24 bit unsigned
128 + * for counting the number of the pixel.
130 struct ipu3_uapi_ae_raw_buffer {
131 __u32 vals[IPU3_UAPI_AE_BINS * IPU3_UAPI_AE_COLORS];
135 * struct ipu3_uapi_ae_raw_buffer_aligned - AE raw buffer
137 * @buff: &ipu3_uapi_ae_raw_buffer to hold full frame meta data.
139 struct ipu3_uapi_ae_raw_buffer_aligned {
140 struct ipu3_uapi_ae_raw_buffer buff __attribute__((aligned(32)));
144 * struct ipu3_uapi_ae_grid_config - AE weight grid
146 * @width: Grid horizontal dimensions. Value: [16, 32], default 16.
147 * @height: Grid vertical dimensions. Value: [16, 24], default 16.
148 * @block_width_log2: Log2 of the width of the grid cell, value: [3, 7].
149 * @block_height_log2: Log2 of the height of the grid cell, value: [3, 7].
150 * default is 3 (cell size 8x8), 4 cell per grid.
151 * @reserved0: reserved
152 * @ae_en: 0: does not write to &ipu3_uapi_ae_raw_buffer_aligned array,
154 * @rst_hist_array: write 1 to trigger histogram array reset.
155 * @done_rst_hist_array: flag for histogram array reset done.
156 * @x_start: X value of top left corner of ROI, default 0.
157 * @y_start: Y value of top left corner of ROI, default 0.
158 * @x_end: X value of bottom right corner of ROI
159 * @y_end: Y value of bottom right corner of ROI
161 * The AE block accumulates 4 global weighted histograms(R, G, B, Y) over
162 * a defined ROI within the frame. The contribution of each pixel into the
163 * histogram, defined by &ipu3_uapi_ae_weight_elem LUT, is indexed by a grid.
165 struct ipu3_uapi_ae_grid_config {
168 __u8 block_width_log2:4;
169 __u8 block_height_log2:4;
172 __u8 rst_hist_array:1;
173 __u8 done_rst_hist_array:1;
181 * struct ipu3_uapi_ae_weight_elem - AE weights LUT
183 * @cell0: weighted histogram grid value.
184 * @cell1: weighted histogram grid value.
185 * @cell2: weighted histogram grid value.
186 * @cell3: weighted histogram grid value.
187 * @cell4: weighted histogram grid value.
188 * @cell5: weighted histogram grid value.
189 * @cell6: weighted histogram grid value.
190 * @cell7: weighted histogram grid value.
192 * Use weighted grid value to give a different contribution factor to each cell.
193 * Precision u4, range [0, 15].
195 struct ipu3_uapi_ae_weight_elem {
207 * struct ipu3_uapi_ae_ccm - AE coefficients for WB and CCM
209 * @gain_gr: WB gain factor for the gr channels. Default 256.
210 * @gain_r: WB gain factor for the r channel. Default 256.
211 * @gain_b: WB gain factor for the b channel. Default 256.
212 * @gain_gb: WB gain factor for the gb channels. Default 256.
213 * @mat: 4x4 matrix that transforms Bayer quad output from WB to RGB+Y.
221 * As part of the raw frame pre-process stage, the WB and color conversion need
222 * to be applied to expose the impact of these gain operations.
224 struct ipu3_uapi_ae_ccm {
233 * struct ipu3_uapi_ae_config - AE config
235 * @grid_cfg: config for auto exposure statistics grid. See struct
236 * &ipu3_uapi_ae_grid_config
237 * @weights: &IPU3_UAPI_AE_WEIGHTS is based on 32x24 blocks in the grid.
238 * Each grid cell has a corresponding value in weights LUT called
239 * grid value, global histogram is updated based on grid value and
241 * @ae_ccm: Color convert matrix pre-processing block.
243 * Calculate AE grid from image resolution, resample ae weights.
245 struct ipu3_uapi_ae_config {
246 struct ipu3_uapi_ae_grid_config grid_cfg __attribute__((aligned(32)));
247 struct ipu3_uapi_ae_weight_elem weights[
248 IPU3_UAPI_AE_WEIGHTS] __attribute__((aligned(32)));
249 struct ipu3_uapi_ae_ccm ae_ccm __attribute__((aligned(32)));
253 * struct ipu3_uapi_af_filter_config - AF 2D filter for contrast measurements
255 * @y1_coeff_0: filter Y1, structure: 3x11, support both symmetry and
256 * anti-symmetry type. A12 is center, A1-A11 are neighbours.
257 * for analyzing low frequency content, used to calculate sum
258 * of gradients in x direction.
259 * @y1_coeff_0.a1: filter1 coefficients A1, u8, default 0.
260 * @y1_coeff_0.a2: filter1 coefficients A2, u8, default 0.
261 * @y1_coeff_0.a3: filter1 coefficients A3, u8, default 0.
262 * @y1_coeff_0.a4: filter1 coefficients A4, u8, default 0.
263 * @y1_coeff_1: Struct
264 * @y1_coeff_1.a5: filter1 coefficients A5, u8, default 0.
265 * @y1_coeff_1.a6: filter1 coefficients A6, u8, default 0.
266 * @y1_coeff_1.a7: filter1 coefficients A7, u8, default 0.
267 * @y1_coeff_1.a8: filter1 coefficients A8, u8, default 0.
268 * @y1_coeff_2: Struct
269 * @y1_coeff_2.a9: filter1 coefficients A9, u8, default 0.
270 * @y1_coeff_2.a10: filter1 coefficients A10, u8, default 0.
271 * @y1_coeff_2.a11: filter1 coefficients A11, u8, default 0.
272 * @y1_coeff_2.a12: filter1 coefficients A12, u8, default 128.
273 * @y1_sign_vec: Each bit corresponds to one coefficient sign bit,
274 * 0: positive, 1: negative, default 0.
275 * @y2_coeff_0: Y2, same structure as Y1. For analyzing high frequency content.
276 * @y2_coeff_0.a1: filter2 coefficients A1, u8, default 0.
277 * @y2_coeff_0.a2: filter2 coefficients A2, u8, default 0.
278 * @y2_coeff_0.a3: filter2 coefficients A3, u8, default 0.
279 * @y2_coeff_0.a4: filter2 coefficients A4, u8, default 0.
280 * @y2_coeff_1: Struct
281 * @y2_coeff_1.a5: filter2 coefficients A5, u8, default 0.
282 * @y2_coeff_1.a6: filter2 coefficients A6, u8, default 0.
283 * @y2_coeff_1.a7: filter2 coefficients A7, u8, default 0.
284 * @y2_coeff_1.a8: filter2 coefficients A8, u8, default 0.
285 * @y2_coeff_2: Struct
286 * @y2_coeff_2.a9: filter1 coefficients A9, u8, default 0.
287 * @y2_coeff_2.a10: filter1 coefficients A10, u8, default 0.
288 * @y2_coeff_2.a11: filter1 coefficients A11, u8, default 0.
289 * @y2_coeff_2.a12: filter1 coefficients A12, u8, default 128.
290 * @y2_sign_vec: Each bit corresponds to one coefficient sign bit,
291 * 0: positive, 1: negative, default 0.
292 * @y_calc: Pre-processing that converts Bayer quad to RGB+Y values to be
293 * used for building histogram. Range [0, 32], default 8.
295 * y_gen_rate_gr + y_gen_rate_r + y_gen_rate_b + y_gen_rate_gb = 32
296 * A single Y is calculated based on sum of Gr/R/B/Gb based on
297 * their contribution ratio.
298 * @y_calc.y_gen_rate_gr: Contribution ratio Gr for Y
299 * @y_calc.y_gen_rate_r: Contribution ratio R for Y
300 * @y_calc.y_gen_rate_b: Contribution ratio B for Y
301 * @y_calc.y_gen_rate_gb: Contribution ratio Gb for Y
302 * @nf: The shift right value that should be applied during the Y1/Y2 filter to
303 * make sure the total memory needed is 2 bytes per grid cell.
304 * @nf.reserved0: reserved
305 * @nf.y1_nf: Normalization factor for the convolution coeffs of y1,
306 * should be log2 of the sum of the abs values of the filter
307 * coeffs, default 7 (2^7 = 128).
308 * @nf.reserved1: reserved
309 * @nf.y2_nf: Normalization factor for y2, should be log2 of the sum of the
310 * abs values of the filter coeffs.
311 * @nf.reserved2: reserved
313 struct ipu3_uapi_af_filter_config {
372 #define IPU3_UAPI_AF_MAX_SETS 24
373 #define IPU3_UAPI_AF_MD_ITEM_SIZE 4
374 #define IPU3_UAPI_AF_SPARE_FOR_BUBBLES \
375 (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \
376 IPU3_UAPI_AF_MD_ITEM_SIZE)
377 #define IPU3_UAPI_AF_Y_TABLE_SET_SIZE 128
378 #define IPU3_UAPI_AF_Y_TABLE_MAX_SIZE \
379 (IPU3_UAPI_AF_MAX_SETS * \
380 (IPU3_UAPI_AF_Y_TABLE_SET_SIZE + IPU3_UAPI_AF_SPARE_FOR_BUBBLES) * \
381 IPU3_UAPI_MAX_STRIPES)
384 * struct ipu3_uapi_af_raw_buffer - AF meta data
386 * @y_table: Each color component will be convolved separately with filter1
387 * and filter2 and the result will be summed out and averaged for
390 struct ipu3_uapi_af_raw_buffer {
391 __u8 y_table[IPU3_UAPI_AF_Y_TABLE_MAX_SIZE] __attribute__((aligned(32)));
395 * struct ipu3_uapi_af_config_s - AF config
397 * @filter_config: AF uses Y1 and Y2 filters as configured in
398 * &ipu3_uapi_af_filter_config
400 * @grid_cfg: See &ipu3_uapi_grid_config, default resolution 16x16. Use large
401 * grid size for large image and vice versa.
403 struct ipu3_uapi_af_config_s {
404 struct ipu3_uapi_af_filter_config filter_config __attribute__((aligned(32)));
406 struct ipu3_uapi_grid_config grid_cfg __attribute__((aligned(32)));
409 #define IPU3_UAPI_AWB_FR_MAX_SETS 24
410 #define IPU3_UAPI_AWB_FR_MD_ITEM_SIZE 8
411 #define IPU3_UAPI_AWB_FR_BAYER_TBL_SIZE 256
412 #define IPU3_UAPI_AWB_FR_SPARE_FOR_BUBBLES \
413 (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \
414 IPU3_UAPI_AWB_FR_MD_ITEM_SIZE)
415 #define IPU3_UAPI_AWB_FR_BAYER_TABLE_MAX_SIZE \
416 (IPU3_UAPI_AWB_FR_MAX_SETS * \
417 (IPU3_UAPI_AWB_FR_BAYER_TBL_SIZE + \
418 IPU3_UAPI_AWB_FR_SPARE_FOR_BUBBLES) * IPU3_UAPI_MAX_STRIPES)
421 * struct ipu3_uapi_awb_fr_meta_data - AWB filter response meta data
423 * @meta_data: Statistics output on the grid after convolving with 1D filter.
425 struct ipu3_uapi_awb_fr_raw_buffer {
426 __u8 meta_data[IPU3_UAPI_AWB_FR_BAYER_TABLE_MAX_SIZE]
427 __attribute__((aligned(32)));
431 * struct ipu3_uapi_awb_fr_config_s - AWB filter response config
433 * @grid_cfg: grid config, default 16x16.
434 * @bayer_coeff: 1D Filter 1x11 center symmetry/anti-symmetry.
435 * coefficients defaults { 0, 0, 0, 0, 0, 128 }.
436 * Applied on whole image for each Bayer channel separately
437 * by a weighted sum of its 11x1 neighbors.
438 * @reserved1: reserved
439 * @bayer_sign: sign of filter coefficients, default 0.
440 * @bayer_nf: normalization factor for the convolution coeffs, to make sure
441 * total memory needed is within pre-determined range.
442 * NF should be the log2 of the sum of the abs values of the
443 * filter coeffs, range [7, 14], default 7.
444 * @reserved2: reserved
446 struct ipu3_uapi_awb_fr_config_s {
447 struct ipu3_uapi_grid_config grid_cfg;
456 * struct ipu3_uapi_4a_config - 4A config
458 * @awb_config: &ipu3_uapi_awb_config_s, default resolution 16x16
459 * @ae_grd_config: auto exposure statistics &ipu3_uapi_ae_grid_config
461 * @af_config: auto focus config &ipu3_uapi_af_config_s
462 * @awb_fr_config: &ipu3_uapi_awb_fr_config_s, default resolution 16x16
464 struct ipu3_uapi_4a_config {
465 struct ipu3_uapi_awb_config_s awb_config __attribute__((aligned(32)));
466 struct ipu3_uapi_ae_grid_config ae_grd_config;
468 struct ipu3_uapi_af_config_s af_config;
469 struct ipu3_uapi_awb_fr_config_s awb_fr_config
470 __attribute__((aligned(32)));
474 * struct ipu3_uapi_bubble_info - Bubble info for host side debugging
476 * @num_of_stripes: A single frame is divided into several parts called stripes
477 * due to limitation on line buffer memory.
478 * The separation between the stripes is vertical. Each such
479 * stripe is processed as a single frame by the ISP pipe.
480 * @padding: padding bytes.
481 * @num_sets: number of sets.
482 * @padding1: padding bytes.
483 * @size_of_set: set size.
484 * @padding2: padding bytes.
485 * @bubble_size: is the amount of padding in the bubble expressed in "sets".
486 * @padding3: padding bytes.
488 struct ipu3_uapi_bubble_info {
489 __u32 num_of_stripes __attribute__((aligned(32)));
500 * struct ipu3_uapi_stats_3a_bubble_info_per_stripe
502 struct ipu3_uapi_stats_3a_bubble_info_per_stripe {
503 struct ipu3_uapi_bubble_info awb[IPU3_UAPI_MAX_STRIPES];
504 struct ipu3_uapi_bubble_info af[IPU3_UAPI_MAX_STRIPES];
505 struct ipu3_uapi_bubble_info awb_fr[IPU3_UAPI_MAX_STRIPES];
509 * struct ipu3_uapi_ff_status - Enable bits for each 3A fixed function
511 * @awb_en: auto white balance enable
512 * @padding: padding config
513 * @ae_en: auto exposure enable
514 * @padding1: padding config
515 * @af_en: auto focus enable
516 * @padding2: padding config
517 * @awb_fr_en: awb filter response enable bit
518 * @padding3: padding config
520 struct ipu3_uapi_ff_status {
521 __u32 awb_en __attribute__((aligned(32)));
532 * struct ipu3_uapi_stats_3a - 3A statistics
534 * @awb_raw_buffer: auto white balance meta data &ipu3_uapi_awb_raw_buffer
535 * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned
536 * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data
537 * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer
538 * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config.
539 * @ae_join_buffers: 1 to use ae_raw_buffer.
540 * @padding: padding config
541 * @stats_3a_bubble_per_stripe: a &ipu3_uapi_stats_3a_bubble_info_per_stripe
542 * @stats_3a_status: 3a statistics status set in &ipu3_uapi_ff_status
544 struct ipu3_uapi_stats_3a {
545 struct ipu3_uapi_awb_raw_buffer awb_raw_buffer;
546 struct ipu3_uapi_ae_raw_buffer_aligned
547 ae_raw_buffer[IPU3_UAPI_MAX_STRIPES];
548 struct ipu3_uapi_af_raw_buffer af_raw_buffer;
549 struct ipu3_uapi_awb_fr_raw_buffer awb_fr_raw_buffer;
550 struct ipu3_uapi_4a_config stats_4a_config;
551 __u32 ae_join_buffers;
553 struct ipu3_uapi_stats_3a_bubble_info_per_stripe
554 stats_3a_bubble_per_stripe;
555 struct ipu3_uapi_ff_status stats_3a_status;
558 /******************* ipu3_uapi_acc_param *******************/
560 #define IPU3_UAPI_ISP_VEC_ELEMS 64
561 #define IPU3_UAPI_ISP_TNR3_VMEM_LEN 9
563 #define IPU3_UAPI_BNR_LUT_SIZE 32
565 /* number of elements in gamma correction LUT */
566 #define IPU3_UAPI_GAMMA_CORR_LUT_ENTRIES 256
568 /* largest grid is 73x56, for grid_height_per_slice of 2, 73x2 = 146 */
569 #define IPU3_UAPI_SHD_MAX_CELLS_PER_SET 146
570 #define IPU3_UAPI_SHD_MAX_CFG_SETS 28
571 /* Normalization shift aka nf */
572 #define IPU3_UAPI_SHD_BLGR_NF_SHIFT 13
573 #define IPU3_UAPI_SHD_BLGR_NF_MASK 7
575 #define IPU3_UAPI_YUVP2_TCC_MACC_TABLE_ELEMENTS 16
576 #define IPU3_UAPI_YUVP2_TCC_INV_Y_LUT_ELEMENTS 14
577 #define IPU3_UAPI_YUVP2_TCC_GAIN_PCWL_LUT_ELEMENTS 258
578 #define IPU3_UAPI_YUVP2_TCC_R_SQR_LUT_ELEMENTS 24
580 #define IPU3_UAPI_ANR_LUT_SIZE 26
581 #define IPU3_UAPI_ANR_PYRAMID_SIZE 22
583 #define IPU3_UAPI_LIN_LUT_SIZE 64
585 /* Bayer Noise Reduction related structs */
588 * struct ipu3_uapi_bnr_static_config_wb_gains_config - White balance gains
590 * @gr: white balance gain for Gr channel.
591 * @r: white balance gain for R channel.
592 * @b: white balance gain for B channel.
593 * @gb: white balance gain for Gb channel.
595 * Precision u3.13, range [0, 8). White balance correction is done by applying
596 * a multiplicative gain to each color channels prior to BNR.
598 struct ipu3_uapi_bnr_static_config_wb_gains_config {
606 * struct ipu3_uapi_bnr_static_config_wb_gains_thr_config - Threshold config
608 * @gr: white balance threshold gain for Gr channel.
609 * @r: white balance threshold gain for R channel.
610 * @b: white balance threshold gain for B channel.
611 * @gb: white balance threshold gain for Gb channel.
613 * Defines the threshold that specifies how different a defect pixel can be from
614 * its neighbors.(used by dynamic defect pixel correction sub block)
615 * Precision u4.4 range [0, 8].
617 struct ipu3_uapi_bnr_static_config_wb_gains_thr_config {
625 * struct ipu3_uapi_bnr_static_config_thr_coeffs_config - Noise model
626 * coefficients that controls noise threshold
628 * @cf: Free coefficient for threshold calculation, range [0, 8191], default 0.
629 * @reserved0: reserved
630 * @cg: Gain coefficient for threshold calculation, [0, 31], default 8.
631 * @ci: Intensity coefficient for threshold calculation. range [0, 0x1f]
633 * format: u3.2 (3 most significant bits represent whole number,
634 * 2 least significant bits represent the fractional part
635 * with each count representing 0.25)
636 * e.g. 6 in binary format is 00110, that translates to 1.5
637 * @reserved1: reserved
638 * @r_nf: Normalization shift value for r^2 calculation, range [12, 20]
639 * where r is a radius of pixel [row, col] from centor of sensor.
642 * Threshold used to distinguish between noise and details.
644 struct ipu3_uapi_bnr_static_config_thr_coeffs_config {
654 * struct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config - Shading config
656 * @gr: Coefficient defines lens shading gain approximation for gr channel
657 * @r: Coefficient defines lens shading gain approximation for r channel
658 * @b: Coefficient defines lens shading gain approximation for b channel
659 * @gb: Coefficient defines lens shading gain approximation for gb channel
661 * Parameters for noise model (NM) adaptation of BNR due to shading correction.
662 * All above have precision of u3.3, default to 0.
664 struct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config {
672 * struct ipu3_uapi_bnr_static_config_opt_center_config - Optical center config
674 * @x_reset: Reset value of X (col start - X center). Precision s12.0.
675 * @reserved0: reserved
676 * @y_reset: Reset value of Y (row start - Y center). Precision s12.0.
677 * @reserved2: reserved
679 * Distance from corner to optical center for NM adaptation due to shading
680 * correction (should be calculated based on shading tables)
682 struct ipu3_uapi_bnr_static_config_opt_center_config {
690 * struct ipu3_uapi_bnr_static_config_lut_config - BNR square root lookup table
692 * @values: pre-calculated values of square root function.
694 * LUT implementation of square root operation.
696 struct ipu3_uapi_bnr_static_config_lut_config {
697 __u8 values[IPU3_UAPI_BNR_LUT_SIZE];
701 * struct ipu3_uapi_bnr_static_config_bp_ctrl_config - Detect bad pixels (bp)
703 * @bp_thr_gain: Defines the threshold that specifies how different a
704 * defect pixel can be from its neighbors. Threshold is
705 * dependent on de-noise threshold calculated by algorithm.
706 * Range [4, 31], default 4.
707 * @reserved0: reserved
708 * @defect_mode: Mode of addressed defect pixels,
709 * 0 - single defect pixel is expected,
710 * 1 - 2 adjacent defect pixels are expected, default 1.
711 * @bp_gain: Defines how 2nd derivation that passes through a defect pixel
712 * is different from 2nd derivations that pass through
713 * neighbor pixels. u4.2, range [0, 256], default 8.
714 * @reserved1: reserved
715 * @w0_coeff: Blending coefficient of defect pixel correction.
716 * Precision u4, range [0, 8], default 8.
717 * @reserved2: reserved
718 * @w1_coeff: Enable influence of incorrect defect pixel correction to be
719 * avoided. Precision u4, range [1, 8], default 8.
720 * @reserved3: reserved
722 struct ipu3_uapi_bnr_static_config_bp_ctrl_config {
735 * struct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config - Denoising config
737 * @alpha: Weight of central element of smoothing filter.
738 * @beta: Weight of peripheral elements of smoothing filter, default 4.
739 * @gamma: Weight of diagonal elements of smoothing filter, default 4.
741 * beta and gamma parameter define the strength of the noise removal filter.
742 * All above has precision u0.4, range [0, 0xf]
743 * format: u0.4 (no / zero bits represent whole number,
744 * 4 bits represent the fractional part
745 * with each count representing 0.0625)
746 * e.g. 0xf translates to 0.0625x15 = 0.9375
748 * @reserved0: reserved
749 * @max_inf: Maximum increase of peripheral or diagonal element influence
750 * relative to the pre-defined value range: [0x5, 0xa]
751 * @reserved1: reserved
752 * @gd_enable: Green disparity enable control, 0 - disable, 1 - enable.
753 * @bpc_enable: Bad pixel correction enable control, 0 - disable, 1 - enable.
754 * @bnr_enable: Bayer noise removal enable control, 0 - disable, 1 - enable.
755 * @ff_enable: Fixed function enable, 0 - disable, 1 - enable.
756 * @reserved2: reserved
758 struct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config {
773 * struct ipu3_uapi_bnr_static_config_opt_center_sqr_config - BNR optical square
775 * @x_sqr_reset: Reset value of X^2.
776 * @y_sqr_reset: Reset value of Y^2.
781 * &ipu3_uapi_bnr_static_config_opt_center_config
782 * #. Both structs are used in threshold formula to calculate r^2, where r
783 * is a radius of pixel [row, col] from centor of sensor.
785 struct ipu3_uapi_bnr_static_config_opt_center_sqr_config {
791 * struct ipu3_uapi_bnr_static_config - BNR static config
793 * @wb_gains: white balance gains &ipu3_uapi_bnr_static_config_wb_gains_config
794 * @wb_gains_thr: white balance gains threshold as defined by
795 * &ipu3_uapi_bnr_static_config_wb_gains_thr_config
796 * @thr_coeffs: coefficients of threshold
797 * &ipu3_uapi_bnr_static_config_thr_coeffs_config
798 * @thr_ctrl_shd: control of shading threshold
799 * &ipu3_uapi_bnr_static_config_thr_ctrl_shd_config
800 * @opt_center: optical center &ipu3_uapi_bnr_static_config_opt_center_config
802 * Above parameters and opt_center_sqr are used for white balance and shading.
804 * @lut: lookup table &ipu3_uapi_bnr_static_config_lut_config
805 * @bp_ctrl: detect and remove bad pixels as defined in struct
806 * &ipu3_uapi_bnr_static_config_bp_ctrl_config
807 * @dn_detect_ctrl: detect and remove noise.
808 * &ipu3_uapi_bnr_static_config_dn_detect_ctrl_config
809 * @column_size: The number of pixels in column.
810 * @opt_center_sqr: Reset value of r^2 to optical center, see
811 * &ipu3_uapi_bnr_static_config_opt_center_sqr_config.
813 struct ipu3_uapi_bnr_static_config {
814 struct ipu3_uapi_bnr_static_config_wb_gains_config wb_gains;
815 struct ipu3_uapi_bnr_static_config_wb_gains_thr_config wb_gains_thr;
816 struct ipu3_uapi_bnr_static_config_thr_coeffs_config thr_coeffs;
817 struct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config thr_ctrl_shd;
818 struct ipu3_uapi_bnr_static_config_opt_center_config opt_center;
819 struct ipu3_uapi_bnr_static_config_lut_config lut;
820 struct ipu3_uapi_bnr_static_config_bp_ctrl_config bp_ctrl;
821 struct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config dn_detect_ctrl;
823 struct ipu3_uapi_bnr_static_config_opt_center_sqr_config opt_center_sqr;
827 * struct ipu3_uapi_bnr_static_config_green_disparity - Correct green disparity
829 * @gd_red: Shading gain coeff for gr disparity level in bright red region.
830 * Precision u0.6, default 4(0.0625).
831 * @reserved0: reserved
832 * @gd_green: Shading gain coeff for gr disparity level in bright green
833 * region. Precision u0.6, default 4(0.0625).
834 * @reserved1: reserved
835 * @gd_blue: Shading gain coeff for gr disparity level in bright blue region.
836 * Precision u0.6, default 4(0.0625).
837 * @reserved2: reserved
838 * @gd_black: Maximal green disparity level in dark region (stronger disparity
839 * assumed to be image detail). Precision u14, default 80.
840 * @reserved3: reserved
841 * @gd_shading: Change maximal green disparity level according to square
842 * distance from image center.
843 * @reserved4: reserved
844 * @gd_support: Lower bound for the number of second green color pixels in
845 * current pixel neighborhood with less than threshold difference
848 * The shading gain coeff of red, green, blue and black are used to calculate
849 * threshold given a pixel's color value and its coordinates in the image.
851 * @reserved5: reserved
852 * @gd_clip: Turn green disparity clip on/off, [0, 1], default 1.
853 * @gd_central_weight: Central pixel weight in 9 pixels weighted sum.
855 struct ipu3_uapi_bnr_static_config_green_disparity {
869 __u32 gd_central_weight:4;
873 * struct ipu3_uapi_dm_config - De-mosaic parameters
875 * @dm_en: de-mosaic enable.
876 * @ch_ar_en: Checker artifacts removal enable flag. Default 0.
877 * @fcc_en: False color correction (FCC) enable flag. Default 0.
878 * @reserved0: reserved
879 * @frame_width: do not care
880 * @gamma_sc: Sharpening coefficient (coefficient of 2-d derivation of
881 * complementary color in Hamilton-Adams interpolation).
882 * u5, range [0, 31], default 8.
883 * @reserved1: reserved
884 * @lc_ctrl: Parameter that controls weights of Chroma Homogeneity metric
885 * in calculation of final homogeneity metric.
886 * u5, range [0, 31], default 7.
887 * @reserved2: reserved
888 * @cr_param1: First parameter that defines Checker artifact removal
889 * feature gain. Precision u5, range [0, 31], default 8.
890 * @reserved3: reserved
891 * @cr_param2: Second parameter that defines Checker artifact removal
892 * feature gain. Precision u5, range [0, 31], default 8.
893 * @reserved4: reserved
894 * @coring_param: Defines power of false color correction operation.
895 * low for preserving edge colors, high for preserving gray
897 * Precision u1.4, range [0, 1.9375], default 4 (0.25).
898 * @reserved5: reserved
900 * The demosaic fixed function block is responsible to covert Bayer(mosaiced)
901 * images into color images based on demosaicing algorithm.
903 struct ipu3_uapi_dm_config {
908 __u32 frame_width:16;
919 __u32 coring_param:5;
924 * struct ipu3_uapi_ccm_mat_config - Color correction matrix
926 * @coeff_m11: CCM 3x3 coefficient, range [-65536, 65535]
927 * @coeff_m12: CCM 3x3 coefficient, range [-8192, 8191]
928 * @coeff_m13: CCM 3x3 coefficient, range [-32768, 32767]
929 * @coeff_o_r: Bias 3x1 coefficient, range [-8191, 8181]
930 * @coeff_m21: CCM 3x3 coefficient, range [-32767, 32767]
931 * @coeff_m22: CCM 3x3 coefficient, range [-8192, 8191]
932 * @coeff_m23: CCM 3x3 coefficient, range [-32768, 32767]
933 * @coeff_o_g: Bias 3x1 coefficient, range [-8191, 8181]
934 * @coeff_m31: CCM 3x3 coefficient, range [-32768, 32767]
935 * @coeff_m32: CCM 3x3 coefficient, range [-8192, 8191]
936 * @coeff_m33: CCM 3x3 coefficient, range [-32768, 32767]
937 * @coeff_o_b: Bias 3x1 coefficient, range [-8191, 8181]
939 * Transform sensor specific color space to standard sRGB by applying 3x3 matrix
940 * and adding a bias vector O. The transformation is basically a rotation and
941 * translation in the 3-dimensional color spaces. Here are the defaults:
943 * 9775, -2671, 1087, 0
944 * -1071, 8303, 815, 0
945 * -23, -7887, 16103, 0
947 struct ipu3_uapi_ccm_mat_config {
963 * struct ipu3_uapi_gamma_corr_ctrl - Gamma correction
965 * @enable: gamma correction enable.
966 * @reserved: reserved
968 struct ipu3_uapi_gamma_corr_ctrl {
974 * struct ipu3_uapi_gamma_corr_lut - Per-pixel tone mapping implemented as LUT.
976 * @lut: 256 tabulated values of the gamma function. LUT[1].. LUT[256]
977 * format u13.0, range [0, 8191].
979 * The tone mapping operation is done by a Piece wise linear graph
980 * that is implemented as a lookup table(LUT). The pixel component input
981 * intensity is the X-axis of the graph which is the table entry.
983 struct ipu3_uapi_gamma_corr_lut {
984 __u16 lut[IPU3_UAPI_GAMMA_CORR_LUT_ENTRIES];
988 * struct ipu3_uapi_gamma_config - Gamma config
990 * @gc_ctrl: control of gamma correction &ipu3_uapi_gamma_corr_ctrl
991 * @gc_lut: lookup table of gamma correction &ipu3_uapi_gamma_corr_lut
993 struct ipu3_uapi_gamma_config {
994 struct ipu3_uapi_gamma_corr_ctrl gc_ctrl __attribute__((aligned(32)));
995 struct ipu3_uapi_gamma_corr_lut gc_lut __attribute__((aligned(32)));
999 * struct ipu3_uapi_csc_mat_config - Color space conversion matrix config
1001 * @coeff_c11: Conversion matrix value, format s0.14, range [-16384, 16383].
1002 * @coeff_c12: Conversion matrix value, format s0.14, range [-8192, 8191].
1003 * @coeff_c13: Conversion matrix value, format s0.14, range [-16384, 16383].
1004 * @coeff_b1: Bias 3x1 coefficient, s13.0 range [-8192, 8191].
1005 * @coeff_c21: Conversion matrix value, format s0.14, range [-16384, 16383].
1006 * @coeff_c22: Conversion matrix value, format s0.14, range [-8192, 8191].
1007 * @coeff_c23: Conversion matrix value, format s0.14, range [-16384, 16383].
1008 * @coeff_b2: Bias 3x1 coefficient, s13.0 range [-8192, 8191].
1009 * @coeff_c31: Conversion matrix value, format s0.14, range [-16384, 16383].
1010 * @coeff_c32: Conversion matrix value, format s0.14, range [-8192, 8191].
1011 * @coeff_c33: Conversion matrix value, format s0.14, range [-16384, 16383].
1012 * @coeff_b3: Bias 3x1 coefficient, s13.0 range [-8192, 8191].
1014 * To transform each pixel from RGB to YUV (Y - brightness/luminance,
1015 * UV -chroma) by applying the pixel's values by a 3x3 matrix and adding an
1016 * optional bias 3x1 vector. Here are the default values for the matrix:
1018 * 4898, 9617, 1867, 0,
1019 * -2410, -4732, 7143, 0,
1020 * 10076, -8437, -1638, 0,
1022 * (i.e. for real number 0.299, 0.299 * 2^14 becomes 4898.)
1024 struct ipu3_uapi_csc_mat_config {
1040 * struct ipu3_uapi_cds_params - Chroma down-scaling
1042 * @ds_c00: range [0, 3]
1043 * @ds_c01: range [0, 3]
1044 * @ds_c02: range [0, 3]
1045 * @ds_c03: range [0, 3]
1046 * @ds_c10: range [0, 3]
1047 * @ds_c11: range [0, 3]
1048 * @ds_c12: range [0, 3]
1049 * @ds_c13: range [0, 3]
1051 * In case user does not provide, above 4x2 filter will use following defaults:
1055 * @ds_nf: Normalization factor for Chroma output downscaling filter,
1056 * range 0,4, default 2.
1057 * @reserved0: reserved
1058 * @csc_en: Color space conversion enable
1059 * @uv_bin_output: 0: output YUV 4.2.0, 1: output YUV 4.2.2(default).
1060 * @reserved1: reserved
1062 struct ipu3_uapi_cds_params {
1074 __u32 uv_bin_output:1;
1079 * struct ipu3_uapi_shd_grid_config - Bayer shading(darkening) correction
1081 * @width: Grid horizontal dimensions, u8, [8, 128], default 73
1082 * @height: Grid vertical dimensions, u8, [8, 128], default 56
1083 * @block_width_log2: Log2 of the width of the grid cell in pixel count
1084 * u4, [0, 15], default value 5.
1085 * @reserved0: reserved
1086 * @block_height_log2: Log2 of the height of the grid cell in pixel count
1087 * u4, [0, 15], default value 6.
1088 * @reserved1: reserved
1089 * @grid_height_per_slice: SHD_MAX_CELLS_PER_SET/width.
1090 * (with SHD_MAX_CELLS_PER_SET = 146).
1091 * @x_start: X value of top left corner of sensor relative to ROI
1092 * s13, [-4096, 0], default 0, only negative values.
1093 * @y_start: Y value of top left corner of sensor relative to ROI
1094 * s13, [-4096, 0], default 0, only negative values.
1096 struct ipu3_uapi_shd_grid_config {
1100 __u8 block_width_log2:3;
1102 __u8 block_height_log2:3;
1104 __u8 grid_height_per_slice;
1111 * struct ipu3_uapi_shd_general_config - Shading general config
1113 * @init_set_vrt_offst_ul: set vertical offset,
1114 * y_start >> block_height_log2 % grid_height_per_slice.
1115 * @shd_enable: shading enable.
1116 * @gain_factor: Gain factor. Shift calculated anti shading value. Precision u2.
1117 * 0x0 - gain factor [1, 5], means no shift interpolated value.
1118 * 0x1 - gain factor [1, 9], means shift interpolated by 1.
1119 * 0x2 - gain factor [1, 17], means shift interpolated by 2.
1120 * @reserved: reserved
1122 * Correction is performed by multiplying a gain factor for each of the 4 Bayer
1123 * channels as a function of the pixel location in the sensor.
1125 struct ipu3_uapi_shd_general_config {
1126 __u32 init_set_vrt_offst_ul:8;
1128 __u32 gain_factor:2;
1133 * struct ipu3_uapi_shd_black_level_config - Black level correction
1135 * @bl_r: Bios values for green red. s11 range [-2048, 2047].
1136 * @bl_gr: Bios values for green blue. s11 range [-2048, 2047].
1137 * @bl_gb: Bios values for red. s11 range [-2048, 2047].
1138 * @bl_b: Bios values for blue. s11 range [-2048, 2047].
1140 struct ipu3_uapi_shd_black_level_config {
1148 * struct ipu3_uapi_shd_config_static - Shading config static
1150 * @grid: shading grid config &ipu3_uapi_shd_grid_config
1151 * @general: shading general config &ipu3_uapi_shd_general_config
1152 * @black_level: black level config for shading correction as defined by
1153 * &ipu3_uapi_shd_black_level_config
1155 struct ipu3_uapi_shd_config_static {
1156 struct ipu3_uapi_shd_grid_config grid;
1157 struct ipu3_uapi_shd_general_config general;
1158 struct ipu3_uapi_shd_black_level_config black_level;
1162 * struct ipu3_uapi_shd_lut - Shading gain factor lookup table.
1165 * @sets.r_and_gr: Red and GreenR Lookup table.
1166 * @sets.r_and_gr.r: Red shading factor.
1167 * @sets.r_and_gr.gr: GreenR shading factor.
1168 * @sets.reserved1: reserved
1169 * @sets.gb_and_b: GreenB and Blue Lookup table.
1170 * @sets.gb_and_b.gb: GreenB shading factor.
1171 * @sets.gb_and_b.b: Blue shading factor.
1172 * @sets.reserved2: reserved
1174 * Map to shading correction LUT register set.
1176 struct ipu3_uapi_shd_lut {
1181 } r_and_gr[IPU3_UAPI_SHD_MAX_CELLS_PER_SET];
1186 } gb_and_b[IPU3_UAPI_SHD_MAX_CELLS_PER_SET];
1188 } sets[IPU3_UAPI_SHD_MAX_CFG_SETS];
1192 * struct ipu3_uapi_shd_config - Shading config
1194 * @shd: shading static config, see &ipu3_uapi_shd_config_static
1195 * @shd_lut: shading lookup table &ipu3_uapi_shd_lut
1197 struct ipu3_uapi_shd_config {
1198 struct ipu3_uapi_shd_config_static shd __attribute__((aligned(32)));
1199 struct ipu3_uapi_shd_lut shd_lut __attribute__((aligned(32)));
1202 /* Image Enhancement Filter directed */
1205 * struct ipu3_uapi_iefd_cux2 - IEFd Config Unit 2 parameters
1207 * @x0: X0 point of Config Unit, u9.0, default 0.
1208 * @x1: X1 point of Config Unit, u9.0, default 0.
1209 * @a01: Slope A of Config Unit, s4.4, default 0.
1210 * @b01: Slope B, always 0.
1212 * Calculate weight for blending directed and non-directed denoise elements
1215 * Each instance of Config Unit needs X coordinate of n points and
1216 * slope A factor between points calculated by driver based on calibration
1219 * All CU inputs are unsigned, they will be converted to signed when written
1220 * to register, i.e. a01 will be written to 9 bit register in s4.4 format.
1221 * This applies to &ipu3_uapi_iefd_cux6_ed, &ipu3_uapi_iefd_cux2_1,
1222 * &ipu3_uapi_iefd_cux2_1, &ipu3_uapi_iefd_cux4 and &ipu3_uapi_iefd_cux6_rad.
1224 struct ipu3_uapi_iefd_cux2 {
1232 * struct ipu3_uapi_iefd_cux6_ed - Calculate power of non-directed sharpening
1233 * element, Config Unit 6 for edge detail (ED).
1235 * @x0: X coordinate of point 0, u9.0, default 0.
1236 * @x1: X coordinate of point 1, u9.0, default 0.
1237 * @x2: X coordinate of point 2, u9.0, default 0.
1238 * @reserved0: reserved
1239 * @x3: X coordinate of point 3, u9.0, default 0.
1240 * @x4: X coordinate of point 4, u9.0, default 0.
1241 * @x5: X coordinate of point 5, u9.0, default 0.
1242 * @reserved1: reserved
1243 * @a01: slope A points 01, s4.4, default 0.
1244 * @a12: slope A points 12, s4.4, default 0.
1245 * @a23: slope A points 23, s4.4, default 0.
1246 * @reserved2: reserved
1247 * @a34: slope A points 34, s4.4, default 0.
1248 * @a45: slope A points 45, s4.4, default 0.
1249 * @reserved3: reserved
1250 * @b01: slope B points 01, s4.4, default 0.
1251 * @b12: slope B points 12, s4.4, default 0.
1252 * @b23: slope B points 23, s4.4, default 0.
1253 * @reserved4: reserved
1254 * @b34: slope B points 34, s4.4, default 0.
1255 * @b45: slope B points 45, s4.4, default 0.
1256 * @reserved5: reserved.
1258 struct ipu3_uapi_iefd_cux6_ed {
1289 * struct ipu3_uapi_iefd_cux2_1 - Calculate power of non-directed denoise
1291 * @x0: X0 point of Config Unit, u9.0, default 0.
1292 * @x1: X1 point of Config Unit, u9.0, default 0.
1293 * @a01: Slope A of Config Unit, s4.4, default 0.
1294 * @reserved1: reserved
1295 * @b01: offset B0 of Config Unit, u7.0, default 0.
1296 * @reserved2: reserved
1298 struct ipu3_uapi_iefd_cux2_1 {
1309 * struct ipu3_uapi_iefd_cux4 - Calculate power of non-directed sharpening
1312 * @x0: X0 point of Config Unit, u9.0, default 0.
1313 * @x1: X1 point of Config Unit, u9.0, default 0.
1314 * @x2: X2 point of Config Unit, u9.0, default 0.
1315 * @reserved0: reserved
1316 * @x3: X3 point of Config Unit, u9.0, default 0.
1317 * @a01: Slope A0 of Config Unit, s4.4, default 0.
1318 * @a12: Slope A1 of Config Unit, s4.4, default 0.
1319 * @reserved1: reserved
1320 * @a23: Slope A2 of Config Unit, s4.4, default 0.
1321 * @b01: Offset B0 of Config Unit, s7.0, default 0.
1322 * @b12: Offset B1 of Config Unit, s7.0, default 0.
1323 * @reserved2: reserved
1324 * @b23: Offset B2 of Config Unit, s7.0, default 0.
1325 * @reserved3: reserved
1327 struct ipu3_uapi_iefd_cux4 {
1348 * struct ipu3_uapi_iefd_cux6_rad - Radial Config Unit (CU)
1350 * @x0: x0 points of Config Unit radial, u8.0
1351 * @x1: x1 points of Config Unit radial, u8.0
1352 * @x2: x2 points of Config Unit radial, u8.0
1353 * @x3: x3 points of Config Unit radial, u8.0
1354 * @x4: x4 points of Config Unit radial, u8.0
1355 * @x5: x5 points of Config Unit radial, u8.0
1356 * @reserved1: reserved
1357 * @a01: Slope A of Config Unit radial, s7.8
1358 * @a12: Slope A of Config Unit radial, s7.8
1359 * @a23: Slope A of Config Unit radial, s7.8
1360 * @a34: Slope A of Config Unit radial, s7.8
1361 * @a45: Slope A of Config Unit radial, s7.8
1362 * @reserved2: reserved
1363 * @b01: Slope B of Config Unit radial, s9.0
1364 * @b12: Slope B of Config Unit radial, s9.0
1365 * @b23: Slope B of Config Unit radial, s9.0
1366 * @reserved4: reserved
1367 * @b34: Slope B of Config Unit radial, s9.0
1368 * @b45: Slope B of Config Unit radial, s9.0
1369 * @reserved5: reserved
1371 struct ipu3_uapi_iefd_cux6_rad {
1401 * struct ipu3_uapi_yuvp1_iefd_cfg_units - IEFd Config Units parameters
1403 * @cu_1: calculate weight for blending directed and
1404 * non-directed denoise elements. See &ipu3_uapi_iefd_cux2
1405 * @cu_ed: calculate power of non-directed sharpening element, see
1406 * &ipu3_uapi_iefd_cux6_ed
1407 * @cu_3: calculate weight for blending directed and
1408 * non-directed denoise elements. A &ipu3_uapi_iefd_cux2
1409 * @cu_5: calculate power of non-directed denoise element apply, use
1410 * &ipu3_uapi_iefd_cux2_1
1411 * @cu_6: calculate power of non-directed sharpening element. See
1412 * &ipu3_uapi_iefd_cux4
1413 * @cu_7: calculate weight for blending directed and
1414 * non-directed denoise elements. Use &ipu3_uapi_iefd_cux2
1415 * @cu_unsharp: Config Unit of unsharp &ipu3_uapi_iefd_cux4
1416 * @cu_radial: Config Unit of radial &ipu3_uapi_iefd_cux6_rad
1417 * @cu_vssnlm: Config Unit of vssnlm &ipu3_uapi_iefd_cux2
1419 struct ipu3_uapi_yuvp1_iefd_cfg_units {
1420 struct ipu3_uapi_iefd_cux2 cu_1;
1421 struct ipu3_uapi_iefd_cux6_ed cu_ed;
1422 struct ipu3_uapi_iefd_cux2 cu_3;
1423 struct ipu3_uapi_iefd_cux2_1 cu_5;
1424 struct ipu3_uapi_iefd_cux4 cu_6;
1425 struct ipu3_uapi_iefd_cux2 cu_7;
1426 struct ipu3_uapi_iefd_cux4 cu_unsharp;
1427 struct ipu3_uapi_iefd_cux6_rad cu_radial;
1428 struct ipu3_uapi_iefd_cux2 cu_vssnlm;
1432 * struct ipu3_uapi_yuvp1_iefd_config_s - IEFd config
1434 * @horver_diag_coeff: Gradient compensation. Compared with vertical /
1435 * horizontal (0 / 90 degree), coefficient of diagonal (45 /
1436 * 135 degree) direction should be corrected by approx.
1438 * @reserved0: reserved
1439 * @clamp_stitch: Slope to stitch between clamped and unclamped edge values
1440 * @reserved1: reserved
1441 * @direct_metric_update: Update coeff for direction metric
1442 * @reserved2: reserved
1443 * @ed_horver_diag_coeff: Radial Coefficient that compensates for
1444 * different distance for vertical/horizontal and
1445 * diagonal gradient calculation (approx. 1/sqrt(2))
1446 * @reserved3: reserved
1448 struct ipu3_uapi_yuvp1_iefd_config_s {
1449 __u32 horver_diag_coeff:7;
1451 __u32 clamp_stitch:6;
1453 __u32 direct_metric_update:5;
1455 __u32 ed_horver_diag_coeff:7;
1460 * struct ipu3_uapi_yuvp1_iefd_control - IEFd control
1462 * @iefd_en: Enable IEFd
1463 * @denoise_en: Enable denoise
1464 * @direct_smooth_en: Enable directional smooth
1465 * @rad_en: Enable radial update
1466 * @vssnlm_en: Enable VSSNLM output filter
1467 * @reserved: reserved
1469 struct ipu3_uapi_yuvp1_iefd_control {
1472 __u32 direct_smooth_en:1;
1479 * struct ipu3_uapi_sharp_cfg - Sharpening config
1481 * @nega_lmt_txt: Sharpening limit for negative overshoots for texture.
1482 * @reserved0: reserved
1483 * @posi_lmt_txt: Sharpening limit for positive overshoots for texture.
1484 * @reserved1: reserved
1485 * @nega_lmt_dir: Sharpening limit for negative overshoots for direction (edge).
1486 * @reserved2: reserved
1487 * @posi_lmt_dir: Sharpening limit for positive overshoots for direction (edge).
1488 * @reserved3: reserved
1490 * Fixed point type u13.0, range [0, 8191].
1492 struct ipu3_uapi_sharp_cfg {
1493 __u32 nega_lmt_txt:13;
1495 __u32 posi_lmt_txt:13;
1497 __u32 nega_lmt_dir:13;
1499 __u32 posi_lmt_dir:13;
1504 * struct struct ipu3_uapi_far_w - Sharpening config for far sub-group
1506 * @dir_shrp: Weight of wide direct sharpening, u1.6, range [0, 64], default 64.
1507 * @reserved0: reserved
1508 * @dir_dns: Weight of wide direct denoising, u1.6, range [0, 64], default 0.
1509 * @reserved1: reserved
1510 * @ndir_dns_powr: Power of non-direct denoising,
1511 * Precision u1.6, range [0, 64], default 64.
1512 * @reserved2: reserved
1514 struct ipu3_uapi_far_w {
1519 __u32 ndir_dns_powr:7;
1524 * struct struct ipu3_uapi_unsharp_cfg - Unsharp config
1526 * @unsharp_weight: Unsharp mask blending weight.
1527 * u1.6, range [0, 64], default 16.
1528 * 0 - disabled, 64 - use only unsharp.
1529 * @reserved0: reserved
1530 * @unsharp_amount: Unsharp mask amount, u4.5, range [0, 511], default 0.
1531 * @reserved1: reserved
1533 struct ipu3_uapi_unsharp_cfg {
1534 __u32 unsharp_weight:7;
1536 __u32 unsharp_amount:9;
1541 * struct ipu3_uapi_yuvp1_iefd_shrp_cfg - IEFd sharpness config
1543 * @cfg: sharpness config &ipu3_uapi_sharp_cfg
1544 * @far_w: wide range config, value as specified by &ipu3_uapi_far_w:
1545 * The 5x5 environment is separated into 2 sub-groups, the 3x3 nearest
1546 * neighbors (8 pixels called Near), and the second order neighborhood
1547 * around them (16 pixels called Far).
1548 * @unshrp_cfg: unsharpness config. &ipu3_uapi_unsharp_cfg
1550 struct ipu3_uapi_yuvp1_iefd_shrp_cfg {
1551 struct ipu3_uapi_sharp_cfg cfg;
1552 struct ipu3_uapi_far_w far_w;
1553 struct ipu3_uapi_unsharp_cfg unshrp_cfg;
1557 * struct ipu3_uapi_unsharp_coef0 - Unsharp mask coefficients
1559 * @c00: Coeff11, s0.8, range [-255, 255], default 1.
1560 * @c01: Coeff12, s0.8, range [-255, 255], default 5.
1561 * @c02: Coeff13, s0.8, range [-255, 255], default 9.
1562 * @reserved: reserved
1564 * Configurable registers for common sharpening support.
1566 struct ipu3_uapi_unsharp_coef0 {
1574 * struct ipu3_uapi_unsharp_coef1 - Unsharp mask coefficients
1576 * @c11: Coeff22, s0.8, range [-255, 255], default 29.
1577 * @c12: Coeff23, s0.8, range [-255, 255], default 55.
1578 * @c22: Coeff33, s0.8, range [-255, 255], default 96.
1579 * @reserved: reserved
1581 struct ipu3_uapi_unsharp_coef1 {
1589 * struct ipu3_uapi_yuvp1_iefd_unshrp_cfg - Unsharp mask config
1591 * @unsharp_coef0: unsharp coefficient 0 config. See &ipu3_uapi_unsharp_coef0
1592 * @unsharp_coef1: unsharp coefficient 1 config. See &ipu3_uapi_unsharp_coef1
1594 struct ipu3_uapi_yuvp1_iefd_unshrp_cfg {
1595 struct ipu3_uapi_unsharp_coef0 unsharp_coef0;
1596 struct ipu3_uapi_unsharp_coef1 unsharp_coef1;
1600 * struct ipu3_uapi_radial_reset_xy - Radial coordinate reset
1602 * @x: Radial reset of x coordinate. Precision s12, [-4095, 4095], default 0.
1603 * @reserved0: reserved
1604 * @y: Radial center y coordinate. Precision s12, [-4095, 4095], default 0.
1605 * @reserved1: reserved
1607 struct ipu3_uapi_radial_reset_xy {
1615 * struct ipu3_uapi_radial_reset_x2 - Radial X^2 reset
1617 * @x2: Radial reset of x^2 coordinate. Precision u24, default 0.
1618 * @reserved: reserved
1620 struct ipu3_uapi_radial_reset_x2 {
1626 * struct ipu3_uapi_radial_reset_y2 - Radial Y^2 reset
1628 * @y2: Radial reset of y^2 coordinate. Precision u24, default 0.
1629 * @reserved: reserved
1631 struct ipu3_uapi_radial_reset_y2 {
1637 * struct ipu3_uapi_radial_cfg - Radial config
1639 * @rad_nf: Radial. R^2 normalization factor is scale down by 2^ - (15 + scale)
1640 * @reserved0: reserved
1641 * @rad_inv_r2: Radial R^-2 normelized to (0.5..1).
1642 * Precision u7, range [0, 127].
1643 * @reserved1: reserved
1645 struct ipu3_uapi_radial_cfg {
1653 * struct ipu3_uapi_rad_far_w - Radial FAR sub-group
1655 * @rad_dir_far_sharp_w: Weight of wide direct sharpening, u1.6, range [0, 64],
1657 * @rad_dir_far_dns_w: Weight of wide direct denoising, u1.6, range [0, 64],
1659 * @rad_ndir_far_dns_power: power of non-direct sharpening, u1.6, range [0, 64],
1661 * @reserved: reserved
1663 struct ipu3_uapi_rad_far_w {
1664 __u32 rad_dir_far_sharp_w:8;
1665 __u32 rad_dir_far_dns_w:8;
1666 __u32 rad_ndir_far_dns_power:8;
1671 * struct ipu3_uapi_cu_cfg0 - Radius Config Unit cfg0 register
1673 * @cu6_pow: Power of CU6. Power of non-direct sharpening, u3.4.
1674 * @reserved0: reserved
1675 * @cu_unsharp_pow: Power of unsharp mask, u2.4.
1676 * @reserved1: reserved
1677 * @rad_cu6_pow: Radial/corner CU6. Directed sharpening power, u3.4.
1678 * @reserved2: reserved
1679 * @rad_cu_unsharp_pow: Radial power of unsharp mask, u2.4.
1680 * @reserved3: reserved
1682 struct ipu3_uapi_cu_cfg0 {
1685 __u32 cu_unsharp_pow:7;
1687 __u32 rad_cu6_pow:7;
1689 __u32 rad_cu_unsharp_pow:6;
1694 * struct ipu3_uapi_cu_cfg1 - Radius Config Unit cfg1 register
1696 * @rad_cu6_x1: X1 point of Config Unit 6, precision u9.0.
1697 * @reserved0: reserved
1698 * @rad_cu_unsharp_x1: X1 point for Config Unit unsharp for radial/corner point
1700 * @reserved1: reserved
1702 struct ipu3_uapi_cu_cfg1 {
1705 __u32 rad_cu_unsharp_x1:9;
1710 * struct ipu3_uapi_yuvp1_iefd_rad_cfg - IEFd parameters changed radially over
1711 * the picture plane.
1713 * @reset_xy: reset xy value in radial calculation. &ipu3_uapi_radial_reset_xy
1714 * @reset_x2: reset x square value in radial calculation. See struct
1715 * &ipu3_uapi_radial_reset_x2
1716 * @reset_y2: reset y square value in radial calculation. See struct
1717 * &ipu3_uapi_radial_reset_y2
1718 * @cfg: radial config defined in &ipu3_uapi_radial_cfg
1719 * @rad_far_w: weight for wide range radial. &ipu3_uapi_rad_far_w
1720 * @cu_cfg0: configuration unit 0. See &ipu3_uapi_cu_cfg0
1721 * @cu_cfg1: configuration unit 1. See &ipu3_uapi_cu_cfg1
1723 struct ipu3_uapi_yuvp1_iefd_rad_cfg {
1724 struct ipu3_uapi_radial_reset_xy reset_xy;
1725 struct ipu3_uapi_radial_reset_x2 reset_x2;
1726 struct ipu3_uapi_radial_reset_y2 reset_y2;
1727 struct ipu3_uapi_radial_cfg cfg;
1728 struct ipu3_uapi_rad_far_w rad_far_w;
1729 struct ipu3_uapi_cu_cfg0 cu_cfg0;
1730 struct ipu3_uapi_cu_cfg1 cu_cfg1;
1733 /* Vssnlm - Very small scale non-local mean algorithm */
1736 * struct ipu3_uapi_vss_lut_x - Vssnlm LUT x0/x1/x2
1738 * @vs_x0: Vssnlm LUT x0, precision u8, range [0, 255], default 16.
1739 * @vs_x1: Vssnlm LUT x1, precision u8, range [0, 255], default 32.
1740 * @vs_x2: Vssnlm LUT x2, precision u8, range [0, 255], default 64.
1741 * @reserved2: reserved
1743 struct ipu3_uapi_vss_lut_x {
1751 * struct ipu3_uapi_vss_lut_y - Vssnlm LUT y0/y1/y2
1753 * @vs_y1: Vssnlm LUT y1, precision u4, range [0, 8], default 1.
1754 * @reserved0: reserved
1755 * @vs_y2: Vssnlm LUT y2, precision u4, range [0, 8], default 3.
1756 * @reserved1: reserved
1757 * @vs_y3: Vssnlm LUT y3, precision u4, range [0, 8], default 8.
1758 * @reserved2: reserved
1760 struct ipu3_uapi_vss_lut_y {
1770 * struct ipu3_uapi_yuvp1_iefd_vssnlm_cf - IEFd Vssnlm Lookup table
1772 * @vss_lut_x: vss lookup table. See &ipu3_uapi_vss_lut_x description
1773 * @vss_lut_y: vss lookup table. See &ipu3_uapi_vss_lut_y description
1775 struct ipu3_uapi_yuvp1_iefd_vssnlm_cfg {
1776 struct ipu3_uapi_vss_lut_x vss_lut_x;
1777 struct ipu3_uapi_vss_lut_y vss_lut_y;
1781 * struct ipu3_uapi_yuvp1_iefd_config - IEFd config
1783 * @units: configuration unit setting, &ipu3_uapi_yuvp1_iefd_cfg_units
1784 * @config: configuration, as defined by &ipu3_uapi_yuvp1_iefd_config_s
1785 * @control: control setting, as defined by &ipu3_uapi_yuvp1_iefd_control
1786 * @sharp: sharpness setting, as defined by &ipu3_uapi_yuvp1_iefd_shrp_cfg
1787 * @unsharp: unsharpness setting, as defined by &ipu3_uapi_yuvp1_iefd_unshrp_cfg
1788 * @rad: radial setting, as defined by &ipu3_uapi_yuvp1_iefd_rad_cfg
1789 * @vsslnm: vsslnm setting, as defined by &ipu3_uapi_yuvp1_iefd_vssnlm_cfg
1791 struct ipu3_uapi_yuvp1_iefd_config {
1792 struct ipu3_uapi_yuvp1_iefd_cfg_units units;
1793 struct ipu3_uapi_yuvp1_iefd_config_s config;
1794 struct ipu3_uapi_yuvp1_iefd_control control;
1795 struct ipu3_uapi_yuvp1_iefd_shrp_cfg sharp;
1796 struct ipu3_uapi_yuvp1_iefd_unshrp_cfg unsharp;
1797 struct ipu3_uapi_yuvp1_iefd_rad_cfg rad;
1798 struct ipu3_uapi_yuvp1_iefd_vssnlm_cfg vsslnm;
1802 * struct ipu3_uapi_yuvp1_yds_config - Y Down-Sampling config
1804 * @c00: range [0, 3], default 0x0
1805 * @c01: range [0, 3], default 0x1
1806 * @c02: range [0, 3], default 0x1
1807 * @c03: range [0, 3], default 0x0
1808 * @c10: range [0, 3], default 0x0
1809 * @c11: range [0, 3], default 0x1
1810 * @c12: range [0, 3], default 0x1
1811 * @c13: range [0, 3], default 0x0
1813 * Above are 4x2 filter coefficients for chroma output downscaling.
1815 * @norm_factor: Normalization factor, range [0, 4], default 2
1821 * @reserved0: reserved
1822 * @bin_output: Down sampling on Luma channel in two optional modes
1823 * 0 - Bin output 4.2.0 (default), 1 output 4.2.2.
1824 * @reserved1: reserved
1826 struct ipu3_uapi_yuvp1_yds_config {
1835 __u32 norm_factor:5;
1841 /* Chroma Noise Reduction */
1844 * struct ipu3_uapi_yuvp1_chnr_enable_config - Chroma noise reduction enable
1846 * @enable: enable/disable chroma noise reduction
1847 * @yuv_mode: 0 - YUV420, 1 - YUV422
1848 * @reserved0: reserved
1849 * @col_size: number of columns in the frame, max width is 2560
1850 * @reserved1: reserved
1852 struct ipu3_uapi_yuvp1_chnr_enable_config {
1861 * struct ipu3_uapi_yuvp1_chnr_coring_config - Coring thresholds for UV
1863 * @u: U coring level, u0.13, range [0.0, 1.0], default 0.0
1864 * @reserved0: reserved
1865 * @v: V coring level, u0.13, range [0.0, 1.0], default 0.0
1866 * @reserved1: reserved
1868 struct ipu3_uapi_yuvp1_chnr_coring_config {
1876 * struct ipu3_uapi_yuvp1_chnr_sense_gain_config - Chroma noise reduction gains
1878 * All sensitivity gain parameters have precision u13.0, range [0, 8191].
1880 * @vy: Sensitivity of horizontal edge of Y, default 100
1881 * @vu: Sensitivity of horizontal edge of U, default 100
1882 * @vv: Sensitivity of horizontal edge of V, default 100
1883 * @reserved0: reserved
1884 * @hy: Sensitivity of vertical edge of Y, default 50
1885 * @hu: Sensitivity of vertical edge of U, default 50
1886 * @hv: Sensitivity of vertical edge of V, default 50
1887 * @reserved1: reserved
1889 struct ipu3_uapi_yuvp1_chnr_sense_gain_config {
1902 * struct ipu3_uapi_yuvp1_chnr_iir_fir_config - Chroma IIR/FIR filter config
1904 * @fir_0h: Value of center tap in horizontal FIR, range [0, 32], default 8.
1905 * @reserved0: reserved
1906 * @fir_1h: Value of distance 1 in horizontal FIR, range [0, 32], default 12.
1907 * @reserved1: reserved
1908 * @fir_2h: Value of distance 2 tap in horizontal FIR, range [0, 32], default 0.
1909 * @dalpha_clip_val: weight for previous row in IIR, range [1, 256], default 0.
1910 * @reserved2: reserved
1912 struct ipu3_uapi_yuvp1_chnr_iir_fir_config {
1918 __u32 dalpha_clip_val:9;
1923 * struct ipu3_uapi_yuvp1_chnr_config - Chroma noise reduction config
1925 * @enable: chroma noise reduction enable, see
1926 * &ipu3_uapi_yuvp1_chnr_enable_config
1927 * @coring: coring config for chroma noise reduction, see
1928 * &ipu3_uapi_yuvp1_chnr_coring_config
1929 * @sense_gain: sensitivity config for chroma noise reduction, see
1930 * ipu3_uapi_yuvp1_chnr_sense_gain_config
1931 * @iir_fir: iir and fir config for chroma noise reduction, see
1932 * ipu3_uapi_yuvp1_chnr_iir_fir_config
1934 struct ipu3_uapi_yuvp1_chnr_config {
1935 struct ipu3_uapi_yuvp1_chnr_enable_config enable;
1936 struct ipu3_uapi_yuvp1_chnr_coring_config coring;
1937 struct ipu3_uapi_yuvp1_chnr_sense_gain_config sense_gain;
1938 struct ipu3_uapi_yuvp1_chnr_iir_fir_config iir_fir;
1941 /* Edge Enhancement and Noise Reduction */
1944 * struct ipu3_uapi_yuvp1_y_ee_nr_lpf_config - Luma(Y) edge enhancement low-pass
1945 * filter coefficients
1947 * @a_diag: Smoothing diagonal coefficient, u5.0.
1948 * @reserved0: reserved
1949 * @a_periph: Image smoothing perpherial, u5.0.
1950 * @reserved1: reserved
1951 * @a_cent: Image Smoothing center coefficient, u5.0.
1952 * @reserved2: reserved
1953 * @enable: 0: Y_EE_NR disabled, output = input; 1: Y_EE_NR enabled.
1955 struct ipu3_uapi_yuvp1_y_ee_nr_lpf_config {
1966 * struct ipu3_uapi_yuvp1_y_ee_nr_sense_config - Luma(Y) edge enhancement
1967 * noise reduction sensitivity gains
1969 * @edge_sense_0: Sensitivity of edge in dark area. u13.0, default 8191.
1970 * @reserved0: reserved
1971 * @delta_edge_sense: Difference in the sensitivity of edges between
1972 * the bright and dark areas. u13.0, default 0.
1973 * @reserved1: reserved
1974 * @corner_sense_0: Sensitivity of corner in dark area. u13.0, default 0.
1975 * @reserved2: reserved
1976 * @delta_corner_sense: Difference in the sensitivity of corners between
1977 * the bright and dark areas. u13.0, default 8191.
1978 * @reserved3: reserved
1980 struct ipu3_uapi_yuvp1_y_ee_nr_sense_config {
1981 __u32 edge_sense_0:13;
1983 __u32 delta_edge_sense:13;
1985 __u32 corner_sense_0:13;
1987 __u32 delta_corner_sense:13;
1992 * struct ipu3_uapi_yuvp1_y_ee_nr_gain_config - Luma(Y) edge enhancement
1993 * noise reduction gain config
1995 * @gain_pos_0: Gain for positive edge in dark area. u5.0, [0, 16], default 2.
1996 * @reserved0: reserved
1997 * @delta_gain_posi: Difference in the gain of edges between the bright and
1998 * dark areas for positive edges. u5.0, [0, 16], default 0.
1999 * @reserved1: reserved
2000 * @gain_neg_0: Gain for negative edge in dark area. u5.0, [0, 16], default 8.
2001 * @reserved2: reserved
2002 * @delta_gain_neg: Difference in the gain of edges between the bright and
2003 * dark areas for negative edges. u5.0, [0, 16], default 0.
2004 * @reserved3: reserved
2006 struct ipu3_uapi_yuvp1_y_ee_nr_gain_config {
2009 __u32 delta_gain_posi:5;
2013 __u32 delta_gain_neg:5;
2018 * struct ipu3_uapi_yuvp1_y_ee_nr_clip_config - Luma(Y) edge enhancement
2019 * noise reduction clipping config
2021 * @clip_pos_0: Limit of positive edge in dark area
2022 * u5, value [0, 16], default 8.
2023 * @reserved0: reserved
2024 * @delta_clip_posi: Difference in the limit of edges between the bright
2025 * and dark areas for positive edges.
2026 * u5, value [0, 16], default 8.
2027 * @reserved1: reserved
2028 * @clip_neg_0: Limit of negative edge in dark area
2029 * u5, value [0, 16], default 8.
2030 * @reserved2: reserved
2031 * @delta_clip_neg: Difference in the limit of edges between the bright
2032 * and dark areas for negative edges.
2033 * u5, value [0, 16], default 8.
2034 * @reserved3: reserved
2036 struct ipu3_uapi_yuvp1_y_ee_nr_clip_config {
2039 __u32 delta_clip_posi:5;
2043 __u32 delta_clip_neg:5;
2048 * struct ipu3_uapi_yuvp1_y_ee_nr_frng_config - Luma(Y) edge enhancement
2049 * noise reduction fringe config
2051 * @gain_exp: Common exponent of gains, u4, [0, 8], default 2.
2052 * @reserved0: reserved
2053 * @min_edge: Threshold for edge and smooth stitching, u13.
2054 * @reserved1: reserved
2055 * @lin_seg_param: Power of LinSeg, u4.
2056 * @reserved2: reserved
2057 * @t1: Parameter for enabling/disabling the edge enhancement, u1.0, [0, 1],
2059 * @t2: Parameter for enabling/disabling the smoothing, u1.0, [0, 1],
2061 * @reserved3: reserved
2063 struct ipu3_uapi_yuvp1_y_ee_nr_frng_config {
2068 __u32 lin_seg_param:4;
2076 * struct ipu3_uapi_yuvp1_y_ee_nr_diag_config - Luma(Y) edge enhancement
2077 * noise reduction diagonal config
2079 * @diag_disc_g: Coefficient that prioritize diagonal edge direction on
2080 * horizontal or vertical for final enhancement.
2081 * u4.0, [1, 15], default 1.
2082 * @reserved0: reserved
2083 * @hvw_hor: Weight of horizontal/vertical edge enhancement for hv edge.
2084 * u2.2, [1, 15], default 4.
2085 * @dw_hor: Weight of diagonal edge enhancement for hv edge.
2086 * u2.2, [1, 15], default 1.
2087 * @hvw_diag: Weight of horizontal/vertical edge enhancement for diagonal edge.
2088 * u2.2, [1, 15], default 1.
2089 * @dw_diag: Weight of diagonal edge enhancement for diagonal edge.
2090 * u2.2, [1, 15], default 4.
2091 * @reserved1: reserved
2093 struct ipu3_uapi_yuvp1_y_ee_nr_diag_config {
2094 __u32 diag_disc_g:4;
2104 * struct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config - Luma(Y) edge enhancement
2105 * noise reduction false color correction (FCC) coring config
2107 * @pos_0: Gain for positive edge in dark, u13.0, [0, 16], default 0.
2108 * @reserved0: reserved
2109 * @pos_delta: Gain for positive edge in bright, value: pos_0 + pos_delta <=16
2111 * @reserved1: reserved
2112 * @neg_0: Gain for negative edge in dark area, u13.0, range [0, 16], default 0.
2113 * @reserved2: reserved
2114 * @neg_delta: Gain for negative edge in bright area. neg_0 + neg_delta <=16
2116 * @reserved3: reserved
2118 * Coring is a simple soft thresholding technique.
2120 struct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config {
2132 * struct ipu3_uapi_yuvp1_y_ee_nr_config - Edge enhancement and noise reduction
2134 * @lpf: low-pass filter config. See &ipu3_uapi_yuvp1_y_ee_nr_lpf_config
2135 * @sense: sensitivity config. See &ipu3_uapi_yuvp1_y_ee_nr_sense_config
2136 * @gain: gain config as defined in &ipu3_uapi_yuvp1_y_ee_nr_gain_config
2137 * @clip: clip config as defined in &ipu3_uapi_yuvp1_y_ee_nr_clip_config
2138 * @frng: fringe config as defined in &ipu3_uapi_yuvp1_y_ee_nr_frng_config
2139 * @diag: diagonal edge config. See &ipu3_uapi_yuvp1_y_ee_nr_diag_config
2140 * @fc_coring: coring config for fringe control. See
2141 * &ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config
2143 struct ipu3_uapi_yuvp1_y_ee_nr_config {
2144 struct ipu3_uapi_yuvp1_y_ee_nr_lpf_config lpf;
2145 struct ipu3_uapi_yuvp1_y_ee_nr_sense_config sense;
2146 struct ipu3_uapi_yuvp1_y_ee_nr_gain_config gain;
2147 struct ipu3_uapi_yuvp1_y_ee_nr_clip_config clip;
2148 struct ipu3_uapi_yuvp1_y_ee_nr_frng_config frng;
2149 struct ipu3_uapi_yuvp1_y_ee_nr_diag_config diag;
2150 struct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config fc_coring;
2153 /* Total Color Correction */
2156 * struct ipu3_uapi_yuvp2_tcc_gen_control_static_config - Total color correction
2157 * general control config
2159 * @en: 0 - TCC disabled. Output = input 1 - TCC enabled.
2160 * @blend_shift: blend shift, Range[3, 4], default NA.
2161 * @gain_according_to_y_only: 0: Gain is calculated according to YUV,
2162 * 1: Gain is calculated according to Y only
2163 * @reserved0: reserved
2164 * @gamma: Final blending coefficients. Values[-16, 16], default NA.
2165 * @reserved1: reserved
2166 * @delta: Final blending coefficients. Values[-16, 16], default NA.
2167 * @reserved2: reserved
2169 struct ipu3_uapi_yuvp2_tcc_gen_control_static_config {
2171 __u32 blend_shift:3;
2172 __u32 gain_according_to_y_only:1;
2181 * struct ipu3_uapi_yuvp2_tcc_macc_elem_static_config - Total color correction
2182 * multi-axis color control (MACC) config
2184 * @a: a coefficient for 2x2 MACC conversion matrix.
2185 * @reserved0: reserved
2186 * @b: b coefficient 2x2 MACC conversion matrix.
2187 * @reserved1: reserved
2188 * @c: c coefficient for 2x2 MACC conversion matrix.
2189 * @reserved2: reserved
2190 * @d: d coefficient for 2x2 MACC conversion matrix.
2191 * @reserved3: reserved
2193 struct ipu3_uapi_yuvp2_tcc_macc_elem_static_config {
2205 * struct ipu3_uapi_yuvp2_tcc_macc_table_static_config - Total color correction
2206 * multi-axis color control (MACC) table array
2208 * @entries: config for multi axis color correction, as specified by
2209 * &ipu3_uapi_yuvp2_tcc_macc_elem_static_config
2211 struct ipu3_uapi_yuvp2_tcc_macc_table_static_config {
2212 struct ipu3_uapi_yuvp2_tcc_macc_elem_static_config
2213 entries[IPU3_UAPI_YUVP2_TCC_MACC_TABLE_ELEMENTS];
2217 * struct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config - Total color correction
2218 * inverse y lookup table
2220 * @entries: lookup table for inverse y estimation, and use it to estimate the
2221 * ratio between luma and chroma. Chroma by approximate the absolute
2222 * value of the radius on the chroma plane (R = sqrt(u^2+v^2) ) and
2223 * luma by approximate by 1/Y.
2225 struct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config {
2226 __u16 entries[IPU3_UAPI_YUVP2_TCC_INV_Y_LUT_ELEMENTS];
2230 * struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config - Total color
2231 * correction lookup table for PCWL
2233 * @entries: lookup table for gain piece wise linear transformation (PCWL)
2235 struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config {
2236 __u16 entries[IPU3_UAPI_YUVP2_TCC_GAIN_PCWL_LUT_ELEMENTS];
2240 * struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config - Total color correction
2241 * lookup table for r square root
2243 * @entries: lookup table for r square root estimation
2245 struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config {
2246 __s16 entries[IPU3_UAPI_YUVP2_TCC_R_SQR_LUT_ELEMENTS];
2250 * struct ipu3_uapi_yuvp2_tcc_static_config- Total color correction static
2252 * @gen_control: general config for Total Color Correction
2253 * @macc_table: config for multi axis color correction
2254 * @inv_y_lut: lookup table for inverse y estimation
2255 * @gain_pcwl: lookup table for gain PCWL
2256 * @r_sqr_lut: lookup table for r square root estimation.
2258 struct ipu3_uapi_yuvp2_tcc_static_config {
2259 struct ipu3_uapi_yuvp2_tcc_gen_control_static_config gen_control;
2260 struct ipu3_uapi_yuvp2_tcc_macc_table_static_config macc_table;
2261 struct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config inv_y_lut;
2262 struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config gain_pcwl;
2263 struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config r_sqr_lut;
2266 /* Advanced Noise Reduction related structs */
2269 * struct ipu3_uapi_anr_alpha - Advanced noise reduction alpha
2271 * Tunable parameters that are subject to modification according to the
2274 struct ipu3_uapi_anr_alpha {
2286 * struct ipu3_uapi_anr_beta - Advanced noise reduction beta
2288 * Tunable parameters that are subject to modification according to the
2291 struct ipu3_uapi_anr_beta {
2299 * struct ipu3_uapi_anr_plane_color - Advanced noise reduction per plane R, Gr,
2300 * Gb and B register settings
2302 * Tunable parameters that are subject to modification according to the
2305 struct ipu3_uapi_anr_plane_color {
2313 * struct ipu3_uapi_anr_transform_config - Advanced noise reduction transform
2315 * @enable: advanced noise reduction enabled.
2316 * @adaptive_treshhold_en: On IPU3, adaptive threshold is always enabled.
2317 * @reserved1: reserved
2318 * @reserved2: reserved
2319 * @alpha: using following defaults:
2320 * 13, 13, 13, 13, 0, 0, 0, 0
2321 * 11, 11, 11, 11, 0, 0, 0, 0
2322 * 14, 14, 14, 14, 0, 0, 0, 0
2323 * @beta: use following defaults:
2327 * @color: use defaults defined in driver/media/pci/intel/ipu3-tables.c
2328 * @sqrt_lut: 11 bits per element, values =
2329 * [724 768 810 849 887
2330 * 923 958 991 1024 1056
2331 * 1116 1145 1173 1201 1086
2332 * 1228 1254 1280 1305 1330
2333 * 1355 1379 1402 1425 1448]
2334 * @xreset: Reset value of X for r^2 calculation Value: col_start-X_center
2335 * Constraint: Xreset + FrameWdith=4095 Xreset= -4095, default -1632.
2336 * @reserved3: reserved
2337 * @yreset: Reset value of Y for r^2 calculation Value: row_start-Y_center
2338 * Constraint: Yreset + FrameHeight=4095 Yreset= -4095, default -1224.
2339 * @reserved4: reserved
2340 * @x_sqr_reset: Reset value of X^2 for r^2 calculation Value = (Xreset)^2
2341 * @r_normfactor: Normalization factor for R. Default 14.
2342 * @reserved5: reserved
2343 * @y_sqr_reset: Reset value of Y^2 for r^2 calculation Value = (Yreset)^2
2344 * @gain_scale: Parameter describing shading gain as a function of distance
2345 * from the image center.
2346 * A single value per frame, loaded by the driver. Default 115.
2348 struct ipu3_uapi_anr_transform_config {
2349 __u32 enable:1; /* 0 or 1, disabled or enabled */
2350 __u32 adaptive_treshhold_en:1; /* On IPU3, always enabled */
2355 struct ipu3_uapi_anr_alpha alpha[3];
2356 struct ipu3_uapi_anr_beta beta[3];
2357 struct ipu3_uapi_anr_plane_color color[3];
2359 __u16 sqrt_lut[IPU3_UAPI_ANR_LUT_SIZE]; /* 11 bits per element */
2366 __u32 x_sqr_reset:24;
2367 __u32 r_normfactor:5;
2370 __u32 y_sqr_reset:24;
2375 * struct ipu3_uapi_anr_stitch_pyramid - ANR stitch pyramid
2377 * @entry0: pyramid LUT entry0, range [0x0, 0x3f]
2378 * @entry1: pyramid LUT entry1, range [0x0, 0x3f]
2379 * @entry2: pyramid LUT entry2, range [0x0, 0x3f]
2380 * @reserved: reserved
2382 struct ipu3_uapi_anr_stitch_pyramid {
2390 * struct ipu3_uapi_anr_stitch_config - ANR stitch config
2392 * @anr_stitch_en: enable stitch. Enabled with 1.
2393 * @reserved: reserved
2394 * @pyramid: pyramid table as defined by &ipu3_uapi_anr_stitch_pyramid
2396 * { 1, 3, 5 }, { 7, 7, 5 }, { 3, 1, 3 },
2397 * { 9, 15, 21 }, { 21, 15, 9 }, { 3, 5, 15 },
2398 * { 25, 35, 35 }, { 25, 15, 5 }, { 7, 21, 35 },
2399 * { 49, 49, 35 }, { 21, 7, 7 }, { 21, 35, 49 },
2400 * { 49, 35, 21 }, { 7, 5, 15 }, { 25, 35, 35 },
2401 * { 25, 15, 5 }, { 3, 9, 15 }, { 21, 21, 15 },
2402 * { 9, 3, 1 }, { 3, 5, 7 }, { 7, 5, 3}, { 1 }
2404 struct ipu3_uapi_anr_stitch_config {
2405 __u32 anr_stitch_en;
2407 struct ipu3_uapi_anr_stitch_pyramid pyramid[IPU3_UAPI_ANR_PYRAMID_SIZE];
2411 * struct ipu3_uapi_anr_config - ANR config
2413 * @transform: advanced noise reduction transform config as specified by
2414 * &ipu3_uapi_anr_transform_config
2415 * @stitch: create 4x4 patch from 4 surrounding 8x8 patches.
2417 struct ipu3_uapi_anr_config {
2418 struct ipu3_uapi_anr_transform_config transform __attribute__((aligned(32)));
2419 struct ipu3_uapi_anr_stitch_config stitch __attribute__((aligned(32)));
2423 * struct ipu3_uapi_acc_param - Accelerator cluster parameters
2425 * ACC refers to the HW cluster containing all Fixed Functions (FFs). Each FF
2426 * implements a specific algorithm.
2428 * @bnr: parameters for bayer noise reduction static config. See
2429 * &ipu3_uapi_bnr_static_config
2430 * @green_disparity: disparity static config between gr and gb channel.
2431 * See &ipu3_uapi_bnr_static_config_green_disparity
2432 * @dm: de-mosaic config. See &ipu3_uapi_dm_config
2433 * @ccm: color correction matrix. See &ipu3_uapi_ccm_mat_config
2434 * @gamma: gamma correction config. See &ipu3_uapi_gamma_config
2435 * @csc: color space conversion matrix. See &ipu3_uapi_csc_mat_config
2436 * @cds: color down sample config. See &ipu3_uapi_cds_params
2437 * @shd: lens shading correction config. See &ipu3_uapi_shd_config
2438 * @iefd: Image enhancement filter and denoise config.
2439 * &ipu3_uapi_yuvp1_iefd_config
2440 * @yds_c0: y down scaler config. &ipu3_uapi_yuvp1_yds_config
2441 * @chnr_c0: chroma noise reduction config. &ipu3_uapi_yuvp1_chnr_config
2442 * @y_ee_nr: y edge enhancement and noise reduction config.
2443 * &ipu3_uapi_yuvp1_y_ee_nr_config
2444 * @yds: y down scaler config. See &ipu3_uapi_yuvp1_yds_config
2445 * @chnr: chroma noise reduction config. See &ipu3_uapi_yuvp1_chnr_config
2446 * @reserved1: reserved
2447 * @yds2: y channel down scaler config. See &ipu3_uapi_yuvp1_yds_config
2448 * @tcc: total color correction config as defined in struct
2449 * &ipu3_uapi_yuvp2_tcc_static_config
2450 * @reserved2: reserved
2451 * @anr: advanced noise reduction config.See &ipu3_uapi_anr_config
2452 * @awb_fr: AWB filter response config. See ipu3_uapi_awb_fr_config
2453 * @ae: auto exposure config As specified by &ipu3_uapi_ae_config
2454 * @af: auto focus config. As specified by &ipu3_uapi_af_config
2455 * @awb: auto white balance config. As specified by &ipu3_uapi_awb_config
2457 struct ipu3_uapi_acc_param {
2458 struct ipu3_uapi_bnr_static_config bnr;
2459 struct ipu3_uapi_bnr_static_config_green_disparity
2460 green_disparity __attribute__((aligned(32)));
2461 struct ipu3_uapi_dm_config dm __attribute__((aligned(32)));
2462 struct ipu3_uapi_ccm_mat_config ccm __attribute__((aligned(32)));
2463 struct ipu3_uapi_gamma_config gamma __attribute__((aligned(32)));
2464 struct ipu3_uapi_csc_mat_config csc __attribute__((aligned(32)));
2465 struct ipu3_uapi_cds_params cds __attribute__((aligned(32)));
2466 struct ipu3_uapi_shd_config shd __attribute__((aligned(32)));
2467 struct ipu3_uapi_yuvp1_iefd_config iefd __attribute__((aligned(32)));
2468 struct ipu3_uapi_yuvp1_yds_config yds_c0 __attribute__((aligned(32)));
2469 struct ipu3_uapi_yuvp1_chnr_config chnr_c0 __attribute__((aligned(32)));
2470 struct ipu3_uapi_yuvp1_y_ee_nr_config y_ee_nr __attribute__((aligned(32)));
2471 struct ipu3_uapi_yuvp1_yds_config yds __attribute__((aligned(32)));
2472 struct ipu3_uapi_yuvp1_chnr_config chnr __attribute__((aligned(32)));
2473 struct ipu3_uapi_yuvp1_yds_config yds2 __attribute__((aligned(32)));
2474 struct ipu3_uapi_yuvp2_tcc_static_config tcc __attribute__((aligned(32)));
2475 struct ipu3_uapi_anr_config anr;
2476 struct ipu3_uapi_awb_fr_config_s awb_fr;
2477 struct ipu3_uapi_ae_config ae;
2478 struct ipu3_uapi_af_config_s af;
2479 struct ipu3_uapi_awb_config awb;
2483 * struct ipu3_uapi_isp_lin_vmem_params - Linearization parameters
2485 * @lin_lutlow_gr: linearization look-up table for GR channel interpolation.
2486 * @lin_lutlow_r: linearization look-up table for R channel interpolation.
2487 * @lin_lutlow_b: linearization look-up table for B channel interpolation.
2488 * @lin_lutlow_gb: linearization look-up table for GB channel interpolation.
2489 * lin_lutlow_gr / lin_lutlow_r / lin_lutlow_b /
2490 * lin_lutlow_gb <= LIN_MAX_VALUE - 1.
2491 * @lin_lutdif_gr: lin_lutlow_gr[i+1] - lin_lutlow_gr[i].
2492 * @lin_lutdif_r: lin_lutlow_r[i+1] - lin_lutlow_r[i].
2493 * @lin_lutdif_b: lin_lutlow_b[i+1] - lin_lutlow_b[i].
2494 * @lin_lutdif_gb: lin_lutlow_gb[i+1] - lin_lutlow_gb[i].
2496 struct ipu3_uapi_isp_lin_vmem_params {
2497 __s16 lin_lutlow_gr[IPU3_UAPI_LIN_LUT_SIZE];
2498 __s16 lin_lutlow_r[IPU3_UAPI_LIN_LUT_SIZE];
2499 __s16 lin_lutlow_b[IPU3_UAPI_LIN_LUT_SIZE];
2500 __s16 lin_lutlow_gb[IPU3_UAPI_LIN_LUT_SIZE];
2501 __s16 lin_lutdif_gr[IPU3_UAPI_LIN_LUT_SIZE];
2502 __s16 lin_lutdif_r[IPU3_UAPI_LIN_LUT_SIZE];
2503 __s16 lin_lutdif_b[IPU3_UAPI_LIN_LUT_SIZE];
2504 __s16 lin_lutdif_gb[IPU3_UAPI_LIN_LUT_SIZE];
2507 /* Temporal Noise Reduction */
2510 * struct ipu3_uapi_isp_tnr3_vmem_params - Temporal noise reduction vector
2513 * @slope: slope setting in interpolation curve for temporal noise reduction.
2514 * @reserved1: reserved
2515 * @sigma: knee point setting in interpolation curve for temporal
2517 * @reserved2: reserved
2519 struct ipu3_uapi_isp_tnr3_vmem_params {
2520 __u16 slope[IPU3_UAPI_ISP_TNR3_VMEM_LEN];
2521 __u16 reserved1[IPU3_UAPI_ISP_VEC_ELEMS
2522 - IPU3_UAPI_ISP_TNR3_VMEM_LEN];
2523 __u16 sigma[IPU3_UAPI_ISP_TNR3_VMEM_LEN];
2524 __u16 reserved2[IPU3_UAPI_ISP_VEC_ELEMS
2525 - IPU3_UAPI_ISP_TNR3_VMEM_LEN];
2529 * struct ipu3_uapi_isp_tnr3_params - Temporal noise reduction v3 parameters
2531 * @knee_y1: Knee point TNR3 assumes standard deviation of Y,U and
2532 * V at Y1 are TnrY1_Sigma_Y, U and V.
2533 * @knee_y2: Knee point TNR3 assumes standard deviation of Y,U and
2534 * V at Y2 are TnrY2_Sigma_Y, U and V.
2535 * @maxfb_y: Max feedback gain for Y
2536 * @maxfb_u: Max feedback gain for U
2537 * @maxfb_v: Max feedback gain for V
2538 * @round_adj_y: rounding Adjust for Y
2539 * @round_adj_u: rounding Adjust for U
2540 * @round_adj_v: rounding Adjust for V
2541 * @ref_buf_select: selection of the reference frame buffer to be used.
2543 struct ipu3_uapi_isp_tnr3_params {
2552 __u32 ref_buf_select;
2555 /* Extreme Noise Reduction version 3 */
2558 * struct ipu3_uapi_isp_xnr3_vmem_params - Extreme noise reduction v3
2559 * vector memory parameters
2561 * @x: xnr3 parameters.
2562 * @a: xnr3 parameters.
2563 * @b: xnr3 parameters.
2564 * @c: xnr3 parameters.
2566 struct ipu3_uapi_isp_xnr3_vmem_params {
2567 __u16 x[IPU3_UAPI_ISP_VEC_ELEMS];
2568 __u16 a[IPU3_UAPI_ISP_VEC_ELEMS];
2569 __u16 b[IPU3_UAPI_ISP_VEC_ELEMS];
2570 __u16 c[IPU3_UAPI_ISP_VEC_ELEMS];
2574 * struct ipu3_uapi_xnr3_alpha_params - Extreme noise reduction v3
2575 * alpha tuning parameters
2577 * @y0: Sigma for Y range similarity in dark area.
2578 * @u0: Sigma for U range similarity in dark area.
2579 * @v0: Sigma for V range similarity in dark area.
2580 * @ydiff: Sigma difference for Y between bright area and dark area.
2581 * @udiff: Sigma difference for U between bright area and dark area.
2582 * @vdiff: Sigma difference for V between bright area and dark area.
2584 struct ipu3_uapi_xnr3_alpha_params {
2594 * struct ipu3_uapi_xnr3_coring_params - Extreme noise reduction v3
2597 * @u0: Coring Threshold of U channel in dark area.
2598 * @v0: Coring Threshold of V channel in dark area.
2599 * @udiff: Threshold difference of U channel between bright and dark area.
2600 * @vdiff: Threshold difference of V channel between bright and dark area.
2602 struct ipu3_uapi_xnr3_coring_params {
2610 * struct ipu3_uapi_xnr3_blending_params - Blending factor
2612 * @strength: The factor for blending output with input. This is tuning
2613 * parameterHigher values lead to more aggressive XNR operation.
2615 struct ipu3_uapi_xnr3_blending_params {
2620 * struct ipu3_uapi_isp_xnr3_params - Extreme noise reduction v3 parameters
2622 * @alpha: parameters for xnr3 alpha. See &ipu3_uapi_xnr3_alpha_params
2623 * @coring: parameters for xnr3 coring. See &ipu3_uapi_xnr3_coring_params
2624 * @blending: parameters for xnr3 blending. See &ipu3_uapi_xnr3_blending_params
2626 struct ipu3_uapi_isp_xnr3_params {
2627 struct ipu3_uapi_xnr3_alpha_params alpha;
2628 struct ipu3_uapi_xnr3_coring_params coring;
2629 struct ipu3_uapi_xnr3_blending_params blending;
2632 /***** Obgrid (optical black level compensation) table entry *****/
2635 * struct ipu3_uapi_obgrid_param - Optical black level compensation parameters
2637 * @gr: Grid table values for color GR
2638 * @r: Grid table values for color R
2639 * @b: Grid table values for color B
2640 * @gb: Grid table values for color GB
2642 * Black level is different for red, green, and blue channels. So black level
2643 * compensation is different per channel.
2645 struct ipu3_uapi_obgrid_param {
2652 /******************* V4L2_META_FMT_IPU3_PARAMS *******************/
2655 * struct ipu3_uapi_flags - bits to indicate which pipeline needs update
2657 * @gdc: 0 = no update, 1 = update.
2658 * @obgrid: 0 = no update, 1 = update.
2659 * @reserved1: Not used.
2660 * @acc_bnr: 0 = no update, 1 = update.
2661 * @acc_green_disparity: 0 = no update, 1 = update.
2662 * @acc_dm: 0 = no update, 1 = update.
2663 * @acc_ccm: 0 = no update, 1 = update.
2664 * @acc_gamma: 0 = no update, 1 = update.
2665 * @acc_csc: 0 = no update, 1 = update.
2666 * @acc_cds: 0 = no update, 1 = update.
2667 * @acc_shd: 0 = no update, 1 = update.
2668 * @reserved2: Not used.
2669 * @acc_iefd: 0 = no update, 1 = update.
2670 * @acc_yds_c0: 0 = no update, 1 = update.
2671 * @acc_chnr_c0: 0 = no update, 1 = update.
2672 * @acc_y_ee_nr: 0 = no update, 1 = update.
2673 * @acc_yds: 0 = no update, 1 = update.
2674 * @acc_chnr: 0 = no update, 1 = update.
2675 * @acc_ytm: 0 = no update, 1 = update.
2676 * @acc_yds2: 0 = no update, 1 = update.
2677 * @acc_tcc: 0 = no update, 1 = update.
2678 * @acc_dpc: 0 = no update, 1 = update.
2679 * @acc_bds: 0 = no update, 1 = update.
2680 * @acc_anr: 0 = no update, 1 = update.
2681 * @acc_awb_fr: 0 = no update, 1 = update.
2682 * @acc_ae: 0 = no update, 1 = update.
2683 * @acc_af: 0 = no update, 1 = update.
2684 * @acc_awb: 0 = no update, 1 = update.
2685 * @__acc_osys: 0 = no update, 1 = update.
2686 * @reserved3: Not used.
2687 * @lin_vmem_params: 0 = no update, 1 = update.
2688 * @tnr3_vmem_params: 0 = no update, 1 = update.
2689 * @xnr3_vmem_params: 0 = no update, 1 = update.
2690 * @tnr3_dmem_params: 0 = no update, 1 = update.
2691 * @xnr3_dmem_params: 0 = no update, 1 = update.
2692 * @reserved4: Not used.
2693 * @obgrid_param: 0 = no update, 1 = update.
2694 * @reserved5: Not used.
2696 struct ipu3_uapi_flags {
2702 __u32 acc_green_disparity:1;
2712 __u32 acc_chnr_c0:1;
2713 __u32 acc_y_ee_nr:1;
2728 __u32 lin_vmem_params:1;
2729 __u32 tnr3_vmem_params:1;
2730 __u32 xnr3_vmem_params:1;
2731 __u32 tnr3_dmem_params:1;
2732 __u32 xnr3_dmem_params:1;
2734 __u32 obgrid_param:1;
2739 * struct ipu3_uapi_params - V4L2_META_FMT_IPU3_PARAMS
2741 * @use: select which parameters to apply, see &ipu3_uapi_flags
2742 * @acc_param: ACC parameters, as specified by &ipu3_uapi_acc_param
2743 * @lin_vmem_params: linearization VMEM, as specified by
2744 * &ipu3_uapi_isp_lin_vmem_params
2745 * @tnr3_vmem_params: tnr3 VMEM as specified by
2746 * &ipu3_uapi_isp_tnr3_vmem_params
2747 * @xnr3_vmem_params: xnr3 VMEM as specified by
2748 * &ipu3_uapi_isp_xnr3_vmem_params
2749 * @tnr3_dmem_params: tnr3 DMEM as specified by &ipu3_uapi_isp_tnr3_params
2750 * @xnr3_dmem_params: xnr3 DMEM as specified by &ipu3_uapi_isp_xnr3_params
2751 * @obgrid_param: obgrid parameters as specified by
2752 * &ipu3_uapi_obgrid_param
2754 * The video queue "parameters" is of format V4L2_META_FMT_IPU3_PARAMS.
2755 * This is a "single plane" v4l2_meta_format using V4L2_BUF_TYPE_META_OUTPUT.
2757 * struct ipu3_uapi_params as defined below contains a lot of parameters and
2758 * ipu3_uapi_flags selects which parameters to apply.
2760 struct ipu3_uapi_params {
2761 /* Flags which of the settings below are to be applied */
2762 struct ipu3_uapi_flags use __attribute__((aligned(32)));
2764 /* Accelerator cluster parameters */
2765 struct ipu3_uapi_acc_param acc_param;
2767 /* ISP vector address space parameters */
2768 struct ipu3_uapi_isp_lin_vmem_params lin_vmem_params;
2769 struct ipu3_uapi_isp_tnr3_vmem_params tnr3_vmem_params;
2770 struct ipu3_uapi_isp_xnr3_vmem_params xnr3_vmem_params;
2772 /* ISP data memory (DMEM) parameters */
2773 struct ipu3_uapi_isp_tnr3_params tnr3_dmem_params;
2774 struct ipu3_uapi_isp_xnr3_params xnr3_dmem_params;
2776 /* Optical black level compensation */
2777 struct ipu3_uapi_obgrid_param obgrid_param;
2780 #endif /* __IPU3_UAPI_H */