[PATCH i-g-t v2 43/66] tests/xe_exec_sip: Add sanity-after-timeout test

Christoph Manszewski christoph.manszewski at intel.com
Tue Jul 30 11:45:00 UTC 2024


From: Karolina Stolarek <karolina.stolarek at intel.com>

Introduce sanity-after-timeout test to check if the shader
gets executed after a hang.

Signed-off-by: Karolina Stolarek <karolina.stolarek at intel.com>
Cc: Christoph Manszewski <christoph.manszewski at intel.com>
Cc: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>
---
 tests/intel/xe_exec_sip.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_exec_sip.c b/tests/intel/xe_exec_sip.c
index 7b4305576..92da8f14d 100644
--- a/tests/intel/xe_exec_sip.c
+++ b/tests/intel/xe_exec_sip.c
@@ -38,9 +38,10 @@
 #define SHADER_BREAKPOINT 0
 #define SHADER_WRITE 1
 #define SHADER_WAIT 2
-#define SIP_WRITE 3
-#define SIP_NULL 4
-#define SIP_WAIT 5
+#define SHADER_HANG 3
+#define SIP_WRITE 4
+#define SIP_NULL 5
+#define SIP_WAIT 6
 
 #define F_SUBMIT_TWICE	(1 << 0)
 
@@ -71,6 +72,11 @@ static struct gpgpu_shader *get_shader(int fd, const int shadertype)
 	gpgpu_shader__write_dword(shader, SHADER_CANARY, 0);
 
 	switch (shadertype) {
+	case SHADER_HANG:
+		gpgpu_shader__label(shader, 0);
+		gpgpu_shader__nop(shader);
+		gpgpu_shader__jump(shader, 0);
+		break;
 	case SHADER_WAIT:
 		gpgpu_shader__wait(shader);
 		break;
@@ -255,6 +261,9 @@ xe_sysfs_get_job_timeout_ms(int fd, struct drm_xe_engine_class_instance *eci)
  * Description: check basic shader with write operation
  * Run type: BAT
  *
+ * SUBTEST: sanity-after-timeout
+ * Description: check basic shader execution after job timeout
+ *
  * SUBTEST: wait-writesip-nodebug
  * Description: verify that we don't enter SIP after wait with debugging disabled.
  *
@@ -342,6 +351,15 @@ igt_main
 	test_render_and_compute("sanity", fd, eci)
 		test_sip(SHADER_WRITE, SIP_NULL, eci, 0);
 
+	test_render_and_compute("sanity-after-timeout", fd, eci) {
+		test_sip(SHADER_HANG, SIP_NULL, eci, 0);
+
+		xe_for_each_engine(fd, eci)
+			if (eci->engine_class == DRM_XE_ENGINE_CLASS_RENDER ||
+			    eci->engine_class == DRM_XE_ENGINE_CLASS_COMPUTE)
+				test_sip(SHADER_WRITE, SIP_NULL, eci, 0);
+	}
+
 	/* Debugger disabled (TD_CTL not set) */
 	igt_subtest_group {
 		igt_fixture {
-- 
2.34.1



More information about the igt-dev mailing list