From: Maarten Lankhorst <dev@lankhorst.se>
To: igt-dev@lists.freedesktop.org
Cc: Maarten Lankhorst <dev@lankhorst.se>
Subject: [PATCH i-g-t] tests/intel/xe_module_load: Add subtest to test with active fd teardown
Date: Wed, 25 Feb 2026 10:42:56 +0100 [thread overview]
Message-ID: <20260225094255.10335-2-dev@lankhorst.se> (raw)
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
next reply other threads:[~2026-02-25 9:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 9:42 Maarten Lankhorst [this message]
2026-02-25 11:33 ` ✓ Xe.CI.BAT: success for tests/intel/xe_module_load: Add subtest to test with active fd teardown 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260225094255.10335-2-dev@lankhorst.se \
--to=dev@lankhorst.se \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox