diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2011-06-22 12:55:01 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-06-22 13:28:33 -0400 |
commit | 483f1798998ede75b2575cc1813c3d89ba64a34e (patch) | |
tree | 4113981d1105b1a97840ba3362962b52f8982252 /drivers/gpu/drm/i915/i915_suspend.c | |
parent | e92d03bff9a0d0bcbb812c9b1290ca96c9338d45 (diff) |
drm/i915: save/resume forcewake lock fixes
The lock must be held for the saving and restoring of VGA state.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
CC: Alexander Zhaunerchyk <alex.vizor@gmail.com>
CC: Andrey Rahmatullin <wrar@wrar.name>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_suspend.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 60a94d2b5264..e8152d23d5b6 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -678,6 +678,7 @@ void i915_save_display(struct drm_device *dev) | |||
678 | } | 678 | } |
679 | 679 | ||
680 | /* VGA state */ | 680 | /* VGA state */ |
681 | mutex_lock(&dev->struct_mutex); | ||
681 | dev_priv->saveVGA0 = I915_READ(VGA0); | 682 | dev_priv->saveVGA0 = I915_READ(VGA0); |
682 | dev_priv->saveVGA1 = I915_READ(VGA1); | 683 | dev_priv->saveVGA1 = I915_READ(VGA1); |
683 | dev_priv->saveVGA_PD = I915_READ(VGA_PD); | 684 | dev_priv->saveVGA_PD = I915_READ(VGA_PD); |
@@ -687,6 +688,7 @@ void i915_save_display(struct drm_device *dev) | |||
687 | dev_priv->saveVGACNTRL = I915_READ(VGACNTRL); | 688 | dev_priv->saveVGACNTRL = I915_READ(VGACNTRL); |
688 | 689 | ||
689 | i915_save_vga(dev); | 690 | i915_save_vga(dev); |
691 | mutex_unlock(&dev->struct_mutex); | ||
690 | } | 692 | } |
691 | 693 | ||
692 | void i915_restore_display(struct drm_device *dev) | 694 | void i915_restore_display(struct drm_device *dev) |
@@ -780,6 +782,8 @@ void i915_restore_display(struct drm_device *dev) | |||
780 | I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL); | 782 | I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL); |
781 | else | 783 | else |
782 | I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL); | 784 | I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL); |
785 | |||
786 | mutex_lock(&dev->struct_mutex); | ||
783 | I915_WRITE(VGA0, dev_priv->saveVGA0); | 787 | I915_WRITE(VGA0, dev_priv->saveVGA0); |
784 | I915_WRITE(VGA1, dev_priv->saveVGA1); | 788 | I915_WRITE(VGA1, dev_priv->saveVGA1); |
785 | I915_WRITE(VGA_PD, dev_priv->saveVGA_PD); | 789 | I915_WRITE(VGA_PD, dev_priv->saveVGA_PD); |
@@ -787,6 +791,7 @@ void i915_restore_display(struct drm_device *dev) | |||
787 | udelay(150); | 791 | udelay(150); |
788 | 792 | ||
789 | i915_restore_vga(dev); | 793 | i915_restore_vga(dev); |
794 | mutex_unlock(&dev->struct_mutex); | ||
790 | } | 795 | } |
791 | 796 | ||
792 | int i915_save_state(struct drm_device *dev) | 797 | int i915_save_state(struct drm_device *dev) |