From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Update primary planes after a GPU reset
Date: Mon, 18 Feb 2013 13:50:26 +0200 [thread overview]
Message-ID: <20130218115026.GL9135@intel.com> (raw)
In-Reply-To: <20130218104737.GE16131@cantiga.alporthouse.com>
On Mon, Feb 18, 2013 at 10:47:37AM +0000, Chris Wilson wrote:
> On Mon, Feb 18, 2013 at 12:15:34PM +0200, Ville Syrjälä wrote:
> > On Fri, Feb 15, 2013 at 11:47:52PM +0000, Chris Wilson wrote:
> > > On Fri, Feb 15, 2013 at 06:56:03PM +0200, Ville Syrjälä wrote:
> > > > On Fri, Feb 15, 2013 at 03:28:33PM +0000, Chris Wilson wrote:
> > > > > On Fri, Feb 15, 2013 at 05:07:46PM +0200, ville.syrjala@linux.intel.com wrote:
> > > > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > >
> > > > > > GPU reset will drop all flips that are still in the ring. So after the
> > > > > > reset, call update_plane() for all CRTCs to make sure the primary
> > > > > > planes are scanning out from the correct buffer.
> > > > > >
> > > > > > The base address update will also generate a FLIP_DONE interrupt, which
> > > > > > will complete any pending flips. That means user space will get its
> > > > > > page flip events and won't get stuck waiting for them.
> > > > >
> > > > > Not for all generations.
> > > >
> > > > Hmm OK those seem to be the ones with the pending flip status bit
> > > > (Gen4 and older?).
> > >
> > > Yes. Also notably the ones unlikely to survive the GPU reset :)
> > >
> > > > But can someone explain why on those platforms we also check the
> > > > vblank interrupt status bit before handling the page flip interrupt?
> > >
> > > For those generations, we are meant to detect the transition of pending
> > > flip status from 1 -> 0. That transition of course doesn't generate an
> > > interrupt (rather it stops generating one), so the nearest I could come
> > > up with was in anticipating the vblank after we saw the pending flip
> > > status was close enough. In the case of a pending vblank raising an
> > > interrupt just as the pending flip status is asserted, shouldn't MSI
> > > prevent the pending flip from being asserted as we process the IIR for
> > > the vblank. Of course not all of those chipsets even have MSI. I'm not
> > > even sure if we can close that race.
> >
> > This is what I *think* gen2-gen4 Bspec are telling me:
> >
> > 1. CS executes MI_DISPLAY_FLIP
> > -> ISR:flip bit 0 -> 1
> > 2. Flip completes
> > -> ISR:flip bit 1 -> 0
> > -> IIR:flip bit 0 -> 1
> > -> interrupt generated
>
> Ah, no. The IIR mirrors the ISR and it really does continually generate
> the PendingFlip interrupt on gen2/3.
Continually? Oh that's nasty, but makes sense if it's just a level
interrupt.
> It wasn't until midway through the gen3 cycle, that they introduced the
> behaviour you describe (which is what the "pending flip is actually flip
> done" bit in ECOSKPD is about). But since we already have to try
> and handle gen2/3, I didn't think it was worth a second gen3 code path
> with the revised behaviour.
Ok. I see we never actually enable the pending flip interrupt on gen2/3
due to this. The same race exists there as well then. I can try to make
a patch for that too.
And we turn off the bit in ECOSKPD on gen3 to make sure we always behave
the same way. Makes sense.
> Can you send that as a patch for gen4? As I have a few people hitting
> pageflip system hangs, but only on gen4 afaict.
I must admit that I'm confused now. Which model does Gen4 actually
follow, pending flip or flip done?
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2013-02-18 11:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 15:07 [PATCH 0/3] drm/i915: More page flip vs. reset improvements ville.syrjala
2013-02-15 15:07 ` [PATCH v2 1/3] drm/i915: Wake up pending_flip_queue as part of reset handling ville.syrjala
2013-02-15 23:53 ` Chris Wilson
2013-02-18 9:58 ` Ville Syrjälä
2013-02-18 12:41 ` Ville Syrjälä
2013-02-18 15:31 ` Ville Syrjälä
2013-02-18 16:39 ` Daniel Vetter
2013-02-15 15:07 ` [PATCH v2 2/3] drm/i915: Really wait for pending flips when panning ville.syrjala
2013-02-15 15:07 ` [PATCH 3/3] drm/i915: Update primary planes after a GPU reset ville.syrjala
2013-02-15 15:28 ` Chris Wilson
2013-02-15 16:56 ` Ville Syrjälä
2013-02-15 23:47 ` Chris Wilson
2013-02-18 10:15 ` Ville Syrjälä
2013-02-18 10:47 ` Chris Wilson
2013-02-18 11:50 ` Ville Syrjälä [this message]
2013-02-18 12:08 ` Chris Wilson
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=20130218115026.GL9135@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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