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

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

 



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

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Michał Winiarski <michal.winiarski@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux