[PATCH i-g-t v1 1/1] tests/xe_eudebug: check if driver is open before toggling enable

Jan Sokolowski jan.sokolowski at intel.com
Fri Jan 10 12:52:01 UTC 2025


In some cases, ccs_mode_all_engines can fail,
which will cause test fixture to not execute properly
and skip drm_open_driver, thus putting the test
in an unstable state.

Check if driver is open or not and reopen if necessary.

Signed-off-by: Jan Sokolowski <jan.sokolowski at intel.com>
---
 tests/intel/xe_eudebug.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index 22b0da658..6d06ed647 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -2868,7 +2868,16 @@ igt_main
 	}
 
 	igt_fixture {
+		/* in previous subtest group, ccs_mode_all_engines can fail,
+		 * which will cause test fixture to not execute properly
+		 * and skip drm_open_driver, thus putting the test in an unstable state.
+		 * Therefore, check if driver is open or not and reopen if necessary
+		 */
+		if (fcntl(fd, F_GETFD) < 0)
+			fd = drm_open_driver(DRIVER_XE);
+
 		xe_eudebug_enable(fd, was_enabled);
+
 		drm_close_driver(fd);
 	}
 
-- 
2.34.1



More information about the igt-dev mailing list