From: Rodrigo Vivi Date: Wed, 17 Sep 2014 20:59:20 +0000 (-0400) Subject: drm/i915: Avoid reading fbc registers in vain when fbc was never enabled. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=342e36c6b0cab1d7461287d553154ff35fee989d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/i915: Avoid reading fbc registers in vain when fbc was never enabled. 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 Signed-off-by: Rodrigo Vivi Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 6f3b94b7300b..1ec3c8f689bc 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;