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, kamil.konieczny@linux.intel.com,
	janga.rahul.kumar@intel.com
Subject: [igt-dev] [i-g-t 09/20] tests/amdgpu: Use drm_close_driver() to close the drm fd
Date: Tue, 16 May 2023 22:20:47 +0530	[thread overview]
Message-ID: <20230516165058.4047595-10-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230516165058.4047595-1-bhanuprakash.modem@intel.com>

To close the drm file descriptor, use igt helper drm_close_driver()
instead of using close().

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/amdgpu/amd_basic.c       | 2 +-
 tests/amdgpu/amd_cs_nop.c      | 2 +-
 tests/amdgpu/amd_deadlock.c    | 2 +-
 tests/amdgpu/amd_info.c        | 2 +-
 tests/amdgpu/amd_module_load.c | 2 +-
 tests/amdgpu/amd_prime.c       | 6 +++---
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/amdgpu/amd_basic.c b/tests/amdgpu/amd_basic.c
index 38525a85e..f7d7f036f 100644
--- a/tests/amdgpu/amd_basic.c
+++ b/tests/amdgpu/amd_basic.c
@@ -696,6 +696,6 @@ igt_main
 
 	igt_fixture {
 		amdgpu_device_deinitialize(device);
-		close(fd);
+		drm_close_driver(fd);
 	}
 }
diff --git a/tests/amdgpu/amd_cs_nop.c b/tests/amdgpu/amd_cs_nop.c
index ea3f6aae8..323c1b16a 100644
--- a/tests/amdgpu/amd_cs_nop.c
+++ b/tests/amdgpu/amd_cs_nop.c
@@ -239,6 +239,6 @@ igt_main
 	igt_fixture {
 		amdgpu_cs_ctx_free(context);
 		amdgpu_device_deinitialize(device);
-		close(fd);
+		drm_close_driver(fd);
 	}
 }
diff --git a/tests/amdgpu/amd_deadlock.c b/tests/amdgpu/amd_deadlock.c
index df650c921..d805b8d18 100644
--- a/tests/amdgpu/amd_deadlock.c
+++ b/tests/amdgpu/amd_deadlock.c
@@ -118,6 +118,6 @@ igt_main
 
 	igt_fixture {
 		amdgpu_device_deinitialize(device);
-		close(fd);
+		drm_close_driver(fd);
 	}
 }
diff --git a/tests/amdgpu/amd_info.c b/tests/amdgpu/amd_info.c
index d6aea827b..c1137ab4d 100644
--- a/tests/amdgpu/amd_info.c
+++ b/tests/amdgpu/amd_info.c
@@ -154,6 +154,6 @@ igt_main
 
 	igt_fixture {
 		amdgpu_device_deinitialize(dev);
-		close(fd);
+		drm_close_driver(fd);
 	}
 }
diff --git a/tests/amdgpu/amd_module_load.c b/tests/amdgpu/amd_module_load.c
index 77df96d50..cbc9106f6 100644
--- a/tests/amdgpu/amd_module_load.c
+++ b/tests/amdgpu/amd_module_load.c
@@ -54,7 +54,7 @@ static void sanity_check(void)
 		err = -errno;
 
 	igt_set_timeout(0, NULL);
-	close(fd);
+	drm_close_driver(fd);
 
 	igt_assert_eq(err, 0);
 }
diff --git a/tests/amdgpu/amd_prime.c b/tests/amdgpu/amd_prime.c
index 62924f15b..6916c3173 100644
--- a/tests/amdgpu/amd_prime.c
+++ b/tests/amdgpu/amd_prime.c
@@ -166,7 +166,7 @@ static void amd_plug(amdgpu_device_handle device, struct cork *c)
 static void unplug(struct cork *c)
 {
 	vgem_fence_signal(c->device, c->fence);
-	close(c->device);
+	drm_close_driver(c->device);
 }
 
 static void i915_to_amd(int i915, int amd, amdgpu_device_handle device)
@@ -461,7 +461,7 @@ igt_main
 
 	igt_fixture {
 		amdgpu_device_deinitialize(device);
-		close(amd);
-		close(i915);
+		drm_close_driver(amd);
+		drm_close_driver(i915);
 	}
 }
-- 
2.40.0

  parent reply	other threads:[~2023-05-16 16:56 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 16:50 [igt-dev] [i-g-t 00/20] XE test cleanup to handle xe_device Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 01/20] lib: Interface to close the drm fd Bhanuprakash Modem
2023-05-18 18:51   ` Zbigniew Kempczyński
2023-05-18 18:54   ` Zbigniew Kempczyński
2023-05-19 15:09   ` [igt-dev] [i-g-t V3 " Bhanuprakash Modem
2023-05-22 11:16     ` Zbigniew Kempczyński
2023-05-16 16:50 ` [igt-dev] [i-g-t 02/20] lib: Cache xe_device at driver open/close level Bhanuprakash Modem
2023-05-18 18:46   ` Zbigniew Kempczyński
2023-05-16 16:50 ` [igt-dev] [i-g-t 03/20] lib/xe/xe_query: Add xe_config() interface Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 04/20] lib/igt_msm: Use drm_close_driver() to close the drm fd Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 05/20] tests/amdgpu: Close the fd before exit Bhanuprakash Modem
2023-06-14 12:39   ` Kamil Konieczny
2023-06-15  0:14     ` vitaly prosyak
2023-06-15  4:46       ` Modem, Bhanuprakash
2023-06-15  7:13         ` Christian König
2023-06-15  8:28           ` Modem, Bhanuprakash
2023-06-15  8:43             ` Christian König
2023-06-15 11:48               ` Kamil Konieczny
2023-06-15 12:03                 ` Christian König
2023-05-16 16:50 ` [igt-dev] [i-g-t 06/20] tests/i915: " Bhanuprakash Modem
2023-05-18 18:58   ` Zbigniew Kempczyński
2023-05-22  5:27     ` Modem, Bhanuprakash
2023-05-22 11:21       ` Zbigniew Kempczyński
2023-05-22 12:33         ` Modem, Bhanuprakash
2023-05-22 15:23           ` Zbigniew Kempczyński
2023-05-16 16:50 ` [igt-dev] [i-g-t 07/20] tests/nouveau_crc: " Bhanuprakash Modem
2023-05-16 20:14   ` Lyude Paul
2023-05-16 16:50 ` [igt-dev] [i-g-t 08/20] tests/xe/xe_gpgpu_fill: " Bhanuprakash Modem
2023-05-18 19:15   ` Kumar, Janga Rahul
2023-05-16 16:50 ` Bhanuprakash Modem [this message]
2023-06-14 12:38   ` [igt-dev] [i-g-t 09/20] tests/amdgpu: Use drm_close_driver() to close the drm fd Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 10/20] tests/i915/kms_mmap_write_crc: Avoid closing the closed fd Bhanuprakash Modem
2023-05-24  8:00   ` Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 11/20] tests/panfrost: Use drm_close_driver() to close the drm fd Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 12/20] tests/v3d: " Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 13/20] tests/vc4: " Bhanuprakash Modem
2023-05-16 16:50 ` [igt-dev] [i-g-t 14/20] tests/vmwgfx: " Bhanuprakash Modem
2023-05-17 19:55   ` "Maaz Mombasawala (VMware)
2023-05-16 16:50 ` [igt-dev] [i-g-t 15/20] tests/kms: " Bhanuprakash Modem
2023-05-24  9:02   ` Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 16/20] tests/xe: " Bhanuprakash Modem
2023-05-18 19:14   ` Kumar, Janga Rahul
2023-05-16 16:50 ` [igt-dev] [i-g-t 17/20] tests/i915: " Bhanuprakash Modem
2023-05-24  8:44   ` Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 18/20] tests/xe/xe_debugfs: Use xe_config() helper to get the config Bhanuprakash Modem
2023-05-24  8:47   ` Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 19/20] tests: Drop xe_device get/put from test level Bhanuprakash Modem
2023-05-24  7:58   ` Kamil Konieczny
2023-05-16 16:50 ` [igt-dev] [i-g-t 20/20] Revert "lib/igt_kms: Cache xe_device info for kms tests" Bhanuprakash Modem
2023-05-24  8:03   ` Kamil Konieczny
2023-05-16 18:45 ` [igt-dev] ✓ Fi.CI.BAT: success for XE test cleanup to handle xe_device (rev4) Patchwork
2023-05-17  3:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-19 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for XE test cleanup to handle xe_device (rev5) Patchwork
2023-05-19 18:09 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230516165058.4047595-10-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janga.rahul.kumar@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    /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