Skip to content

Commit

Permalink
drm/i915: Restore GTT mapping first upon resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Wilson committed Dec 9, 2010
1 parent 4a19d02 commit d1c3b17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,18 @@ static int i915_drm_thaw(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private;
int error = 0;

if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev);
mutex_unlock(&dev->struct_mutex);
}

i915_restore_state(dev);
intel_opregion_setup(dev);

/* KMS EnterVT equivalent */
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev);
dev_priv->mm.suspended = 0;

error = i915_gem_init_ringbuffer(dev);
Expand Down

0 comments on commit d1c3b17

Please sign in to comment.