[Intel-gfx] [PATCH 2/2] drm/i915: move gt powersave init out of save_state and modeset_init_hw

Jesse Barnes jbarnes at virtuousgeek.org
Fri Oct 11 21:41:04 CEST 2013


We need to do this at init and resume time, but it's not modeset
related.  Since we'll need the modeset functions for managing
save/restore after the power well is toggled, we want to keep them
separate from GT related state save/restore to keep from affecting GT
activity while the display is off.

Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_dma.c      | 2 ++
 drivers/gpu/drm/i915/i915_drv.c      | 3 +++
 drivers/gpu/drm/i915/i915_suspend.c  | 2 --
 drivers/gpu/drm/i915/intel_display.c | 4 ----
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index f221631..313a8c9 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1331,6 +1331,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
 	intel_modeset_gem_init(dev);
 
+	intel_enable_gt_powersave(dev);
+
 	/* Always safe in the mode setting case. */
 	/* FIXME: do pre/post-mode set stuff in core KMS code */
 	dev->vblank_disable_allowed = 1;
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0fc9658..82a1d53 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -507,6 +507,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	intel_disable_gt_powersave(dev);
+
 	intel_opregion_fini(dev);
 
 	console_lock();
@@ -604,6 +606,7 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 		mutex_lock(&dev->struct_mutex);
 
 		error = i915_gem_init_hw(dev);
+		intel_enable_gt_powersave(dev);
 		mutex_unlock(&dev->struct_mutex);
 
 		/* We need working interrupts for modeset enabling ... */
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 98790c7..cd28fd5 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -395,8 +395,6 @@ int i915_save_state(struct drm_device *dev)
 		}
 	}
 
-	intel_disable_gt_powersave(dev);
-
 	/* Cache mode state */
 	if (INTEL_INFO(dev)->gen < 7)
 		dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5452b34..4835c51 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10403,10 +10403,6 @@ void intel_modeset_init_hw(struct drm_device *dev)
 			   DPLL_INTEGRATED_CRI_CLK_VLV);
 
 	intel_init_dpio(dev);
-
-	mutex_lock(&dev->struct_mutex);
-	intel_enable_gt_powersave(dev);
-	mutex_unlock(&dev->struct_mutex);
 }
 
 void intel_modeset_suspend_hw(struct drm_device *dev)
-- 
1.8.3.1




More information about the Intel-gfx mailing list