xref: /linux/drivers/gpu/drm/amd/display/dc/spl/dc_spl_isharp_filters.h (revision 994aeacbb3c039b4f3e02e76e6d39407920e76c6)
1 // SPDX-License-Identifier: MIT
2 //
3 // Copyright 2024 Advanced Micro Devices, Inc.
4 
5 #ifndef __DC_SPL_ISHARP_FILTERS_H__
6 #define __DC_SPL_ISHARP_FILTERS_H__
7 
8 #include "dc_spl_types.h"
9 
10 #define ISHARP_LUT_TABLE_SIZE 32
11 const uint32_t *spl_get_filter_isharp_1D_lut_0(void);
12 const uint32_t *spl_get_filter_isharp_1D_lut_0p5x(void);
13 const uint32_t *spl_get_filter_isharp_1D_lut_1p0x(void);
14 const uint32_t *spl_get_filter_isharp_1D_lut_1p5x(void);
15 const uint32_t *spl_get_filter_isharp_1D_lut_2p0x(void);
16 const uint32_t *spl_get_filter_isharp_1D_lut_3p0x(void);
17 uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void);
18 uint16_t *spl_get_filter_isharp_bs_4tap_64p(void);
19 uint16_t *spl_get_filter_isharp_bs_3tap_64p(void);
20 const uint16_t *spl_get_filter_isharp_wide_6tap_64p(void);
21 uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps);
22 
23 #define NUM_SHARPNESS_ADJ_LEVELS 6
24 struct scale_ratio_to_sharpness_level_adj {
25 	unsigned int ratio_numer;
26 	unsigned int ratio_denom;
27 	unsigned int level_down_adj; /* adjust sharpness level down */
28 };
29 
30 struct isharp_1D_lut_pregen {
31 	unsigned int sharpness_numer;
32 	unsigned int sharpness_denom;
33 	uint32_t value[ISHARP_LUT_TABLE_SIZE];
34 };
35 
36 enum system_setup {
37 	SDR_NL = 0,
38 	SDR_L,
39 	HDR_NL,
40 	HDR_L,
41 	NUM_SHARPNESS_SETUPS
42 };
43 
44 void spl_init_blur_scale_coeffs(void);
45 void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data,
46 	const struct spl_scaler_data *data);
47 
48 void spl_build_isharp_1dlut_from_reference_curve(struct spl_fixed31_32 ratio, enum system_setup setup,
49 	struct adaptive_sharpness sharpness, enum scale_to_sharpness_policy scale_to_sharpness_policy);
50 uint32_t *spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup);
51 #endif /* __DC_SPL_ISHARP_FILTERS_H__ */
52