From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Avoid reading fbc registers in vain when fbc was never enabled. Date: Thu, 18 Sep 2014 13:39:19 +0200 Message-ID: <20140918113919.GM31703@phenom.ffwll.local> References: <1410987560-1833-1-git-send-email-rodrigo.vivi@intel.com> <20140918062848.GC23478@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id DFD1C6E633 for ; Thu, 18 Sep 2014 04:38:53 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id ex7so2907008wid.9 for ; Thu, 18 Sep 2014 04:38:52 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140918062848.GC23478@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Rodrigo Vivi , intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Thu, Sep 18, 2014 at 07:28:48AM +0100, Chris Wilson wrote: > On Wed, Sep 17, 2014 at 04:59:20PM -0400, Rodrigo Vivi wrote: > > If it wasn't never enabled by kernel parameter or platform default > > we can avoid reading registers so many times in vain > > Nak. Well I've merged this for now to reduce fbc impact. > > Cc: Paulo Zanoni > > Signed-off-by: Rodrigo Vivi > > --- > > drivers/gpu/drm/i915/intel_pm.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c > > index a988862..afcc284 100644 > > --- a/drivers/gpu/drm/i915/intel_pm.c > > +++ b/drivers/gpu/drm/i915/intel_pm.c > > @@ -339,6 +339,12 @@ bool intel_fbc_enabled(struct drm_device *dev) > > { > > struct drm_i915_private *dev_priv = dev->dev_private; > > > > + /* If it wasn't never enabled by kernel parameter or platform default > > + * we can avoid reading registers so many times in vain > > + */ > > + if (!i915.enable_fbc) > > + return false; > > + > > if (!dev_priv->display.fbc_enabled) > > return false; > > The correct state to check here is whether we have enabled fbc, not the > module parameter which just rules whether we should turn it on. > Look at making dev_priv->fbc.no_fbc_reason always correct instead. Well we need to fix this all up anyway, since pretty much everything on the software side of fbc is busted (locking, tracking, piles of rechecks and other hilarious stuff). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch