From 342e36c6b0cab1d7461287d553154ff35fee989d Mon Sep 17 00:00:00 2001 From: Rodrigo Vivi Date: Wed, 17 Sep 2014 16:59:20 -0400 Subject: [PATCH] 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 --- 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 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; -- 2.20.1