[igt-dev] [PATCH i-g-t] tests/i915/gem_ctx_param: Test that you can only set the VM once
Jason Ekstrand
jason at jlekstrand.net
Sat Jul 10 21:19:23 UTC 2021
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>
---
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
More information about the igt-dev
mailing list