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

Commit d892e939 authored by Chris Wilson's avatar Chris Wilson
Browse files

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



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+
Cc: stable@vger.kernel.org
Link: http://patchwork.freedesktop.org/patch/msgid/20170212215344.16600-1-chris@chris-wilson.co.uk


Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 04a68a35
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -441,7 +441,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]);
@@ -454,7 +454,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);