[Intel-gfx] [PATCH] i915: Fix RC6 handling in non-KMS mode

Andrew Lutomirski luto at mit.edu
Tue Dec 22 01:40:42 CET 2009


Reinitializing RC6 in non-KMS mode breaks resume.  So skip RC6
entirely when !KMS.  Also remove a duplicate restoration of the RC6
registers.

This fixes a regression reported by Jeff Chua.

Signed-off-by: Andy Lutomirski <luto at mit.edu>

---

I have not personally tested on 2.6.33-rc1 because I can't suspend at
all.  But it seems to work in KMS mode, at least, on 2.6.32.1 with the
drm code kludged in from 2.6.33-rc1 + drm-next.

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9a05f1a..6498654 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -307,8 +307,6 @@ typedef struct drm_i915_private {
 	u32 saveDSPACNTR;
 	u32 saveDSPBCNTR;
 	u32 saveDSPARB;
-	u32 saveRENDERSTANDBY;
-	u32 savePWRCTXA;
 	u32 saveHWS;
 	u32 savePIPEACONF;
 	u32 savePIPEBCONF;
diff --git a/drivers/gpu/drm/i915/i915_suspend.c
b/drivers/gpu/drm/i915/i915_suspend.c
index d5ebb00..a3b90c9 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -732,12 +732,6 @@ int i915_save_state(struct drm_device *dev)

 	pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);

-	/* Render Standby */
-	if (I915_HAS_RC6(dev)) {
-		dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
-		dev_priv->savePWRCTXA = I915_READ(PWRCTXA);
-	}
-
 	/* Hardware status page */
 	dev_priv->saveHWS = I915_READ(HWS_PGA);

@@ -793,12 +787,6 @@ int i915_restore_state(struct drm_device *dev)

 	pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);

-	/* Render Standby */
-	if (I915_HAS_RC6(dev)) {
-		I915_WRITE(MCHBAR_RENDER_STANDBY, dev_priv->saveRENDERSTANDBY);
-		I915_WRITE(PWRCTXA, dev_priv->savePWRCTXA);
-	}
-
 	/* Hardware status page */
 	I915_WRITE(HWS_PGA, dev_priv->saveHWS);

diff --git a/drivers/gpu/drm/i915/intel_display.c
b/drivers/gpu/drm/i915/intel_display.c
index c21dede..089b1df 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4593,7 +4593,7 @@ void intel_init_clock_gating(struct drm_device *dev)
 	 * GPU can automatically power down the render unit if given a page
 	 * to save state.
 	 */
-	if (I915_HAS_RC6(dev)) {
+	if (I915_HAS_RC6(dev) && drm_core_check_feature(dev, DRIVER_MODESET)) {
 		struct drm_gem_object *pwrctx;
 		struct drm_i915_gem_object *obj_priv;
 		int ret;



More information about the Intel-gfx mailing list