Re: [PATCH i-g-t 4/4] tests/syncobj: Add some wait and reset tests (v5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux