drm/i915: Hold pc8 lock around toggling pc8.gpu_idle
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 19 Nov 2013 02:32:36 +0000 (18:32 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 21 Nov 2013 08:11:27 +0000 (09:11 +0100)
We need to hold the pc8 lock around toggling the value of gpu_idle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 3b7f1c4eb48eb83cd46daf3882d0528cec54499e..54e7fa6d96288a6e6cf9c5d1d068518eb6462717 100644 (file)
@@ -6761,18 +6761,22 @@ done:
 
 static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv)
 {
+       mutex_lock(&dev_priv->pc8.lock);
        if (!dev_priv->pc8.gpu_idle) {
                dev_priv->pc8.gpu_idle = true;
-               hsw_enable_package_c8(dev_priv);
+               __hsw_enable_package_c8(dev_priv);
        }
+       mutex_unlock(&dev_priv->pc8.lock);
 }
 
 static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv)
 {
+       mutex_lock(&dev_priv->pc8.lock);
        if (dev_priv->pc8.gpu_idle) {
                dev_priv->pc8.gpu_idle = false;
-               hsw_disable_package_c8(dev_priv);
+               __hsw_disable_package_c8(dev_priv);
        }
+       mutex_unlock(&dev_priv->pc8.lock);
 }
 
 #define for_each_power_domain(domain, mask)                            \