[PATCH 39/66] tests/xe_exec_sip: Check if we reset due to unhandled attention

Christoph Manszewski christoph.manszewski at intel.com
Mon Jul 29 16:01:32 UTC 2024


From: Dominik Grzegorzek <dominik.grzegorzek at intel.com>

Add breakpoint-waitsip test which checks whether we reset upon
unhandled attention.

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Cc: Christoph Manszewski <christoph.manszewski at intel.com>
---
 tests/intel/xe_exec_sip.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_exec_sip.c b/tests/intel/xe_exec_sip.c
index e52889818..1b0accb3b 100644
--- a/tests/intel/xe_exec_sip.c
+++ b/tests/intel/xe_exec_sip.c
@@ -40,6 +40,7 @@
 #define SHADER_WAIT 2
 #define SIP_WRITE 3
 #define SIP_NULL 4
+#define SIP_WAIT 5
 
 static struct intel_buf *
 create_fill_buf(int fd, int width, int height, uint8_t color)
@@ -97,7 +98,9 @@ static struct gpgpu_shader *get_sip(int fd, const int siptype,
 	switch (siptype) {
 	case SIP_WRITE:
 		break;
-	/* TODO: Add alternative SIP instructions here */
+	case SIP_WAIT:
+		gpgpu_shader__wait(sip);
+		break;
 	}
 
 	gpgpu_shader__end_system_routine(sip, shadertype == SHADER_BREAKPOINT);
@@ -211,12 +214,20 @@ xe_sysfs_get_job_timeout_ms(int fd, struct drm_xe_engine_class_instance *eci)
  * SUBTEST: breakpoint-writesip
  * Description: Test that we enter SIP after hitting breakpoint in shader.
  *
+ * SUBTEST: breakpoint-waitsip
+ * Description: Test that we reset after seeing the attention without the debugger.
+ *
  */
 static void test_sip(int shader, int sip, struct drm_xe_engine_class_instance *eci)
 {
 	unsigned int threads = 512;
 	unsigned int height = max_t(threads, HEIGHT, threads * 2);
 	unsigned int width = WIDTH;
+	struct drm_xe_ext_set_property ext = {
+		.base.name = DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY,
+		.property = DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG,
+		.value = DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE,
+	};
 	struct timespec ts = { };
 	uint32_t exec_queue_id, handle, vm_id;
 	struct intel_bb *ibb;
@@ -228,6 +239,7 @@ static void test_sip(int shader, int sip, struct drm_xe_engine_class_instance *e
 	fd = drm_open_driver(DRIVER_XE);
 	xe_device_get(fd);
 
+
 	vm_id = xe_vm_create(fd, 0, 0);
 
 	/* Get timeout for job, and add 4s to ensure timeout processes in subtest. */
@@ -235,7 +247,9 @@ static void test_sip(int shader, int sip, struct drm_xe_engine_class_instance *e
 	timeout *= NSEC_PER_MSEC;
 	timeout *= igt_run_in_simulation() ? 10 : 1;
 
-	exec_queue_id = xe_exec_queue_create(fd, vm_id, eci, 0);
+	exec_queue_id = xe_exec_queue_create(fd, vm_id, eci,
+					     has_debugger(fd) ?
+					     to_user_pointer(&ext) : 0);
 	ibb = intel_bb_create_with_context(fd, exec_queue_id, vm_id, NULL, 4096);
 
 	igt_nsec_elapsed(&ts);
@@ -292,6 +306,9 @@ igt_main
 
 		test_render_and_compute("breakpoint-writesip", fd, eci)
 			test_sip(SHADER_BREAKPOINT, SIP_WRITE, eci);
+
+		test_render_and_compute("breakpoint-waitsip", fd, eci)
+			test_sip(SHADER_BREAKPOINT, SIP_WAIT, eci);
 	}
 
 	igt_fixture
-- 
2.34.1



More information about the igt-dev mailing list