Commit da636ad6 authored by Jesse Barnes's avatar Jesse Barnes Committed by Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 1f84e550
...@@ -160,6 +160,7 @@ static void i915_save_vga(struct drm_device *dev) ...@@ -160,6 +160,7 @@ static void i915_save_vga(struct drm_device *dev)
dev_priv->saveAR[i] = i915_read_ar(st01, i, 0); dev_priv->saveAR[i] = i915_read_ar(st01, i, 0);
inb(st01); inb(st01);
outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX); outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX);
inb(st01);
/* Graphics controller registers */ /* Graphics controller registers */
for (i = 0; i < 9; i++) for (i = 0; i < 9; i++)
...@@ -225,6 +226,7 @@ static void i915_restore_vga(struct drm_device *dev) ...@@ -225,6 +226,7 @@ static void i915_restore_vga(struct drm_device *dev)
i915_write_ar(st01, i, dev_priv->saveAR[i], 0); i915_write_ar(st01, i, dev_priv->saveAR[i], 0);
inb(st01); /* switch back to index mode */ inb(st01); /* switch back to index mode */
outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX); outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX);
inb(st01);
/* VGA color palette registers */ /* VGA color palette registers */
outb(dev_priv->saveDACMASK, VGA_DACMASK); outb(dev_priv->saveDACMASK, VGA_DACMASK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment