public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_exec_reset: Add spin-deadline section
@ 2026-01-05  3:53 Matthew Brost
  2026-01-05  4:49 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matthew Brost @ 2026-01-05  3:53 UTC (permalink / raw)
  To: igt-dev

Add a spin-deadline test section that sets deadlines on fences, thereby
triggering the internal KMD deadline logic. The test does not assert
deadline behavior directly; instead, ftrace can be enabled to infer the
expected KMD behavior.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 tests/intel/xe_exec_reset.c | 44 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index a3c4b2d7ba..0e07ff5ccf 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c
@@ -27,14 +27,37 @@
 #include <string.h>
 
 #define SYNC_OBJ_SIGNALED	(0x1 << 0)
+#define DEADLINE		(0x1 << 1)
 #define LEGACY_MODE_ADDR	0x1a0000
 
+static uint64_t now_monotonic_nsec(void)
+{
+	struct timespec ts;
+
+	clock_gettime(CLOCK_MONOTONIC, &ts);
+
+	return (uint64_t)ts.tv_sec * 1000000000ull + ts.tv_nsec;
+}
+
+static uint64_t deadline_in_10ms(void)
+{
+	return now_monotonic_nsec() + 10ull * 1000 * 1000;
+}
+
+static uint64_t deadline_in_5ms(void)
+{
+	return now_monotonic_nsec() + 5ull * 1000 * 1000;
+}
+
 /**
  * SUBTEST: spin
  * Description: test spin
  *
  * SUBTEST: spin-signaled
  * Description: test spin with signaled sync obj
+ *
+ * SUBTEST: spin-deadline
+ * Description: test spin with a deadline
  */
 static void test_spin(int fd, struct drm_xe_engine_class_instance *eci,
 		      unsigned int flags)
@@ -87,8 +110,23 @@ static void test_spin(int fd, struct drm_xe_engine_class_instance *eci,
 		xe_exec(fd, &exec);
 
 		xe_spin_wait_started(spin);
-		usleep(50000);
 		igt_assert(!syncobj_wait(fd, &syncobj, 1, 1, 0, NULL));
+
+		if (flags & DEADLINE) {
+			struct drm_syncobj_wait args = {
+				.handles = to_user_pointer(&syncobj),
+				.count_handles = 1,
+				.deadline_nsec = deadline_in_10ms(),
+				.flags = DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE,
+			};
+
+			__syncobj_wait(fd, &args);
+
+			args.deadline_nsec = deadline_in_5ms();
+			__syncobj_wait(fd, &args);
+		}
+
+		usleep(50000);
 		xe_spin_end(spin);
 
 		igt_assert(syncobj_wait(fd, &syncobj, 1, INT64_MAX, 0, NULL));
@@ -792,6 +830,10 @@ igt_main
 		xe_for_each_engine(fd, hwe)
 			test_spin(fd, hwe, 0);
 
+	igt_subtest("spin-deadline")
+		xe_for_each_engine(fd, hwe)
+			test_spin(fd, hwe, DEADLINE);
+
 	igt_subtest("spin-signaled")
 		xe_for_each_engine(fd, hwe)
 			test_spin(fd, hwe, SYNC_OBJ_SIGNALED);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-05  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05  3:53 [PATCH] tests/intel/xe_exec_reset: Add spin-deadline section Matthew Brost
2026-01-05  4:49 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-01-05  4:58 ` ✓ i915.CI.BAT: " Patchwork
2026-01-05  6:11 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-05  7:06 ` ✗ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox