summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-11-11 12:19:18 -0500
committerEric Anholt <eric@anholt.net>2009-11-30 16:27:23 -0800
commitc1b5dea097258b3d3d570d5ccc8f4bf5accb3f29 (patch)
tree0d155441a03e806332621c661336dadefbf86a87 /drivers/gpu/drm/i915
parent69341a5e01897714f968b7dccb94f57137acf45f (diff)
drm/i915: Disable pwrctx before unpin and free
Otherwise the chip may scribble over free memory. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index abd24e2a493..d2519f0136e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4588,6 +4588,11 @@ void intel_modeset_cleanup(struct drm_device *dev)
dev_priv->display.disable_fbc(dev);
if (dev_priv->pwrctx) {
+ struct drm_i915_gem_object *obj_priv;
+
+ obj_priv = dev_priv->pwrctx->driver_private;
+ I915_WRITE(PWRCTXA, obj_priv->gtt_offset &~ PWRCTX_EN);
+ I915_READ(PWRCTXA);
i915_gem_object_unpin(dev_priv->pwrctx);
drm_gem_object_unreference(dev_priv->pwrctx);
}