[igt-dev] [PATCH i-g-t] tests/i915/gem_ctx_param: Test that you can only set the VM once

Daniel Vetter daniel.vetter at ffwll.ch
Mon Jul 12 15:28:28 UTC 2021


On Sat, Jul 10, 2021 at 11:19 PM Jason Ekstrand <jason at jlekstrand.net> wrote:
> We're about to add this restriction to i915 so we should test for it
> explicitly.
>
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  tests/i915/gem_ctx_param.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/tests/i915/gem_ctx_param.c b/tests/i915/gem_ctx_param.c
> index c795f1b45..3b79a3e5e 100644
> --- a/tests/i915/gem_ctx_param.c
> +++ b/tests/i915/gem_ctx_param.c
> @@ -188,6 +188,15 @@ static void test_vm(int i915)
>         gem_vm_destroy(i915, arg.value);
>         igt_assert_eq(err, -EINVAL);
>
> +       /* Test that we can't set the VM twice */
> +       arg.ctx_id = gem_context_create(i915);
> +       arg.value = gem_vm_create(i915);
> +       gem_context_set_param(i915, &arg);
> +       err = __gem_context_set_param(i915, &arg);
> +       gem_vm_destroy(i915, arg.value);
> +       gem_context_destroy(i915, arg.ctx_id);
> +       igt_assert_eq(err, -EINVAL);
> +
>         /* Test that we can't set the VM after we've done an execbuf */
>         arg.ctx_id = gem_context_create(i915);
>         spin = igt_spin_new(i915, .ctx_id = arg.ctx_id);
> --
> 2.31.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the igt-dev mailing list