diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-06 08:37:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-06 08:50:19 +0000 |
commit | e23accf43753055430064fa02efe7d33ab11564f (patch) | |
tree | 2cb1646c3c931d842768759364ab46b958e2dacd /tests/gem_wait.c | |
parent | 15559e6cb613fe152f71471643de0ac0c12332d4 (diff) |
igt/gem_wait: Test negative timeouts
The user should be able to specify a negative timeout to indefinitely
wait upon a bo becoming idle.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_wait.c')
-rw-r--r-- | tests/gem_wait.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/gem_wait.c b/tests/gem_wait.c index 515f7f67..67317ddf 100644 --- a/tests/gem_wait.c +++ b/tests/gem_wait.c @@ -111,6 +111,7 @@ static void render_timeout(int fd) drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int64_t timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; + int64_t negative_timeout = -1; int ret; const bool do_signals = true; /* signals will seem to make the operation * use less process CPU time */ @@ -206,6 +207,17 @@ static void render_timeout(int fd) igt_assert_eq(timeout, 0); + /* Now check that we can pass negative (infinite) timeouts. */ + negative_timeout = -1; + for (i = 0; i < iter; i++) + blt_color_fill(batch, dst2, BUF_PAGES); + + intel_batchbuffer_flush(batch); + + igt_assert_eq(gem_bo_wait_timeout(fd, dst2->handle, &negative_timeout), 0); + igt_assert_eq(negative_timeout, 0); + igt_assert(gem_bo_busy(fd, dst2->handle) == false); + if (do_signals) igt_stop_signal_helper(); drm_intel_bo_unreference(dst2); |