public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_module_load: Add subtest to test with active fd teardown
@ 2026-02-25  9:42 Maarten Lankhorst
  2026-02-25 11:33 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2026-02-25  9:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maarten Lankhorst

Create an evil testcase to ensure we also unload when the device is
still sort of active.

igt_create_fb will create a framebuffer and probably a backing BO,
while I also saw a crash related to property blobs.

This tests that we can teardown with buffer objects,
property blobs and framebuffers on the list.

There should probably be another test for a VM and engine too,
but this should be enough for a first attempt.

Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
 tests/intel/xe_module_load.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tests/intel/xe_module_load.c b/tests/intel/xe_module_load.c
index 0c75c4ebc1..4be7b44482 100644
--- a/tests/intel/xe_module_load.c
+++ b/tests/intel/xe_module_load.c
@@ -91,6 +91,27 @@ static void load_and_check_xe(const char *opts)
 	drm_close_driver(drm_fd);
 }
 
+static void display_opened_unload(void)
+{
+	igt_display_t display;
+	int drm_fd;
+	struct igt_fb fb;
+	uint32_t blob_id;
+
+	/* drm_open_driver loads xe module if needed */
+	drm_fd = drm_open_driver(DRIVER_XE);
+	igt_display_require(&display, drm_fd);
+
+	/* Create a property blob and a FB, hopefully with a separate backing BO */
+	igt_create_fb(drm_fd, 640, 480, DRM_FORMAT_XRGB8888, 0, &fb);
+	igt_assert_eq(0, drmModeCreatePropertyBlob(drm_fd, &fb, sizeof(fb), &blob_id));
+
+	/* Unbind, close, unload, check for booms */
+	igt_kmod_unbind("xe", NULL);
+	drm_close_driver(drm_fd);
+	igt_xe_driver_unload();
+}
+
 static const char * const unwanted_drivers[] = {
 	"xe",
 	"i915",
@@ -107,6 +128,9 @@ static const char * const unwanted_drivers[] = {
  * SUBTEST: unload
  * Description: Unload the Xe driver
  *
+ * SUBTEST: display-opened-unload
+ * Description: Test behavior of xe driver unloading while fd is still opened.
+ *
  * SUBTEST: reload
  * Description: Reload the Xe driver
  *
@@ -132,6 +156,10 @@ int igt_main()
 		igt_xe_driver_unload();
 	}
 
+	igt_subtest("display-opened-unload") {
+		display_opened_unload();
+	}
+
 	igt_subtest("force-load") {
 		for (int i = 0; unwanted_drivers[i] != NULL; i++) {
 			igt_intel_driver_unload(unwanted_drivers[i]);
-- 
2.51.0


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

end of thread, other threads:[~2026-03-10 14:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25  9:42 [PATCH i-g-t] tests/intel/xe_module_load: Add subtest to test with active fd teardown Maarten Lankhorst
2026-02-25 11:33 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-02-25 12:03 ` ✗ i915.CI.BAT: failure " Patchwork
2026-02-25 16:25 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-26  0:06 ` ✗ Xe.CI.BAT: failure for tests/intel/xe_module_load: Add subtest to test with active fd teardown (rev2) Patchwork
2026-02-26  0:37 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-26  2:39 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-10 14:14 ` [PATCH i-g-t] tests/intel/xe_module_load: Add subtest to test with active fd teardown Thomas Hellström

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