Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Subject: [PATCH i-g-t 4/9] tests/kms_dp_aux_dev: Test cleanup
Date: Mon, 10 Jun 2024 22:04:52 +0530	[thread overview]
Message-ID: <20240610163457.3711476-5-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240610163457.3711476-1-bhanuprakash.modem@intel.com>

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@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


  parent reply	other threads:[~2024-06-10 16:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 16:34 [PATCH i-g-t 0/9] IGT KMS Test cleanup Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 1/9] tests/intel/kms_fence_pin_leak: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 2/9] tests/intel/kms_pipe_b_c_ivb: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 3/9] tests/intel/kms_pwrite_crc: " Bhanuprakash Modem
2024-06-10 16:34 ` Bhanuprakash Modem [this message]
2024-06-10 16:34 ` [PATCH i-g-t 5/9] tests/kms_hdmi_inject: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 6/9] tests/kms_tiled_display: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 7/9] tests/kms_tv_load_detect: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 8/9] tests/kms_universal_plane: " Bhanuprakash Modem
2024-06-10 16:34 ` [PATCH i-g-t 9/9] tests/kms_properties: Create dynamic subtests Bhanuprakash Modem
2024-06-10 17:14 ` ✓ CI.xeBAT: success for IGT KMS Test cleanup Patchwork
2024-06-10 17:25 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-06-10 18:19 ` ✗ CI.xeFULL: " Patchwork

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=20240610163457.3711476-5-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --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