From: Kristian Høgsberg Date: Wed, 11 Nov 2009 17:19:18 +0000 (-0500) Subject: drm/i915: Disable pwrctx before unpin and free X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c1b5dea097258b3d3d570d5ccc8f4bf5accb3f29;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git drm/i915: Disable pwrctx before unpin and free Otherwise the chip may scribble over free memory. Signed-off-by: Kristian Høgsberg Signed-off-by: Jesse Barnes Signed-off-by: Eric Anholt --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index abd24e2a4932..d2519f0136ef 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); }