diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-08 09:26:19 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-09 14:46:23 -0500 |
commit | d1c3b177b9940541e89015a726ac279caf1a21f3 (patch) | |
tree | 3e7cec06ee0703b45d05eedc4e422718cb15e328 /drivers/gpu/drm/i915/i915_drv.c | |
parent | 4a19d02e0a8cd8799e5d150d8eb74861e1a4cdec (diff) |
drm/i915: Restore GTT mapping first upon resume
As suggested by Daniel Vetter, this is a safeguard should any of the
registers cause reference to PTE entries.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ad28b21f4d03..2be344a8e93b 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -304,13 +304,18 @@ static int i915_drm_thaw(struct drm_device *dev) | |||
304 | struct drm_i915_private *dev_priv = dev->dev_private; | 304 | struct drm_i915_private *dev_priv = dev->dev_private; |
305 | int error = 0; | 305 | int error = 0; |
306 | 306 | ||
307 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
308 | mutex_lock(&dev->struct_mutex); | ||
309 | i915_gem_restore_gtt_mappings(dev); | ||
310 | mutex_unlock(&dev->struct_mutex); | ||
311 | } | ||
312 | |||
307 | i915_restore_state(dev); | 313 | i915_restore_state(dev); |
308 | intel_opregion_setup(dev); | 314 | intel_opregion_setup(dev); |
309 | 315 | ||
310 | /* KMS EnterVT equivalent */ | 316 | /* KMS EnterVT equivalent */ |
311 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 317 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
312 | mutex_lock(&dev->struct_mutex); | 318 | mutex_lock(&dev->struct_mutex); |
313 | i915_gem_restore_gtt_mappings(dev); | ||
314 | dev_priv->mm.suspended = 0; | 319 | dev_priv->mm.suspended = 0; |
315 | 320 | ||
316 | error = i915_gem_init_ringbuffer(dev); | 321 | error = i915_gem_init_ringbuffer(dev); |