Skip to content

Commit 1352564

Browse files
committed
drm/dsc: fix drm_edp_dsc_sink_output_bpp() DPCD high byte usage
The operator precedence between << and & is wrong, leading to the high byte being completely ignored. For example, with the 6.4 format, 32 becomes 0 and 24 becomes 8. Fix it, and remove the slightly confusing and unnecessary DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT macro while at it. Fixes: 0575650 ("drm/dp: DRM DP helper/macros to get DP sink DSC parameters") Cc: Stanislav Lisovskiy <[email protected]> Cc: Manasi Navare <[email protected]> Cc: Anusha Srivatsa <[email protected]> Cc: <[email protected]> # v5.0+ Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Ankit Nautiyal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1b617bc commit 1352564

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/drm/display/drm_dp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@
286286

287287
#define DP_DSC_MAX_BITS_PER_PIXEL_HI 0x068 /* eDP 1.4 */
288288
# define DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK (0x3 << 0)
289-
# define DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT 8
290289
# define DP_DSC_MAX_BPP_DELTA_VERSION_MASK 0x06
291290
# define DP_DSC_MAX_BPP_DELTA_AVAILABILITY 0x08
292291

include/drm/display/drm_dp_helper.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ static inline u16
181181
drm_edp_dsc_sink_output_bpp(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
182182
{
183183
return dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_LOW - DP_DSC_SUPPORT] |
184-
(dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_HI - DP_DSC_SUPPORT] &
185-
DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK <<
186-
DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT);
184+
((dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_HI - DP_DSC_SUPPORT] &
185+
DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK) << 8);
187186
}
188187

189188
static inline u32

0 commit comments

Comments
 (0)