Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/xe/xe_debugfs: Get gt subtest passing
@ 2023-03-24  5:02 Niranjana Vishwanathapura
  2023-03-24  6:00 ` Mauro Carvalho Chehab
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Niranjana Vishwanathapura @ 2023-03-24  5:02 UTC (permalink / raw)
  To: igt-dev

Get gt subtest passing by properly getting and using
xe device config info.

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
---
 tests/xe/xe_debugfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/xe/xe_debugfs.c b/tests/xe/xe_debugfs.c
index ad6191fbc..6bdd3ef06 100644
--- a/tests/xe/xe_debugfs.c
+++ b/tests/xe/xe_debugfs.c
@@ -71,7 +71,7 @@ static int validate_entries(int fd, const char *add_path, const char * const str
  * Description: Check if various debugfs devnodes exist and test reading them.
  */
 static void
-test_base(int fd)
+test_base(int fd, struct drm_xe_query_config *config)
 {
 	static const char * const expected_files[] = {
 		"gt0",
@@ -88,8 +88,6 @@ test_base(int fd)
 
 	char reference[4096];
 	int val = 0;
-	struct xe_device *xe_dev = xe_device_get(fd);
-	struct drm_xe_query_config *config = xe_dev->config;
 
 	igt_assert(config);
 	sprintf(reference, "devid 0x%llx",
@@ -145,8 +143,6 @@ test_base(int fd)
 	igt_debugfs_dump(fd, "gem_names");
 
 	validate_entries(fd, "", expected_files, ARRAY_SIZE(expected_files));
-
-	xe_device_put(fd);
 }
 
 /**
@@ -244,17 +240,19 @@ static int opt_handler(int option, int option_index, void *input)
 
 igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
+	struct xe_device *xe_dev;
 	char devnode[PATH_MAX];
 	int fd;
 	int gt;
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
+		xe_dev = xe_device_get(fd);
 		__igt_debugfs_dump(fd, "info", IGT_LOG_INFO);
 	}
 
 	igt_subtest("base") {
-		test_base(fd);
+		test_base(fd, xe_dev->config);
 	}
 
 
@@ -271,6 +269,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 	}
 
 	igt_fixture {
+		xe_device_put(fd);
 		close(fd);
 	}
 }
-- 
2.21.0.rc0.32.g243a4c7e27

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [igt-dev] [PATCH i-g-t] tests/xe/xe_debugfs: Get gt subtest passing
@ 2023-03-28  5:04 Niranjana Vishwanathapura
  0 siblings, 0 replies; 5+ messages in thread
From: Niranjana Vishwanathapura @ 2023-03-28  5:04 UTC (permalink / raw)
  To: igt-dev

Get gt subtest passing by properly getting and using
xe device config info.

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 tests/xe/xe_debugfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/xe/xe_debugfs.c b/tests/xe/xe_debugfs.c
index ad6191fbc..6bdd3ef06 100644
--- a/tests/xe/xe_debugfs.c
+++ b/tests/xe/xe_debugfs.c
@@ -71,7 +71,7 @@ static int validate_entries(int fd, const char *add_path, const char * const str
  * Description: Check if various debugfs devnodes exist and test reading them.
  */
 static void
-test_base(int fd)
+test_base(int fd, struct drm_xe_query_config *config)
 {
 	static const char * const expected_files[] = {
 		"gt0",
@@ -88,8 +88,6 @@ test_base(int fd)
 
 	char reference[4096];
 	int val = 0;
-	struct xe_device *xe_dev = xe_device_get(fd);
-	struct drm_xe_query_config *config = xe_dev->config;
 
 	igt_assert(config);
 	sprintf(reference, "devid 0x%llx",
@@ -145,8 +143,6 @@ test_base(int fd)
 	igt_debugfs_dump(fd, "gem_names");
 
 	validate_entries(fd, "", expected_files, ARRAY_SIZE(expected_files));
-
-	xe_device_put(fd);
 }
 
 /**
@@ -244,17 +240,19 @@ static int opt_handler(int option, int option_index, void *input)
 
 igt_main_args("", long_options, help_str, opt_handler, NULL)
 {
+	struct xe_device *xe_dev;
 	char devnode[PATH_MAX];
 	int fd;
 	int gt;
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
+		xe_dev = xe_device_get(fd);
 		__igt_debugfs_dump(fd, "info", IGT_LOG_INFO);
 	}
 
 	igt_subtest("base") {
-		test_base(fd);
+		test_base(fd, xe_dev->config);
 	}
 
 
@@ -271,6 +269,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 	}
 
 	igt_fixture {
+		xe_device_put(fd);
 		close(fd);
 	}
 }
-- 
2.21.0.rc0.32.g243a4c7e27

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-28  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-24  5:02 [igt-dev] [PATCH i-g-t] tests/xe/xe_debugfs: Get gt subtest passing Niranjana Vishwanathapura
2023-03-24  6:00 ` Mauro Carvalho Chehab
2023-03-24  6:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-24 12:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-03-28  5:04 [igt-dev] [PATCH i-g-t] " Niranjana Vishwanathapura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox