From 95f453798217663530c321d2d634cebace26a5b4 Mon Sep 17 00:00:00 2001 From: Marta Lofstedt Date: Wed, 30 Aug 2017 10:45:01 +0300 Subject: [PATCH] drm/i915: Lock FBC state on intel_fbc_init Previous intel_fbc_init tried to match FBC HW and SW state. However, there is nothing preventing the BIOS from changing this when ever it feel like it before or after we exited the intel_fbc_init. TODO: Need to check if this is maybe needed after all for the old machines. I.e. rework intel_fbc_hw_is_active return true instead of i8xx_fbc_is_active(dev_priv); Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101623 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102473 Signed-off-by: Marta Lofstedt --- drivers/gpu/drm/i915/intel_fbc.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 58a772de6672..1a4147f4937d 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -355,16 +355,6 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv) intel_fbc_recompress(dev_priv); } -static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv) -{ - if (INTEL_GEN(dev_priv) >= 5) - return ilk_fbc_is_active(dev_priv); - else if (IS_GM45(dev_priv)) - return g4x_fbc_is_active(dev_priv); - else - return i8xx_fbc_is_active(dev_priv); -} - static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv) { struct intel_fbc *fbc = &dev_priv->fbc; @@ -1375,9 +1365,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv) if (INTEL_GEN(dev_priv) <= 4 && !IS_GM45(dev_priv)) I915_WRITE(FBC_CONTROL, 500 << FBC_CTL_INTERVAL_SHIFT); - /* We still don't have any sort of hardware state readout for FBC, so - * deactivate it in case the BIOS activated it to make sure software - * matches the hardware state. */ - if (intel_fbc_hw_is_active(dev_priv)) - intel_fbc_hw_deactivate(dev_priv); + mutex_lock(&fbc->lock); + intel_fbc_hw_deactivate(dev_priv); + mutex_unlock(&fbc->lock); } -- 2.11.0