diff options
author | Eric Anholt <eric@anholt.net> | 2009-06-03 03:26:58 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-04 07:43:11 -0400 |
commit | 1fd1c624362819ecc36db2458c6a972c48ae92d6 (patch) | |
tree | 9547e1a861be1a95b854945a46df8010f6d71c8f /drivers/gpu | |
parent | 0e7ddf7eeeef5aea85412120539ab5369577faeb (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')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 20 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c431fa54bbb5..fcaa5444daa0 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -285,6 +285,13 @@ typedef struct drm_i915_private { | |||
285 | u8 saveDACMASK; | 285 | u8 saveDACMASK; |
286 | u8 saveCR[37]; | 286 | u8 saveCR[37]; |
287 | uint64_t saveFENCE[16]; | 287 | uint64_t saveFENCE[16]; |
288 | u32 saveCURACNTR; | ||
289 | u32 saveCURAPOS; | ||
290 | u32 saveCURABASE; | ||
291 | u32 saveCURBCNTR; | ||
292 | u32 saveCURBPOS; | ||
293 | u32 saveCURBBASE; | ||
294 | u32 saveCURSIZE; | ||
288 | 295 | ||
289 | struct { | 296 | struct { |
290 | struct drm_mm gtt_space; | 297 | struct drm_mm gtt_space; |
@@ -642,6 +649,7 @@ void i915_gem_detach_phys_object(struct drm_device *dev, | |||
642 | void i915_gem_free_all_phys_object(struct drm_device *dev); | 649 | void i915_gem_free_all_phys_object(struct drm_device *dev); |
643 | int i915_gem_object_get_pages(struct drm_gem_object *obj); | 650 | int i915_gem_object_get_pages(struct drm_gem_object *obj); |
644 | void i915_gem_object_put_pages(struct drm_gem_object *obj); | 651 | void i915_gem_object_put_pages(struct drm_gem_object *obj); |
652 | void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv); | ||
645 | 653 | ||
646 | /* i915_gem_tiling.c */ | 654 | /* i915_gem_tiling.c */ |
647 | void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); | 655 | void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); |
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 | ||