[PATCH i-g-t 2/2] tests/intel/xe_query: Query engine capabilities
Nirmoy Das
nirmoy.das at intel.com
Fri Aug 9 10:39:22 UTC 2024
Query engine capabilities.
Cc: Francois Dugast <francois.dugast at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Mateusz Jablonski <mateusz.jablonski at intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das at 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
More information about the igt-dev
mailing list