OSDN Git Service

drm/i915/selftests: Wait for the dma-fence timeout
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 17 Jan 2018 13:57:13 +0000 (13:57 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 17 Jan 2018 17:09:59 +0000 (17:09 +0000)
commitba02f4c26b37102ab030aa81d42d8021c81a43ab
tree3a55cb2c9fb41e26120b76c5d48b72c5f8562474
parent3f5b933e60506452ea4f83d8a436607cb1c8fa24
drm/i915/selftests: Wait for the dma-fence timeout

When testing that the timeout fired, we need to be sure we have waited
just long enough for the timeout to have occurred and for the softirq
(on another cpu) to have completed. Sleeping for an arbitrary amount is
prone to error, so wait for the timeout instead and complain if it was
too late.

v2: Use wait_event_timeout to provide an upper bound
v3: Fix inverted check for wait_event_timeout timing out
v4: Restore the check that the fences aren't signalled too early, by
inspecting them before the expected timeout.

References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180117135713.2324-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_sw_fence.c