Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Luca Coelho <luca@coelho.fi>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 11/13] drm/i915: Make wm latencies monotonic
Date: Thu, 18 Sep 2025 16:29:08 +0300	[thread overview]
Message-ID: <aMwJJPEoS8u6ovU9@intel.com> (raw)
In-Reply-To: <4dcd22ba34cf11a501220834fe6b9375de26e2a1.camel@coelho.fi>

On Tue, Sep 16, 2025 at 01:29:17PM +0300, Luca Coelho wrote:
> On Fri, 2025-09-05 at 17:58 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Some systems (eg. LNL Lenovo Thinkapd X1 Carbon) declare
> > semi-bogus non-monotonic WM latency values:
> >  WM0 latency not provided
> >  WM1 latency 100 usec
> >  WM2 latency 100 usec
> >  WM3 latency 100 usec
> >  WM4 latency 93 usec
> >  WM5 latency 100 usec
> > 
> > Apparently Windows just papers over the issue by bumping the
> > latencies for the higher watermark levels to make them monotonic
> > again. Do the same.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/skl_watermark.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> > index e11ba1a822f4..d334cc661328 100644
> > --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> > +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> > @@ -3238,6 +3238,19 @@ static void sanitize_wm_latency(struct intel_display *display)
> >  	}
> >  }
> >  
> > +static void make_wm_latency_monotonic(struct intel_display *display)
> > +{
> > +	u16 *wm = display->wm.skl_latency;
> > +	int level, num_levels = display->wm.num_levels;
> > +
> > +	for (level = 1; level < num_levels; level++) {
> > +		if (wm[level] == 0)
> > +			break;
> > +
> > +		wm[level] = max(wm[level], wm[level-1]);
> > +	}
> > +}
> > +
> 
> What if, for instance, we have:
> 
>  WM0 latency not provided
>  WM1 latency 200 usec
>  WM2 latency 100 usec
>  WM3 latency 100 usec
>  WM4 latency 100 usec
>  WM5 latency 100 usec
> 
> Do we really want to set them all to be 200 usec? Maybe multiples of
> the minimum we have would still be fine?

The latencies are supposed to increase as you go along,
each subsequent level corresponding to some deeper pkgC state.

> 
> What's the actual reason for this "papering over"? Is it to synchronize
> timers?

Dunno why Windows started to do this (as opposed to complaining and
telling people to fix their pcode firmware to correctly populate the
latencies). But since it does that it seems likely we might run into
more cases like this in the future.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-18 13:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 14:58 [PATCH 00/13] drm/1915: skl+ watermark/latency stuff Ville Syrjala
2025-09-05 14:58 ` [PATCH 01/13] drm/i915/dram: Also apply the 16Gb DIMM w/a for larger DRAM chips Ville Syrjala
2025-09-16  8:15   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 02/13] drm/i915: Apply the 16Gb DIMM w/a only for the platforms that need it Ville Syrjala
2025-09-16  8:25   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 03/13] drm/i915: Tweak the read latency fixup code Ville Syrjala
2025-09-16  8:28   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 04/13] drm/i915: Don't pass the latency array to {skl, mtl}_read_wm_latency() Ville Syrjala
2025-09-16  8:35   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 05/13] drm/i915: Move adjust_wm_latency() out from {mtl, skl}_read_wm_latency() Ville Syrjala
2025-09-16  8:36   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 06/13] drm/i915: Extract multiply_wm_latency() from skl_read_wm_latency() Ville Syrjala
2025-09-16  8:41   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 07/13] drm/i915: Extract increase_wm_latency() Ville Syrjala
2025-09-16  8:44   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 08/13] drm/i915: Use increase_wm_latency() for the 16Gb DIMM w/a Ville Syrjala
2025-09-16  8:46   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 09/13] drm/i915: Extract sanitize_wm_latency() Ville Syrjala
2025-09-16  8:49   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 10/13] drm/i915: Flatten sanitize_wm_latency() a bit Ville Syrjala
2025-09-16  8:58   ` Luca Coelho
2025-09-18 13:31   ` [PATCH v2 " Ville Syrjala
2025-09-05 14:58 ` [PATCH 11/13] drm/i915: Make wm latencies monotonic Ville Syrjala
2025-09-16 10:29   ` Luca Coelho
2025-09-18 13:29     ` Ville Syrjälä [this message]
2025-09-05 14:58 ` [PATCH 12/13] drm/i915: Print both the original and adjusted wm latencies Ville Syrjala
2025-09-16  9:25   ` Luca Coelho
2025-09-05 14:58 ` [PATCH 13/13] drm/i915: Make sure wm block/lines are non-decreasing Ville Syrjala
2025-09-16 11:15   ` Luca Coelho
2025-09-05 15:25 ` ✗ CI.checkpatch: warning for drm/1915: skl+ watermark/latency stuff (rev2) Patchwork
2025-09-05 15:26 ` ✓ CI.KUnit: success " Patchwork
2025-09-05 16:02 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-06  1:26 ` ✓ Xe.CI.Full: " Patchwork

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=aMwJJPEoS8u6ovU9@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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