Skip to content

Commit a122243

Browse files
committed
drm/i915: Fail if DSC compression requirement is less than platform supports
Currently we just clamp that value to the highest supported one, however that means, we are not able to fit this into our available bandwidth range, so we might see glitches or FIFO underruns. While choosing less compressed bpp than min bpp required to handle the mode is harmless and might even save some bandwidth, choosing higher compressed bpp than min bpp required to handle the required mode config, can cause issues. So in that case lets just conclude that even with DSC, we are not able to comply with bandwidth requirements and fail. v2: - s/clamp_t/min_t/ (Luca Coelho) Signed-off-by: Stanislav Lisovskiy <[email protected]> Reviewed-by: Luca Coelho <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ce98870 commit a122243

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,18 @@ u32 intel_dp_dsc_nearest_valid_bpp(struct drm_i915_private *i915, u32 bpp, u32 p
713713

714714
/*
715715
* According to BSpec, 27 is the max DSC output bpp,
716-
* 8 is the min DSC output bpp
716+
* 8 is the min DSC output bpp.
717+
* While we can still clamp higher bpp values to 27, saving bandwidth,
718+
* if it is required to oompress up to bpp < 8, means we can't do
719+
* that and probably means we can't fit the required mode, even with
720+
* DSC enabled.
717721
*/
718-
bits_per_pixel = clamp_t(u32, bits_per_pixel, 8, 27);
722+
if (bits_per_pixel < 8) {
723+
drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min 8\n",
724+
bits_per_pixel);
725+
return 0;
726+
}
727+
bits_per_pixel = min_t(u32, bits_per_pixel, 27);
719728
} else {
720729
/* Find the nearest match in the array of known BPPs from VESA */
721730
for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp) - 1; i++) {

0 commit comments

Comments
 (0)