diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-18 21:32:36 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-19 07:03:38 -0500 |
commit | be1c1fe21b3a9d48580bdf976c8dac844f456290 (patch) | |
tree | 6d6a6e125795ca13168e710aef63dabc26a8fffd | |
parent | 1d37b689b1c07c01101534e55ffcd43f69069355 (diff) |
drm/i915: Hold pc8 lock around toggling pc8.gpu_idle
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>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index de6edd0f6205..0b77916e7ea6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6585,18 +6585,22 @@ done: | |||
6585 | 6585 | ||
6586 | static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv) | 6586 | static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv) |
6587 | { | 6587 | { |
6588 | mutex_lock(&dev_priv->pc8.lock); | ||
6588 | if (!dev_priv->pc8.gpu_idle) { | 6589 | if (!dev_priv->pc8.gpu_idle) { |
6589 | dev_priv->pc8.gpu_idle = true; | 6590 | dev_priv->pc8.gpu_idle = true; |
6590 | hsw_enable_package_c8(dev_priv); | 6591 | __hsw_enable_package_c8(dev_priv); |
6591 | } | 6592 | } |
6593 | mutex_unlock(&dev_priv->pc8.lock); | ||
6592 | } | 6594 | } |
6593 | 6595 | ||
6594 | static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv) | 6596 | static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv) |
6595 | { | 6597 | { |
6598 | mutex_lock(&dev_priv->pc8.lock); | ||
6596 | if (dev_priv->pc8.gpu_idle) { | 6599 | if (dev_priv->pc8.gpu_idle) { |
6597 | dev_priv->pc8.gpu_idle = false; | 6600 | dev_priv->pc8.gpu_idle = false; |
6598 | hsw_disable_package_c8(dev_priv); | 6601 | __hsw_disable_package_c8(dev_priv); |
6599 | } | 6602 | } |
6603 | mutex_unlock(&dev_priv->pc8.lock); | ||
6600 | } | 6604 | } |
6601 | 6605 | ||
6602 | #define for_each_power_domain(domain, mask) \ | 6606 | #define for_each_power_domain(domain, mask) \ |