xref: /linux/drivers/staging/media/ipu3/ipu3-tables.h (revision 44f57d78)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2018 Intel Corporation */
3 
4 #ifndef __IPU3_TABLES_H
5 #define __IPU3_TABLES_H
6 
7 #include "ipu3-abi.h"
8 
9 #define IMGU_BDS_GRANULARITY		32	/* Downscaling granularity */
10 #define IMGU_BDS_MIN_SF_INV		IMGU_BDS_GRANULARITY
11 #define IMGU_BDS_CONFIG_LEN		97
12 
13 #define IMGU_SCALER_DOWNSCALE_4TAPS_LEN	128
14 #define IMGU_SCALER_DOWNSCALE_2TAPS_LEN	64
15 #define IMGU_SCALER_FP			((u32)1 << 31) /* 1.0 in fixed point */
16 
17 #define IMGU_XNR3_VMEM_LUT_LEN		16
18 
19 #define IMGU_GDC_LUT_UNIT		4
20 #define IMGU_GDC_LUT_LEN		256
21 
22 struct imgu_css_bds_config {
23 	struct imgu_abi_bds_phase_arr hor_phase_arr;
24 	struct imgu_abi_bds_phase_arr ver_phase_arr;
25 	struct imgu_abi_bds_ptrn_arr ptrn_arr;
26 	u16 sample_patrn_length;
27 	u8 hor_ds_en;
28 	u8 ver_ds_en;
29 };
30 
31 struct imgu_css_xnr3_vmem_defaults {
32 	s16 x[IMGU_XNR3_VMEM_LUT_LEN];
33 	s16 a[IMGU_XNR3_VMEM_LUT_LEN];
34 	s16 b[IMGU_XNR3_VMEM_LUT_LEN];
35 	s16 c[IMGU_XNR3_VMEM_LUT_LEN];
36 };
37 
38 extern const struct imgu_css_bds_config
39 			imgu_css_bds_configs[IMGU_BDS_CONFIG_LEN];
40 extern const s32 imgu_css_downscale_4taps[IMGU_SCALER_DOWNSCALE_4TAPS_LEN];
41 extern const s32 imgu_css_downscale_2taps[IMGU_SCALER_DOWNSCALE_2TAPS_LEN];
42 extern const s16 imgu_css_gdc_lut[IMGU_GDC_LUT_UNIT][IMGU_GDC_LUT_LEN];
43 extern const struct imgu_css_xnr3_vmem_defaults imgu_css_xnr3_vmem_defaults;
44 extern const struct ipu3_uapi_bnr_static_config imgu_css_bnr_defaults;
45 extern const struct ipu3_uapi_dm_config imgu_css_dm_defaults;
46 extern const struct ipu3_uapi_ccm_mat_config imgu_css_ccm_defaults;
47 extern const struct ipu3_uapi_gamma_corr_lut imgu_css_gamma_lut;
48 extern const struct ipu3_uapi_csc_mat_config imgu_css_csc_defaults;
49 extern const struct ipu3_uapi_cds_params imgu_css_cds_defaults;
50 extern const struct ipu3_uapi_shd_config_static imgu_css_shd_defaults;
51 extern const struct ipu3_uapi_yuvp1_iefd_config imgu_css_iefd_defaults;
52 extern const struct ipu3_uapi_yuvp1_yds_config imgu_css_yds_defaults;
53 extern const struct ipu3_uapi_yuvp1_chnr_config imgu_css_chnr_defaults;
54 extern const struct ipu3_uapi_yuvp1_y_ee_nr_config imgu_css_y_ee_nr_defaults;
55 extern const struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config
56 						imgu_css_tcc_gain_pcwl_lut;
57 extern const struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config
58 						imgu_css_tcc_r_sqr_lut;
59 extern const struct imgu_abi_anr_config imgu_css_anr_defaults;
60 extern const struct ipu3_uapi_awb_fr_config_s imgu_css_awb_fr_defaults;
61 extern const struct ipu3_uapi_ae_grid_config imgu_css_ae_grid_defaults;
62 extern const struct ipu3_uapi_ae_ccm imgu_css_ae_ccm_defaults;
63 extern const struct ipu3_uapi_af_config_s imgu_css_af_defaults;
64 extern const struct ipu3_uapi_awb_config_s imgu_css_awb_defaults;
65 
66 #endif
67