Commit 5eeb3c0e authored by Chris Wilson's avatar Chris Wilson Committed by Greg Kroah-Hartman

drm/i915: Pass timeout==0 on to i915_gem_object_wait_fence()

commit 636deb5b upstream.

The i915_gem_object_wait_fence() uses an incoming timeout=0 to query
whether the current fence is busy or idle, without waiting. This can be
used by the wait-ioctl to implement a busy query.

Fixes: e95433c7 ("drm/i915: Rearrange i915_wait_request() accounting with callers")
Testcase: igt/gem_wait/basic-busy-write-all
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Link: http://patchwork.freedesktop.org/patch/msgid/20170212215344.16600-1-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit d892e939)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d11d14c5
...@@ -440,7 +440,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, ...@@ -440,7 +440,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
timeout = i915_gem_object_wait_fence(shared[i], timeout = i915_gem_object_wait_fence(shared[i],
flags, timeout, flags, timeout,
rps); rps);
if (timeout <= 0) if (timeout < 0)
break; break;
dma_fence_put(shared[i]); dma_fence_put(shared[i]);
...@@ -453,7 +453,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv, ...@@ -453,7 +453,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
excl = reservation_object_get_excl_rcu(resv); excl = reservation_object_get_excl_rcu(resv);
} }
if (excl && timeout > 0) if (excl && timeout >= 0)
timeout = i915_gem_object_wait_fence(excl, flags, timeout, rps); timeout = i915_gem_object_wait_fence(excl, flags, timeout, rps);
dma_fence_put(excl); dma_fence_put(excl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment