diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-11 06:07:54 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-11 15:44:56 -0500 |
commit | d9126400580e2caada85fa68799952956a6062fd (patch) | |
tree | 094e340efb97cb2d232437250ea76747560098c7 /drivers/gpu/drm | |
parent | bcfb2e285827bf0cfea8bbfad18a4fca57fbabae (diff) |
drm/i915/gtt: Unmap the PCI pages after unbinding them from the GTT
Dave Airlie spotted that his ILK laptop with DMAR enabled was generating
the occasional DMAR warning.
"The ordering in the previous code was to rewrite the GTT table before
unmapping the pages and that makes sense to me."
This is his stable patch ported to d-i-n.
Reported-by: Dave Airlie <airlied@redhat.com>
Original-patch-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 86673e77d7cb..70433ae50ac8 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -85,15 +85,11 @@ int i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj) | |||
85 | 85 | ||
86 | void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) | 86 | void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) |
87 | { | 87 | { |
88 | struct drm_device *dev = obj->base.dev; | 88 | intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT, |
89 | struct drm_i915_private *dev_priv = dev->dev_private; | 89 | obj->base.size >> PAGE_SHIFT); |
90 | 90 | ||
91 | if (dev_priv->mm.gtt->needs_dmar) { | 91 | if (obj->sg_list) { |
92 | intel_gtt_unmap_memory(obj->sg_list, obj->num_sg); | 92 | intel_gtt_unmap_memory(obj->sg_list, obj->num_sg); |
93 | obj->sg_list = NULL; | 93 | obj->sg_list = NULL; |
94 | obj->num_sg = 0; | ||
95 | } | 94 | } |
96 | |||
97 | intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT, | ||
98 | obj->base.size >> PAGE_SHIFT); | ||
99 | } | 95 | } |