提交 483f1798 编写于 作者: B Ben Widawsky 提交者: Keith Packard

drm/i915: save/resume forcewake lock fixes

The lock must be held for the saving and restoring of VGA state.
Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
CC: Alexander Zhaunerchyk <alex.vizor@gmail.com>
CC: Andrey Rahmatullin <wrar@wrar.name>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NKeith Packard <keithp@keithp.com>
上级 e92d03bf
...@@ -678,6 +678,7 @@ void i915_save_display(struct drm_device *dev) ...@@ -678,6 +678,7 @@ void i915_save_display(struct drm_device *dev)
} }
/* VGA state */ /* VGA state */
mutex_lock(&dev->struct_mutex);
dev_priv->saveVGA0 = I915_READ(VGA0); dev_priv->saveVGA0 = I915_READ(VGA0);
dev_priv->saveVGA1 = I915_READ(VGA1); dev_priv->saveVGA1 = I915_READ(VGA1);
dev_priv->saveVGA_PD = I915_READ(VGA_PD); dev_priv->saveVGA_PD = I915_READ(VGA_PD);
...@@ -687,6 +688,7 @@ void i915_save_display(struct drm_device *dev) ...@@ -687,6 +688,7 @@ void i915_save_display(struct drm_device *dev)
dev_priv->saveVGACNTRL = I915_READ(VGACNTRL); dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);
i915_save_vga(dev); i915_save_vga(dev);
mutex_unlock(&dev->struct_mutex);
} }
void i915_restore_display(struct drm_device *dev) void i915_restore_display(struct drm_device *dev)
...@@ -780,6 +782,8 @@ void i915_restore_display(struct drm_device *dev) ...@@ -780,6 +782,8 @@ void i915_restore_display(struct drm_device *dev)
I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL); I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
else else
I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL); I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
mutex_lock(&dev->struct_mutex);
I915_WRITE(VGA0, dev_priv->saveVGA0); I915_WRITE(VGA0, dev_priv->saveVGA0);
I915_WRITE(VGA1, dev_priv->saveVGA1); I915_WRITE(VGA1, dev_priv->saveVGA1);
I915_WRITE(VGA_PD, dev_priv->saveVGA_PD); I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
...@@ -787,6 +791,7 @@ void i915_restore_display(struct drm_device *dev) ...@@ -787,6 +791,7 @@ void i915_restore_display(struct drm_device *dev)
udelay(150); udelay(150);
i915_restore_vga(dev); i915_restore_vga(dev);
mutex_unlock(&dev->struct_mutex);
} }
int i915_save_state(struct drm_device *dev) int i915_save_state(struct drm_device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册