[Intel-gfx] [PATCH] restore render clock gating on resume

Andrew Lutomirski luto at mit.edu
Fri Oct 30 07:41:26 CET 2009


The render clock gating mode currently isn't restored when resuming,
which causes high power consumption after a suspend/resume cycle on my
laptop.

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

---

Alternatively, we could just call intel_init_clock_gating on resume
and save 12 bytes of memory.

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9c67f06..82385df 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -374,6 +374,8 @@ typedef struct drm_i915_private {
 	u32 saveCACHE_MODE_0;
 	u32 saveD_STATE;
 	u32 saveDSPCLK_GATE_D;
+	u32 saveRENCLK_GATE_D1;
+	u32 saveRENCLK_GATE_D2;
 	u32 saveMI_ARB_STATE;
 	u32 saveSWF0[16];
 	u32 saveSWF1[16];
diff --git a/drivers/gpu/drm/i915/i915_suspend.c
b/drivers/gpu/drm/i915/i915_suspend.c
index 992d561..d2fd6b2 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -723,6 +723,8 @@ int i915_save_state(struct drm_device *dev)
 	/* Clock gating state */
 	dev_priv->saveD_STATE = I915_READ(D_STATE);
 	dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D); /* Not sure
about this */
+	dev_priv->saveRENCLK_GATE_D1 = I915_READ(RENCLK_GATE_D1);
+	dev_priv->saveRENCLK_GATE_D2 = I915_READ(RENCLK_GATE_D2);

 	/* Cache mode state */
 	dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
@@ -798,6 +800,8 @@ int i915_restore_state(struct drm_device *dev)
 	/* Clock gating state */
 	I915_WRITE (D_STATE, dev_priv->saveD_STATE);
 	I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D);
+	I915_WRITE (RENCLK_GATE_D1, dev_priv->saveRENCLK_GATE_D1);
+	I915_WRITE (RENCLK_GATE_D2, dev_priv->saveRENCLK_GATE_D2);

 	/* Cache mode state */
 	I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);



More information about the Intel-gfx mailing list