[igt-dev] [PATCH i-g-t 1/2] xe_pm: Kill display for PM tests

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Mar 28 12:40:43 UTC 2023


Display keeps PM alive, do the minimal initialization to disable
display for the PM tests entirely.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 tests/xe/xe_pm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/xe/xe_pm.c b/tests/xe/xe_pm.c
index 23b8246ed..861f6b915 100644
--- a/tests/xe/xe_pm.c
+++ b/tests/xe/xe_pm.c
@@ -365,6 +365,8 @@ igt_main
 	};
 
 	igt_fixture {
+		drmModeResPtr res;
+
 		memset(&device, 0, sizeof(device));
 		device.fd_xe = drm_open_driver(DRIVER_XE);
 		device.pci_xe = igt_device_get_pci_device(device.fd_xe);
@@ -376,6 +378,17 @@ igt_main
 		xe_for_each_hw_engine(device.fd_xe, hwe)
 			test_exec(device, hwe, 1, 1, NO_SUSPEND, NO_RPM);
 
+		/* Kill display, if it exists */
+		res = drmModeGetResources(device.fd_xe);
+		if (res) {
+			igt_display_t display;
+
+			drmModeFreeResources(res);
+			igt_display_require(&display, device.fd_xe);
+			igt_display_commit2(&display, COMMIT_ATOMIC);
+			igt_display_fini(&display);
+		}
+
 		get_d3cold_allowed(device.pci_xe, d3cold_allowed);
 		igt_assert(igt_setup_runtime_pm(device.fd_xe));
 	}
-- 
2.34.1



More information about the igt-dev mailing list