[Intel-gfx] [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)
Chris Wilson
chris at chris-wilson.co.uk
Thu Aug 10 09:50:11 UTC 2017
Quoting Jason Ekstrand (2017-08-10 06:35:43)
> +static void
> +test_single_wait(int fd, uint32_t test_flags, int expect)
> +{
> + uint32_t syncobj = syncobj_create(fd);
> + uint32_t flags = 0;
> + int timeline;
> +
> + if (test_flags & WAIT_FOR_SUBMIT)
> + flags |= LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT;
> +
> + if (test_flags & WAIT_ALL)
> + flags |= LOCAL_SYNCOBJ_WAIT_FLAGS_WAIT_ALL;
> +
> + if (test_flags & (WAIT_SUBMITTED | WAIT_SIGNALED))
> + timeline = syncobj_attach_sw_sync(fd, syncobj);
> +
> + if (test_flags & WAIT_SIGNALED)
> + sw_sync_timeline_inc(timeline, 1);
> +
> + igt_assert_eq(syncobj_wait_err(fd, &syncobj, 1, 0, flags), expect);
> +
> + igt_assert_eq(syncobj_wait_err(fd, &syncobj, 1, short_timeout(),
> + flags), expect);
> +
> + if (expect != -ETIME) {
> + igt_assert_eq(syncobj_wait_err(fd, &syncobj, 1, UINT64_MAX,
> + flags), expect);
Won't this fail in 6000 years time... Perhaps not an issue, but
maximum duration is gettime_ns() + INT64_MAX (and these tests serve as
part of the ABI guide / documentation as well as checking the contract).
We don't have an encoding for an infinite wait, I guess several millennia
will just have to do.
-Chris
More information about the Intel-gfx
mailing list