Skip to content

Commit f803feb

Browse files
ideakmehmetb0
authored andcommitted
drm: Fix DSC BPP increment decoding
BugLink: https://bugs.launchpad.net/bugs/2104873 [ Upstream commit e00a2e5 ] Starting with DPCD version 2.0 bits 6:3 of the DP_DSC_BITS_PER_PIXEL_INC DPCD register contains the NativeYCbCr422_MAX_bpp_DELTA field, which can be non-zero as opposed to earlier DPCD versions, hence decoding the bit_per_pixel increment value at bits 2:0 in the same register requires applying a mask, do so. Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Fixes: 0c2287c ("drm/display/dp: Add helper function to get DSC bpp precision") Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250212161851.4007005-1-imre.deak@intel.com Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com>
1 parent 55e676b commit f803feb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ u8 drm_dp_dsc_sink_bpp_incr(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
23752375
{
23762376
u8 bpp_increment_dpcd = dsc_dpcd[DP_DSC_BITS_PER_PIXEL_INC - DP_DSC_SUPPORT];
23772377

2378-
switch (bpp_increment_dpcd) {
2378+
switch (bpp_increment_dpcd & DP_DSC_BITS_PER_PIXEL_MASK) {
23792379
case DP_DSC_BITS_PER_PIXEL_1_16:
23802380
return 16;
23812381
case DP_DSC_BITS_PER_PIXEL_1_8:

include/drm/display/drm_dp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@
359359
# define DP_DSC_BITS_PER_PIXEL_1_4 0x2
360360
# define DP_DSC_BITS_PER_PIXEL_1_2 0x3
361361
# define DP_DSC_BITS_PER_PIXEL_1_1 0x4
362+
# define DP_DSC_BITS_PER_PIXEL_MASK 0x7
362363

363364
#define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */
364365
# define DP_PSR_IS_SUPPORTED 1

0 commit comments

Comments
 (0)