dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off()
Date: Thu, 01 Nov 2012 11:34:45 +0200	[thread overview]
Message-ID: <1351762485.24104.16.camel@ideak-mobl> (raw)
In-Reply-To: <20121031224608.GJ5755@phenom.ffwll.local>

On Wed, 2012-10-31 at 23:46 +0100, Daniel Vetter wrote:
> On Thu, Nov 01, 2012 at 12:03:39AM +0200, Imre Deak wrote:
> > drm_vblank_off() requires callers to hold the event_lock.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> Hm, do we put this code through its paces already in flip_test by
> scheduling a vblank wait in the future (a second or so), and then
> disabling the display?

There isn't such a test case yet, but this bug is triggered with what we
have already, the 'wait-for-vblank + dpms off' test. But it might make
sense to delay the vblank as you say, in case disabling takes a long
time and the vblank arrives before we get to drm_vblank_off(). I can add
something for that.

--Imre

> -Daniel
> > ---
> >  drivers/gpu/drm/i915/intel_display.c |   15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index b453901..56f1119 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -3413,6 +3413,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
> >  	struct intel_encoder *encoder;
> >  	int pipe = intel_crtc->pipe;
> >  	int plane = intel_crtc->plane;
> > +	unsigned long flags;
> >  	u32 reg, temp;
> >  
> >  
> > @@ -3423,7 +3424,11 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
> >  		encoder->disable(encoder);
> >  
> >  	intel_crtc_wait_for_pending_flips(crtc);
> > +
> > +	spin_lock_irqsave(&dev->event_lock, flags);
> >  	drm_vblank_off(dev, pipe);
> > +	spin_unlock_irqrestore(&dev->event_lock, flags);
> > +
> >  	intel_crtc_update_cursor(crtc, false);
> >  
> >  	intel_disable_plane(dev_priv, plane, pipe);
> > @@ -3495,6 +3500,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
> >  	int plane = intel_crtc->plane;
> >  	enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder;
> >  	bool is_pch_port;
> > +	unsigned long flags;
> >  
> >  	if (!intel_crtc->active)
> >  		return;
> > @@ -3505,7 +3511,11 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
> >  		encoder->disable(encoder);
> >  
> >  	intel_crtc_wait_for_pending_flips(crtc);
> > +
> > +	spin_lock_irqsave(&dev->event_lock, flags);
> >  	drm_vblank_off(dev, pipe);
> > +	spin_unlock_irqrestore(&dev->event_lock, flags);
> > +
> >  	intel_crtc_update_cursor(crtc, false);
> >  
> >  	intel_disable_plane(dev_priv, plane, pipe);
> > @@ -3617,6 +3627,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
> >  	struct intel_encoder *encoder;
> >  	int pipe = intel_crtc->pipe;
> >  	int plane = intel_crtc->plane;
> > +	unsigned long flags;
> >  
> >  
> >  	if (!intel_crtc->active)
> > @@ -3627,7 +3638,11 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
> >  
> >  	/* Give the overlay scaler a chance to disable if it's on this pipe */
> >  	intel_crtc_wait_for_pending_flips(crtc);
> > +
> > +	spin_lock_irqsave(&dev->event_lock, flags);
> >  	drm_vblank_off(dev, pipe);
> > +	spin_unlock_irqrestore(&dev->event_lock, flags);
> > +
> >  	intel_crtc_dpms_overlay(intel_crtc, false);
> >  	intel_crtc_update_cursor(crtc, false);
> >  
> > -- 
> > 1.7.9.5
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

  reply	other threads:[~2012-11-01  9:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 22:03 [PATCH 1/2] drm: fix order of event_lock wrt. vblank_time_clock Imre Deak
2012-10-31 22:03 ` [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off() Imre Deak
2012-10-31 22:46   ` Daniel Vetter
2012-11-01  9:34     ` Imre Deak [this message]
2012-11-01  9:22 ` [PATCH 1/2] drm: fix order of event_lock wrt. vblank_time_clock Imre Deak
2012-11-02 11:30 ` [PATCH v2 0/4] drm/exynos, intel: fix locking for flip/vbl event list Imre Deak
2012-11-07  9:31   ` Inki Dae
2012-11-07 10:43     ` [PATCH v2 0/4] drm/exynos,intel: " Imre Deak
2012-11-07 16:25       ` [PATCH v2 0/4] drm/exynos, intel: " Inki Dae
2012-11-07 16:28         ` Rob Clark
2012-11-07 16:42           ` Inki Dae
2012-11-02 11:30 ` [PATCH v2 1/4] drm/exynos: hold event_lock while accessing pageflip_event_list Imre Deak
2012-11-02 11:30 ` [PATCH v2 2/4] drm/exynos: call drm_vblank_put for each queued flip event Imre Deak
2012-11-02 11:30 ` [PATCH v2 3/4] drm/exynos: fix lockdep for event_lock wrt. vbl_time_lock Imre Deak
2012-11-02 11:30 ` [PATCH v2 4/4] drm: hold event_lock while accessing vblank_event_list Imre Deak

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=1351762485.24104.16.camel@ideak-mobl \
    --to=imre.deak@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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;
as well as URLs for NNTP newsgroup(s).