1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI_RKISP1_CONFIG_H 20 #define _UAPI_RKISP1_CONFIG_H 21 #include <linux/types.h> 22 #define RKISP1_CIF_ISP_MODULE_DPCC (1U << 0) 23 #define RKISP1_CIF_ISP_MODULE_BLS (1U << 1) 24 #define RKISP1_CIF_ISP_MODULE_SDG (1U << 2) 25 #define RKISP1_CIF_ISP_MODULE_HST (1U << 3) 26 #define RKISP1_CIF_ISP_MODULE_LSC (1U << 4) 27 #define RKISP1_CIF_ISP_MODULE_AWB_GAIN (1U << 5) 28 #define RKISP1_CIF_ISP_MODULE_FLT (1U << 6) 29 #define RKISP1_CIF_ISP_MODULE_BDM (1U << 7) 30 #define RKISP1_CIF_ISP_MODULE_CTK (1U << 8) 31 #define RKISP1_CIF_ISP_MODULE_GOC (1U << 9) 32 #define RKISP1_CIF_ISP_MODULE_CPROC (1U << 10) 33 #define RKISP1_CIF_ISP_MODULE_AFC (1U << 11) 34 #define RKISP1_CIF_ISP_MODULE_AWB (1U << 12) 35 #define RKISP1_CIF_ISP_MODULE_IE (1U << 13) 36 #define RKISP1_CIF_ISP_MODULE_AEC (1U << 14) 37 #define RKISP1_CIF_ISP_MODULE_WDR (1U << 15) 38 #define RKISP1_CIF_ISP_MODULE_DPF (1U << 16) 39 #define RKISP1_CIF_ISP_MODULE_DPF_STRENGTH (1U << 17) 40 #define RKISP1_CIF_ISP_CTK_COEFF_MAX 0x100 41 #define RKISP1_CIF_ISP_CTK_OFFSET_MAX 0x800 42 #define RKISP1_CIF_ISP_AE_MEAN_MAX_V10 25 43 #define RKISP1_CIF_ISP_AE_MEAN_MAX_V12 81 44 #define RKISP1_CIF_ISP_AE_MEAN_MAX RKISP1_CIF_ISP_AE_MEAN_MAX_V12 45 #define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 16 46 #define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 32 47 #define RKISP1_CIF_ISP_HIST_BIN_N_MAX RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 48 #define RKISP1_CIF_ISP_AFM_MAX_WINDOWS 3 49 #define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE 17 50 #define RKISP1_CIF_ISP_BDM_MAX_TH 0xff 51 #define RKISP1_CIF_ISP_BLS_START_H_MAX 0x00000fff 52 #define RKISP1_CIF_ISP_BLS_STOP_H_MAX 0x00000fff 53 #define RKISP1_CIF_ISP_BLS_START_V_MAX 0x00000fff 54 #define RKISP1_CIF_ISP_BLS_STOP_V_MAX 0x00000fff 55 #define RKISP1_CIF_ISP_BLS_SAMPLES_MAX 0x00000012 56 #define RKISP1_CIF_ISP_BLS_FIX_SUB_MAX 0x00000fff 57 #define RKISP1_CIF_ISP_BLS_FIX_SUB_MIN 0xfffff000 58 #define RKISP1_CIF_ISP_BLS_FIX_MASK 0x00001fff 59 #define RKISP1_CIF_ISP_AWB_MAX_GRID 1 60 #define RKISP1_CIF_ISP_AWB_MAX_FRAMES 7 61 #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 17 62 #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 34 63 #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 64 #define RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE 8 65 #define RKISP1_CIF_ISP_LSC_SAMPLES_MAX 17 66 #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 25 67 #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 81 68 #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 69 #define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3 70 #define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS 17 71 #define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS 6 72 #define RKISP1_CIF_ISP_STAT_AWB (1U << 0) 73 #define RKISP1_CIF_ISP_STAT_AUTOEXP (1U << 1) 74 #define RKISP1_CIF_ISP_STAT_AFM (1U << 2) 75 #define RKISP1_CIF_ISP_STAT_HIST (1U << 3) 76 enum rkisp1_cif_isp_version { 77 RKISP1_V10 = 10, 78 RKISP1_V11, 79 RKISP1_V12, 80 RKISP1_V13, 81 }; 82 enum rkisp1_cif_isp_histogram_mode { 83 RKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE, 84 RKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED, 85 RKISP1_CIF_ISP_HISTOGRAM_MODE_R_HISTOGRAM, 86 RKISP1_CIF_ISP_HISTOGRAM_MODE_G_HISTOGRAM, 87 RKISP1_CIF_ISP_HISTOGRAM_MODE_B_HISTOGRAM, 88 RKISP1_CIF_ISP_HISTOGRAM_MODE_Y_HISTOGRAM 89 }; 90 enum rkisp1_cif_isp_awb_mode_type { 91 RKISP1_CIF_ISP_AWB_MODE_MANUAL, 92 RKISP1_CIF_ISP_AWB_MODE_RGB, 93 RKISP1_CIF_ISP_AWB_MODE_YCBCR 94 }; 95 enum rkisp1_cif_isp_flt_mode { 96 RKISP1_CIF_ISP_FLT_STATIC_MODE, 97 RKISP1_CIF_ISP_FLT_DYNAMIC_MODE 98 }; 99 enum rkisp1_cif_isp_exp_ctrl_autostop { 100 RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0 = 0, 101 RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1 = 1, 102 }; 103 enum rkisp1_cif_isp_exp_meas_mode { 104 RKISP1_CIF_ISP_EXP_MEASURING_MODE_0, 105 RKISP1_CIF_ISP_EXP_MEASURING_MODE_1, 106 }; 107 struct rkisp1_cif_isp_window { 108 __u16 h_offs; 109 __u16 v_offs; 110 __u16 h_size; 111 __u16 v_size; 112 }; 113 struct rkisp1_cif_isp_bls_fixed_val { 114 __s16 r; 115 __s16 gr; 116 __s16 gb; 117 __s16 b; 118 }; 119 struct rkisp1_cif_isp_bls_config { 120 __u8 enable_auto; 121 __u8 en_windows; 122 struct rkisp1_cif_isp_window bls_window1; 123 struct rkisp1_cif_isp_window bls_window2; 124 __u8 bls_samples; 125 struct rkisp1_cif_isp_bls_fixed_val fixed_val; 126 }; 127 struct rkisp1_cif_isp_dpcc_methods_config { 128 __u32 method; 129 __u32 line_thresh; 130 __u32 line_mad_fac; 131 __u32 pg_fac; 132 __u32 rnd_thresh; 133 __u32 rg_fac; 134 }; 135 struct rkisp1_cif_isp_dpcc_config { 136 __u32 mode; 137 __u32 output_mode; 138 __u32 set_use; 139 struct rkisp1_cif_isp_dpcc_methods_config methods[RKISP1_CIF_ISP_DPCC_METHODS_MAX]; 140 __u32 ro_limits; 141 __u32 rnd_offs; 142 }; 143 struct rkisp1_cif_isp_gamma_corr_curve { 144 __u16 gamma_y[RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE]; 145 }; 146 struct rkisp1_cif_isp_gamma_curve_x_axis_pnts { 147 __u32 gamma_dx0; 148 __u32 gamma_dx1; 149 }; 150 struct rkisp1_cif_isp_sdg_config { 151 struct rkisp1_cif_isp_gamma_corr_curve curve_r; 152 struct rkisp1_cif_isp_gamma_corr_curve curve_g; 153 struct rkisp1_cif_isp_gamma_corr_curve curve_b; 154 struct rkisp1_cif_isp_gamma_curve_x_axis_pnts xa_pnts; 155 }; 156 struct rkisp1_cif_isp_lsc_config { 157 __u16 r_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX]; 158 __u16 gr_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX]; 159 __u16 gb_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX]; 160 __u16 b_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX]; 161 __u16 x_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; 162 __u16 y_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; 163 __u16 x_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; 164 __u16 y_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; 165 __u16 config_width; 166 __u16 config_height; 167 }; 168 struct rkisp1_cif_isp_ie_config { 169 __u16 effect; 170 __u16 color_sel; 171 __u16 eff_mat_1; 172 __u16 eff_mat_2; 173 __u16 eff_mat_3; 174 __u16 eff_mat_4; 175 __u16 eff_mat_5; 176 __u16 eff_tint; 177 }; 178 struct rkisp1_cif_isp_cproc_config { 179 __u8 c_out_range; 180 __u8 y_in_range; 181 __u8 y_out_range; 182 __u8 contrast; 183 __u8 brightness; 184 __u8 sat; 185 __u8 hue; 186 }; 187 struct rkisp1_cif_isp_awb_meas_config { 188 struct rkisp1_cif_isp_window awb_wnd; 189 __u32 awb_mode; 190 __u8 max_y; 191 __u8 min_y; 192 __u8 max_csum; 193 __u8 min_c; 194 __u8 frames; 195 __u8 awb_ref_cr; 196 __u8 awb_ref_cb; 197 __u8 enable_ymax_cmp; 198 }; 199 struct rkisp1_cif_isp_awb_gain_config { 200 __u16 gain_red; 201 __u16 gain_green_r; 202 __u16 gain_blue; 203 __u16 gain_green_b; 204 }; 205 struct rkisp1_cif_isp_flt_config { 206 __u32 mode; 207 __u8 grn_stage1; 208 __u8 chr_h_mode; 209 __u8 chr_v_mode; 210 __u32 thresh_bl0; 211 __u32 thresh_bl1; 212 __u32 thresh_sh0; 213 __u32 thresh_sh1; 214 __u32 lum_weight; 215 __u32 fac_sh1; 216 __u32 fac_sh0; 217 __u32 fac_mid; 218 __u32 fac_bl0; 219 __u32 fac_bl1; 220 }; 221 struct rkisp1_cif_isp_bdm_config { 222 __u8 demosaic_th; 223 }; 224 struct rkisp1_cif_isp_ctk_config { 225 __u16 coeff[3][3]; 226 __u16 ct_offset[3]; 227 }; 228 enum rkisp1_cif_isp_goc_mode { 229 RKISP1_CIF_ISP_GOC_MODE_LOGARITHMIC, 230 RKISP1_CIF_ISP_GOC_MODE_EQUIDISTANT 231 }; 232 struct rkisp1_cif_isp_goc_config { 233 __u32 mode; 234 __u16 gamma_y[RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES]; 235 }; 236 struct rkisp1_cif_isp_hst_config { 237 __u32 mode; 238 __u8 histogram_predivider; 239 struct rkisp1_cif_isp_window meas_window; 240 __u8 hist_weight[RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE]; 241 }; 242 struct rkisp1_cif_isp_aec_config { 243 __u32 mode; 244 __u32 autostop; 245 struct rkisp1_cif_isp_window meas_window; 246 }; 247 struct rkisp1_cif_isp_afc_config { 248 __u8 num_afm_win; 249 struct rkisp1_cif_isp_window afm_win[RKISP1_CIF_ISP_AFM_MAX_WINDOWS]; 250 __u32 thres; 251 __u32 var_shift; 252 }; 253 enum rkisp1_cif_isp_dpf_gain_usage { 254 RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED, 255 RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS, 256 RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS, 257 RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS, 258 RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS, 259 RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS, 260 RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX 261 }; 262 enum rkisp1_cif_isp_dpf_rb_filtersize { 263 RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9, 264 RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9, 265 }; 266 enum rkisp1_cif_isp_dpf_nll_scale_mode { 267 RKISP1_CIF_ISP_NLL_SCALE_LINEAR, 268 RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC, 269 }; 270 struct rkisp1_cif_isp_dpf_nll { 271 __u16 coeff[RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS]; 272 __u32 scale_mode; 273 }; 274 struct rkisp1_cif_isp_dpf_rb_flt { 275 __u32 fltsize; 276 __u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS]; 277 __u8 r_enable; 278 __u8 b_enable; 279 }; 280 struct rkisp1_cif_isp_dpf_g_flt { 281 __u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS]; 282 __u8 gr_enable; 283 __u8 gb_enable; 284 }; 285 struct rkisp1_cif_isp_dpf_gain { 286 __u32 mode; 287 __u16 nf_r_gain; 288 __u16 nf_b_gain; 289 __u16 nf_gr_gain; 290 __u16 nf_gb_gain; 291 }; 292 struct rkisp1_cif_isp_dpf_config { 293 struct rkisp1_cif_isp_dpf_gain gain; 294 struct rkisp1_cif_isp_dpf_g_flt g_flt; 295 struct rkisp1_cif_isp_dpf_rb_flt rb_flt; 296 struct rkisp1_cif_isp_dpf_nll nll; 297 }; 298 struct rkisp1_cif_isp_dpf_strength_config { 299 __u8 r; 300 __u8 g; 301 __u8 b; 302 }; 303 struct rkisp1_cif_isp_isp_other_cfg { 304 struct rkisp1_cif_isp_dpcc_config dpcc_config; 305 struct rkisp1_cif_isp_bls_config bls_config; 306 struct rkisp1_cif_isp_sdg_config sdg_config; 307 struct rkisp1_cif_isp_lsc_config lsc_config; 308 struct rkisp1_cif_isp_awb_gain_config awb_gain_config; 309 struct rkisp1_cif_isp_flt_config flt_config; 310 struct rkisp1_cif_isp_bdm_config bdm_config; 311 struct rkisp1_cif_isp_ctk_config ctk_config; 312 struct rkisp1_cif_isp_goc_config goc_config; 313 struct rkisp1_cif_isp_dpf_config dpf_config; 314 struct rkisp1_cif_isp_dpf_strength_config dpf_strength_config; 315 struct rkisp1_cif_isp_cproc_config cproc_config; 316 struct rkisp1_cif_isp_ie_config ie_config; 317 }; 318 struct rkisp1_cif_isp_isp_meas_cfg { 319 struct rkisp1_cif_isp_awb_meas_config awb_meas_config; 320 struct rkisp1_cif_isp_hst_config hst_config; 321 struct rkisp1_cif_isp_aec_config aec_config; 322 struct rkisp1_cif_isp_afc_config afc_config; 323 }; 324 struct rkisp1_params_cfg { 325 __u32 module_en_update; 326 __u32 module_ens; 327 __u32 module_cfg_update; 328 struct rkisp1_cif_isp_isp_meas_cfg meas; 329 struct rkisp1_cif_isp_isp_other_cfg others; 330 }; 331 struct rkisp1_cif_isp_awb_meas { 332 __u32 cnt; 333 __u8 mean_y_or_g; 334 __u8 mean_cb_or_b; 335 __u8 mean_cr_or_r; 336 }; 337 struct rkisp1_cif_isp_awb_stat { 338 struct rkisp1_cif_isp_awb_meas awb_mean[RKISP1_CIF_ISP_AWB_MAX_GRID]; 339 }; 340 struct rkisp1_cif_isp_bls_meas_val { 341 __u16 meas_r; 342 __u16 meas_gr; 343 __u16 meas_gb; 344 __u16 meas_b; 345 }; 346 struct rkisp1_cif_isp_ae_stat { 347 __u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX]; 348 struct rkisp1_cif_isp_bls_meas_val bls_val; 349 }; 350 struct rkisp1_cif_isp_af_meas_val { 351 __u32 sum; 352 __u32 lum; 353 }; 354 struct rkisp1_cif_isp_af_stat { 355 struct rkisp1_cif_isp_af_meas_val window[RKISP1_CIF_ISP_AFM_MAX_WINDOWS]; 356 }; 357 struct rkisp1_cif_isp_hist_stat { 358 __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX]; 359 }; 360 struct rkisp1_cif_isp_stat { 361 struct rkisp1_cif_isp_awb_stat awb; 362 struct rkisp1_cif_isp_ae_stat ae; 363 struct rkisp1_cif_isp_af_stat af; 364 struct rkisp1_cif_isp_hist_stat hist; 365 }; 366 struct rkisp1_stat_buffer { 367 __u32 meas_type; 368 __u32 frame_id; 369 struct rkisp1_cif_isp_stat params; 370 }; 371 #endif 372