[igt-dev] [PATCH i-g-t 04/10] tests/syncobj_timeline: add more timeline tests
Chris Wilson
chris at chris-wilson.co.uk
Wed Nov 20 21:33:04 UTC 2019
Quoting Lionel Landwerlin (2019-11-20 21:21:37)
> +struct checker_thread_data {
> + int fd;
> + uint32_t syncobj;
> + bool running;
> + bool started;
> +};
> +
> +static void *
> +checker_thread_func(void *_data)
> +{
> + struct checker_thread_data *data = _data;
> + uint64_t value, last_value = 0;
> +
> + while (data->running) {
while (READ_ONCE(data->running)) {
to make sure gcc does not get too clever (surprisingly it does happen,
but I expect syncobj_timeline_query() to be a treated as a barrier as it
will have a syscall).
> + syncobj_timeline_query(data->fd, &data->syncobj, &value, 1);
> +
> + data->started = true;
> +
> + igt_assert(last_value <= value);
> + last_value = value;
> + }
> +
> + return NULL;
> +}
More information about the igt-dev
mailing list