disp: msm: sde: unify dsc format index look up for tables
Simplify dsc encoding format index look up by clubbing dsc v1.1 and v1.2 tables. Change-Id: I145ff4e301758d2991ca992fc6616ed2e7b72754 Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
b6b3b01190
commit
33e63e03c7
@@ -106,38 +106,35 @@ static char sde_dsc_rc_range_bpg[DSC_RATIO_TYPE_MAX][DSC_NUM_BUF_RANGES] = {
|
|||||||
/**
|
/**
|
||||||
* Maps to lookup the sde_dsc_ratio_type index used in rate control tables
|
* Maps to lookup the sde_dsc_ratio_type index used in rate control tables
|
||||||
*/
|
*/
|
||||||
static struct sde_dsc_v1_1_table_index_lut {
|
static struct sde_dsc_table_index_lut {
|
||||||
int scr_ver;
|
|
||||||
u32 bpc;
|
|
||||||
u32 bpp;
|
|
||||||
u32 type;
|
|
||||||
} sde_dsc_v1_1_index_map[] = {
|
|
||||||
{0, 8, 8, DSC_V11_8BPC_8BPP},
|
|
||||||
{0, 10, 8, DSC_V11_10BPC_8BPP},
|
|
||||||
{0, 10, 10, DSC_V11_10BPC_10BPP},
|
|
||||||
|
|
||||||
{1, 8, 8, DSC_V11_SCR1_8BPC_8BPP},
|
|
||||||
{1, 10, 8, DSC_V11_SCR1_10BPC_8BPP},
|
|
||||||
{1, 10, 10, DSC_V11_SCR1_10BPC_10BPP},
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct sde_dsc_v1_2_table_index_lut {
|
|
||||||
u32 fmt;
|
u32 fmt;
|
||||||
|
u32 scr_ver;
|
||||||
|
u32 minor_ver;
|
||||||
u32 bpc;
|
u32 bpc;
|
||||||
u32 bpp;
|
u32 bpp;
|
||||||
u32 type;
|
u32 type;
|
||||||
} sde_dsc_v1_2_index_map[] = {
|
} sde_dsc_index_map[] = {
|
||||||
{MSM_CHROMA_444, 8, 8, DSC_V12_444_8BPC_8BPP},
|
/* DSC 1.1 formats - scr version is considered */
|
||||||
{MSM_CHROMA_444, 10, 8, DSC_V12_444_10BPC_8BPP},
|
{MSM_CHROMA_444, 0, 1, 8, 8, DSC_V11_8BPC_8BPP},
|
||||||
{MSM_CHROMA_444, 10, 10, DSC_V12_444_10BPC_10BPP},
|
{MSM_CHROMA_444, 0, 1, 10, 8, DSC_V11_10BPC_8BPP},
|
||||||
|
{MSM_CHROMA_444, 0, 1, 10, 10, DSC_V11_10BPC_10BPP},
|
||||||
|
|
||||||
{MSM_CHROMA_422, 8, 7, DSC_V12_422_8BPC_7BPP},
|
{MSM_CHROMA_444, 1, 1, 8, 8, DSC_V11_SCR1_8BPC_8BPP},
|
||||||
{MSM_CHROMA_422, 8, 8, DSC_V12_422_8BPC_8BPP},
|
{MSM_CHROMA_444, 1, 1, 10, 8, DSC_V11_SCR1_10BPC_8BPP},
|
||||||
{MSM_CHROMA_422, 10, 7, DSC_V12_422_10BPC_7BPP},
|
{MSM_CHROMA_444, 1, 1, 10, 10, DSC_V11_SCR1_10BPC_10BPP},
|
||||||
{MSM_CHROMA_422, 10, 10, DSC_V12_422_10BPC_10BPP},
|
|
||||||
|
|
||||||
{MSM_CHROMA_420, 8, 6, DSC_V12_420_8BPC_6BPP},
|
/* DSC 1.2 formats - scr version is no-op */
|
||||||
{MSM_CHROMA_420, 10, 6, DSC_V12_420_10BPC_6BPP},
|
{MSM_CHROMA_444, -1, 2, 8, 8, DSC_V12_444_8BPC_8BPP},
|
||||||
|
{MSM_CHROMA_444, -1, 2, 10, 8, DSC_V12_444_10BPC_8BPP},
|
||||||
|
{MSM_CHROMA_444, -1, 2, 10, 10, DSC_V12_444_10BPC_10BPP},
|
||||||
|
|
||||||
|
{MSM_CHROMA_422, -1, 2, 8, 7, DSC_V12_422_8BPC_7BPP},
|
||||||
|
{MSM_CHROMA_422, -1, 2, 8, 8, DSC_V12_422_8BPC_8BPP},
|
||||||
|
{MSM_CHROMA_422, -1, 2, 10, 7, DSC_V12_422_10BPC_7BPP},
|
||||||
|
{MSM_CHROMA_422, -1, 2, 10, 10, DSC_V12_422_10BPC_10BPP},
|
||||||
|
|
||||||
|
{MSM_CHROMA_420, -1, 2, 8, 6, DSC_V12_420_8BPC_6BPP},
|
||||||
|
{MSM_CHROMA_420, -1, 2, 10, 6, DSC_V12_420_10BPC_6BPP},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int _get_rc_table_index(struct drm_dsc_config *dsc, int scr_ver)
|
static int _get_rc_table_index(struct drm_dsc_config *dsc, int scr_ver)
|
||||||
@@ -158,20 +155,14 @@ static int _get_rc_table_index(struct drm_dsc_config *dsc, int scr_ver)
|
|||||||
else if (dsc->native_420)
|
else if (dsc->native_420)
|
||||||
fmt = MSM_CHROMA_420;
|
fmt = MSM_CHROMA_420;
|
||||||
|
|
||||||
if (dsc->dsc_version_minor == 0x1) {
|
for (i = 0; i < ARRAY_SIZE(sde_dsc_index_map); i++) {
|
||||||
for (i = 0; i < ARRAY_SIZE(sde_dsc_v1_1_index_map); i++) {
|
if (dsc->dsc_version_minor == sde_dsc_index_map[i].minor_ver &&
|
||||||
if (bpc == sde_dsc_v1_1_index_map[i].bpc &&
|
fmt == sde_dsc_index_map[i].fmt &&
|
||||||
bpp == sde_dsc_v1_1_index_map[i].bpp &&
|
bpc == sde_dsc_index_map[i].bpc &&
|
||||||
scr_ver == sde_dsc_v1_1_index_map[i].scr_ver)
|
bpp == sde_dsc_index_map[i].bpp &&
|
||||||
return sde_dsc_v1_1_index_map[i].type;
|
(dsc->dsc_version_minor != 0x1 ||
|
||||||
}
|
scr_ver == sde_dsc_index_map[i].scr_ver))
|
||||||
} else if (dsc->dsc_version_minor == 0x2) {
|
return sde_dsc_index_map[i].type;
|
||||||
for (i = 0; i < ARRAY_SIZE(sde_dsc_v1_2_index_map); i++) {
|
|
||||||
if (bpc == sde_dsc_v1_2_index_map[i].bpc &&
|
|
||||||
bpp == sde_dsc_v1_2_index_map[i].bpp &&
|
|
||||||
fmt == sde_dsc_v1_2_index_map[i].fmt)
|
|
||||||
return sde_dsc_v1_2_index_map[i].type;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDE_ERROR("unsupported DSC v%d.%dr%d, bpc:%d, bpp:%d, fmt:0x%x\n",
|
SDE_ERROR("unsupported DSC v%d.%dr%d, bpc:%d, bpp:%d, fmt:0x%x\n",
|
||||||
|
Reference in New Issue
Block a user