Skip to content

Commit

Permalink
drm/i915: Pass timeout==0 on to i915_gem_object_wait_fence()
Browse files Browse the repository at this point in the history
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: e95433c ("drm/i915: Rearrange i915_wait_request() accounting with callers")
Testcase: igt/gem_wait/basic-busy-write-all
Signed-off-by: Chris Wilson <[email protected]>
Cc: Matthew Auld <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: <[email protected]> # v4.10-rc1+
Cc: [email protected]
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Joonas Lahtinen <[email protected]>
(cherry picked from commit d892e93)
Signed-off-by: Jani Nikula <[email protected]>
  • Loading branch information
ickle authored and jnikula committed Feb 15, 2017
1 parent 757a2d1 commit 0e363e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
timeout = i915_gem_object_wait_fence(shared[i],
flags, timeout,
rps);
if (timeout <= 0)
if (timeout < 0)
break;

dma_fence_put(shared[i]);
Expand All @@ -453,7 +453,7 @@ i915_gem_object_wait_reservation(struct reservation_object *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);

dma_fence_put(excl);
Expand Down

0 comments on commit 0e363e2

Please sign in to comment.