Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Mateusz Jablonski <mateusz.jablonski@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH i-g-t 2/2] tests/intel/xe_query: Query engine capabilities
Date: Fri,  9 Aug 2024 12:39:22 +0200	[thread overview]
Message-ID: <20240809103922.12964-2-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240809103922.12964-1-nirmoy.das@intel.com>

Query engine capabilities.

Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mateusz Jablonski <mateusz.jablonski@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 tests/intel/xe_query.c | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
index ddb2e76e5..36eb58f0d 100644
--- a/tests/intel/xe_query.c
+++ b/tests/intel/xe_query.c
@@ -203,6 +203,53 @@ test_query_engines(int fd)
 	igt_assert_lt(0, i);
 }
 
+/**
+ * SUBTEST: query-engines-capabilities
+ * Description: Display engine capabilities for classes available for xe device
+ * Test category: functionality test
+ *
+ * SUBTEST: multigpu-query-engines-capabilities
+ * Description: Display engine capabilities for classes available for all Xe devices.
+ * Category: Core
+ * Mega feature: General Core features
+ * Sub-category: MultiGPU
+ * Test category: functionality test
+ */
+static void
+test_query_engine_capabilities(int fd)
+{
+	struct drm_xe_engine *e;
+	int i = 0, class;
+	static const struct {
+		u32 flag;
+		const char *name;
+	} capabilities[] = {
+		{DRM_XE_ENGINE_CAPABILITY_WMTP, "wmtp"},
+	};
+
+
+	xe_for_each_engine_class(class) {
+		struct drm_xe_engine_class_instance *hwe;
+
+		e = xe_engine(fd, class);
+		hwe = &e->instance;
+
+		igt_assert(hwe);
+		igt_info("engine %d: %s, tile: TILE-%d, capabilities: ", i++,
+			 xe_engine_class_string(hwe->engine_class),
+			 hwe->gt_id);
+		for (int j = 0; j < ARRAY_SIZE(capabilities); j++) {
+			igt_info("%s: %s, ", capabilities[j].name,
+				 e->capabilities & capabilities[j].flag ?
+				 "yes" : "no");
+
+		}
+		igt_info("\n");
+	}
+
+	igt_assert(i > 0);
+}
+
 /**
  * SUBTEST: query-mem-usage
  * Test category: functionality test
@@ -1077,6 +1124,7 @@ igt_main
 		void (*func)(int);
 	} funcs[] = {
 		{ "query-engines", test_query_engines },
+		{ "query-engines-capabilities", test_query_engine_capabilities },
 		{ "query-mem-usage", test_query_mem_regions },
 		{ "query-gt-list", test_query_gt_list },
 		{ "query-config", test_query_config },
-- 
2.42.0


  reply	other threads:[~2024-08-09 10:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 10:39 [PATCH i-g-t 1/2] drm-uapi/xe: Add wmtp engine capability Nirmoy Das
2024-08-09 10:39 ` Nirmoy Das [this message]
2024-08-09 12:07 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2024-08-09 12:08 ` ✓ CI.xeBAT: " Patchwork
2024-08-09 14:17 ` ✗ CI.xeFULL: failure " Patchwork
2024-08-10 17:53 ` ✗ 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=20240809103922.12964-2-nirmoy.das@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=mateusz.jablonski@intel.com \
    --cc=matthew.d.roper@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