Re: [PATCH 8/8] drm/i915: protect FBC functions with HAS_FBC checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 03, 2015 at 04:56:31PM +0100, Chris Wilson wrote:
> On Thu, Jul 02, 2015 at 07:25:14PM -0300, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
> > 
> > Now all the functions called by other files have the HAS_FBC
> > protection. This allows us to drop the checks for the low level
> > function pointers.
> > 
> > Suggested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_fbc.c | 27 ++++++++++++++++++---------
> >  1 file changed, 18 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> > index cc9b7ef..bc3cdb3 100644
> > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > @@ -388,9 +388,6 @@ static void intel_fbc_enable(struct drm_crtc *crtc)
> >  
> >  	WARN_ON(!mutex_is_locked(&dev_priv->fbc.lock));
> >  
> > -	if (!dev_priv->display.enable_fbc)
> > -		return;
> > -
> >  	intel_fbc_cancel_work(dev_priv);
> >  
> >  	work = kzalloc(sizeof(*work), GFP_KERNEL);
> 
> > @@ -661,6 +661,9 @@ void intel_fbc_cleanup_cfb(struct drm_device *dev)
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> > +	if (!HAS_FBC(dev_priv))
> > +		return;
> > +
> >  	mutex_lock(&dev_priv->fbc.lock);
> >  	__intel_fbc_cleanup_cfb(dev);
> >  	mutex_unlock(&dev_priv->fbc.lock);
> 
> dev_priv->display.enable_fbc is one less pointer dereference than
> HAS_FBC() and is a better indication of whether we have initialised the
> display device for FBC (i.e. it also carries information about whether
> the setup succeeded, maybe some platforms have HAS_FBC but we fail to
> negotiate etc).

With or without that change (would prefer with!),
Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux