Skip to contentSkip to conversation

drm/i915: disable power wells on suspend

PATCH In review Jesse Barnes 6 participants 42 messages May 29, 2014 – Jun 12, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 drm/i915: disable power wells on suspend

From: Kristen Carlson Accardi <[email protected]>

We want to make sure everything is disabled and at its lowest power when freezing.

---
 drivers/gpu/drm/i915/i915_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +2 -0
index e2bfdda..66c6ffb 100644
@@ -551,6 +551,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	dev_priv->suspend_count++;
 
+	intel_display_set_init_power(dev_priv, false);
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/4 drm/i915: leave rc6 enabled at suspend time

From: Kristen Carlson Accardi <[email protected]>

This allows the system to enter the lowest power mode during system freeze.

---
 drivers/gpu/drm/i915/i915_drv.c  |  3 ---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -3
index 66c6ffb..433bdfa 100644
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
-
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
 		 * for _thaw.
@@ -543,7 +541,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 	i915_save_state(dev);
 
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..bf90e7d 100644
@@ -956,6 +956,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
 void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
+void intel_enable_gt_powersave_sync(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +11 -5
index 1840d15..8d9e036 100644
@@ -4891,12 +4891,9 @@ void intel_disable_gt_powersave(struct drm_device *dev)
 	}
 }
 
-static void intel_gen6_powersave_work(struct work_struct *work)
+void intel_enable_gt_powersave_sync(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private,
-			     rps.delayed_resume_work.work);
-	struct drm_device *dev = dev_priv->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	mutex_lock(&dev_priv->rps.hw_lock);
 
@@ -4917,6 +4914,15 @@ static void intel_gen6_powersave_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+static void intel_gen6_powersave_work(struct work_struct *work)
+{
+	struct drm_i915_private *dev_priv =
+		container_of(work, struct drm_i915_private,
+			     rps.delayed_resume_work.work);
+
+	intel_enable_gt_powersave_sync(dev_priv->dev);
+}
+
 void intel_enable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
Signature · 1 line
1.9.1
Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

Quoted 16 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This allows the system to enter the lowest power mode during system freeze.

---
 drivers/gpu/drm/i915/i915_drv.c  |  3 ---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..433bdfa 100644

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 525

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -2
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
-

I wonder what was the reason for this call. One possibility is that i915_save_state() depends on it to save the correct registers, but it would be good to clarify this.

It also cancels some deferred works which we do need here. But we could also add that to intel_enable_gt_powersave_sync() in this patch.

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 546

Quoted 8 lines
drivers/gpu/drm/i915/i915_drv.c +0 -1
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
 		 * for _thaw.
@@ -543,7 +541,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 	i915_save_state(dev);
 
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);

Some stuff in the above call is unrelated to this patch, like intel_uncore_forcewake_reset(). At least canceling force_wake_timer there seems to be needed here. In any case it would be better to have the above two changes in a separate patch.

With that fixed this patch looks ok to me. The original patch was from me, so fwiw:

Quoted 39 lines
drivers/gpu/drm/i915/i915_drv.c +0 -0
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..bf90e7d 100644
@@ -956,6 +956,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
 void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
+void intel_enable_gt_powersave_sync(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +4 -5
index 1840d15..8d9e036 100644
@@ -4891,12 +4891,9 @@ void intel_disable_gt_powersave(struct drm_device *dev)
 	}
 }
 
-static void intel_gen6_powersave_work(struct work_struct *work)
+void intel_enable_gt_powersave_sync(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private,
-			     rps.delayed_resume_work.work);
-	struct drm_device *dev = dev_priv->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	mutex_lock(&dev_priv->rps.hw_lock);
 
@@ -4917,6 +4914,15 @@ static void intel_gen6_powersave_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+static void intel_gen6_powersave_work(struct work_struct *work)
+{

drivers/gpu/drm/i915/intel_pm.c static void intel_gen6_powersave_work(struct work_struct *work) · line 4928

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +7 -0
+	struct drm_i915_private *dev_priv =
+		container_of(work, struct drm_i915_private,
+			     rps.delayed_resume_work.work);
+
+	intel_enable_gt_powersave_sync(dev_priv->dev);
+}
+
 void intel_enable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

Quoted 27 lines · On Fri, 30 May 2014 15:54:37 +0300 Imre Deak <[email protected]> wrote:
Quoted 16 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This allows the system to enter the lowest power mode during system freeze.

---
 drivers/gpu/drm/i915/i915_drv.c  |  3 ---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..433bdfa 100644

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 525

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -2
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
-

I wonder what was the reason for this call. One possibility is that i915_save_state() depends on it to save the correct registers, but it would be good to clarify this.

Quoted 2 lines

It also cancels some deferred works which we do need here. But we could also add that to intel_enable_gt_powersave_sync() in this patch.

Yeah I was worried about that too, but then we do the reset on resume anyway, and I didn't see anything in my logs in testing...

But I can split that out if there's a reason to. Seems like we do a bit too much teardown at suspend these days (like tearing down opregion state), I'd like to trim it back if possible and share between runtime and system suspend/freeze.

I'll look into the forcewake bits.

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#4 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

Quoted 4 lines · Jesse Barnes

But I can split that out if there's a reason to. Seems like we do a bit too much teardown at suspend these days (like tearing down opregion state), I'd like to trim it back if possible and share between runtime and system suspend/freeze.

I guess the answer is to move all the paranoid bits from suspend into hibernate-resume.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#5 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

Quoted 8 lines · On Fri, 30 May 2014 16:40:27 +0100 Chris Wilson <[email protected]>…
Quoted 4 lines · Jesse Barnes

But I can split that out if there's a reason to. Seems like we do a bit too much teardown at suspend these days (like tearing down opregion state), I'd like to trim it back if possible and share between runtime and system suspend/freeze.

I guess the answer is to move all the paranoid bits from suspend into hibernate-resume.

Well and probably move a bunch of stuff out of _freeze and into a shared _suspend function for use at runtime suspend, suspend, and hibernate.

Separate patches for all of that though so all the breakage is easily bisected. :)

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#6 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

In reply to Jesse Barnes
Quoted 23 lines · Jesse Barnes
Quoted 20 lines · On Fri, 30 May 2014 15:54:37 +0300 Imre Deak <[email protected]> wrote:
Quoted 19 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This allows the system to enter the lowest power mode during system freeze.

---
 drivers/gpu/drm/i915/i915_drv.c  |  3 ---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..433bdfa 100644
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 525

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +0 -2
-		intel_disable_gt_powersave(dev);
-

I wonder what was the reason for this call. One possibility is that i915_save_state() depends on it to save the correct registers, but it would be good to clarify this.

save_state needs to die. Pretty much because it's fragile like you've just pointed out.

Quoted 10 lines
Quoted 2 lines

It also cancels some deferred works which we do need here. But we could also add that to intel_enable_gt_powersave_sync() in this patch.

Yeah I was worried about that too, but then we do the reset on resume anyway, and I didn't see anything in my logs in testing...

But I can split that out if there's a reason to. Seems like we do a bit too much teardown at suspend these days (like tearing down opregion state), I'd like to trim it back if possible and share between runtime and system suspend/freeze.

Yeah, that's the direction I'm pushing towards, too - we should only stop timers, work, interrupts and stuff like that, but never tear down structures. So if you can use this opportunity to fix a few of the offenders (like opregion) I'd be very happy.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#7 lore raw

PATCH 1/1 drm/i915: leave rc6 enabled at suspend time v2

In reply to Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)

---
 drivers/gpu/drm/i915/i915_drv.c  |  4 +---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 13 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +1 -3
index 66c6ffb..c65fc68 100644
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
-
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
 		 * for _thaw.
@@ -542,8 +540,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	del_timer_sync(&dev_priv->uncore.force_wake_timer);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..bf90e7d 100644
@@ -956,6 +956,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
 void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
+void intel_enable_gt_powersave_sync(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +11 -5
index 1840d15..8d9e036 100644
@@ -4891,12 +4891,9 @@ void intel_disable_gt_powersave(struct drm_device *dev)
 	}
 }
 
-static void intel_gen6_powersave_work(struct work_struct *work)
+void intel_enable_gt_powersave_sync(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private,
-			     rps.delayed_resume_work.work);
-	struct drm_device *dev = dev_priv->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	mutex_lock(&dev_priv->rps.hw_lock);
 
@@ -4917,6 +4914,15 @@ static void intel_gen6_powersave_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+static void intel_gen6_powersave_work(struct work_struct *work)
+{
+	struct drm_i915_private *dev_priv =
+		container_of(work, struct drm_i915_private,
+			     rps.delayed_resume_work.work);
+
+	intel_enable_gt_powersave_sync(dev_priv->dev);
+}
+
 void intel_enable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
Signature · 1 line
1.9.1
#8 lore raw

PATCH 1/1 drm/i915: leave rc6 enabled at suspend time v3

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)

---
 drivers/gpu/drm/i915/i915_drv.c  |  4 ++--
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index 66c6ffb..4774299 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);
 
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
@@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	del_timer_sync(&dev_priv->uncore.force_wake_timer);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..74fbe4d 100644
@@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
+void intel_suspend_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
 void gen6_update_ring_freq(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +20 -0
index 1840d15..139eebe 100644
@@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
 		valleyview_cleanup_gt_powersave(dev);
 }
 
+/**
+ * intel_suspend_gt_powersave - suspend PM work and helper threads
+ * @dev: drm device
+ *
+ * We don't want to disable RC6 or other features here, we just want
+ * to make sure any work we've queued has finished and won't bother
+ * us while we're suspended.
+ */
+void intel_suspend_gt_powersave(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Interrupts should be disabled already to avoid re-arming. */
+	WARN_ON(dev->irq_enabled);
+
+	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
+
+	cancel_work_sync(&dev_priv->rps.work);
+}
+
 void intel_disable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
Signature · 1 line
1.9.1
#9 lore raw

PATCH 1/1 drm/i915: leave rc6 enabled at suspend time v4

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);
 
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
@@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	intel_uncore_forcewake_reset(dev, false);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/i915_drv.h +1 -0
index bea9ab40..89d6b47 100644
@@ -2084,6 +2084,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev);
 extern void intel_uncore_init(struct drm_device *dev);
 extern void intel_uncore_check_errors(struct drm_device *dev);
 extern void intel_uncore_fini(struct drm_device *dev);
+extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 
 void
 i915_enable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..74fbe4d 100644
@@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
+void intel_suspend_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
 void gen6_update_ring_freq(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +20 -0
index 1840d15..139eebe 100644
@@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
 		valleyview_cleanup_gt_powersave(dev);
 }
 
+/**
+ * intel_suspend_gt_powersave - suspend PM work and helper threads
+ * @dev: drm device
+ *
+ * We don't want to disable RC6 or other features here, we just want
+ * to make sure any work we've queued has finished and won't bother
+ * us while we're suspended.
+ */
+void intel_suspend_gt_powersave(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Interrupts should be disabled already to avoid re-arming. */
+	WARN_ON(dev->irq_enabled);
+
+	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
+
+	cancel_work_sync(&dev_priv->rps.work);
+}
+
 void intel_disable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/intel_uncore.c +1 -1
index 871c284..741a4e3 100644
@@ -316,7 +316,7 @@ static void gen6_force_wake_timer(unsigned long arg)
 	intel_runtime_pm_put(dev_priv);
 }
 
-static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
+void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	unsigned long irqflags;
Signature · 1 line
1.9.1
#10 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 8 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

Someone please look at

https://bugs.freedesktop.org/show_bug.cgi?id=78059

Yes, I'm starting to block semi-related feature work on regressions because we suck that much.
-Daniel

Quoted 106 lines
---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);
 
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
@@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	intel_uncore_forcewake_reset(dev, false);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/i915_drv.h +1 -0
index bea9ab40..89d6b47 100644
@@ -2084,6 +2084,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev);
 extern void intel_uncore_init(struct drm_device *dev);
 extern void intel_uncore_check_errors(struct drm_device *dev);
 extern void intel_uncore_fini(struct drm_device *dev);
+extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 
 void
 i915_enable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..74fbe4d 100644
@@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
+void intel_suspend_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
 void gen6_update_ring_freq(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +20 -0
index 1840d15..139eebe 100644
@@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
 		valleyview_cleanup_gt_powersave(dev);
 }
 
+/**
+ * intel_suspend_gt_powersave - suspend PM work and helper threads
+ * @dev: drm device
+ *
+ * We don't want to disable RC6 or other features here, we just want
+ * to make sure any work we've queued has finished and won't bother
+ * us while we're suspended.
+ */
+void intel_suspend_gt_powersave(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Interrupts should be disabled already to avoid re-arming. */
+	WARN_ON(dev->irq_enabled);
+
+	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
+
+	cancel_work_sync(&dev_priv->rps.work);
+}
+
 void intel_disable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/intel_uncore.c +1 -1
index 871c284..741a4e3 100644
@@ -316,7 +316,7 @@ static void gen6_force_wake_timer(unsigned long arg)
 	intel_runtime_pm_put(dev_priv);
 }
 
-static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
+void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	unsigned long irqflags;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#11 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 10 lines · On Thu, 5 Jun 2014 11:21:02 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 8 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

Quoted 6 lines

Someone please look at

https://bugs.freedesktop.org/show_bug.cgi?id=78059

Yes, I'm starting to block semi-related feature work on regressions because we suck that much.

Chris said a fix was already available...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#12 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

In reply to Jesse Barnes
Quoted 21 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

--Imre

Quoted 73 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
@@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	intel_uncore_forcewake_reset(dev, false);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/i915_drv.h +1 -0
index bea9ab40..89d6b47 100644
@@ -2084,6 +2084,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev);
 extern void intel_uncore_init(struct drm_device *dev);
 extern void intel_uncore_check_errors(struct drm_device *dev);
 extern void intel_uncore_fini(struct drm_device *dev);
+extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 
 void
 i915_enable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..74fbe4d 100644
@@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
+void intel_suspend_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
 void gen6_update_ring_freq(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +20 -0
index 1840d15..139eebe 100644
@@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
 		valleyview_cleanup_gt_powersave(dev);
 }
 
+/**
+ * intel_suspend_gt_powersave - suspend PM work and helper threads
+ * @dev: drm device
+ *
+ * We don't want to disable RC6 or other features here, we just want
+ * to make sure any work we've queued has finished and won't bother
+ * us while we're suspended.
+ */
+void intel_suspend_gt_powersave(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Interrupts should be disabled already to avoid re-arming. */
+	WARN_ON(dev->irq_enabled);
+
+	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
+
+	cancel_work_sync(&dev_priv->rps.work);
+}
+
 void intel_disable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 871c284..741a4e3 100644

drivers/gpu/drm/i915/intel_uncore.c static void gen6_force_wake_timer(unsigned long arg) · line 322

Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c +1 -1
@@ -316,7 +316,7 @@ static void gen6_force_wake_timer(unsigned long arg)
 	intel_runtime_pm_put(dev_priv);
 }
 
-static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
+void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	unsigned long irqflags;

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 25 lines · Imre Deak
Quoted 24 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Hm, for runtime pm we might schedule the delayed rps work with a 0 delay, just to get the gpu going faster. Just an aside.

Also some runtime pm vs system suspend tests in igt would be good if we don't have them yet. And if we have them some analysis why this didn't blow up in testing (and something to address that gap if feasible). -Daniel

Quoted 92 lines

--Imre

Quoted 73 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
@@ -542,8 +542,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	intel_uncore_forcewake_reset(dev, false);
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/i915_drv.h +1 -0
index bea9ab40..89d6b47 100644
@@ -2084,6 +2084,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev);
 extern void intel_uncore_init(struct drm_device *dev);
 extern void intel_uncore_check_errors(struct drm_device *dev);
 extern void intel_uncore_fini(struct drm_device *dev);
+extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 
 void
 i915_enable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..74fbe4d 100644
@@ -957,6 +957,7 @@ void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
+void intel_suspend_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
 void gen6_update_ring_freq(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +20 -0
index 1840d15..139eebe 100644
@@ -4864,6 +4864,26 @@ void intel_cleanup_gt_powersave(struct drm_device *dev)
 		valleyview_cleanup_gt_powersave(dev);
 }
 
+/**
+ * intel_suspend_gt_powersave - suspend PM work and helper threads
+ * @dev: drm device
+ *
+ * We don't want to disable RC6 or other features here, we just want
+ * to make sure any work we've queued has finished and won't bother
+ * us while we're suspended.
+ */
+void intel_suspend_gt_powersave(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Interrupts should be disabled already to avoid re-arming. */
+	WARN_ON(dev->irq_enabled);
+
+	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
+
+	cancel_work_sync(&dev_priv->rps.work);
+}
+
 void intel_disable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 871c284..741a4e3 100644

drivers/gpu/drm/i915/intel_uncore.c static void gen6_force_wake_timer(unsigned long arg) · line 322

Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c +1 -1
@@ -316,7 +316,7 @@ static void gen6_force_wake_timer(unsigned long arg)
 	intel_runtime_pm_put(dev_priv);
 }
 
-static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
+void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	unsigned long irqflags;

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#14 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 33 lines · Daniel Vetter
Quoted 25 lines · Imre Deak
Quoted 24 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Quoted 6 lines

Hm, for runtime pm we might schedule the delayed rps work with a 0 delay, just to get the gpu going faster. Just an aside.

Also some runtime pm vs system suspend tests in igt would be good if we don't have them yet. And if we have them some analysis why this didn't blow up in testing (and something to address that gap if feasible).

To clarify the above is about the new functionality to enable deeper system wide power states. Atm, we don't have a bug related to the above runtime resume->system suspend sequence, since we explicitly disable gt power saving/RC6. For deeper power states we have to do the opposite and leave RC6 enabled and that's what I commented on.

--Imre

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#15 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 41 lines · Imre Deak
Quoted 33 lines · Daniel Vetter
Quoted 25 lines · Imre Deak
Quoted 24 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Quoted 6 lines

Hm, for runtime pm we might schedule the delayed rps work with a 0 delay, just to get the gpu going faster. Just an aside.

Also some runtime pm vs system suspend tests in igt would be good if we don't have them yet. And if we have them some analysis why this didn't blow up in testing (and something to address that gap if feasible).

Quoted 5 lines

To clarify the above is about the new functionality to enable deeper system wide power states. Atm, we don't have a bug related to the above runtime resume->system suspend sequence, since we explicitly disable gt power saving/RC6. For deeper power states we have to do the opposite and leave RC6 enabled and that's what I commented on.

Well I just want to make sure that we have test coverage. If Jesse has run all the rpm tests with piglit run -t rpm and it didn't blow up we need to fix this gap.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#16 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 28 lines · On Tue, 10 Jun 2014 17:26:45 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 27 lines · Imre Deak
Quoted 26 lines · Daniel Vetter
Quoted 25 lines · Imre Deak
Quoted 24 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Seems like we could just flush the enable if it was outstanding?

Quoted 13 lines
Quoted 7 lines
Quoted 6 lines

Hm, for runtime pm we might schedule the delayed rps work with a 0 delay, just to get the gpu going faster. Just an aside.

Also some runtime pm vs system suspend tests in igt would be good if we don't have them yet. And if we have them some analysis why this didn't blow up in testing (and something to address that gap if feasible).

Quoted 5 lines

To clarify the above is about the new functionality to enable deeper system wide power states. Atm, we don't have a bug related to the above runtime resume->system suspend sequence, since we explicitly disable gt power saving/RC6. For deeper power states we have to do the opposite and leave RC6 enabled and that's what I commented on.

Quoted 3 lines

Well I just want to make sure that we have test coverage. If Jesse has run all the rpm tests with piglit run -t rpm and it didn't blow up we need to fix this gap.

I have not... I'm not sure how to test this though, as I think we'd need to measure c states or power when we do a suspend. If we checked for RC6 enable at resume, we'd probably race with the enable work queue.

Either way, we should add some asserts to the suspend path to make sure all the conditions we need for minimum power are met.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#17 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 31 lines · On Wed, 11 Jun 2014 15:21:16 -0700 Jesse Barnes <[email protected]>…
Quoted 28 lines · On Tue, 10 Jun 2014 17:26:45 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 27 lines · Imre Deak
Quoted 26 lines · Daniel Vetter
Quoted 25 lines · Imre Deak
Quoted 24 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Seems like we could just flush the enable if it was outstanding?

Oh and I see we already have the flush in v4... do you think we might not actually arm the deferred enable work before we get here? I think the runtime_resume and suspend calls should be serialized, but if not we'd need some locking I guess...

Jesse

Reviewed-by
#18 lore raw

Re: [PATCH] drm/i915: leave rc6 enabled at suspend time v4

Quoted 41 lines · Jesse Barnes
Quoted 38 lines · On Wed, 11 Jun 2014 15:21:16 -0700 Jesse Barnes <[email protected]>…
Quoted 34 lines · On Tue, 10 Jun 2014 17:26:45 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 33 lines · Imre Deak
Quoted 32 lines · Daniel Vetter
Quoted 31 lines · Imre Deak
Quoted 21 lines · Jesse Barnes

This allows the system to enter the lowest power mode during system freeze.

v2: delete force wake timer at suspend (Imre)
v3: add GT work suspend function (Imre)
v4: use uncore forcewake reset (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.c     |  4 ++--
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_pm.c     | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.c |  2 +-
 5 files changed, 25 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index 66c6ffb..7148eac 100644

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 524

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +1 -1
@@ -521,7 +521,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;
 
-		intel_disable_gt_powersave(dev);
+		intel_suspend_gt_powersave(dev);

I realized now that we actually do need to enable RC6 explicitly. If we get here right after runtime resume, the deferred RC6 enabling might be still pending and so RC6 might not be enabled.

Quoted 3 lines
Quoted 1 line

Seems like we could just flush the enable if it was outstanding?

Oh and I see we already have the flush in v4...

Right, I was just blind and I guess also thinking in terms of timers that don't have a similar flush API. Anyway this is fine and my comment about it above can be ignored.

Quoted 2 lines

do you think we might not actually arm the deferred enable work before we get here?

I haven't thought about this. But now that you mentioned I looked into the device and dpm core and can't see what would prevent our system suspend handler to be called while we are still running our driver load function. But this is a separate issue (if true at all) that exists regardless of this patch and also not a really real life scenario. So I suggest we investigate this as a follow-up.

Quoted 2 lines

I think the runtime_resume and suspend calls should be serialized, but if not we'd need some locking I guess...

Yes, this is taken care of the RPM framework. Similarly system suspend/resume handlers are serialized wrt. the runtime suspend/resume handlers.

This patch is:

Btw, now all 4 patches in the patchset are reviewed.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#19 lore raw

Re: [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time

In reply to Jesse Barnes
Quoted 1 line · On Thu, 29 May 2014 14:11:35 -0700 Jesse Barnes <[email protected]>…

From: Kristen Carlson Accardi <[email protected]>

Imre is the author.

Quoted 78 lines

This allows the system to enter the lowest power mode during system freeze.

---
 drivers/gpu/drm/i915/i915_drv.c  |  3 ---
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 16 +++++++++++-----
 3 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -3
index 66c6ffb..433bdfa 100644
@@ -521,8 +521,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 		drm_irq_uninstall(dev);
 		dev_priv->enable_hotplug_processing = false;Linux-3.16
 
-		intel_disable_gt_powersave(dev);
-
 		/*
 		 * Disable CRTCs directly since we want to preserve sw state
 		 * for _thaw.
@@ -543,7 +541,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 	i915_save_state(dev);
 
 	intel_opregion_fini(dev);
-	intel_uncore_fini(dev);
 
 	console_lock();
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
drivers/gpu/drm/i915/intel_drv.h +1 -0
index c597b0d..bf90e7d 100644
@@ -956,6 +956,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
 void intel_init_gt_powersave(struct drm_device *dev);
 void intel_cleanup_gt_powersave(struct drm_device *dev);
 void intel_enable_gt_powersave(struct drm_device *dev);
+void intel_enable_gt_powersave_sync(struct drm_device *dev);
 void intel_disable_gt_powersave(struct drm_device *dev);
 void intel_reset_gt_powersave(struct drm_device *dev);
 void ironlake_teardown_rc6(struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +11 -5
index 1840d15..8d9e036 100644
@@ -4891,12 +4891,9 @@ void intel_disable_gt_powersave(struct drm_device *dev)
 	}
 }
 
-static void intel_gen6_powersave_work(struct work_struct *work)
+void intel_enable_gt_powersave_sync(struct drm_device *dev)
 {
-	struct drm_i915_private *dev_priv =
-		container_of(work, struct drm_i915_private,
-			     rps.delayed_resume_work.work);
-	struct drm_device *dev = dev_priv->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	mutex_lock(&dev_priv->rps.hw_lock);
 
@@ -4917,6 +4914,15 @@ static void intel_gen6_powersave_work(struct work_struct *work)
 	intel_runtime_pm_put(dev_priv);
 }
 
+static void intel_gen6_powersave_work(struct work_struct *work)
+{
+	struct drm_i915_private *dev_priv =
+		container_of(work, struct drm_i915_private,
+			     rps.delayed_resume_work.work);
+
+	intel_enable_gt_powersave_sync(dev_priv->dev);
+}
+
 void intel_enable_gt_powersave(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
#20 lore raw

PATCH 3/4 drm/i915: send proper opregion notifications on suspend/resume

In reply to Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This indicates to the firmware that it can power down various other components or bring them back up, depending on the target system state.

---
 drivers/acpi/sleep.c            |  1 +
 drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
drivers/acpi/sleep.c +1 -0
index c40fb2e..807f333 100644
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
 {
 	return acpi_target_sleep_state;
 }
+EXPORT_SYMBOL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
 
drivers/gpu/drm/i915/i915_drv.c +10 -0
index 433bdfa..b6211d7 100644
@@ -28,6 +28,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/acpi.h>
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
@@ -491,6 +492,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc;
+	pci_power_t opregion_target_state;
 
 	intel_runtime_pm_get(dev_priv);
 
@@ -540,6 +542,12 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	if (acpi_target_system_state() >= ACPI_STATE_S3)
+		opregion_target_state = PCI_D3cold;
+	else
+		opregion_target_state = PCI_D1;
+	intel_opregion_notify_adapter(dev, opregion_target_state);
+
 	intel_opregion_fini(dev);
 
 	console_lock();
@@ -671,6 +679,8 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 	dev_priv->modeset_restore = MODESET_DONE;
 	mutex_unlock(&dev_priv->modeset_restore_lock);
 
+	intel_opregion_notify_adapter(dev, PCI_D0);
+
 	intel_runtime_pm_put(dev_priv);
 	return 0;
 }
Signature · 1 line
1.9.1
#21 lore raw

PATCH 3/5 ACPI: export target system state for use by drivers

From: Kristen Carlson Accardi <[email protected]>

Needed in ->freeze routines to figure out the target system state and take appropriate action.

v2: split out ACPI patch

---
 drivers/acpi/sleep.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/sleep.c +1 -0
index c40fb2e..807f333 100644
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
 {
 	return acpi_target_sleep_state;
 }
+EXPORT_SYMBOL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
 
Signature · 1 line
1.9.1
#22 lore raw

Re: [PATCH 3/5] ACPI: export target system state for use by drivers

Quoted 9 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

Needed in ->freeze routines to figure out the target system state and take appropriate action.

v2: split out ACPI patch

This is in my linux-next branch already.

I can put out a separate branch with it for you to pull from if necessary.

Rafael

Quoted 17 lines
---
 drivers/acpi/sleep.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/sleep.c +1 -0
index c40fb2e..807f333 100644
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
 {
 	return acpi_target_sleep_state;
 }
+EXPORT_SYMBOL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
 
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#23 lore raw

PATCH 4/5 drm/i915: send proper opregion notifications on suspend/resume

In reply to Jesse Barnes

This indicates to the firmware that it can power down various other components or bring them back up, depending on the target system state.

---
 drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +10 -0
index 433bdfa..b6211d7 100644
@@ -28,6 +28,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/acpi.h>
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
@@ -491,6 +492,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc;
+	pci_power_t opregion_target_state;
 
 	intel_runtime_pm_get(dev_priv);
 
@@ -540,6 +542,12 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	if (acpi_target_system_state() >= ACPI_STATE_S3)
+		opregion_target_state = PCI_D3cold;
+	else
+		opregion_target_state = PCI_D1;
+	intel_opregion_notify_adapter(dev, opregion_target_state);
+
 	intel_opregion_fini(dev);
 
 	console_lock();
@@ -671,6 +679,8 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 	dev_priv->modeset_restore = MODESET_DONE;
 	mutex_unlock(&dev_priv->modeset_restore_lock);
 
+	intel_opregion_notify_adapter(dev, PCI_D0);
+
 	intel_runtime_pm_put(dev_priv);
 	return 0;
 }
Signature · 1 line
1.9.1
Reviewed-by on v1 3/4
#24 lore raw

Re: [PATCH 3/4] drm/i915: send proper opregion notifications on suspend/resume

In reply to Jesse Barnes
Quoted 58 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This indicates to the firmware that it can power down various other components or bring them back up, depending on the target system state.

---
 drivers/acpi/sleep.c            |  1 +
 drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
drivers/acpi/sleep.c +1 -0
index c40fb2e..807f333 100644
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
 {
 	return acpi_target_sleep_state;
 }
+EXPORT_SYMBOL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
 
drivers/gpu/drm/i915/i915_drv.c +8 -0
index 433bdfa..b6211d7 100644
@@ -28,6 +28,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/acpi.h>
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
@@ -491,6 +492,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc;
+	pci_power_t opregion_target_state;
 
 	intel_runtime_pm_get(dev_priv);
 
@@ -540,6 +542,12 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	if (acpi_target_system_state() >= ACPI_STATE_S3)
+		opregion_target_state = PCI_D3cold;
+	else
+		opregion_target_state = PCI_D1;
+	intel_opregion_notify_adapter(dev, opregion_target_state);
+
 	intel_opregion_fini(dev);
 
 	console_lock();

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 683

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -671,6 +679,8 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 	dev_priv->modeset_restore = MODESET_DONE;
 	mutex_unlock(&dev_priv->modeset_restore_lock);
 
+	intel_opregion_notify_adapter(dev, PCI_D0);
+

This could be moved after intel_opregion_init() just for clarity, but I'm also fine keeping it here.

This patch depends on Rafael's change in his PM tree to export acpi_target_system_state(), other than that this is:

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 686

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +0 -0
 	intel_runtime_pm_put(dev_priv);
 	return 0;
 }

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#25 lore raw

Re: [PATCH 3/4] drm/i915: send proper opregion notifications on suspend/resume

In reply to Jesse Barnes
Quoted 1 line · On Thu, 29 May 2014 14:11:36 -0700 Jesse Barnes <[email protected]>…

From: Kristen Carlson Accardi <[email protected]>

This one was based on a patch from Imre - I just added the D0 on the resume path.

Quoted 65 lines

This indicates to the firmware that it can power down various other components or bring them back up, depending on the target system state.

---
 drivers/acpi/sleep.c            |  1 +
 drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
drivers/acpi/sleep.c +1 -0
index c40fb2e..807f333 100644
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
 {
 	return acpi_target_sleep_state;
 }
+EXPORT_SYMBOL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
 
drivers/gpu/drm/i915/i915_drv.c +10 -0
index 433bdfa..b6211d7 100644
@@ -28,6 +28,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/acpi.h>
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
@@ -491,6 +492,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc;
+	pci_power_t opregion_target_state;
 
 	intel_runtime_pm_get(dev_priv);
 
@@ -540,6 +542,12 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	i915_save_state(dev);
 
+	if (acpi_target_system_state() >= ACPI_STATE_S3)
+		opregion_target_state = PCI_D3cold;
+	else
+		opregion_target_state = PCI_D1;
+	intel_opregion_notify_adapter(dev, opregion_target_state);
+
 	intel_opregion_fini(dev);
 
 	console_lock();
@@ -671,6 +679,8 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 	dev_priv->modeset_restore = MODESET_DONE;
 	mutex_unlock(&dev_priv->modeset_restore_lock);
 
+	intel_opregion_notify_adapter(dev, PCI_D0);
+
 	intel_runtime_pm_put(dev_priv);
 	return 0;
 }
#26 lore raw

PATCH 4/4 drm/i915: make sure PC8 is enabled on suspend and disabled on resume

In reply to Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +6 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	if (drm_core_check_feature(dev, DRIVER_MODESET) &&
 	    restore_gtt_mappings) {
 		mutex_lock(&dev->struct_mutex);
Signature · 1 line
1.9.1
Reviewed-by on v1 4/4
#27 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 26 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +3 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 625

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);

I would put this before we access any of the HW regs in thaw_early() and correspondingly the above call to hsw_enable_pc8() to suspend_late() before we call pci_disable_device().

With that change this is:

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 629

Quoted 4 lines
drivers/gpu/drm/i915/i915_drv.c +1 -0
+
 	if (drm_core_check_feature(dev, DRIVER_MODESET) &&
 	    restore_gtt_mappings) {
 		mutex_lock(&dev->struct_mutex);

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#28 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 37 lines · On Fri, 30 May 2014 16:37:53 +0300 Imre Deak <[email protected]> wrote:
Quoted 26 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +3 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 625

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);

I would put this before we access any of the HW regs in thaw_early() and correspondingly the above call to hsw_enable_pc8() to suspend_late() before we call pci_disable_device().

Quoted 2 lines

With that change this is:

For the thaw side I think that makes sense.

But for the freeze side, putting it in suspend_late won't get us the freeze behavior we want. I think Rafael and Kristen are thinking of re-using the freeze infrastructure for some kind of connected standby feature, where most stuff is frozen, but the system isn't in S3 or S4, so we need the enable_pc8 call in the _freeze path as well.

Rafael, is that correct?

I'll add a late_freeze and put it there instead, so it doesn't pollute the S3 suspend path.

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#29 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 45 lines · Jesse Barnes
Quoted 37 lines · On Fri, 30 May 2014 16:37:53 +0300 Imre Deak <[email protected]> wrote:
Quoted 26 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +3 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 625

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);

I would put this before we access any of the HW regs in thaw_early() and correspondingly the above call to hsw_enable_pc8() to suspend_late() before we call pci_disable_device().

Quoted 2 lines

With that change this is:

For the thaw side I think that makes sense.

Quoted 7 lines

But for the freeze side, putting it in suspend_late won't get us the freeze behavior we want. I think Rafael and Kristen are thinking of re-using the freeze infrastructure for some kind of connected standby feature, where most stuff is frozen, but the system isn't in S3 or S4, so we need the enable_pc8 call in the _freeze path as well.

Rafael, is that correct?

No, it isn't. The .freeze()/.thaw() callbacks are hibernation-specific. There are no plans for using this in PM beyond hibernation.

What we're going to use are .suspend/_late/_noirq() and the corresponding resume callbacks and runtime PM.

Quoted 2 lines

I'll add a late_freeze and put it there instead, so it doesn't pollute the S3 suspend path.

The freeze/thaw stuff need not do any PM BTW, it just needs to quiesce the device to prevent it from doing DMA etc and then bring it back to life.

Rafael

#30 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 57 lines · On Fri, 30 May 2014 23:12:45 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 45 lines · Jesse Barnes
Quoted 37 lines · On Fri, 30 May 2014 16:37:53 +0300 Imre Deak <[email protected]> wrote:
Quoted 26 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +3 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 

drivers/gpu/drm/i915/i915_drv.c static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) · line 625

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);

I would put this before we access any of the HW regs in thaw_early() and correspondingly the above call to hsw_enable_pc8() to suspend_late() before we call pci_disable_device().

Quoted 2 lines

With that change this is:

For the thaw side I think that makes sense.

Quoted 7 lines

But for the freeze side, putting it in suspend_late won't get us the freeze behavior we want. I think Rafael and Kristen are thinking of re-using the freeze infrastructure for some kind of connected standby feature, where most stuff is frozen, but the system isn't in S3 or S4, so we need the enable_pc8 call in the _freeze path as well.

Rafael, is that correct?

No, it isn't. The .freeze()/.thaw() callbacks are hibernation-specific. There are no plans for using this in PM beyond hibernation.

Quoted 8 lines

What we're going to use are .suspend/_late/_noirq() and the corresponding resume callbacks and runtime PM.

Quoted 2 lines

I'll add a late_freeze and put it there instead, so it doesn't pollute the S3 suspend path.

The freeze/thaw stuff need not do any PM BTW, it just needs to quiesce the device to prevent it from doing DMA etc and then bring it back to life.

Ok thanks. Kristen corrected me on IRC too. The latest patch I sent should do what we want then, now that I've removed the freeze_late function and put our PC8 enable in suspend_late like Imre suggested initially.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#31 lore raw

PATCH 1/1 drm/i915: make sure PC8 is enabled on suspend and disabled on resume v2

In reply to Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

v2: move disable_pc8 call to thaw_early (Imre)
move enable_pc8 to freeze_late (Imre/Jesse)

---
 drivers/gpu/drm/i915/i915_drv.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +22 -0
index a573f5a..0a8925e 100644
@@ -559,6 +559,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 
@@ -608,6 +611,9 @@ static int i915_drm_thaw_early(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	intel_uncore_early_sanitize(dev);
 	intel_uncore_sanitize(dev);
 	intel_power_domains_init_hw(dev_priv);
@@ -939,6 +945,21 @@ static int i915_pm_freeze(struct device *dev)
 	return i915_drm_freeze(drm_dev);
 }
 
+static int i915_pm_freeze_late(struct device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct drm_device *drm_dev = pci_get_drvdata(pdev);
+	struct drm_i915_private *dev_priv = drm_dev->dev_private;
+
+	if (IS_HASWELL(drm_dev) || IS_BROADWELL(drm_dev))
+		hsw_enable_pc8(dev_priv);
+
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, PCI_D3hot);
+
+	return 0;
+}
+
 static int i915_pm_thaw_early(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -1476,6 +1497,7 @@ static const struct dev_pm_ops i915_pm_ops = {
 	.resume_early = i915_pm_resume_early,
 	.resume = i915_pm_resume,
 	.freeze = i915_pm_freeze,
+	.freeze_late = i915_pm_freeze_late,
 	.thaw_early = i915_pm_thaw_early,
 	.thaw = i915_pm_thaw,
 	.poweroff = i915_pm_poweroff,
Signature · 1 line
1.9.1
#32 lore raw

PATCH 1/1 drm/i915: make sure PC8 is enabled on suspend and disabled on resume v3

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

v2: move disable_pc8 call to thaw_early (Imre)
move enable_pc8 to freeze_late (Imre/Jesse)
v3: drop spurious hunk from _freeze now that we have freeze_late (Jesse)

---
 drivers/gpu/drm/i915/i915_drv.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +19 -0
index a573f5a..ff291c0 100644
@@ -608,6 +608,9 @@ static int i915_drm_thaw_early(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	intel_uncore_early_sanitize(dev);
 	intel_uncore_sanitize(dev);
 	intel_power_domains_init_hw(dev_priv);
@@ -939,6 +942,21 @@ static int i915_pm_freeze(struct device *dev)
 	return i915_drm_freeze(drm_dev);
 }
 
+static int i915_pm_freeze_late(struct device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct drm_device *drm_dev = pci_get_drvdata(pdev);
+	struct drm_i915_private *dev_priv = drm_dev->dev_private;
+
+	if (IS_HASWELL(drm_dev) || IS_BROADWELL(drm_dev))
+		hsw_enable_pc8(dev_priv);
+
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, PCI_D3hot);
+
+	return 0;
+}
+
 static int i915_pm_thaw_early(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -1476,6 +1494,7 @@ static const struct dev_pm_ops i915_pm_ops = {
 	.resume_early = i915_pm_resume_early,
 	.resume = i915_pm_resume,
 	.freeze = i915_pm_freeze,
+	.freeze_late = i915_pm_freeze_late,
 	.thaw_early = i915_pm_thaw_early,
 	.thaw = i915_pm_thaw,
 	.poweroff = i915_pm_poweroff,
Signature · 1 line
1.9.1
#33 lore raw

PATCH 1/1 drm/i915: make sure PC8 is enabled on suspend and disabled on resume v4

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

v2: move disable_pc8 call to thaw_early (Imre)
move enable_pc8 to freeze_late (Imre/Jesse)
v3: drop spurious hunk from _freeze now that we have freeze_late (Jesse)
v4: move back to suspend_late (Imre was right)

---
 drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +7 -0
index a573f5a..2583442 100644
@@ -608,6 +608,9 @@ static int i915_drm_thaw_early(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	intel_uncore_early_sanitize(dev);
 	intel_uncore_sanitize(dev);
 	intel_power_domains_init_hw(dev_priv);
@@ -891,6 +894,7 @@ static int i915_pm_suspend_late(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *drm_dev = pci_get_drvdata(pdev);
+	struct drm_i915_private *dev_priv = drm_dev->dev_private;
 
 	/*
 	 * We have a suspedn ordering issue with the snd-hda driver also
@@ -904,6 +908,9 @@ static int i915_pm_suspend_late(struct device *dev)
 	if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
 		return 0;
 
+	if (IS_HASWELL(drm_dev) || IS_BROADWELL(drm_dev))
+		hsw_enable_pc8(dev_priv);
+
 	pci_disable_device(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#34 lore raw

Re: [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v4

Quoted 5 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

Quoted 7 lines

v2: move disable_pc8 call to thaw_early (Imre)
move enable_pc8 to freeze_late (Imre/Jesse)
v3: drop spurious hunk from _freeze now that we have freeze_late (Jesse)
v4: move back to suspend_late (Imre was right)

Quoted 36 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +7 -0
index a573f5a..2583442 100644
@@ -608,6 +608,9 @@ static int i915_drm_thaw_early(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	intel_uncore_early_sanitize(dev);
 	intel_uncore_sanitize(dev);
 	intel_power_domains_init_hw(dev_priv);
@@ -891,6 +894,7 @@ static int i915_pm_suspend_late(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *drm_dev = pci_get_drvdata(pdev);
+	struct drm_i915_private *dev_priv = drm_dev->dev_private;
 
 	/*
 	 * We have a suspedn ordering issue with the snd-hda driver also
@@ -904,6 +908,9 @@ static int i915_pm_suspend_late(struct device *dev)
 	if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
 		return 0;
 
+	if (IS_HASWELL(drm_dev) || IS_BROADWELL(drm_dev))
+		hsw_enable_pc8(dev_priv);
+
 	pci_disable_device(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 
#35 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

In reply to Jesse Barnes
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

pc8 is fully subsumed into runtime pm by now. Do we _really_ still need this?
-Daniel

Quoted 35 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +6 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	if (drm_core_check_feature(dev, DRIVER_MODESET) &&
 	    restore_gtt_mappings) {
 		mutex_lock(&dev->struct_mutex);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#36 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 11 lines · Daniel Vetter
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

pc8 is fully subsumed into runtime pm by now. Do we _really_ still need this?

Yes, since the system suspend/resume handlers are called with an RPM ref held and thus PC8 disabled.

--Imre

Quoted 33 lines

-Daniel

Quoted 31 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +6 -0
index b6211d7..24dc856 100644
@@ -558,6 +558,9 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	intel_display_set_init_power(dev_priv, false);
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_enable_pc8(dev_priv);
+
 	return 0;
 }
 
@@ -618,6 +621,9 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		hsw_disable_pc8(dev_priv);
+
 	if (drm_core_check_feature(dev, DRIVER_MODESET) &&
 	    restore_gtt_mappings) {
 		mutex_lock(&dev->struct_mutex);
Signature · 1 line
1.9.1
Quoted 5 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#37 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 7 lines · Imre Deak
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

pc8 is fully subsumed into runtime pm by now. Do we _really_ still need this?

Yes, since the system suspend/resume handlers are called with an RPM ref held and thus PC8 disabled.

But doesn't patch 1 try to fix that? Imo we should have this here but instead go through highl-level the runtime pm functions to shut off the chip on all platforms.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#38 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 11 lines · Daniel Vetter
Quoted 10 lines · Imre Deak
Quoted 9 lines · Daniel Vetter
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

pc8 is fully subsumed into runtime pm by now. Do we _really_ still need this?

Yes, since the system suspend/resume handlers are called with an RPM ref held and thus PC8 disabled.

But doesn't patch 1 try to fix that?

That only disables the display side, but we won't disable PC8 until the RPM suspend handler is called. And that won't happen because the last RPM ref is held by the DPM framework for the duration of system suspend/resume handlers.

Quoted 2 lines

Imo we should have this here but instead go through highl-level the runtime pm functions to shut off the chip on all platforms.

After the planned refactoring we could have a low-level function that we can call both from here and the runtime PM path, but until that happens we need to do this here directly.

--Imre

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#39 lore raw

Re: [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume

Quoted 18 lines · Imre Deak
Quoted 17 lines · Daniel Vetter
Quoted 15 lines · Imre Deak
Quoted 11 lines · Daniel Vetter
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

This matches the runtime suspend paths and allows the system to enter the lowest power mode at freeze time.

pc8 is fully subsumed into runtime pm by now. Do we _really_ still need this?

Yes, since the system suspend/resume handlers are called with an RPM ref held and thus PC8 disabled.

Quoted 6 lines
Quoted 1 line

But doesn't patch 1 try to fix that?

That only disables the display side, but we won't disable PC8 until the RPM suspend handler is called. And that won't happen because the last RPM ref is held by the DPM framework for the duration of system suspend/resume handlers.

Yeah, there's discussion going on to make system suspend be optionally based upon runtime pm in the core. Atm that's not possible since the system wakes up everyone to suspend them.

Quoted 6 lines
Quoted 2 lines

Imo we should have this here but instead go through highl-level the runtime pm functions to shut off the chip on all platforms.

After the planned refactoring we could have a low-level function that we can call both from here and the runtime PM path, but until that happens we need to do this here directly.

Yeah, that's what I'm actually aiming for - we should be able to call the runtime pm suspend code from the system suspend code and share pretty much all the code. The sequence I'm thinking of would be for system suspend:

1. Stop everything we need to stop (gpu, display, rps, ...) to be able to enter runtime pm.

2. Check for leaked references. This might be tricky because audio.

3. Call runtime pm suspend hooks.

Resume would be the same, but inverted.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Reviewed-by on v1 1/4
#40 lore raw
In reply to Jesse Barnes
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

We want to make sure everything is disabled and at its lowest power when freezing.

Looks ok to me:

Quoted 9 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index e2bfdda..66c6ffb 100644

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 558

Quoted 8 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -551,6 +551,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 	dev_priv->suspend_count++;
 
+	intel_display_set_init_power(dev_priv, false);
+
 	return 0;
 }
 

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#41 lore raw
Quoted 22 lines · On Fri, 30 May 2014 15:48:23 +0300 Imre Deak <[email protected]> wrote:
Quoted 7 lines · Jesse Barnes

From: Kristen Carlson Accardi <[email protected]>

We want to make sure everything is disabled and at its lowest power when freezing.

Looks ok to me:

Quoted 10 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index e2bfdda..66c6ffb 100644
@@ -551,6 +551,8 @@ static int i915_drm_freeze(struct drm_device *dev)
 
Quoted 8 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_freeze(struct drm_device *dev) · line 558

Quoted 7 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
 	dev_priv->suspend_count++;
 
+	intel_display_set_init_power(dev_priv, false);
+
 	return 0;
 }
 

This was actually Imre's patch not mine.