aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_suspend.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-06-03 03:26:58 -0400
committerEric Anholt <eric@anholt.net>2009-06-04 07:43:11 -0400
commit1fd1c624362819ecc36db2458c6a972c48ae92d6 (patch)
tree9547e1a861be1a95b854945a46df8010f6d71c8f /drivers/gpu/drm/i915/i915_suspend.c
parent0e7ddf7eeeef5aea85412120539ab5369577faeb (diff)
drm/i915: Save/restore cursor state on suspend/resume.
This may fix cursor corruption in X on resume, which would persist until the cursor was hidden and then shown again. V2: Also include the cursor control regs. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_suspend.c')
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index ce8a21344a71..a98e2831ed31 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -295,6 +295,16 @@ int i915_save_state(struct drm_device *dev)
295 i915_save_palette(dev, PIPE_B); 295 i915_save_palette(dev, PIPE_B);
296 dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT); 296 dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT);
297 297
298 /* Cursor state */
299 dev_priv->saveCURACNTR = I915_READ(CURACNTR);
300 dev_priv->saveCURAPOS = I915_READ(CURAPOS);
301 dev_priv->saveCURABASE = I915_READ(CURABASE);
302 dev_priv->saveCURBCNTR = I915_READ(CURBCNTR);
303 dev_priv->saveCURBPOS = I915_READ(CURBPOS);
304 dev_priv->saveCURBBASE = I915_READ(CURBBASE);
305 if (!IS_I9XX(dev))
306 dev_priv->saveCURSIZE = I915_READ(CURSIZE);
307
298 /* CRT state */ 308 /* CRT state */
299 dev_priv->saveADPA = I915_READ(ADPA); 309 dev_priv->saveADPA = I915_READ(ADPA);
300 310
@@ -480,6 +490,16 @@ int i915_restore_state(struct drm_device *dev)
480 I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); 490 I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR);
481 I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); 491 I915_WRITE(DSPBADDR, I915_READ(DSPBADDR));
482 492
493 /* Cursor state */
494 I915_WRITE(CURAPOS, dev_priv->saveCURAPOS);
495 I915_WRITE(CURACNTR, dev_priv->saveCURACNTR);
496 I915_WRITE(CURABASE, dev_priv->saveCURABASE);
497 I915_WRITE(CURBPOS, dev_priv->saveCURBPOS);
498 I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR);
499 I915_WRITE(CURBBASE, dev_priv->saveCURBBASE);
500 if (!IS_I9XX(dev))
501 I915_WRITE(CURSIZE, dev_priv->saveCURSIZE);
502
483 /* CRT state */ 503 /* CRT state */
484 I915_WRITE(ADPA, dev_priv->saveADPA); 504 I915_WRITE(ADPA, dev_priv->saveADPA);
485 505