[Intel-gfx] [PATCH igt 1/2] tests/syncobj_wait: Replace open-coded calls to __syncobj_wait()
Chris Wilson
chris at chris-wilson.co.uk
Tue Oct 10 17:19:09 UTC 2017
Remove the bare igt_ioctl(SYNCOBJ_WAIT) in favour of __syncobj_wait()
for tidier error reporting.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Jason Ekstrand <jason at jlekstrand.net>
Cc: Dave Airlie <airlied at redhat.com>
---
tests/syncobj_wait.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
index 385d8cd8..78ed1fc5 100644
--- a/tests/syncobj_wait.c
+++ b/tests/syncobj_wait.c
@@ -713,7 +713,7 @@ test_wait_interrupted(int fd, uint32_t test_flags)
{
struct local_syncobj_wait wait = { 0 };
uint32_t syncobj = syncobj_create(fd, 0);
- int ret, timeline;
+ int timeline;
wait.handles = to_user_pointer(&syncobj);
wait.count_handles = 1;
@@ -721,20 +721,16 @@ test_wait_interrupted(int fd, uint32_t test_flags)
if (test_flags & WAIT_FOR_SUBMIT) {
wait.timeout_nsec = short_timeout();
- igt_while_interruptible(true) {
- ret = igt_ioctl(fd, LOCAL_IOCTL_SYNCOBJ_WAIT, &wait);
- igt_assert(ret == -1 && errno == ETIME);
- }
+ igt_while_interruptible(true)
+ igt_assert_eq(__syncobj_wait(fd, &wait), -ETIME);
}
timeline = syncobj_attach_sw_sync(fd, syncobj);
close(timeline);
wait.timeout_nsec = short_timeout();
- igt_while_interruptible(true) {
- ret = igt_ioctl(fd, LOCAL_IOCTL_SYNCOBJ_WAIT, &wait);
- igt_assert(ret == -1 && errno == ETIME);
- }
+ igt_while_interruptible(true)
+ igt_assert_eq(__syncobj_wait(fd, &wait), -ETIME);
syncobj_destroy(fd, syncobj);
}
--
2.15.0.rc0
More information about the Intel-gfx
mailing list