Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Fix DSC BPP increment decoding

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: 0c2287c96521 ("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

+2 -1
+1 -1
drivers/gpu/drm/display/drm_dp_helper.c
··· 2544 2544 { 2545 2545 u8 bpp_increment_dpcd = dsc_dpcd[DP_DSC_BITS_PER_PIXEL_INC - DP_DSC_SUPPORT]; 2546 2546 2547 - switch (bpp_increment_dpcd) { 2547 + switch (bpp_increment_dpcd & DP_DSC_BITS_PER_PIXEL_MASK) { 2548 2548 case DP_DSC_BITS_PER_PIXEL_1_16: 2549 2549 return 16; 2550 2550 case DP_DSC_BITS_PER_PIXEL_1_8:
+1
include/drm/display/drm_dp.h
··· 359 359 # define DP_DSC_BITS_PER_PIXEL_1_4 0x2 360 360 # define DP_DSC_BITS_PER_PIXEL_1_2 0x3 361 361 # define DP_DSC_BITS_PER_PIXEL_1_1 0x4 362 + # define DP_DSC_BITS_PER_PIXEL_MASK 0x7 362 363 363 364 #define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */ 364 365 # define DP_PSR_IS_SUPPORTED 1