diff mbox

[v2,2/3] drm/i915: Take runtime pm in i915_gem_resume()

Message ID 20161118133647.4868-3-david.weinehall@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Weinehall Nov. 18, 2016, 1:36 p.m. UTC
In i915_gem_resume(), before calling i915_gem_restore_gtt_mappings(),
we want to take the runtime PM wakelocks for the entire duration
instead of many short lived wakelocks around each access to the GGTT.
We will take it in i915_gem_resume() as any other GEM operation
is likely to require the gT powerwell as well.

v2: Better explanation of the patch (Chris)

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
CC: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d5b7723bb028..da6e949906ca 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4240,6 +4240,7 @@  void i915_gem_resume(struct drm_device *dev)
 
 	WARN_ON(dev_priv->gt.awake);
 
+	intel_runtime_pm_get(dev_priv);
 	mutex_lock(&dev->struct_mutex);
 	i915_gem_restore_gtt_mappings(dev_priv);
 
@@ -4250,6 +4251,7 @@  void i915_gem_resume(struct drm_device *dev)
 	dev_priv->gt.resume(dev_priv);
 
 	mutex_unlock(&dev->struct_mutex);
+	intel_runtime_pm_put(dev_priv);
 }
 
 void i915_gem_init_swizzling(struct drm_i915_private *dev_priv)