Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/xe_query: add media GT presence checker
@ 2023-09-21  7:02 Lukasz Laguna
  2023-09-21  8:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukasz Laguna @ 2023-09-21  7:02 UTC (permalink / raw)
  To: igt-dev

Add helper checking if platform is equipped with media GT.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
 lib/xe/xe_query.c | 20 ++++++++++++++++++++
 lib/xe/xe_query.h |  1 +
 2 files changed, 21 insertions(+)

diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index c356abe1e..ea76e90be 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -712,6 +712,26 @@ bool xe_has_engine_class(int fd, uint16_t engine_class)
 	return false;
 }
 
+/**
+ * xe_has_media_gt:
+ * @fd: xe device fd
+ *
+ * Returns true if device @fd has media GT otherwise false.
+ */
+bool xe_has_media_gt(int fd)
+{
+	struct xe_device *xe_dev;
+
+	xe_dev = find_in_cache(fd);
+	igt_assert(xe_dev);
+
+	for (int i = 0; i < xe_dev->number_gt; i++)
+		if (xe_dev->gts->gts[i].type == XE_QUERY_GT_TYPE_MEDIA)
+			return true;
+
+	return false;
+}
+
 igt_constructor
 {
 	xe_device_cache_init();
diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h
index 20dbfa12c..e632b6925 100644
--- a/lib/xe/xe_query.h
+++ b/lib/xe/xe_query.h
@@ -104,6 +104,7 @@ uint16_t xe_dev_id(int fd);
 bool xe_supports_faults(int fd);
 const char *xe_engine_class_string(uint32_t engine_class);
 bool xe_has_engine_class(int fd, uint16_t engine_class);
+bool xe_has_media_gt(int fd);
 
 struct xe_device *xe_device_get(int fd);
 void xe_device_put(int fd);
-- 
2.40.0

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

end of thread, other threads:[~2023-09-21 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21  7:02 [igt-dev] [PATCH i-g-t] lib/xe_query: add media GT presence checker Lukasz Laguna
2023-09-21  8:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-09-21  9:02 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-09-21 19:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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