[igt-dev] [PATCH i-g-t] i915/gem_ctx_isolation: Check nonpriv values are kept across switch

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 26 18:23:35 UTC 2019


Verify that the values we store in our nonpriv context image registers
are restored after a switch.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski at intel.com>
---
 tests/i915/gem_ctx_isolation.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
index c4302394e..5be32d60c 100644
--- a/tests/i915/gem_ctx_isolation.c
+++ b/tests/i915/gem_ctx_isolation.c
@@ -579,6 +579,17 @@ static void nonpriv(int fd,
 			  __func__, v, values[v]);
 		write_regs(fd, ctx, e, flags, values[v]);
 
+		if (flags & DIRTY2) {
+			uint32_t sw = gem_context_create(fd);
+
+			igt_spin_free(fd,
+				      igt_spin_new(fd,
+						   .ctx = sw,
+						   .engine = engine));
+
+			gem_context_destroy(fd, sw);
+		}
+
 		regs[1] = read_regs(fd, ctx, e, flags);
 
 		/*
@@ -838,6 +849,8 @@ igt_main
 
 			igt_subtest_f("%s-nonpriv", e->name)
 				nonpriv(fd, e, 0);
+			igt_subtest_f("%s-nonpriv-switch", e->name)
+				nonpriv(fd, e, DIRTY2);
 
 			igt_subtest_f("%s-clean", e->name)
 				isolation(fd, e, 0);
-- 
2.23.0



More information about the igt-dev mailing list