Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] drm/i915: Fail if DSC compression requirement is less than platform supports
Date: Mon, 26 Jun 2023 11:28:21 +0300	[thread overview]
Message-ID: <20230626082821.2085-1-stanislav.lisovskiy@intel.com> (raw)

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.

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 9f40da20e88d..8696a1f02805 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -713,8 +713,17 @@ u32 intel_dp_dsc_nearest_valid_bpp(struct drm_i915_private *i915, u32 bpp, u32 p
 
 		/*
 		 * According to BSpec, 27 is the max DSC output bpp,
-		 * 8 is the min DSC output bpp
+		 * 8 is the min DSC output bpp.
+		 * While we can still clamp higher bpp values to 27, saving bandwidth,
+		 * if it is required to oompress up to bpp < 8, means we can't do
+		 * that and probably means we can't fit the required mode, even with
+		 * DSC enabled.
 		 */
+		if (bits_per_pixel < 8) {
+			drm_dbg_kms(&i915->drm, "Unsupported BPP %u, min 8\n",
+				    bits_per_pixel);
+			return 0;
+		}
 		bits_per_pixel = clamp_t(u32, bits_per_pixel, 8, 27);
 	} else {
 		/* Find the nearest match in the array of known BPPs from VESA */
-- 
2.37.3


             reply	other threads:[~2023-06-26  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  8:28 Stanislav Lisovskiy [this message]
2023-06-26 11:06 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fail if DSC compression requirement is less than platform supports Patchwork
2023-06-26 11:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-26 12:18 ` [Intel-gfx] [PATCH] " Luca Coelho
2023-06-26 13:52   ` Lisovskiy, Stanislav
2023-06-26 19:14 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2023-06-28 16:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fail if DSC compression requirement is less than platform supports (rev2) Patchwork
2023-06-28 16:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-29  9:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-06-29 12:25 [Intel-gfx] [PATCH] drm/i915: Fail if DSC compression requirement is less than platform supports Stanislav Lisovskiy
2023-06-29 13:07 ` Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626082821.2085-1-stanislav.lisovskiy@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox