From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/i915: lock event_lock for drm_vblank_off() Date: Wed, 31 Oct 2012 23:46:08 +0100 Message-ID: <20121031224608.GJ5755@phenom.ffwll.local> References: <1351721019-8040-1-git-send-email-imre.deak@intel.com> <1351721019-8040-2-git-send-email-imre.deak@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E2B39EE99 for ; Wed, 31 Oct 2012 15:45:03 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id c1so1024856eek.36 for ; Wed, 31 Oct 2012 15:45:02 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1351721019-8040-2-git-send-email-imre.deak@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Imre Deak Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 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? -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 -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch