Skip to content

Commit

Permalink
drm/i915: Disable pwrctx before unpin and free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kristian Høgsberg authored and Eric Anholt committed Dec 1, 2009
1 parent 69341a5 commit c1b5dea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c1b5dea

Please sign in to comment.