From: Daniel Vetter Subject: Re: [PATCH v2 20/21] drm/i915: factor out intel_set_cpu_fifo_underrun_reporting_nolock Date: Thu, 6 Mar 2014 21:46:49 +0100 Message-ID: <20140306204649.GH17001@phenom.ffwll.local> References: <1393953790-20733-1-git-send-email-imre.deak@intel.com> <1393953790-20733-21-git-send-email-imre.deak@intel.com> <20140306111838.1e89ab6c@jbarnes-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 026F7FAB0D for ; Thu, 6 Mar 2014 12:46:53 -0800 (PST) Received: by mail-ea0-f182.google.com with SMTP id b10so1951911eae.13 for ; Thu, 06 Mar 2014 12:46:53 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140306111838.1e89ab6c@jbarnes-desktop> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Mar 06, 2014 at 11:18:38AM -0800, Jesse Barnes wrote: > On Tue, 4 Mar 2014 19:23:09 +0200 > Imre Deak wrote: > > > Needed by the next patch, wanting to set the underrun reporting as part > > of a bigger dev_priv->irq_lock'ed sequence. > > > > Signed-off-by: Imre Deak > > --- > > drivers/gpu/drm/i915/i915_irq.c | 20 +++++++++++++++----- > > 1 file changed, 15 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > > index 9d9309c..bc94cfb 100644 > > --- a/drivers/gpu/drm/i915/i915_irq.c > > +++ b/drivers/gpu/drm/i915/i915_irq.c > > @@ -387,17 +387,14 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev, > > * > > * Returns the previous state of underrun reporting. > > */ > > -bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, > > - enum pipe pipe, bool enable) > > +bool intel_set_cpu_fifo_underrun_reporting_nolock(struct drm_device *dev, > > + enum pipe pipe, bool enable) In i915_irq.c we tend to use a simple __ prefix instead of a _nolock postfix. I've frobbed this while applying (and will fix up the next patch). -Daniel > > { > > struct drm_i915_private *dev_priv = dev->dev_private; > > struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; > > struct intel_crtc *intel_crtc = to_intel_crtc(crtc); > > - unsigned long flags; > > bool ret; > > > > - spin_lock_irqsave(&dev_priv->irq_lock, flags); > > - > > ret = !intel_crtc->cpu_fifo_underrun_disabled; > > > > if (enable == ret) > > @@ -415,7 +412,20 @@ bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, > > broadwell_set_fifo_underrun_reporting(dev, pipe, enable); > > > > done: > > + return ret; > > +} > > + > > +bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, > > + enum pipe pipe, bool enable) > > +{ > > + struct drm_i915_private *dev_priv = dev->dev_private; > > + unsigned long flags; > > + bool ret; > > + > > + spin_lock_irqsave(&dev_priv->irq_lock, flags); > > + ret = intel_set_cpu_fifo_underrun_reporting_nolock(dev, pipe, enable); > > spin_unlock_irqrestore(&dev_priv->irq_lock, flags); > > + > > return ret; > > } > > > > Funky how diff left the spin_unlock line alone. :) > > Reviewed-by: Jesse Barnes > > -- > Jesse Barnes, Intel Open Source Technology Center > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch