intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Hold pc8 lock around toggling pc8.gpu_idle
@ 2013-10-10 13:14 Chris Wilson
  2013-10-10 13:14 ` [PATCH 2/2] drm/i915: Do not enable package C8 on unsupported hardware Chris Wilson
  2013-10-10 20:04 ` [PATCH 1/2] drm/i915: Hold pc8 lock around toggling pc8.gpu_idle Paulo Zanoni
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2013-10-10 13:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni

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>
---
 drivers/gpu/drm/i915/intel_display.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5ce1558..4fa1fd5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6546,18 +6546,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);
 }
 
 static void haswell_modeset_global_resources(struct drm_device *dev)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-28 16:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 13:14 [PATCH 1/2] drm/i915: Hold pc8 lock around toggling pc8.gpu_idle Chris Wilson
2013-10-10 13:14 ` [PATCH 2/2] drm/i915: Do not enable package C8 on unsupported hardware Chris Wilson
2013-10-10 20:17   ` Paulo Zanoni
2013-10-10 20:32     ` Chris Wilson
2013-10-28 16:55       ` Paulo Zanoni
2013-10-28 16:57         ` Chris Wilson
2013-10-10 20:04 ` [PATCH 1/2] drm/i915: Hold pc8 lock around toggling pc8.gpu_idle Paulo Zanoni
2013-10-10 20:34   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).