[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:27:57 UTC 2017


Quoting Jason Ekstrand (2017-08-10 06:35:43)
> +igt_main
> +{
> +       int fd;
> +
> +       igt_fixture {
> +               fd = drm_open_driver(DRIVER_ANY);

DRIVER_ANY | DRIVER_VGEM

(ANY really means KMS)

> +               igt_require(has_syncobj_wait(fd));
> +               igt_require_sw_sync();

We should add something like

igt_require(has_timer_resolution(CLOCK_MONOTONIC, SHORT_TIME_NSEC / 2));

static bool has_timer_resolution(clockid_t clk, uint64_t target_ns)
{
	struct timespec res;

	if (clock_getres(clk, &res))
		return false; /* clock unavailable */

	return res.tv_sec * NSEC_PER_SEC + res.tv_nsec <= target_ns;
}

That'll rule out testing on pnv most likely.
-Chris


More information about the Intel-gfx mailing list