Commit 342e36c6 authored by Rodrigo Vivi's avatar Rodrigo Vivi Committed by Daniel Vetter

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 <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 01d06e9f
...@@ -339,6 +339,12 @@ bool intel_fbc_enabled(struct drm_device *dev) ...@@ -339,6 +339,12 @@ bool intel_fbc_enabled(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; 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) if (!dev_priv->display.fbc_enabled)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment