[igt-dev] [PATCH i-g-t 3/4] lib: Clear displays on finish before process exit

Swati Sharma swati2.sharma at intel.com
Fri Jun 9 13:20:18 UTC 2023


From: Chris Wilson <chris.p.wilson at intel.com>

As we want to check for resource leaks at process exit, we want to
release all resources allocated during the test. This includes the
kernel objects being used for scanout by igt_display, so reset the
display on exit.

Signed-off-by: Chris Wilson <chris.p.wilson at intel.com>
Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
---
 lib/igt_kms.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5341c637..089a4f0b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3001,6 +3001,9 @@ void igt_display_fini(igt_display_t *display)
 	if (is_xe_device(drm_fd))
 		xe_device_put(drm_fd);
 
+	igt_display_reset(display);
+	igt_display_commit(display);
+
 	for (i = 0; i < display->n_planes; ++i) {
 		igt_plane_t *plane = &display->planes[i];
 
-- 
2.25.1



More information about the igt-dev mailing list