From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Wait for pending flips in intel_pipe_set_base()
Date: Fri, 2 Nov 2012 19:26:37 +0200 [thread overview]
Message-ID: <20121102172637.GV3791@intel.com> (raw)
In-Reply-To: <275ffc$785jr7@fmsmga002.fm.intel.com>
On Fri, Nov 02, 2012 at 03:25:59PM +0000, Chris Wilson wrote:
> On Thu, 1 Nov 2012 20:06:00 +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > intel_pipe_set_base() never actually waited for any pending page flips
> > on the CRTC. It looks like it tried to, by calling intel_finish_fb() on
> > the current front buffer. But the pending flips were actually tracked
> > in the BO of the previous front buffer, so the call to intel_finish_fb()
> > never did anything useful.
> >
> > Now even the pending_flip counter is gone, so we should just
> > use intel_crtc_wait_for_pending_flips(), but since we're already holding
> > struct_mutex when we would call that function, we need another version
> > of it, that itself doesn't lock struct_mutex.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 51 +++++++++++++++++++++------------
> > 1 files changed, 32 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 1a38267..7bf4749 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2228,6 +2228,37 @@ static void intel_crtc_update_sarea_pos(struct drm_crtc *crtc, int x, int y)
> > }
> > }
> >
> > +static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
> > +{
> > + struct drm_device *dev = crtc->dev;
> > + struct drm_i915_private *dev_priv = dev->dev_private;
> > + unsigned long flags;
> > + bool pending;
> > +
> > + if (atomic_read(&dev_priv->mm.wedged))
> > + return false;
> > +
> > + spin_lock_irqsave(&dev->event_lock, flags);
> > + pending = to_intel_crtc(crtc)->unpin_work != NULL;
> > + spin_unlock_irqrestore(&dev->event_lock, flags);
> > +
> > + return pending;
> > +}
> > +
> > +static void intel_crtc_wait_for_pending_flips_locked(struct drm_crtc *crtc)
> > +{
>
> Can we rearrange this such that the waiting logic is inside _locked()
> and then intel_crtc_wiat_for_pending_flips() becomes a wrapper that
> acquires the struct_mutex and then calls _locked()? Just to keep the
> code simpler at the expense of the pathological case.
Yeah that looks doable. It does mean we'll be holding struct_mutex
around the wait_event() always. As I was already doing that for the
panning case, doing the same in the crtc_disable() case shouldn't
be any worse.
But now I started to wonder a bit about the performance implications
of keeping struct_mutex locked for that long...
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2012-11-02 17:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 18:05 [PATCH 0/3] drm/i915: i915_gem_execbuffer_wait_for_flips and other flip stuff ville.syrjala
2012-11-01 18:06 ` [PATCH 1/3] drm/i915: Wait for pending flips in intel_pipe_set_base() ville.syrjala
2012-11-02 13:26 ` Chris Wilson
2012-11-02 14:02 ` Ville Syrjälä
2012-11-02 14:28 ` Chris Wilson
2012-11-02 15:25 ` Chris Wilson
2012-11-02 17:26 ` Ville Syrjälä [this message]
2012-11-02 17:34 ` Chris Wilson
2012-11-01 18:06 ` [PATCH 2/3] drm/i915: Wake up pending flip waiters when the GPU hangs ville.syrjala
2012-11-02 13:27 ` Chris Wilson
2012-11-01 18:06 ` [PATCH 3a/3] drm/i915: Avoid i915_gem_execbuffer_wait_for_flips() on SNB+ ville.syrjala
2012-11-01 18:06 ` [PATCH v2 3b/3] drm/i915: Kill i915_gem_execbuffer_wait_for_flips() ville.syrjala
2012-11-02 13:29 ` Chris Wilson
2012-11-02 18:09 ` Jesse Barnes
2012-11-02 18:24 ` Kristian Høgsberg
2012-11-02 18:44 ` 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=20121102172637.GV3791@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.