From 5f59fead5362f0dd66557a46d651bcde6be2be38 Mon Sep 17 00:00:00 2001 From: Amine Najahi Date: Wed, 12 Aug 2020 13:36:10 -0400 Subject: [PATCH] disp: msm: sde: expand dsc range_bpg_offset to support 10bpc DSC driver is applying the range_bpg_offset values for 8 bpc/8bpp to all compression ratios. This results in invalid DSC configuration in 10bpc mode and sink is not able to decode this image resulting in black screen. This change adds a table of range_bpg_offset values to capture the configuration for different bpc/bpp combinations. Change-Id: I27e8edcbded8a8e512315599d768750ba473bd60 Signed-off-by: Amine Najahi --- msm/sde_dsc_helper.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/msm/sde_dsc_helper.c b/msm/sde_dsc_helper.c index 06ba0939c0..d0ad849568 100644 --- a/msm/sde_dsc_helper.c +++ b/msm/sde_dsc_helper.c @@ -81,10 +81,27 @@ static char sde_dsc_rc_range_max_qp[DSC_RATIO_TYPE_MAX][DSC_NUM_BUF_RANGES] = { }; /* - * Rate control - bpg offset values + * Rate control - bpg offset values for each ratio type in sde_dsc_ratio_type */ -static char sde_dsc_rc_range_bpg_offset[DSC_NUM_BUF_RANGES] = - {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}; +static char sde_dsc_rc_range_bpg[DSC_RATIO_TYPE_MAX][DSC_NUM_BUF_RANGES] = { + /* DSC v1.1 */ + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -10, -12, -12, -12}, + /* DSC v1.1 SCR and DSC V1.2 RGB 444 */ + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -10, -12, -12, -12}, + /* DSC v1.2 YUV422 */ + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -10, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -10, -12, -12, -12}, + {10, 8, 6, 4, 2, 0, -2, -4, -6, -8, -10, -10, -12, -12, -12}, + /* DSC v1.2 YUV420 */ + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {2, 0, 0, -2, -4, -6, -8, -8, -8, -10, -10, -12, -12, -12, -12}, + {10, 8, 6, 4, 2, 0, -2, -4, -6, -8, -10, -10, -12, -12, -12}, +}; /** * Maps to lookup the sde_dsc_ratio_type index used in rate control tables @@ -206,7 +223,7 @@ int sde_dsc_populate_dsc_config(struct drm_dsc_config *dsc, int scr_ver) { dsc->rc_range_params[i].range_max_qp = sde_dsc_rc_range_max_qp[ratio_idx][i]; dsc->rc_range_params[i].range_bpg_offset = - sde_dsc_rc_range_bpg_offset[i]; + sde_dsc_rc_range_bpg[ratio_idx][i]; } if (bpp == 8) {