intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Hogander, Jouni" <jouni.hogander@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 4/4] drm/i915/psr: Add poll for checking PSR is idle before starting update
Date: Wed, 27 Aug 2025 16:06:47 +0300	[thread overview]
Message-ID: <aK8C5-fWIwd9eLbt@intel.com> (raw)
In-Reply-To: <808fef64029b77661d2e084c1ff7e29fc0706cb6.camel@intel.com>

On Tue, Aug 26, 2025 at 02:30:50PM +0000, Hogander, Jouni wrote:
> On Tue, 2025-08-26 at 15:36 +0300, Ville Syrjälä wrote:
> > On Wed, Aug 06, 2025 at 08:22:13AM +0300, Jouni Högander wrote:
> > > We are currently observing crc failures after we started using dsb
> > > for PSR
> > > updates as well. This seems to happen because PSR HW is still
> > > sending
> > > couple of updates using old framebuffers on wake-up.
> > > 
> > > Fix this by adding poll ensuring PSR is idle before starting
> > > update.
> > > 
> > > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_display.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> > > b/drivers/gpu/drm/i915/display/intel_display.c
> > > index c1a3a95c65f0..411c74c73eae 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > @@ -7271,6 +7271,8 @@ static void intel_atomic_dsb_finish(struct
> > > intel_atomic_state *state,
> > >  		intel_psr_trigger_frame_change_event(new_crtc_stat
> > > e->dsb_commit,
> > >  						     state, crtc);
> > >  
> > > +		intel_psr_wait_for_idle_dsb(new_crtc_state);
> > > +
> > >  		if (new_crtc_state->use_dsb)
> > >  			intel_dsb_vblank_evade(state,
> > > new_crtc_state->dsb_commit);
> > 
> > How come the 'evade scanline 0 + normal evasion' in
> > intel_dsb_vblank_evade()
> > is not enough here?
> 
> the problem doesn't happen when PSR is in SRD_ENT/DEEP_SLEEP as
> committing new changes is started. It seems to happen when PSR
> transitioning into SRD_ENT/DEEP_SLEEP is ongoing when new changes are
> being committed. In this case evasion passes and PSR is continuing
> transitioning into SRD_ENT/DEEP_SLEEP. Then wake-up starts immediately
> due to pending "Frame Change" event and in this case HW is sending a
> frame using old plane configuration.

That's a bit weird. I think we are configuring things so that there
should be that extra vblank already for the first frame after PSR
exit. So I would expect things to latch properly even if we write
the registers during the PSR entry sequence.

Hmm, though the DSB itself never waits for the delayed vblank
directly. Maybe the delayed vblank does get suppressed for
one frame during the sequence somewhere, but the undelayed
vblank used by the DSB does not.

One could perhaps try to sample a timestamp from the DSB after
it thinks the vblank has happened, and sample another one from
the CPU delayed vblank interrupt (which I would expect to match
when the hardware really latches stuff), and compare how they
look. Though that does require one to enable the CPU interrupt
which itself will trigger the PSR exit (at least on some hw),
so not sure how easy it is to hit the exact conditions required.
I suppose one might try to wait for the PSR state machine to
be in the right state just before triggering the exit.

> 
> Bspec is saying this transition to SRD_ENT/DEEP_SLEEP can't be
> interrupted.
> 
> BR,
> 
> Jouni Högander
> > 
> 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-08-27 13:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  5:22 [PATCH v2 0/4] Wait PSR idle before on dsb commit Jouni Högander
2025-08-06  5:22 ` [PATCH v2 1/4] drm/i915/psr: Pass intel_crtc_state instead of intel_dp in wait_for_idle Jouni Högander
2025-08-13  7:24   ` Kahola, Mika
2025-08-06  5:22 ` [PATCH v2 2/4] drm/i915/psr: Add new define for PSR idle timeout Jouni Högander
2025-08-13  7:28   ` Kahola, Mika
2025-08-06  5:22 ` [PATCH v2 3/4] drm/i915/psr: New interface adding PSR idle poll into dsb commit Jouni Högander
2025-08-26 12:33   ` Ville Syrjälä
2025-08-06  5:22 ` [PATCH v2 4/4] drm/i915/psr: Add poll for checking PSR is idle before starting update Jouni Högander
2025-08-26 12:36   ` Ville Syrjälä
2025-08-26 14:30     ` Hogander, Jouni
2025-08-27 13:06       ` Ville Syrjälä [this message]
2025-08-27 13:22         ` Hogander, Jouni
2025-08-27 19:19           ` Ville Syrjälä
2025-08-28  7:02             ` Hogander, Jouni
2025-08-06  5:29 ` ✓ CI.KUnit: success for Wait PSR idle before on dsb commit (rev2) Patchwork
2025-08-06  5:43 ` ✗ CI.checksparse: warning " Patchwork
2025-08-06  6:30 ` ✓ Xe.CI.BAT: success " Patchwork
2025-08-06  7:33 ` ✗ Xe.CI.Full: failure " 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=aK8C5-fWIwd9eLbt@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jouni.hogander@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).