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: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Rodrigo Vivi 2014-09-17 16:59:20 -04:00 committed by Daniel Vetter
parent 01d06e9f96
commit 342e36c6b0

View 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;