Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: sspl: cleanup filter code

[Why & How]
Remove unused filters and functions
Add static to limit scope

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Jun Lei <jun.lei@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Samson Tam and committed by
Alex Deucher
53b2e0c2 8f87447a

+40 -590
+4 -317
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.c
··· 11 11 // LUT content is packed as 4-bytes into one DWORD/entry 12 12 // A_start = 0.000000 13 13 // A_end = 10.000000 14 - // A_gain = 2.000000 15 - // B_start = 11.000000 16 - // B_end = 86.000000 17 - // C_start = 40.000000 18 - // C_end = 64.000000 19 - //======================================== 20 - static const uint32_t filter_isharp_1D_lut_0[ISHARP_LUT_TABLE_SIZE] = { 21 - 0x02010000, 22 - 0x0A070503, 23 - 0x1614100D, 24 - 0x1C1B1918, 25 - 0x22211F1E, 26 - 0x27262423, 27 - 0x2A2A2928, 28 - 0x2D2D2C2B, 29 - 0x302F2F2E, 30 - 0x31313030, 31 - 0x31313131, 32 - 0x31313131, 33 - 0x30303031, 34 - 0x292D2F2F, 35 - 0x191D2125, 36 - 0x050A0F14, 37 - 0x00000000, 38 - 0x00000000, 39 - 0x00000000, 40 - 0x00000000, 41 - 0x00000000, 42 - 0x00000000, 43 - 0x00000000, 44 - 0x00000000, 45 - 0x00000000, 46 - 0x00000000, 47 - 0x00000000, 48 - 0x00000000, 49 - 0x00000000, 50 - 0x00000000, 51 - 0x00000000, 52 - 0x00000000, 53 - }; 54 - //======================================== 55 - // Delta Gain 1DLUT 56 - // LUT content is packed as 4-bytes into one DWORD/entry 57 - // A_start = 0.000000 58 - // A_end = 10.000000 59 - // A_gain = 0.500000 60 - // B_start = 11.000000 61 - // B_end = 127.000000 62 - // C_start = 96.000000 63 - // C_end = 127.000000 64 - //======================================== 65 - 66 - static const uint32_t filter_isharp_1D_lut_0p5x[ISHARP_LUT_TABLE_SIZE] = { 67 - 0x00000000, 68 - 0x02020101, 69 - 0x06050403, 70 - 0x07070606, 71 - 0x09080808, 72 - 0x0A0A0A09, 73 - 0x0C0B0B0B, 74 - 0x0D0D0C0C, 75 - 0x0E0E0D0D, 76 - 0x0F0F0E0E, 77 - 0x100F0F0F, 78 - 0x10101010, 79 - 0x11111010, 80 - 0x11111111, 81 - 0x11111111, 82 - 0x11111111, 83 - 0x11111111, 84 - 0x11111111, 85 - 0x11111111, 86 - 0x10101111, 87 - 0x10101010, 88 - 0x0F0F0F10, 89 - 0x0E0E0F0F, 90 - 0x0D0D0E0E, 91 - 0x0C0C0D0D, 92 - 0x0B0B0B0C, 93 - 0x090A0A0A, 94 - 0x08080809, 95 - 0x06060707, 96 - 0x04050506, 97 - 0x02030304, 98 - 0x00010102, 99 - }; 100 - //======================================== 101 - // Delta Gain 1DLUT 102 - // LUT content is packed as 4-bytes into one DWORD/entry 103 - // A_start = 0.000000 104 - // A_end = 10.000000 105 - // A_gain = 1.000000 106 - // B_start = 11.000000 107 - // B_end = 127.000000 108 - // C_start = 96.000000 109 - // C_end = 127.000000 110 - //======================================== 111 - static const uint32_t filter_isharp_1D_lut_1p0x[ISHARP_LUT_TABLE_SIZE] = { 112 - 0x01000000, 113 - 0x05040302, 114 - 0x0B0A0806, 115 - 0x0E0E0D0C, 116 - 0x1211100F, 117 - 0x15141312, 118 - 0x17171615, 119 - 0x1A191918, 120 - 0x1C1B1B1A, 121 - 0x1E1D1D1C, 122 - 0x1F1F1E1E, 123 - 0x2020201F, 124 - 0x21212121, 125 - 0x22222222, 126 - 0x23232222, 127 - 0x23232323, 128 - 0x23232323, 129 - 0x22222323, 130 - 0x22222222, 131 - 0x21212121, 132 - 0x1F202020, 133 - 0x1E1E1F1F, 134 - 0x1C1D1D1E, 135 - 0x1A1B1B1C, 136 - 0x1819191A, 137 - 0x15161717, 138 - 0x12131415, 139 - 0x0F101112, 140 - 0x0C0D0E0E, 141 - 0x08090A0B, 142 - 0x04050607, 143 - 0x00010203, 144 - }; 145 - //======================================== 146 - // Delta Gain 1DLUT 147 - // LUT content is packed as 4-bytes into one DWORD/entry 148 - // A_start = 0.000000 149 - // A_end = 10.000000 150 - // A_gain = 1.500000 151 - // B_start = 11.000000 152 - // B_end = 127.000000 153 - // C_start = 96.000000 154 - // C_end = 127.000000 155 - //======================================== 156 - static const uint32_t filter_isharp_1D_lut_1p5x[ISHARP_LUT_TABLE_SIZE] = { 157 - 0x01010000, 158 - 0x07050402, 159 - 0x110F0C0A, 160 - 0x16141312, 161 - 0x1B191817, 162 - 0x1F1E1D1C, 163 - 0x23222120, 164 - 0x26262524, 165 - 0x2A292827, 166 - 0x2C2C2B2A, 167 - 0x2F2E2E2D, 168 - 0x3130302F, 169 - 0x32323131, 170 - 0x33333332, 171 - 0x34343433, 172 - 0x34343434, 173 - 0x34343434, 174 - 0x33343434, 175 - 0x32333333, 176 - 0x31313232, 177 - 0x2F303031, 178 - 0x2D2E2E2F, 179 - 0x2A2B2C2C, 180 - 0x2728292A, 181 - 0x24252626, 182 - 0x20212223, 183 - 0x1C1D1E1F, 184 - 0x1718191B, 185 - 0x12131416, 186 - 0x0C0E0F10, 187 - 0x0608090B, 188 - 0x00020305 189 - }; 190 - //======================================== 191 - // Delta Gain 1DLUT 192 - // LUT content is packed as 4-bytes into one DWORD/entry 193 - // A_start = 0.000000 194 - // A_end = 10.000000 195 - // A_gain = 2.000000 196 - // B_start = 11.000000 197 - // B_end = 127.000000 198 - // C_start = 40.000000 199 - // C_end = 127.000000 200 - //======================================== 201 - static const uint32_t filter_isharp_1D_lut_2p0x[ISHARP_LUT_TABLE_SIZE] = { 202 - 0x02010000, 203 - 0x0A070503, 204 - 0x1614100D, 205 - 0x1D1B1A18, 206 - 0x2322201F, 207 - 0x29282625, 208 - 0x2F2D2C2B, 209 - 0x33323130, 210 - 0x38373534, 211 - 0x3B3A3938, 212 - 0x3E3E3D3C, 213 - 0x4140403F, 214 - 0x43424241, 215 - 0x44444443, 216 - 0x45454545, 217 - 0x46454545, 218 - 0x45454546, 219 - 0x45454545, 220 - 0x43444444, 221 - 0x41424243, 222 - 0x3F404041, 223 - 0x3C3D3E3E, 224 - 0x38393A3B, 225 - 0x34353738, 226 - 0x30313233, 227 - 0x2B2C2D2F, 228 - 0x25262829, 229 - 0x1F202223, 230 - 0x181A1B1D, 231 - 0x10121416, 232 - 0x080B0D0E, 233 - 0x00020406, 234 - }; 235 - //======================================== 236 - // Delta Gain 1DLUT 237 - // LUT content is packed as 4-bytes into one DWORD/entry 238 - // A_start = 0.000000 239 - // A_end = 10.000000 240 14 // A_gain = 3.000000 241 15 // B_start = 11.000000 242 16 // B_end = 127.000000 ··· 52 278 0x0003060A, 53 279 }; 54 280 55 - //======================================== 56 - // Wide scaler coefficients 57 - //======================================================== 58 - // <using> gen_scaler_coeffs.m 59 - // <date> 15-Dec-2021 60 - // <coeffDescrip> 6t_64p_LanczosEd_p_1_p_10qb_ 61 - // <num_taps> 6 62 - // <num_phases> 64 63 - // <CoefType> LanczosEd 64 - // <CoefQuant> S1.10 65 - //======================================================== 66 - static const uint16_t filter_isharp_wide_6tap_64p[198] = { 67 - 0x0000, 0x0000, 0x0400, 0x0000, 0x0000, 0x0000, 68 - 0x0003, 0x0FF3, 0x0400, 0x000D, 0x0FFD, 0x0000, 69 - 0x0006, 0x0FE7, 0x03FE, 0x001C, 0x0FF9, 0x0000, 70 - 0x0009, 0x0FDB, 0x03FC, 0x002B, 0x0FF5, 0x0000, 71 - 0x000C, 0x0FD0, 0x03F9, 0x003A, 0x0FF1, 0x0000, 72 - 0x000E, 0x0FC5, 0x03F5, 0x004A, 0x0FED, 0x0001, 73 - 0x0011, 0x0FBB, 0x03F0, 0x005A, 0x0FE9, 0x0001, 74 - 0x0013, 0x0FB2, 0x03EB, 0x006A, 0x0FE5, 0x0001, 75 - 0x0015, 0x0FA9, 0x03E4, 0x007B, 0x0FE1, 0x0002, 76 - 0x0017, 0x0FA1, 0x03DD, 0x008D, 0x0FDC, 0x0002, 77 - 0x0018, 0x0F99, 0x03D4, 0x00A0, 0x0FD8, 0x0003, 78 - 0x001A, 0x0F92, 0x03CB, 0x00B2, 0x0FD3, 0x0004, 79 - 0x001B, 0x0F8C, 0x03C1, 0x00C6, 0x0FCE, 0x0004, 80 - 0x001C, 0x0F86, 0x03B7, 0x00D9, 0x0FC9, 0x0005, 81 - 0x001D, 0x0F80, 0x03AB, 0x00EE, 0x0FC4, 0x0006, 82 - 0x001E, 0x0F7C, 0x039F, 0x0101, 0x0FBF, 0x0007, 83 - 0x001F, 0x0F78, 0x0392, 0x0115, 0x0FBA, 0x0008, 84 - 0x001F, 0x0F74, 0x0385, 0x012B, 0x0FB5, 0x0008, 85 - 0x0020, 0x0F71, 0x0376, 0x0140, 0x0FB0, 0x0009, 86 - 0x0020, 0x0F6E, 0x0367, 0x0155, 0x0FAB, 0x000B, 87 - 0x0020, 0x0F6C, 0x0357, 0x016B, 0x0FA6, 0x000C, 88 - 0x0020, 0x0F6A, 0x0347, 0x0180, 0x0FA2, 0x000D, 89 - 0x0020, 0x0F69, 0x0336, 0x0196, 0x0F9D, 0x000E, 90 - 0x0020, 0x0F69, 0x0325, 0x01AB, 0x0F98, 0x000F, 91 - 0x001F, 0x0F68, 0x0313, 0x01C3, 0x0F93, 0x0010, 92 - 0x001F, 0x0F69, 0x0300, 0x01D8, 0x0F8F, 0x0011, 93 - 0x001E, 0x0F69, 0x02ED, 0x01EF, 0x0F8B, 0x0012, 94 - 0x001D, 0x0F6A, 0x02D9, 0x0205, 0x0F87, 0x0014, 95 - 0x001D, 0x0F6C, 0x02C5, 0x021A, 0x0F83, 0x0015, 96 - 0x001C, 0x0F6E, 0x02B1, 0x0230, 0x0F7F, 0x0016, 97 - 0x001B, 0x0F70, 0x029C, 0x0247, 0x0F7B, 0x0017, 98 - 0x001A, 0x0F72, 0x0287, 0x025D, 0x0F78, 0x0018, 99 - 0x0019, 0x0F75, 0x0272, 0x0272, 0x0F75, 0x0019 100 - }; 101 281 // Blur and scale coefficients 102 282 //======================================================== 103 283 // <using> gen_BlurScale_coeffs.m ··· 341 613 {1, 1, 5}, 342 614 }; 343 615 344 - const uint32_t *spl_get_filter_isharp_1D_lut_0(void) 345 - { 346 - return filter_isharp_1D_lut_0; 347 - } 348 - const uint32_t *spl_get_filter_isharp_1D_lut_0p5x(void) 349 - { 350 - return filter_isharp_1D_lut_0p5x; 351 - } 352 - const uint32_t *spl_get_filter_isharp_1D_lut_1p0x(void) 353 - { 354 - return filter_isharp_1D_lut_1p0x; 355 - } 356 - const uint32_t *spl_get_filter_isharp_1D_lut_1p5x(void) 357 - { 358 - return filter_isharp_1D_lut_1p5x; 359 - } 360 - const uint32_t *spl_get_filter_isharp_1D_lut_2p0x(void) 361 - { 362 - return filter_isharp_1D_lut_2p0x; 363 - } 364 - const uint32_t *spl_get_filter_isharp_1D_lut_3p0x(void) 365 - { 366 - return filter_isharp_1D_lut_3p0x; 367 - } 368 - const uint16_t *spl_get_filter_isharp_wide_6tap_64p(void) 369 - { 370 - return filter_isharp_wide_6tap_64p; 371 - } 372 - const uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void) 373 - { 374 - return filter_isharp_bs_4tap_in_6_64p_s1_12; 375 - } 376 - const uint16_t *spl_get_filter_isharp_bs_4tap_64p(void) 377 - { 378 - return filter_isharp_bs_4tap_64p_s1_12; 379 - } 380 - const uint16_t *spl_get_filter_isharp_bs_3tap_64p(void) 381 - { 382 - return filter_isharp_bs_3tap_64p_s1_12; 383 - } 384 - 385 616 static unsigned int spl_calculate_sharpness_level_adj(struct spl_fixed31_32 ratio) 386 617 { 387 618 int j; ··· 380 693 } 381 694 382 695 static unsigned int spl_calculate_sharpness_level(struct spl_fixed31_32 ratio, 383 - int discrete_sharpness_level, enum system_setup setup, 696 + unsigned int discrete_sharpness_level, enum system_setup setup, 384 697 struct spl_sharpness_range sharpness_range, 385 698 enum scale_to_sharpness_policy scale_to_sharpness_policy) 386 699 { ··· 514 827 const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps) 515 828 { 516 829 if (taps == 3) 517 - return spl_get_filter_isharp_bs_3tap_64p(); 830 + return filter_isharp_bs_3tap_64p_s1_12; 518 831 else if (taps == 4) 519 - return spl_get_filter_isharp_bs_4tap_64p(); 832 + return filter_isharp_bs_4tap_64p_s1_12; 520 833 else if (taps == 6) 521 - return spl_get_filter_isharp_bs_4tap_in_6_64p(); 834 + return filter_isharp_bs_4tap_in_6_64p_s1_12; 522 835 else { 523 836 /* should never happen, bug */ 524 837 SPL_BREAK_TO_DEBUGGER();
+5 -13
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.h
··· 7 7 8 8 #include "dc_spl_types.h" 9 9 10 - const uint32_t *spl_get_filter_isharp_1D_lut_0(void); 11 - const uint32_t *spl_get_filter_isharp_1D_lut_0p5x(void); 12 - const uint32_t *spl_get_filter_isharp_1D_lut_1p0x(void); 13 - const uint32_t *spl_get_filter_isharp_1D_lut_1p5x(void); 14 - const uint32_t *spl_get_filter_isharp_1D_lut_2p0x(void); 15 - const uint32_t *spl_get_filter_isharp_1D_lut_3p0x(void); 16 - const uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void); 17 - const uint16_t *spl_get_filter_isharp_bs_4tap_64p(void); 18 - const uint16_t *spl_get_filter_isharp_bs_3tap_64p(void); 19 - const uint16_t *spl_get_filter_isharp_wide_6tap_64p(void); 20 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps); 21 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps); 22 - 23 10 #define NUM_SHARPNESS_ADJ_LEVELS 6 24 11 struct scale_ratio_to_sharpness_level_adj { 25 12 unsigned int ratio_numer; ··· 34 47 void spl_build_isharp_1dlut_from_reference_curve(struct spl_fixed31_32 ratio, enum system_setup setup, 35 48 struct adaptive_sharpness sharpness, enum scale_to_sharpness_policy scale_to_sharpness_policy); 36 49 uint32_t *spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup); 50 + 51 + // public API 52 + const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps); 53 + const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps); 54 + 37 55 #endif /* __DC_SPL_ISHARP_FILTERS_H__ */
+19 -20
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_easf_filters.c
··· 1136 1136 }; 1137 1137 1138 1138 /* Converted scaler coeff tables from S1.10 to S1.12 */ 1139 - 1140 1139 static const uint16_t easf_filter_3tap_64p_ratio_0_30_s1_12[99] = { 1141 1140 0x0800, 0x0800, 0x0000, 1142 1141 0x07d8, 0x0818, 0x0010, ··· 2000 2001 0x0064, 0x3dd4, 0x09c8, 0x09c8, 0x3dd4, 0x0064, 2001 2002 }; 2002 2003 2003 - struct scale_ratio_to_reg_value_lookup easf_v_bf3_mode_lookup[] = { 2004 + static struct scale_ratio_to_reg_value_lookup easf_v_bf3_mode_lookup[] = { 2004 2005 {3, 10, 0x0000}, 2005 2006 {4, 10, 0x0000}, 2006 2007 {5, 10, 0x0000}, ··· 2012 2013 {-1, -1, 0x0002}, 2013 2014 }; 2014 2015 2015 - struct scale_ratio_to_reg_value_lookup easf_h_bf3_mode_lookup[] = { 2016 + static struct scale_ratio_to_reg_value_lookup easf_h_bf3_mode_lookup[] = { 2016 2017 {3, 10, 0x0000}, 2017 2018 {4, 10, 0x0000}, 2018 2019 {5, 10, 0x0000}, ··· 2024 2025 {-1, -1, 0x0002}, 2025 2026 }; 2026 2027 2027 - struct scale_ratio_to_reg_value_lookup easf_reducer_gain6_6tap_lookup[] = { 2028 + static struct scale_ratio_to_reg_value_lookup easf_reducer_gain6_6tap_lookup[] = { 2028 2029 {3, 10, 0x4100}, 2029 2030 {4, 10, 0x4100}, 2030 2031 {5, 10, 0x4100}, ··· 2036 2037 {-1, -1, 0x4100}, 2037 2038 }; 2038 2039 2039 - struct scale_ratio_to_reg_value_lookup easf_reducer_gain4_6tap_lookup[] = { 2040 + static struct scale_ratio_to_reg_value_lookup easf_reducer_gain4_6tap_lookup[] = { 2040 2041 {3, 10, 0x4000}, 2041 2042 {4, 10, 0x4000}, 2042 2043 {5, 10, 0x4000}, ··· 2048 2049 {-1, -1, 0x4000}, 2049 2050 }; 2050 2051 2051 - struct scale_ratio_to_reg_value_lookup easf_gain_ring6_6tap_lookup[] = { 2052 + static struct scale_ratio_to_reg_value_lookup easf_gain_ring6_6tap_lookup[] = { 2052 2053 {3, 10, 0x0000}, 2053 2054 {4, 10, 0x251F}, 2054 2055 {5, 10, 0x291F}, ··· 2060 2061 {-1, -1, 0xA640}, 2061 2062 }; 2062 2063 2063 - struct scale_ratio_to_reg_value_lookup easf_gain_ring4_6tap_lookup[] = { 2064 + static struct scale_ratio_to_reg_value_lookup easf_gain_ring4_6tap_lookup[] = { 2064 2065 {3, 10, 0x0000}, 2065 2066 {4, 10, 0x9600}, 2066 2067 {5, 10, 0xA460}, ··· 2072 2073 {-1, -1, 0xB058}, 2073 2074 }; 2074 2075 2075 - struct scale_ratio_to_reg_value_lookup easf_reducer_gain6_4tap_lookup[] = { 2076 + static struct scale_ratio_to_reg_value_lookup easf_reducer_gain6_4tap_lookup[] = { 2076 2077 {3, 10, 0x4100}, 2077 2078 {4, 10, 0x4100}, 2078 2079 {5, 10, 0x4100}, ··· 2084 2085 {-1, -1, 0x4100}, 2085 2086 }; 2086 2087 2087 - struct scale_ratio_to_reg_value_lookup easf_reducer_gain4_4tap_lookup[] = { 2088 + static struct scale_ratio_to_reg_value_lookup easf_reducer_gain4_4tap_lookup[] = { 2088 2089 {3, 10, 0x4000}, 2089 2090 {4, 10, 0x4000}, 2090 2091 {5, 10, 0x4000}, ··· 2096 2097 {-1, -1, 0x4000}, 2097 2098 }; 2098 2099 2099 - struct scale_ratio_to_reg_value_lookup easf_gain_ring6_4tap_lookup[] = { 2100 + static struct scale_ratio_to_reg_value_lookup easf_gain_ring6_4tap_lookup[] = { 2100 2101 {3, 10, 0x0000}, 2101 2102 {4, 10, 0x0000}, 2102 2103 {5, 10, 0x0000}, ··· 2108 2109 {-1, -1, 0x0000}, 2109 2110 }; 2110 2111 2111 - struct scale_ratio_to_reg_value_lookup easf_gain_ring4_4tap_lookup[] = { 2112 + static struct scale_ratio_to_reg_value_lookup easf_gain_ring4_4tap_lookup[] = { 2112 2113 {3, 10, 0x0000}, 2113 2114 {4, 10, 0x0000}, 2114 2115 {5, 10, 0x0000}, ··· 2120 2121 {-1, -1, 0xAC00}, 2121 2122 }; 2122 2123 2123 - struct scale_ratio_to_reg_value_lookup easf_3tap_dntilt_uptilt_offset_lookup[] = { 2124 + static struct scale_ratio_to_reg_value_lookup easf_3tap_dntilt_uptilt_offset_lookup[] = { 2124 2125 {3, 10, 0x0000}, 2125 2126 {4, 10, 0x0000}, 2126 2127 {5, 10, 0x0000}, ··· 2132 2133 {-1, -1, 0xA8D8}, 2133 2134 }; 2134 2135 2135 - struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt_maxval_lookup[] = { 2136 + static struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt_maxval_lookup[] = { 2136 2137 {3, 10, 0x0000}, 2137 2138 {4, 10, 0x0000}, 2138 2139 {5, 10, 0x0000}, ··· 2144 2145 {-1, -1, 0x3ADB}, 2145 2146 }; 2146 2147 2147 - struct scale_ratio_to_reg_value_lookup easf_3tap_dntilt_slope_lookup[] = { 2148 + static struct scale_ratio_to_reg_value_lookup easf_3tap_dntilt_slope_lookup[] = { 2148 2149 {3, 10, 0x3800}, 2149 2150 {4, 10, 0x3800}, 2150 2151 {5, 10, 0x3800}, ··· 2156 2157 {-1, -1, 0x3B66}, 2157 2158 }; 2158 2159 2159 - struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt1_slope_lookup[] = { 2160 + static struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt1_slope_lookup[] = { 2160 2161 {3, 10, 0x3800}, 2161 2162 {4, 10, 0x3800}, 2162 2163 {5, 10, 0x3800}, ··· 2168 2169 {-1, -1, 0x2F20}, 2169 2170 }; 2170 2171 2171 - struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt2_slope_lookup[] = { 2172 + static struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt2_slope_lookup[] = { 2172 2173 {3, 10, 0x0000}, 2173 2174 {4, 10, 0x0000}, 2174 2175 {5, 10, 0x0000}, ··· 2180 2181 {-1, -1, 0x1F00}, 2181 2182 }; 2182 2183 2183 - struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt2_offset_lookup[] = { 2184 + static struct scale_ratio_to_reg_value_lookup easf_3tap_uptilt2_offset_lookup[] = { 2184 2185 {3, 10, 0x0000}, 2185 2186 {4, 10, 0x0000}, 2186 2187 {5, 10, 0x0000}, ··· 2192 2193 {-1, -1, 0x9E00}, 2193 2194 }; 2194 2195 2195 - const uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio) 2196 + static const uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio) 2196 2197 { 2197 2198 if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2198 2199 return easf_filter_3tap_64p_ratio_0_30_s1_12; ··· 2212 2213 return easf_filter_3tap_64p_ratio_1_00_s1_12; 2213 2214 } 2214 2215 2215 - const uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio) 2216 + static const uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio) 2216 2217 { 2217 2218 if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2218 2219 return easf_filter_4tap_64p_ratio_0_30_s1_12; ··· 2232 2233 return easf_filter_4tap_64p_ratio_1_00_s1_12; 2233 2234 } 2234 2235 2235 - const uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio) 2236 + static const uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio) 2236 2237 { 2237 2238 if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2238 2239 return easf_filter_6tap_64p_ratio_0_30_s1_12;
+4 -5
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_easf_filters.h
··· 13 13 const uint32_t reg_value; 14 14 }; 15 15 16 - const uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio); 17 - const uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio); 18 - const uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio); 19 16 void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data, 20 17 const struct spl_scaler_data *data, bool enable_easf_v, 21 18 bool enable_easf_h); 22 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio); 23 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p_s1_10(int taps, struct spl_fixed31_32 ratio); 24 19 25 20 uint32_t spl_get_v_bf3_mode(struct spl_fixed31_32 ratio); 26 21 uint32_t spl_get_h_bf3_mode(struct spl_fixed31_32 ratio); ··· 29 34 uint32_t spl_get_3tap_uptilt1_slope(int taps, struct spl_fixed31_32 ratio); 30 35 uint32_t spl_get_3tap_uptilt2_slope(int taps, struct spl_fixed31_32 ratio); 31 36 uint32_t spl_get_3tap_uptilt2_offset(int taps, struct spl_fixed31_32 ratio); 37 + 38 + /* public API */ 39 + const uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio); 40 + const uint16_t *spl_dscl_get_easf_filter_coeffs_64p_s1_10(int taps, struct spl_fixed31_32 ratio); 32 41 33 42 #endif /* __DC_SPL_SCL_EASF_FILTERS_H__ */
+7 -225
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_filters.c
··· 4 4 5 5 #include "spl_debug.h" 6 6 #include "dc_spl_scl_filters.h" 7 - //========================================= 8 - // <num_taps> = 2 9 - // <num_phases> = 16 10 - // <scale_ratio> = 0.833333 (input/output) 11 - // <sharpness> = 0 12 - // <CoefType> = ModifiedLanczos 13 - // <CoefQuant> = s1.10 14 - // <CoefOut> = s1.12 15 - //========================================= 16 - static const uint16_t filter_2tap_16p[18] = { 17 - 0x1000, 0x0000, 18 - 0x0FF0, 0x0010, 19 - 0x0FB0, 0x0050, 20 - 0x0F34, 0x00CC, 21 - 0x0E68, 0x0198, 22 - 0x0D44, 0x02BC, 23 - 0x0BC4, 0x043C, 24 - 0x09FC, 0x0604, 25 - 0x0800, 0x0800 26 - }; 27 - 28 - //========================================= 29 - // <num_taps> = 3 30 - // <num_phases> = 16 31 - // <scale_ratio> = 0.83333 (input/output) 32 - // <sharpness> = 0 33 - // <CoefType> = ModifiedLanczos 34 - // <CoefQuant> = 1.10 35 - // <CoefOut> = 1.12 36 - //========================================= 37 - static const uint16_t filter_3tap_16p_upscale[27] = { 38 - 0x0804, 0x07FC, 0x0000, 39 - 0x06AC, 0x0978, 0x3FDC, 40 - 0x055C, 0x0AF0, 0x3FB4, 41 - 0x0420, 0x0C50, 0x3F90, 42 - 0x0300, 0x0D88, 0x3F78, 43 - 0x0200, 0x0E90, 0x3F70, 44 - 0x0128, 0x0F5C, 0x3F7C, 45 - 0x007C, 0x0FD8, 0x3FAC, 46 - 0x0000, 0x1000, 0x0000 47 - }; 48 - 49 - //========================================= 50 - // <num_taps> = 3 51 - // <num_phases> = 16 52 - // <scale_ratio> = 1.16666 (input/output) 53 - // <sharpness> = 0 54 - // <CoefType> = ModifiedLanczos 55 - // <CoefQuant> = 1.10 56 - // <CoefOut> = 1.12 57 - //========================================= 58 - static const uint16_t filter_3tap_16p_116[27] = { 59 - 0x0804, 0x07FC, 0x0000, 60 - 0x0700, 0x0914, 0x3FEC, 61 - 0x0604, 0x0A1C, 0x3FE0, 62 - 0x050C, 0x0B14, 0x3FE0, 63 - 0x041C, 0x0BF4, 0x3FF0, 64 - 0x0340, 0x0CB0, 0x0010, 65 - 0x0274, 0x0D3C, 0x0050, 66 - 0x01C0, 0x0D94, 0x00AC, 67 - 0x0128, 0x0DB4, 0x0124 68 - }; 69 - 70 - //========================================= 71 - // <num_taps> = 3 72 - // <num_phases> = 16 73 - // <scale_ratio> = 1.49999 (input/output) 74 - // <sharpness> = 0 75 - // <CoefType> = ModifiedLanczos 76 - // <CoefQuant> = 1.10 77 - // <CoefOut> = 1.12 78 - //========================================= 79 - static const uint16_t filter_3tap_16p_149[27] = { 80 - 0x0804, 0x07FC, 0x0000, 81 - 0x0730, 0x08CC, 0x0004, 82 - 0x0660, 0x098C, 0x0014, 83 - 0x0590, 0x0A3C, 0x0034, 84 - 0x04C4, 0x0AD4, 0x0068, 85 - 0x0400, 0x0B54, 0x00AC, 86 - 0x0348, 0x0BB0, 0x0108, 87 - 0x029C, 0x0BEC, 0x0178, 88 - 0x0200, 0x0C00, 0x0200 89 - }; 90 - 91 - //========================================= 92 - // <num_taps> = 3 93 - // <num_phases> = 16 94 - // <scale_ratio> = 1.83332 (input/output) 95 - // <sharpness> = 0 96 - // <CoefType> = ModifiedLanczos 97 - // <CoefQuant> = 1.10 98 - // <CoefOut> = 1.12 99 - //========================================= 100 - static const uint16_t filter_3tap_16p_183[27] = { 101 - 0x0804, 0x07FC, 0x0000, 102 - 0x0754, 0x0880, 0x002C, 103 - 0x06A8, 0x08F0, 0x0068, 104 - 0x05FC, 0x0954, 0x00B0, 105 - 0x0550, 0x09AC, 0x0104, 106 - 0x04A8, 0x09F0, 0x0168, 107 - 0x0408, 0x0A20, 0x01D8, 108 - 0x036C, 0x0A40, 0x0254, 109 - 0x02DC, 0x0A48, 0x02DC 110 - }; 111 - 112 - //========================================= 113 - // <num_taps> = 4 114 - // <num_phases> = 16 115 - // <scale_ratio> = 0.83333 (input/output) 116 - // <sharpness> = 0 117 - // <CoefType> = ModifiedLanczos 118 - // <CoefQuant> = 1.10 119 - // <CoefOut> = 1.12 120 - //========================================= 121 - static const uint16_t filter_4tap_16p_upscale[36] = { 122 - 0x0000, 0x1000, 0x0000, 0x0000, 123 - 0x3F74, 0x0FDC, 0x00B4, 0x3FFC, 124 - 0x3F0C, 0x0F70, 0x0194, 0x3FF0, 125 - 0x3ECC, 0x0EC4, 0x0298, 0x3FD8, 126 - 0x3EAC, 0x0DE4, 0x03B8, 0x3FB8, 127 - 0x3EA4, 0x0CD8, 0x04F4, 0x3F90, 128 - 0x3EB8, 0x0BA0, 0x0644, 0x3F64, 129 - 0x3ED8, 0x0A54, 0x07A0, 0x3F34, 130 - 0x3F00, 0x08FC, 0x0900, 0x3F04 131 - }; 132 - 133 - //========================================= 134 - // <num_taps> = 4 135 - // <num_phases> = 16 136 - // <scale_ratio> = 1.16666 (input/output) 137 - // <sharpness> = 0 138 - // <CoefType> = ModifiedLanczos 139 - // <CoefQuant> = 1.10 140 - // <CoefOut> = 1.12 141 - //========================================= 142 - static const uint16_t filter_4tap_16p_116[36] = { 143 - 0x01A8, 0x0CB4, 0x01A4, 0x0000, 144 - 0x0110, 0x0CB0, 0x0254, 0x3FEC, 145 - 0x0090, 0x0C80, 0x031C, 0x3FD4, 146 - 0x0024, 0x0C2C, 0x03F4, 0x3FBC, 147 - 0x3FD8, 0x0BAC, 0x04DC, 0x3FA0, 148 - 0x3F9C, 0x0B14, 0x05CC, 0x3F84, 149 - 0x3F70, 0x0A60, 0x06C4, 0x3F6C, 150 - 0x3F5C, 0x098C, 0x07BC, 0x3F5C, 151 - 0x3F54, 0x08AC, 0x08AC, 0x3F54 152 - }; 153 - 154 - //========================================= 155 - // <num_taps> = 4 156 - // <num_phases> = 16 157 - // <scale_ratio> = 1.49999 (input/output) 158 - // <sharpness> = 0 159 - // <CoefType> = ModifiedLanczos 160 - // <CoefQuant> = 1.10 161 - // <CoefOut> = 1.12 162 - //========================================= 163 - static const uint16_t filter_4tap_16p_149[36] = { 164 - 0x02B8, 0x0A90, 0x02B8, 0x0000, 165 - 0x0230, 0x0A90, 0x0350, 0x3FF0, 166 - 0x01B8, 0x0A78, 0x03F0, 0x3FE0, 167 - 0x0148, 0x0A48, 0x049C, 0x3FD4, 168 - 0x00E8, 0x0A00, 0x054C, 0x3FCC, 169 - 0x0098, 0x09A0, 0x0600, 0x3FC8, 170 - 0x0054, 0x0928, 0x06B4, 0x3FD0, 171 - 0x001C, 0x08A4, 0x0760, 0x3FE0, 172 - 0x3FFC, 0x0804, 0x0804, 0x3FFC 173 - }; 174 - 175 - //========================================= 176 - // <num_taps> = 4 177 - // <num_phases> = 16 178 - // <scale_ratio> = 1.83332 (input/output) 179 - // <sharpness> = 0 180 - // <CoefType> = ModifiedLanczos 181 - // <CoefQuant> = 1.10 182 - // <CoefOut> = 1.12 183 - //========================================= 184 - static const uint16_t filter_4tap_16p_183[36] = { 185 - 0x03B0, 0x08A0, 0x03B0, 0x0000, 186 - 0x0348, 0x0898, 0x041C, 0x0004, 187 - 0x02DC, 0x0884, 0x0490, 0x0010, 188 - 0x0278, 0x0864, 0x0500, 0x0024, 189 - 0x021C, 0x0838, 0x0570, 0x003C, 190 - 0x01C8, 0x07FC, 0x05E0, 0x005C, 191 - 0x0178, 0x07B8, 0x064C, 0x0084, 192 - 0x0130, 0x076C, 0x06B0, 0x00B4, 193 - 0x00F0, 0x0714, 0x0710, 0x00EC 194 - }; 195 7 196 8 //========================================= 197 9 // <num_taps> = 2 ··· 1130 1318 0x3FD4, 0x3F84, 0x0214, 0x0694, 0x0694, 0x0214, 0x3F84, 0x3FD4 1131 1319 }; 1132 1320 1133 - const uint16_t *spl_get_filter_3tap_16p(struct spl_fixed31_32 ratio) 1134 - { 1135 - if (ratio.value < spl_fixpt_one.value) 1136 - return filter_3tap_16p_upscale; 1137 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1138 - return filter_3tap_16p_116; 1139 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1140 - return filter_3tap_16p_149; 1141 - else 1142 - return filter_3tap_16p_183; 1143 - } 1144 - 1145 - const uint16_t *spl_get_filter_3tap_64p(struct spl_fixed31_32 ratio) 1321 + static const uint16_t *spl_get_filter_3tap_64p(struct spl_fixed31_32 ratio) 1146 1322 { 1147 1323 if (ratio.value < spl_fixpt_one.value) 1148 1324 return filter_3tap_64p_upscale; ··· 1142 1342 return filter_3tap_64p_183; 1143 1343 } 1144 1344 1145 - const uint16_t *spl_get_filter_4tap_16p(struct spl_fixed31_32 ratio) 1146 - { 1147 - if (ratio.value < spl_fixpt_one.value) 1148 - return filter_4tap_16p_upscale; 1149 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1150 - return filter_4tap_16p_116; 1151 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1152 - return filter_4tap_16p_149; 1153 - else 1154 - return filter_4tap_16p_183; 1155 - } 1156 - 1157 - const uint16_t *spl_get_filter_4tap_64p(struct spl_fixed31_32 ratio) 1345 + static const uint16_t *spl_get_filter_4tap_64p(struct spl_fixed31_32 ratio) 1158 1346 { 1159 1347 if (ratio.value < spl_fixpt_one.value) 1160 1348 return filter_4tap_64p_upscale; ··· 1154 1366 return filter_4tap_64p_183; 1155 1367 } 1156 1368 1157 - const uint16_t *spl_get_filter_5tap_64p(struct spl_fixed31_32 ratio) 1369 + static const uint16_t *spl_get_filter_5tap_64p(struct spl_fixed31_32 ratio) 1158 1370 { 1159 1371 if (ratio.value < spl_fixpt_one.value) 1160 1372 return filter_5tap_64p_upscale; ··· 1166 1378 return filter_5tap_64p_183; 1167 1379 } 1168 1380 1169 - const uint16_t *spl_get_filter_6tap_64p(struct spl_fixed31_32 ratio) 1381 + static const uint16_t *spl_get_filter_6tap_64p(struct spl_fixed31_32 ratio) 1170 1382 { 1171 1383 if (ratio.value < spl_fixpt_one.value) 1172 1384 return filter_6tap_64p_upscale; ··· 1178 1390 return filter_6tap_64p_183; 1179 1391 } 1180 1392 1181 - const uint16_t *spl_get_filter_7tap_64p(struct spl_fixed31_32 ratio) 1393 + static const uint16_t *spl_get_filter_7tap_64p(struct spl_fixed31_32 ratio) 1182 1394 { 1183 1395 if (ratio.value < spl_fixpt_one.value) 1184 1396 return filter_7tap_64p_upscale; ··· 1190 1402 return filter_7tap_64p_183; 1191 1403 } 1192 1404 1193 - const uint16_t *spl_get_filter_8tap_64p(struct spl_fixed31_32 ratio) 1405 + static const uint16_t *spl_get_filter_8tap_64p(struct spl_fixed31_32 ratio) 1194 1406 { 1195 1407 if (ratio.value < spl_fixpt_one.value) 1196 1408 return filter_8tap_64p_upscale; ··· 1202 1414 return filter_8tap_64p_183; 1203 1415 } 1204 1416 1205 - const uint16_t *spl_get_filter_2tap_16p(void) 1206 - { 1207 - return filter_2tap_16p; 1208 - } 1209 - 1210 - const uint16_t *spl_get_filter_2tap_64p(void) 1417 + static const uint16_t *spl_get_filter_2tap_64p(void) 1211 1418 { 1212 1419 return filter_2tap_64p; 1213 1420 } ··· 1231 1448 return NULL; 1232 1449 } 1233 1450 } 1234 -
+1 -10
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_filters.h
··· 7 7 8 8 #include "dc_spl_types.h" 9 9 10 - const uint16_t *spl_get_filter_3tap_16p(struct spl_fixed31_32 ratio); 11 - const uint16_t *spl_get_filter_3tap_64p(struct spl_fixed31_32 ratio); 12 - const uint16_t *spl_get_filter_4tap_16p(struct spl_fixed31_32 ratio); 13 - const uint16_t *spl_get_filter_4tap_64p(struct spl_fixed31_32 ratio); 14 - const uint16_t *spl_get_filter_5tap_64p(struct spl_fixed31_32 ratio); 15 - const uint16_t *spl_get_filter_6tap_64p(struct spl_fixed31_32 ratio); 16 - const uint16_t *spl_get_filter_7tap_64p(struct spl_fixed31_32 ratio); 17 - const uint16_t *spl_get_filter_8tap_64p(struct spl_fixed31_32 ratio); 18 - const uint16_t *spl_get_filter_2tap_16p(void); 19 - const uint16_t *spl_get_filter_2tap_64p(void); 10 + /* public API */ 20 11 const uint16_t *spl_dscl_get_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio); 21 12 22 13 #endif /* __DC_SPL_SCL_FILTERS_H__ */