[igt-dev] [PATCH i-g-t 3/4] tests/gen7_exec_parse: Add tests for longer LRIs

Mika Kuoppala mika.kuoppala at linux.intel.com
Mon Aug 17 12:01:48 UTC 2020


Test that reg/value pair inside a longer stream
is handled correctly.

Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
---
 tests/i915/gen7_exec_parse.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/i915/gen7_exec_parse.c b/tests/i915/gen7_exec_parse.c
index 91a72c7c..39bb1c4e 100644
--- a/tests/i915/gen7_exec_parse.c
+++ b/tests/i915/gen7_exec_parse.c
@@ -405,6 +405,26 @@ static void hsw_load_register_reg(void)
 		0xffffffff, /* value */
 		MI_BATCH_BUFFER_END,
 	};
+	uint32_t do_lri_long_middle[16] = {
+		MI_LOAD_REGISTER_IMM | (7 - 2),
+		HSW_CS_GPR0,
+		0,
+		0, /* [3] = dst */
+		0xffffffff,
+		HSW_CS_GPR0,
+		0,
+		MI_BATCH_BUFFER_END,
+	};
+	uint32_t do_lri_long_end[16] = {
+		MI_LOAD_REGISTER_IMM | (7 - 2),
+		HSW_CS_GPR0,
+		0,
+		HSW_CS_GPR0,
+		0,
+		0, /* [5] = dst */
+		0xffffffff,
+		MI_BATCH_BUFFER_END,
+	};
 	uint32_t allowed_regs[] = {
 		HSW_CS_GPR1,
 		SO_WRITE_OFFSET_0,
@@ -496,6 +516,22 @@ static void hsw_load_register_reg(void)
 			   I915_EXEC_RENDER,
 			   bad_lrr_errno);
 
+		igt_debug("Testing disallowed long lri middle 0x%08x\n",
+			  disallowed_regs[i]);
+		do_lri_long_middle[3] = disallowed_regs[i];
+		exec_batch(fd, handle,
+			   do_lri_long_middle, sizeof(do_lri_long_middle),
+			   I915_EXEC_RENDER,
+			   bad_lrr_errno);
+
+		igt_debug("Testing disallowed long lri end 0x%08x\n",
+			  disallowed_regs[i]);
+		do_lri_long_end[5] = disallowed_regs[i];
+		exec_batch(fd, handle,
+			   do_lri_long_end, sizeof(do_lri_long_end),
+			   I915_EXEC_RENDER,
+			   bad_lrr_errno);
+
 		exec_batch_patched(fd, handle,
 				   store_gpr0, sizeof(store_gpr0),
 				   2 * sizeof(uint32_t), /* reloc */
-- 
2.17.1



More information about the igt-dev mailing list