mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
drm/amd/display: add s1_12 filter tables
[Why & How] Instead of converting tables from s1_10 to s1_12, add s1_12 tables instead. Remove init calls that do the conversion. Add APIs to read s1_10 tables Reviewed-by: Navid Assadian <navid.assadian@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c36d7948bb
commit
5a20ca32a2
|
|
@ -456,9 +456,113 @@ static const uint16_t filter_isharp_bs_3tap_64p[99] = {
|
|||
};
|
||||
|
||||
/* Converted Blur & Scale coeff tables from S1.10 to S1.12 */
|
||||
static uint16_t filter_isharp_bs_4tap_in_6_64p_s1_12[198];
|
||||
static uint16_t filter_isharp_bs_4tap_64p_s1_12[132];
|
||||
static uint16_t filter_isharp_bs_3tap_64p_s1_12[99];
|
||||
static const uint16_t filter_isharp_bs_4tap_in_6_64p_s1_12[198] = {
|
||||
0x0000, 0x0394, 0x08dc, 0x0390, 0x0000, 0x0000,
|
||||
0x0000, 0x0378, 0x08dc, 0x03ac, 0x0000, 0x0000,
|
||||
0x0000, 0x035c, 0x08d8, 0x03c8, 0x0004, 0x0000,
|
||||
0x0000, 0x0340, 0x08d4, 0x03e8, 0x0004, 0x0000,
|
||||
0x0000, 0x0324, 0x08d0, 0x0404, 0x0008, 0x0000,
|
||||
0x0000, 0x0308, 0x08cc, 0x0420, 0x000c, 0x0000,
|
||||
0x0000, 0x02ec, 0x08c8, 0x0440, 0x000c, 0x0000,
|
||||
0x0000, 0x02d4, 0x08c0, 0x045c, 0x0010, 0x0000,
|
||||
0x0000, 0x02b8, 0x08b8, 0x047c, 0x0014, 0x0000,
|
||||
0x0000, 0x02a0, 0x08b0, 0x0498, 0x0018, 0x0000,
|
||||
0x0000, 0x0288, 0x08a8, 0x04b4, 0x001c, 0x0000,
|
||||
0x0000, 0x0270, 0x08a0, 0x04d0, 0x0020, 0x0000,
|
||||
0x0000, 0x0258, 0x0894, 0x04f0, 0x0024, 0x0000,
|
||||
0x0000, 0x0240, 0x0888, 0x050c, 0x002c, 0x0000,
|
||||
0x0000, 0x0228, 0x087c, 0x052c, 0x0030, 0x0000,
|
||||
0x0000, 0x0214, 0x0870, 0x0544, 0x0038, 0x0000,
|
||||
0x0000, 0x01fc, 0x0860, 0x0568, 0x003c, 0x0000,
|
||||
0x0000, 0x01e8, 0x0854, 0x0580, 0x0044, 0x0000,
|
||||
0x0000, 0x01d0, 0x0844, 0x05a0, 0x004c, 0x0000,
|
||||
0x0000, 0x01bc, 0x0834, 0x05bc, 0x0054, 0x0000,
|
||||
0x0000, 0x01a8, 0x0824, 0x05d8, 0x005c, 0x0000,
|
||||
0x0000, 0x0194, 0x0810, 0x05f8, 0x0064, 0x0000,
|
||||
0x0000, 0x0180, 0x0800, 0x0614, 0x006c, 0x0000,
|
||||
0x0000, 0x0170, 0x07ec, 0x0630, 0x0074, 0x0000,
|
||||
0x0000, 0x015c, 0x07d8, 0x064c, 0x0080, 0x0000,
|
||||
0x0000, 0x014c, 0x07c4, 0x0668, 0x0088, 0x0000,
|
||||
0x0000, 0x0138, 0x07b0, 0x0684, 0x0094, 0x0000,
|
||||
0x0000, 0x0128, 0x0798, 0x06a0, 0x00a0, 0x0000,
|
||||
0x0000, 0x0118, 0x0784, 0x06bc, 0x00a8, 0x0000,
|
||||
0x0000, 0x0108, 0x076c, 0x06d8, 0x00b4, 0x0000,
|
||||
0x0000, 0x00fc, 0x0754, 0x06ec, 0x00c4, 0x0000,
|
||||
0x0000, 0x00ec, 0x073c, 0x0708, 0x00d0, 0x0000,
|
||||
0x0000, 0x00dc, 0x0724, 0x0724, 0x00dc, 0x0000,
|
||||
};
|
||||
|
||||
static const uint16_t filter_isharp_bs_4tap_64p_s1_12[132] = {
|
||||
0x0394, 0x08dc, 0x0390, 0x0000,
|
||||
0x0378, 0x08dc, 0x03ac, 0x0000,
|
||||
0x035c, 0x08d8, 0x03c8, 0x0004,
|
||||
0x0340, 0x08d4, 0x03e8, 0x0004,
|
||||
0x0324, 0x08d0, 0x0404, 0x0008,
|
||||
0x0308, 0x08cc, 0x0420, 0x000c,
|
||||
0x02ec, 0x08c8, 0x0440, 0x000c,
|
||||
0x02d4, 0x08c0, 0x045c, 0x0010,
|
||||
0x02b8, 0x08b8, 0x047c, 0x0014,
|
||||
0x02a0, 0x08b0, 0x0498, 0x0018,
|
||||
0x0288, 0x08a8, 0x04b4, 0x001c,
|
||||
0x0270, 0x08a0, 0x04d0, 0x0020,
|
||||
0x0258, 0x0894, 0x04f0, 0x0024,
|
||||
0x0240, 0x0888, 0x050c, 0x002c,
|
||||
0x0228, 0x087c, 0x052c, 0x0030,
|
||||
0x0214, 0x0870, 0x0544, 0x0038,
|
||||
0x01fc, 0x0860, 0x0568, 0x003c,
|
||||
0x01e8, 0x0854, 0x0580, 0x0044,
|
||||
0x01d0, 0x0844, 0x05a0, 0x004c,
|
||||
0x01bc, 0x0834, 0x05bc, 0x0054,
|
||||
0x01a8, 0x0824, 0x05d8, 0x005c,
|
||||
0x0194, 0x0810, 0x05f8, 0x0064,
|
||||
0x0180, 0x0800, 0x0614, 0x006c,
|
||||
0x0170, 0x07ec, 0x0630, 0x0074,
|
||||
0x015c, 0x07d8, 0x064c, 0x0080,
|
||||
0x014c, 0x07c4, 0x0668, 0x0088,
|
||||
0x0138, 0x07b0, 0x0684, 0x0094,
|
||||
0x0128, 0x0798, 0x06a0, 0x00a0,
|
||||
0x0118, 0x0784, 0x06bc, 0x00a8,
|
||||
0x0108, 0x076c, 0x06d8, 0x00b4,
|
||||
0x00fc, 0x0754, 0x06ec, 0x00c4,
|
||||
0x00ec, 0x073c, 0x0708, 0x00d0,
|
||||
0x00dc, 0x0724, 0x0724, 0x00dc,
|
||||
};
|
||||
|
||||
static const uint16_t filter_isharp_bs_3tap_64p_s1_12[99] = {
|
||||
0x0800, 0x0800, 0x0000,
|
||||
0x07d8, 0x0818, 0x0010,
|
||||
0x07b0, 0x082c, 0x0024,
|
||||
0x0788, 0x0844, 0x0034,
|
||||
0x0760, 0x0858, 0x0048,
|
||||
0x0738, 0x0870, 0x0058,
|
||||
0x0710, 0x0884, 0x006c,
|
||||
0x06e8, 0x0898, 0x0080,
|
||||
0x06c0, 0x08a8, 0x0098,
|
||||
0x0698, 0x08bc, 0x00ac,
|
||||
0x0670, 0x08cc, 0x00c4,
|
||||
0x0648, 0x08e0, 0x00d8,
|
||||
0x0620, 0x08f0, 0x00f0,
|
||||
0x05f8, 0x0900, 0x0108,
|
||||
0x05d0, 0x0910, 0x0120,
|
||||
0x05a8, 0x0920, 0x0138,
|
||||
0x0584, 0x0928, 0x0154,
|
||||
0x055c, 0x0938, 0x016c,
|
||||
0x0534, 0x0944, 0x0188,
|
||||
0x0510, 0x094c, 0x01a4,
|
||||
0x04e8, 0x0958, 0x01c0,
|
||||
0x04c4, 0x0960, 0x01dc,
|
||||
0x049c, 0x096c, 0x01f8,
|
||||
0x0478, 0x0970, 0x0218,
|
||||
0x0454, 0x0978, 0x0234,
|
||||
0x042c, 0x0980, 0x0254,
|
||||
0x0408, 0x0988, 0x0270,
|
||||
0x03e4, 0x098c, 0x0290,
|
||||
0x03c0, 0x0990, 0x02b0,
|
||||
0x039c, 0x0994, 0x02d0,
|
||||
0x037c, 0x0990, 0x02f4,
|
||||
0x0358, 0x0994, 0x0314,
|
||||
0x0334, 0x0998, 0x0334,
|
||||
};
|
||||
|
||||
/* Pre-generated 1DLUT for given setup and sharpness level */
|
||||
struct isharp_1D_lut_pregen filter_isharp_1D_lut_pregen[NUM_SHARPNESS_SETUPS] = {
|
||||
|
|
@ -537,15 +641,15 @@ const uint16_t *spl_get_filter_isharp_wide_6tap_64p(void)
|
|||
{
|
||||
return filter_isharp_wide_6tap_64p;
|
||||
}
|
||||
uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void)
|
||||
const uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void)
|
||||
{
|
||||
return filter_isharp_bs_4tap_in_6_64p_s1_12;
|
||||
}
|
||||
uint16_t *spl_get_filter_isharp_bs_4tap_64p(void)
|
||||
const uint16_t *spl_get_filter_isharp_bs_4tap_64p(void)
|
||||
{
|
||||
return filter_isharp_bs_4tap_64p_s1_12;
|
||||
}
|
||||
uint16_t *spl_get_filter_isharp_bs_3tap_64p(void)
|
||||
const uint16_t *spl_get_filter_isharp_bs_3tap_64p(void)
|
||||
{
|
||||
return filter_isharp_bs_3tap_64p_s1_12;
|
||||
}
|
||||
|
|
@ -720,17 +824,7 @@ uint32_t *spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup)
|
|||
return filter_isharp_1D_lut_pregen[setup].value;
|
||||
}
|
||||
|
||||
void spl_init_blur_scale_coeffs(void)
|
||||
{
|
||||
convert_filter_s1_10_to_s1_12(filter_isharp_bs_3tap_64p,
|
||||
filter_isharp_bs_3tap_64p_s1_12, 3);
|
||||
convert_filter_s1_10_to_s1_12(filter_isharp_bs_4tap_64p,
|
||||
filter_isharp_bs_4tap_64p_s1_12, 4);
|
||||
convert_filter_s1_10_to_s1_12(filter_isharp_bs_4tap_in_6_64p,
|
||||
filter_isharp_bs_4tap_in_6_64p_s1_12, 6);
|
||||
}
|
||||
|
||||
uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps)
|
||||
const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps)
|
||||
{
|
||||
if (taps == 3)
|
||||
return spl_get_filter_isharp_bs_3tap_64p();
|
||||
|
|
@ -745,6 +839,21 @@ uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps)
|
|||
}
|
||||
}
|
||||
|
||||
const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps)
|
||||
{
|
||||
if (taps == 3)
|
||||
return filter_isharp_bs_3tap_64p;
|
||||
else if (taps == 4)
|
||||
return filter_isharp_bs_4tap_64p;
|
||||
else if (taps == 6)
|
||||
return filter_isharp_bs_4tap_in_6_64p;
|
||||
else {
|
||||
/* should never happen, bug */
|
||||
SPL_BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data,
|
||||
const struct spl_scaler_data *data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,11 +13,12 @@ const uint32_t *spl_get_filter_isharp_1D_lut_1p0x(void);
|
|||
const uint32_t *spl_get_filter_isharp_1D_lut_1p5x(void);
|
||||
const uint32_t *spl_get_filter_isharp_1D_lut_2p0x(void);
|
||||
const uint32_t *spl_get_filter_isharp_1D_lut_3p0x(void);
|
||||
uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void);
|
||||
uint16_t *spl_get_filter_isharp_bs_4tap_64p(void);
|
||||
uint16_t *spl_get_filter_isharp_bs_3tap_64p(void);
|
||||
const uint16_t *spl_get_filter_isharp_bs_4tap_in_6_64p(void);
|
||||
const uint16_t *spl_get_filter_isharp_bs_4tap_64p(void);
|
||||
const uint16_t *spl_get_filter_isharp_bs_3tap_64p(void);
|
||||
const uint16_t *spl_get_filter_isharp_wide_6tap_64p(void);
|
||||
uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps);
|
||||
const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps);
|
||||
const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps);
|
||||
|
||||
#define NUM_SHARPNESS_ADJ_LEVELS 6
|
||||
struct scale_ratio_to_sharpness_level_adj {
|
||||
|
|
@ -40,7 +41,6 @@ enum system_setup {
|
|||
NUM_SHARPNESS_SETUPS
|
||||
};
|
||||
|
||||
void spl_init_blur_scale_coeffs(void);
|
||||
void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data,
|
||||
const struct spl_scaler_data *data);
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -13,14 +13,14 @@ struct scale_ratio_to_reg_value_lookup {
|
|||
const uint32_t reg_value;
|
||||
};
|
||||
|
||||
void spl_init_easf_filter_coeffs(void);
|
||||
uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio);
|
||||
uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio);
|
||||
uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio);
|
||||
uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio);
|
||||
const uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio);
|
||||
const uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio);
|
||||
const uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio);
|
||||
void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data,
|
||||
const struct spl_scaler_data *data, bool enable_easf_v,
|
||||
bool enable_easf_h);
|
||||
const uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio);
|
||||
const uint16_t *spl_dscl_get_easf_filter_coeffs_64p_s1_10(int taps, struct spl_fixed31_32 ratio);
|
||||
|
||||
uint32_t spl_get_v_bf3_mode(struct spl_fixed31_32 ratio);
|
||||
uint32_t spl_get_h_bf3_mode(struct spl_fixed31_32 ratio);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user