Lines Matching +full:fixed +full:- +full:1 +full:- +full:8 +full:v
1 /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR MIT) */
13 #define RKISP1_CIF_ISP_MODULE_DPCC (1U << 0)
15 #define RKISP1_CIF_ISP_MODULE_BLS (1U << 1)
16 /* Sensor De-gamma */
17 #define RKISP1_CIF_ISP_MODULE_SDG (1U << 2)
19 #define RKISP1_CIF_ISP_MODULE_HST (1U << 3)
21 #define RKISP1_CIF_ISP_MODULE_LSC (1U << 4)
23 #define RKISP1_CIF_ISP_MODULE_AWB_GAIN (1U << 5)
25 #define RKISP1_CIF_ISP_MODULE_FLT (1U << 6)
27 #define RKISP1_CIF_ISP_MODULE_BDM (1U << 7)
29 #define RKISP1_CIF_ISP_MODULE_CTK (1U << 8)
31 #define RKISP1_CIF_ISP_MODULE_GOC (1U << 9)
33 #define RKISP1_CIF_ISP_MODULE_CPROC (1U << 10)
35 #define RKISP1_CIF_ISP_MODULE_AFC (1U << 11)
37 #define RKISP1_CIF_ISP_MODULE_AWB (1U << 12)
39 #define RKISP1_CIF_ISP_MODULE_IE (1U << 13)
41 #define RKISP1_CIF_ISP_MODULE_AEC (1U << 14)
43 #define RKISP1_CIF_ISP_MODULE_WDR (1U << 15)
44 /* Denoise Pre-Filter */
45 #define RKISP1_CIF_ISP_MODULE_DPF (1U << 16)
46 /* Denoise Pre-Filter Strength */
47 #define RKISP1_CIF_ISP_MODULE_DPF_STRENGTH (1U << 17)
78 /* maximum value for fixed black level */
80 /* minimum value for fixed black level */
88 #define RKISP1_CIF_ISP_AWB_MAX_GRID 1
102 #define RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE 8
122 #define RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE (1U << 2)
124 #define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER (1U << 0)
125 #define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_RB_CENTER (1U << 1)
126 #define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_G_3X3 (1U << 2)
127 #define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_RB_3X3 (1U << 3)
129 /* 0-2 for sets 1-3 */
131 #define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_FIX_SET (1U << 3)
133 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_GREEN_ENABLE (1U << 0)
134 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE (1U << 1)
135 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_GREEN_ENABLE (1U << 2)
136 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE (1U << 3)
137 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_GREEN_ENABLE (1U << 4)
138 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_RED_BLUE_ENABLE (1U << 8)
139 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE (1U << 9)
140 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_RED_BLUE_ENABLE (1U << 10)
141 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE (1U << 11)
142 #define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_RED_BLUE_ENABLE (1U << 12)
144 #define RKISP1_CIF_ISP_DPCC_LINE_THRESH_G(v) ((v) << 0) argument
145 #define RKISP1_CIF_ISP_DPCC_LINE_THRESH_RB(v) ((v) << 8) argument
146 #define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_G(v) ((v) << 0) argument
147 #define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_RB(v) ((v) << 8) argument
148 #define RKISP1_CIF_ISP_DPCC_PG_FAC_G(v) ((v) << 0) argument
149 #define RKISP1_CIF_ISP_DPCC_PG_FAC_RB(v) ((v) << 8) argument
150 #define RKISP1_CIF_ISP_DPCC_RND_THRESH_G(v) ((v) << 0) argument
151 #define RKISP1_CIF_ISP_DPCC_RND_THRESH_RB(v) ((v) << 8) argument
152 #define RKISP1_CIF_ISP_DPCC_RG_FAC_G(v) ((v) << 0) argument
153 #define RKISP1_CIF_ISP_DPCC_RG_FAC_RB(v) ((v) << 8) argument
155 #define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_G(n, v) ((v) << ((n) * 4)) argument
156 #define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_RB(n, v) ((v) << ((n) * 4 + 2)) argument
158 #define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_G(n, v) ((v) << ((n) * 4)) argument
159 #define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_RB(n, v) ((v) << ((n) * 4 + 2)) argument
175 #define RKISP1_CIF_ISP_STAT_AWB (1U << 0)
176 #define RKISP1_CIF_ISP_STAT_AUTOEXP (1U << 1)
177 #define RKISP1_CIF_ISP_STAT_AFM (1U << 2)
178 #define RKISP1_CIF_ISP_STAT_HIST (1U << 3)
181 * enum rkisp1_cif_isp_version - ISP variants
221 * enum rkisp1_cif_isp_exp_ctrl_autostop - stop modes
227 RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1 = 1,
231 * enum rkisp1_cif_isp_exp_meas_mode - Exposure measure mode
240 /*---------- PART1: Input Parameters ------------*/
243 * struct rkisp1_cif_isp_window - measurement window.
261 * struct rkisp1_cif_isp_bls_fixed_val - BLS fixed subtraction values
266 * @r: Fixed (signed!) subtraction value for Bayer pattern R
267 * @gr: Fixed (signed!) subtraction value for Bayer pattern Gr
268 * @gb: Fixed (signed!) subtraction value for Bayer pattern Gb
269 * @b: Fixed (signed!) subtraction value for Bayer pattern B
279 * struct rkisp1_cif_isp_bls_config - Configuration used by black level subtraction
282 * are subtracted. Otherwise the fixed subtraction
285 * @bls_window1: Measurement window 1 size
289 * @fixed_val: Fixed subtraction values
301 * struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
326 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
349 * struct rkisp1_cif_isp_gamma_corr_curve - gamma curve point definition y-axis (output).
352 * gamma_y[0] = 0x0000, gamma_y[1] = 0x0100, ... gamma_y[15] = 0x0f00, gamma_y[16] = 0xfff
354 * @gamma_y: the values for the y-axis of gamma curve points. Each value is 12 bit.
361 * struct rkisp1_cif_isp_gamma_curve_x_axis_pnts - De-Gamma Curve definition x increments
362 * (sampling points). gamma_dx0 is for the lower samples (1-8), gamma_dx1 is for the
363 * higher samples (9-16). The reset values for both fields is 0x44444444. This means
364 * that each sample is 4 units away from the previous one on the x-axis.
366 * @gamma_dx0: gamma curve sample points definitions. Bits 0:2 for sample 1. Bit 3 unused.
367 * Bits 4:6 for sample 2. bit 7 unused ... Bits 28:30 for sample 8. Bit 31 unused
377 * struct rkisp1_cif_isp_sdg_config - Configuration used by sensor degamma
392 * struct rkisp1_cif_isp_lsc_config - Configuration used by Lens shading correction
421 * struct rkisp1_cif_isp_ie_config - Configuration used by image effects
426 * @color_sel: bits 0:2 - colors bitmask (001 - blue, 010 - green, 100 - red).
427 * bits 8:15 - Threshold value of the RGB colors for the color selection effect.
428 * @eff_mat_1: 3x3 Matrix Coefficients for Emboss Effect 1
430 * @eff_mat_3: 3x3 Matrix Coefficients for Emboss 3/Sketch 1
447 * struct rkisp1_cif_isp_cproc_config - Configuration used by Color Processing
450 * (0 for limit, 1 for full)
454 * @brightness: 80~7F, -128~+127
456 * @hue: 80~7F, -90~+87.188
469 * struct rkisp1_cif_isp_awb_meas_config - Configuration for the AWB statistics
480 * @frames: number of frames - 1 used for mean value calculation
481 * (ucFrames=0 means 1 Frame)
488 * Note: currently the h and v offsets are mapped to grid offsets
503 * struct rkisp1_cif_isp_awb_gain_config - Configuration used by auto white balance gain
506 * 0x100h = 1, unsigned integer value, range 0 to 4 with 8 bit fractional part.
508 * out_data_x = ( AWB_GAIN_X * in_data + 128) >> 8
523 * struct rkisp1_cif_isp_flt_config - Configuration used by ISP filtering
529 * @grn_stage1: Green filter stage 1 select (range 0x0...0x8)
541 * @fac_bl1: filter factor for blur 1 level (max blur)
561 * struct rkisp1_cif_isp_bdm_config - Configuration used by Bayer DeMosaic
570 * struct rkisp1_cif_isp_ctk_config - Configuration used by Cross Talk correction
572 * @coeff: color correction matrix. Values are 11-bit signed fixed-point numbers with 4 bit integer
573 * and 7 bit fractional part, ranging from -8 (0x400) to +7.992 (0x3FF). 0 is
574 * represented by 0x000 and a coefficient value of 1 as 0x080.
588 * struct rkisp1_cif_isp_goc_config - Configuration used by Gamma Out correction
591 * @gamma_y: gamma out curve y-axis for all color components
607 * struct rkisp1_cif_isp_hst_config - Configuration for Histogram statistics
613 * @hist_weight: weighting factor for sub-windows
632 * struct rkisp1_cif_isp_aec_config - Configuration for Auto Exposure statistics
645 * struct rkisp1_cif_isp_afc_config - Configuration for the Auto Focus statistics
661 * enum rkisp1_cif_isp_dpf_gain_usage - dpf gain usage
683 * enum rkisp1_cif_isp_dpf_rb_filtersize - Red and blue filter sizes
695 * enum rkisp1_cif_isp_dpf_nll_scale_mode - dpf noise level scale mode
705 * struct rkisp1_cif_isp_dpf_nll - Noise level lookup
716 * struct rkisp1_cif_isp_dpf_rb_flt - Red blue filter config
732 * struct rkisp1_cif_isp_dpf_g_flt - Green filter Configuration
745 * struct rkisp1_cif_isp_dpf_gain - Noise function Configuration
764 * struct rkisp1_cif_isp_dpf_config - Configuration used by De-noising pre-filter
779 * struct rkisp1_cif_isp_dpf_strength_config - strength of the filter
792 * struct rkisp1_cif_isp_isp_other_cfg - Parameters for some blocks in rockchip isp1
804 * @dpf_config: De-noising pre-filter config
826 * struct rkisp1_cif_isp_isp_meas_cfg - Rockchip ISP1 Measure Parameters
841 * struct rkisp1_params_cfg - Rockchip ISP1 Input Parameters Meta Data
860 * struct rkisp1_cif_isp_compand_bls_config - Rockchip ISP1 Companding parameters (BLS)
861 * @r: Fixed subtraction value for Bayer pattern R
862 * @gr: Fixed subtraction value for Bayer pattern Gr
863 * @gb: Fixed subtraction value for Bayer pattern Gb
864 * @b: Fixed subtraction value for Bayer pattern B
867 * dedicated BLS block, the BLS values in the compander are 20-bit unsigned.
877 * struct rkisp1_cif_isp_compand_curve_config - Rockchip ISP1 Companding
879 * @px: Compand curve x-values. Each value stores the distance from the
880 * previous x-value, expressed as log2 of the distance on 5 bits.
881 * @x: Compand curve x-values. The functionality of these parameters are
884 * @y: Compand curve y-values
892 /*---------- PART2: Measurement Statistics ------------*/
895 * struct rkisp1_cif_isp_awb_meas - AWB measured values
914 * struct rkisp1_cif_isp_awb_stat - statistics automatic white balance data
923 * struct rkisp1_cif_isp_bls_meas_val - BLS measured values
938 * struct rkisp1_cif_isp_ae_stat - statistics auto exposure data
959 * struct rkisp1_cif_isp_af_meas_val - AF measured values
970 * struct rkisp1_cif_isp_af_stat - statistics auto focus data
982 * struct rkisp1_cif_isp_hist_stat - statistics histogram data
984 * @hist_bins: measured bin counters. Each bin is a 20 bits unsigned fixed point
985 * type. Bits 0-4 are the fractional part and bits 5-19 are the
988 * The window of the measurements area is divided to 5x5 sub-windows for
989 * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each
990 * sub-window independently and the final result is a weighted average of the
991 * histogram measurements on all sub-windows. The window of the measurements
992 * area and the weight of each sub-window are configurable using
1010 * struct rkisp1_cif_isp_stat - Rockchip ISP1 Statistics Data
1025 * struct rkisp1_stat_buffer - Rockchip ISP1 Statistics Meta Data
1037 /*---------- PART3: Extensible Configuration Parameters ------------*/
1040 * enum rkisp1_ext_params_block_type - RkISP1 extensible params block type
1044 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG: Sensor de-gamma
1047 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM: Bayer de-mosaic
1048 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK: Cross-talk correction
1050 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF: De-noise pre-filter
1051 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH: De-noise pre-filter strength
1058 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS: Auto-focus statistics
1086 #define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE (1U << 0)
1087 #define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE (1U << 1)
1090 * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block
1095 * as its first member, followed by the block-specific configuration data. The
1097 * properly handle the block content by casting it to the correct block-specific
1105 * The @flags field is a bitmask of per-block flags RKISP1_EXT_PARAMS_FL_*.
1125 * fields (@type, @flags and @size) and the block-specific parameters.
1129 * .. code-block:: c
1135 * bls->header.type = RKISP1_EXT_PARAMS_BLOCK_ID_BLS;
1136 * bls->header.flags = RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE;
1137 * bls->header.size = sizeof(*bls);
1139 * bls->config.enable_auto = 0;
1140 * bls->config.fixed_val.r = blackLevelRed_;
1141 * bls->config.fixed_val.gr = blackLevelGreenR_;
1142 * bls->config.fixed_val.gb = blackLevelGreenB_;
1143 * bls->config.fixed_val.b = blackLevelBlue_;
1158 * struct rkisp1_ext_params_bls_config - RkISP1 extensible params BLS config
1171 } __attribute__((aligned(8)));
1174 * struct rkisp1_ext_params_dpcc_config - RkISP1 extensible params DPCC config
1187 } __attribute__((aligned(8)));
1190 * struct rkisp1_ext_params_sdg_config - RkISP1 extensible params SDG config
1203 } __attribute__((aligned(8)));
1206 * struct rkisp1_ext_params_lsc_config - RkISP1 extensible params LSC config
1219 } __attribute__((aligned(8)));
1222 * struct rkisp1_ext_params_awb_gain_config - RkISP1 extensible params AWB
1225 * RkISP1 extensible parameters Auto-White Balance Gains configuration block.
1230 * @config: Auto-White Balance Gains configuration, see
1236 } __attribute__((aligned(8)));
1239 * struct rkisp1_ext_params_flt_config - RkISP1 extensible params FLT config
1251 } __attribute__((aligned(8)));
1254 * struct rkisp1_ext_params_bdm_config - RkISP1 extensible params BDM config
1266 } __attribute__((aligned(8)));
1269 * struct rkisp1_ext_params_ctk_config - RkISP1 extensible params CTK config
1271 * RkISP1 extensible parameters Cross-Talk configuration block. Identified by
1276 * @config: Cross-Talk configuration, see :c:type:`rkisp1_cif_isp_ctk_config`
1281 } __attribute__((aligned(8)));
1284 * struct rkisp1_ext_params_goc_config - RkISP1 extensible params GOC config
1286 * RkISP1 extensible parameters Gamma-Out configuration block. Identified by
1291 * @config: Gamma-Out configuration, see :c:type:`rkisp1_cif_isp_goc_config`
1296 } __attribute__((aligned(8)));
1299 * struct rkisp1_ext_params_dpf_config - RkISP1 extensible params DPF config
1301 * RkISP1 extensible parameters De-noise Pre-Filter configuration block.
1306 * @config: De-noise Pre-Filter configuration, see
1312 } __attribute__((aligned(8)));
1315 * struct rkisp1_ext_params_dpf_strength_config - RkISP1 extensible params DPF
1318 * RkISP1 extensible parameters De-noise Pre-Filter strength configuration
1323 * @config: De-noise Pre-Filter strength configuration, see
1329 } __attribute__((aligned(8)));
1332 * struct rkisp1_ext_params_cproc_config - RkISP1 extensible params CPROC config
1345 } __attribute__((aligned(8)));
1348 * struct rkisp1_ext_params_ie_config - RkISP1 extensible params IE config
1360 } __attribute__((aligned(8)));
1363 * struct rkisp1_ext_params_awb_meas_config - RkISP1 extensible params AWB
1366 * RkISP1 extensible parameters Auto-White Balance Measurement configuration
1371 * @config: Auto-White Balance measure configuration, see
1377 } __attribute__((aligned(8)));
1380 * struct rkisp1_ext_params_hst_config - RkISP1 extensible params Histogram config
1393 } __attribute__((aligned(8)));
1396 * struct rkisp1_ext_params_aec_config - RkISP1 extensible params AEC config
1398 * RkISP1 extensible parameters Auto-Exposure statistics configuration block.
1403 * @config: Auto-Exposure statistics configuration, see
1409 } __attribute__((aligned(8)));
1412 * struct rkisp1_ext_params_afc_config - RkISP1 extensible params AFC config
1414 * RkISP1 extensible parameters Auto-Focus statistics configuration block.
1419 * @config: Auto-Focus statistics configuration, see
1425 } __attribute__((aligned(8)));
1428 * struct rkisp1_ext_params_compand_bls_config - RkISP1 extensible params
1442 } __attribute__((aligned(8)));
1445 * struct rkisp1_ext_params_compand_curve_config - RkISP1 extensible params
1461 } __attribute__((aligned(8)));
1490 * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version
1495 RKISP1_EXT_PARAM_BUFFER_V1 = 1,
1499 * struct rkisp1_ext_params_cfg - RkISP1 extensible parameters configuration
1503 * parameter block is represented by a block-specific structure which contains a
1519 * the supported format versions will be implemented in the form of a read-only
1523 * For each ISP block that userspace wants to configure, a block-specific
1530 * +-------------------- struct rkisp1_ext_params_cfg -------------------+
1534 * | +------------------------- data ---------------------------------+ |
1535 * | | +------------- struct rkisp1_ext_params_bls_config -----------+ | |
1536 * | | | +-------- struct rkisp1_ext_params_block_header ---------+ | | |
1540 * | | | +---------------------------------------------------------+ | | |
1541 * | | | +---------- struct rkisp1_cif_isp_bls_config -------------+ | | |
1547 * | | | +---------------------------------------------------------+ | | |
1548 * | | +------------ struct rkisp1_ext_params_dpcc_config -----------+ | |
1549 * | | | +-------- struct rkisp1_ext_params_block_header ---------+ | | |
1553 * | | | +---------------------------------------------------------+ | | |
1554 * | | | +---------- struct rkisp1_cif_isp_dpcc_config ------------+ | | |
1560 * | | | +---------------------------------------------------------+ | | |
1561 * | | +-------------------------------------------------------------+ | |
1562 * | +-----------------------------------------------------------------+ |
1563 * +---------------------------------------------------------------------+