drm/i915: Avoid reading fbc registers in vain when fbc was never enabled.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 17 Sep 2014 20:59:20 +0000 (16:59 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Sep 2014 12:43:24 +0000 (14:43 +0200)
If it wasn't never enabled by kernel parameter or platform default
we can avoid reading registers so many times in vain

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_pm.c

index 6f3b94b7300bf36445520f2184314c8256f34c8d..1ec3c8f689bc8efe09cff39d12f5eef70c2903e3 100644 (file)
@@ -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;