diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-29 16:52:23 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-29 17:35:21 +0200 |
commit | 04dfa492d195e063a07053815ff541b4351b0097 (patch) | |
tree | bb546606d0439f0a33655e512c972fd8ef143a6b | |
parent | b711bfe54f74c6a4337f978e6bef4c47a2f2ea9e (diff) |
tests/gem_wait_rendering_timeout: test the timeout case
When I've first tried this it somehow failed, but I can't reproduce
this any more. I guess I've hunted a ghost.
-rw-r--r-- | tests/gem_wait_render_timeout.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c index 53ec7d20..904e7839 100644 --- a/tests/gem_wait_render_timeout.c +++ b/tests/gem_wait_render_timeout.c @@ -163,8 +163,6 @@ int main(int argc, char **argv) intel_batchbuffer_flush(batch); ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); - if (do_signals) - drmtest_stop_signal_helper(); if (ret) { fprintf(stderr, "Timed wait failed %s\n", strerror(errno)); exit(EXIT_FAILURE); @@ -178,6 +176,20 @@ int main(int argc, char **argv) printf("Finished with %lu time remaining\n", timeout); } + /* Now check that we correctly time out, twice the auto-tune load should + * be good enough. */ + timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC; + for (i = 0; i < iter*2; i++) + blt_color_fill(batch, dst2, BUF_PAGES); + + intel_batchbuffer_flush(batch); + + ret = gem_bo_wait_timeout(fd, dst2->handle, &timeout); + assert(ret == -ETIME); + assert(timeout == 0); + + if (do_signals) + drmtest_stop_signal_helper(); drm_intel_bo_unreference(dst2); drm_intel_bo_unreference(dst); intel_batchbuffer_free(batch); |