drm/i915/execbuffer: Clear domains before beginning reloc processing
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 13 Jan 2011 11:03:48 +0000 (11:03 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 13 Jan 2011 16:06:05 +0000 (16:06 +0000)
After reordering the sequence of relocating objects, commit 6fe4f1404,
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: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem_execbuffer.c

index 6b34e98a1270e2f150d5000ff535404a09f57e5c..8db88e34ef7b8d2db75b1cb1d19c3da43d7855a7 100644 (file)
@@ -464,8 +464,6 @@ i915_gem_execbuffer_relocate(struct drm_device *dev,
        int ret;
 
        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);
                if (ret)
                        return ret;
@@ -505,6 +503,9 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
                        list_move(&obj->exec_list, &ordered_objects);
                else
                        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);
 
@@ -712,8 +713,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
 
        list_for_each_entry(obj, objects, exec_list) {
                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,
                                                               reloc + reloc_offset[offset]);
                if (ret)