Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
To: Luca Coelho <luca@coelho.fi>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fail if DSC compression requirement is less than platform supports
Date: Mon, 26 Jun 2023 16:52:20 +0300	[thread overview]
Message-ID: <ZJmYFA8eAcl/TmzQ@intel.com> (raw)
In-Reply-To: <e1bef6bb59b788b737ed9f461b2aa525f46d2e8b.camel@coelho.fi>

On Mon, Jun 26, 2023 at 03:18:52PM +0300, Luca Coelho wrote:
> On Mon, 2023-06-26 at 11:28 +0300, Stanislav Lisovskiy wrote:
> > 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
> 
> Small typo, "compress".

Thanks for spotting

> 
> 
> > +		 * 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);
> 
> I guess you don't need to clamp anymore but could use min_t(u32,
> bits_per_pixel, 27) now, right? Actually, you don't even need to type
> it, so min(bits_per_pixel, 27) should suffice.

Yep, was thinking about that, was willing to leave clamp just as an additional
check "just in case", but probably you are right. 

Stan

> 
> 
> >  	} else {
> >  		/* Find the nearest match in the array of known BPPs from VESA */
> 
> --
> Cheers,
> Luca.

  reply	other threads:[~2023-06-26 13:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  8:28 [Intel-gfx] [PATCH] drm/i915: Fail if DSC compression requirement is less than platform supports Stanislav Lisovskiy
2023-06-26 11:06 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " 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 [this message]
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=ZJmYFA8eAcl/TmzQ@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=luca@coelho.fi \
    /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