mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
tests/gem_wait_rendering_timeout: check polling behaviour
... with timeout=0. We have special code in the kernel to optimize that one.
This commit is contained in:
parent
b8e00110a0
commit
a35dcac0ff
@ -180,15 +180,18 @@ int main(int argc, char **argv)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
assert(gem_bo_busy(fd, dst2->handle) == false);
|
assert(gem_bo_busy(fd, dst2->handle) == false);
|
||||||
|
|
||||||
assert(timeout != 0);
|
assert(timeout != 0);
|
||||||
|
|
||||||
if (timeout == (ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC))
|
if (timeout == (ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC))
|
||||||
printf("Buffer was already done!\n");
|
printf("Buffer was already done!\n");
|
||||||
else {
|
else {
|
||||||
printf("Finished with %lu time remaining\n", timeout);
|
printf("Finished with %lu time remaining\n", timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check that polling with timeout=0 works. */
|
||||||
|
timeout = 0;
|
||||||
|
assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == 0);
|
||||||
|
assert(timeout == 0);
|
||||||
|
|
||||||
/* Now check that we correctly time out, twice the auto-tune load should
|
/* Now check that we correctly time out, twice the auto-tune load should
|
||||||
* be good enough. */
|
* be good enough. */
|
||||||
timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC;
|
timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC;
|
||||||
@ -202,6 +205,12 @@ int main(int argc, char **argv)
|
|||||||
assert(timeout == 0);
|
assert(timeout == 0);
|
||||||
assert(gem_bo_busy(fd, dst2->handle) == true);
|
assert(gem_bo_busy(fd, dst2->handle) == true);
|
||||||
|
|
||||||
|
/* check that polling with timeout=0 works. */
|
||||||
|
timeout = 0;
|
||||||
|
assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == -ETIME);
|
||||||
|
assert(timeout == 0);
|
||||||
|
|
||||||
|
|
||||||
if (do_signals)
|
if (do_signals)
|
||||||
drmtest_stop_signal_helper();
|
drmtest_stop_signal_helper();
|
||||||
drm_intel_bo_unreference(dst2);
|
drm_intel_bo_unreference(dst2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user