[PATCH i-g-t 4/9] tests/kms_dp_aux_dev: Test cleanup

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Jun 10 16:34:52 UTC 2024


Make sure the below points in IGT cleanup:

 - Sanitize the state before starting the subtest.
 - Clear the states before exiting the subtest.
 - Update existing libdrm APIs with IGT kms APIs.
 - Other misc (Ex: update deprecated APIs/macros/enums, FB leaks etc..)

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_dp_aux_dev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/kms_dp_aux_dev.c b/tests/kms_dp_aux_dev.c
index 3e1d8be3a..7e1d52254 100644
--- a/tests/kms_dp_aux_dev.c
+++ b/tests/kms_dp_aux_dev.c
@@ -152,15 +152,19 @@ igt_simple_main
 	drmModeRes *res;
 	int drm_fd;
 
-	drm_fd = drm_open_driver_master(DRIVER_ANY);
+	igt_fixture {
+		drm_fd = drm_open_driver_master(DRIVER_ANY);
 
-	res = drmModeGetResources(drm_fd);
-	igt_require(res);
+		res = drmModeGetResources(drm_fd);
+		igt_require(res);
+	}
 
 	for (int i = 0; i < res->count_connectors; i++)
 		valid_connectors += test(drm_fd, res->connectors[i]);
 	igt_require(valid_connectors);
 
-	drmModeFreeResources(res);
-	drm_close_driver(drm_fd);
+	igt_fixture {
+		drmModeFreeResources(res);
+		drm_close_driver(drm_fd);
+	}
 }
-- 
2.43.2



More information about the igt-dev mailing list