Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9126400 authored by Chris Wilson's avatar Chris Wilson
Browse files

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: default avatarDave Airlie <airlied@redhat.com>
Original-patch-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent bcfb2e28
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -85,15 +85,11 @@ int i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj)


void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj)
void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj)
{
{
	struct drm_device *dev = obj->base.dev;
	intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT,
	struct drm_i915_private *dev_priv = dev->dev_private;
			      obj->base.size >> PAGE_SHIFT);


	if (dev_priv->mm.gtt->needs_dmar) {
	if (obj->sg_list) {
		intel_gtt_unmap_memory(obj->sg_list, obj->num_sg);
		intel_gtt_unmap_memory(obj->sg_list, obj->num_sg);
		obj->sg_list = NULL;
		obj->sg_list = NULL;
		obj->num_sg = 0;
	}
	}

	intel_gtt_clear_range(obj->gtt_space->start >> PAGE_SHIFT,
			      obj->base.size >> PAGE_SHIFT);
}
}