]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: hide (seqno-1) in ringbuffer code
authorBen Widawsky <ben@bwidawsk.net>
Wed, 11 Apr 2012 18:18:21 +0000 (11:18 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Apr 2012 19:14:14 +0000 (21:14 +0200)
Waiting for seqno-1 in our object synchronization code is an
implementation detail given how we've decided to do the waits within the
rest of our code.

Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_ringbuffer.c

index 0115b12df573e054b4821c0de26af4bb9d77413a..71934dd0ee43d641c0c1e990dd4b809f14d76b44 100644 (file)
@@ -2002,7 +2002,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
        }
 
 
-       ret = to->sync_to(to, from, seqno - 1);
+       ret = to->sync_to(to, from, seqno);
        if (!ret)
                from->sync_seqno[idx] = seqno;
 
index dfdb613752c5c1fab629d8085fde9e5808949cb8..467b3319e4bd30ea297a45a127d96d7b9d1eec5a 100644 (file)
@@ -482,6 +482,12 @@ intel_ring_sync(struct intel_ring_buffer *waiter,
                  MI_SEMAPHORE_COMPARE |
                  MI_SEMAPHORE_REGISTER;
 
+       /* Throughout all of the GEM code, seqno passed implies our current
+        * seqno is >= the last seqno executed. However for hardware the
+        * comparison is strictly greater than.
+        */
+       seqno -= 1;
+
        ret = intel_ring_begin(waiter, 4);
        if (ret)
                return ret;