aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorJesse Barnes <jesse.barnes@intel.com>2008-01-29 00:05:22 -0500
committerDave Airlie <airlied@redhat.com>2008-02-19 18:45:14 -0500
commitda636ad6a0d72eb5cb99738056af0bcc3db9ef9d (patch)
treed4db29714f1f1e119be9b7a359e6d77e599547bc /drivers/char/drm
parent1f84e550a870bf5f5f399b611db68f3324ea7883 (diff)
drm/i915: Fix hibernate save/restore of VGA attribute regs
In hibernate, we may end up calling the VGA save regs function twice, so we need to make sure it's idempotent. That means leaving ARX in index mode after the first save operation. Fixes hibernate on 965. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/i915_drv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c
index 5025f5b02412..35758a6c8b0d 100644
--- a/drivers/char/drm/i915_drv.c
+++ b/drivers/char/drm/i915_drv.c
@@ -160,6 +160,7 @@ static void i915_save_vga(struct drm_device *dev)
160 dev_priv->saveAR[i] = i915_read_ar(st01, i, 0); 160 dev_priv->saveAR[i] = i915_read_ar(st01, i, 0);
161 inb(st01); 161 inb(st01);
162 outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX); 162 outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX);
163 inb(st01);
163 164
164 /* Graphics controller registers */ 165 /* Graphics controller registers */
165 for (i = 0; i < 9; i++) 166 for (i = 0; i < 9; i++)
@@ -225,6 +226,7 @@ static void i915_restore_vga(struct drm_device *dev)
225 i915_write_ar(st01, i, dev_priv->saveAR[i], 0); 226 i915_write_ar(st01, i, dev_priv->saveAR[i], 0);
226 inb(st01); /* switch back to index mode */ 227 inb(st01); /* switch back to index mode */
227 outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX); 228 outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX);
229 inb(st01);
228 230
229 /* VGA color palette registers */ 231 /* VGA color palette registers */
230 outb(dev_priv->saveDACMASK, VGA_DACMASK); 232 outb(dev_priv->saveDACMASK, VGA_DACMASK);