Re: [PATCH igt 2/2] tests/gem_ctx_param: Update invalid param

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

 



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
_______________________________________________
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