[igt-dev] [PATCH igt 2/2] tests/gem_ctx_param: Update invalid param
Chris Wilson
chris at chris-wilson.co.uk
Fri Feb 16 13:57:31 UTC 2018
Quoting Chris Wilson (2018-02-16 13:49:51)
> + for (unsigned i = 0; i < size; i++) {
> + int64_t prio = values[i];
> + int expected = 0;
> + int err;
> +
> + arg.value = prio;
> +
> + if (flags & USER &&
> + prio > I915_CONTEXT_DEFAULT_PRIORITY)
> + expected = -EPERM;
> +
> + if (prio < I915_CONTEXT_MIN_USER_PRIORITY ||
> + prio > I915_CONTEXT_MAX_USER_PRIORITY)
> + expected = -EINVAL;
> +
> + err =__gem_context_set_param(fd, &arg);
> + igt_assert_f(err == expected,
> + "Priority requested %" PRId64 ", expected result %d, returned %d\n",
> + prio, expected, err);
> +
> + gem_context_get_param(fd, &arg);
> + if (!err)
> + old_prio = prio;
> + igt_assert_eq(arg.value, old_prio);
Fwiw, I still believe that simply reimplementing^baking the kernel in
userspace does not make for a good test.
-Chris
More information about the igt-dev
mailing list