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

Commit 595dad76 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915/execbuffer: Clear domains before beginning reloc processing



After reordering the sequence of relocating objects, commit 6fe4f140,
we can no longer rely on seeing all reloc targets prior to performing
the relocation. As a result we were ignoring the need to flush objects
from the render cache and invalidate the sampler caches, resulting in
rendering glitches. So we need to clear the relocation domains earlier.

Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Tested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent dd6864a4
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -464,8 +464,6 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
	int ret;
	int ret;


	list_for_each_entry(obj, objects, exec_list) {
	list_for_each_entry(obj, objects, exec_list) {
		obj->base.pending_read_domains = 0;
		obj->base.pending_write_domain = 0;
		ret = i915_gem_execbuffer_relocate_object(obj, eb);
		ret = i915_gem_execbuffer_relocate_object(obj, eb);
		if (ret)
		if (ret)
			return ret;
			return ret;
@@ -505,6 +503,9 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
			list_move(&obj->exec_list, &ordered_objects);
			list_move(&obj->exec_list, &ordered_objects);
		else
		else
			list_move_tail(&obj->exec_list, &ordered_objects);
			list_move_tail(&obj->exec_list, &ordered_objects);

		obj->base.pending_read_domains = 0;
		obj->base.pending_write_domain = 0;
	}
	}
	list_splice(&ordered_objects, objects);
	list_splice(&ordered_objects, objects);


@@ -712,8 +713,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,


	list_for_each_entry(obj, objects, exec_list) {
	list_for_each_entry(obj, objects, exec_list) {
		int offset = obj->exec_entry - exec;
		int offset = obj->exec_entry - exec;
		obj->base.pending_read_domains = 0;
		obj->base.pending_write_domain = 0;
		ret = i915_gem_execbuffer_relocate_object_slow(obj, eb,
		ret = i915_gem_execbuffer_relocate_object_slow(obj, eb,
							       reloc + reloc_offset[offset]);
							       reloc + reloc_offset[offset]);
		if (ret)
		if (ret)