summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dsc
diff options
context:
space:
mode:
authorJaehyun Chung <jaehyun.chung@amd.com>2020-08-06 00:28:53 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-08-17 21:09:06 +0300
commite0f7ff99c92ff5e033e169c30cff607ff7c17192 (patch)
tree729e7cb863247456840ebf7acc24f4d1cbc2a52a /drivers/gpu/drm/amd/display/dc/dsc
parent5ab7943187f22b572fd12d517bd699771b88ce91 (diff)
downloadlinux-e0f7ff99c92ff5e033e169c30cff607ff7c17192.tar.xz
drm/amd/display: Mask DPCD field to avoid reading unsupported field value
[Why] DSC will be disabled if DPCD 0006F[6:3] is set to a non-zero value because bits 6:3 are not currently supported. When 6:3 is populated, an unsupported INCREMENT OF bits_per_pixel value is read (DPCD 0006F[2:0]) [How] Mask the INCREMENT OF bits_per_pixel field so that values in the unsupported field are ignored. Signed-off-by: Jaehyun Chung <jaehyun.chung@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dsc')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index da1b654833d5..4c844cfaa956 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -192,8 +192,10 @@ static bool dsc_throughput_from_dpcd(int dpcd_throughput, int *throughput)
}
-static bool dsc_bpp_increment_div_from_dpcd(int bpp_increment_dpcd, uint32_t *bpp_increment_div)
+static bool dsc_bpp_increment_div_from_dpcd(uint8_t bpp_increment_dpcd, uint32_t *bpp_increment_div)
{
+ // Mask bpp increment dpcd field to avoid reading other fields
+ bpp_increment_dpcd &= 0x7;
switch (bpp_increment_dpcd) {
case 0: