[igt-dev] [PATCH i-g-t 1/3] lib/igt_gt: Add gem_engine_can_block_ggtt_binder
Nirmoy Das
nirmoy.das at intel.com
Thu Sep 14 20:18:07 UTC 2023
On MTL GGTT updates happens through MI_UPDATE_GGTT command.
Add a method to detect if a engine can block ggtt binder.
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
lib/igt_gt.c | 15 +++++++++++++++
lib/igt_gt.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index a24a566c7..aa5e75b07 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -659,3 +659,18 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags)
igt_assert(0);
}
}
+
+/**
+ * gem_engine_can_block_ggtt_binder:
+ * @fd: open i915 drm file descriptor
+ * @engine: engine to be assessed
+ *
+ * Detect if the platform needs blitter based GGTT
+ * updates.
+ */
+bool gem_engine_can_block_ggtt_binder(int fd,
+ const struct intel_execution_engine2 *engine)
+{
+ return IS_METEORLAKE(intel_get_drm_devid(fd)) &&
+ engine->class == I915_ENGINE_CLASS_COPY;
+}
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 3d10349e4..d0c5510b1 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -83,5 +83,7 @@ extern const struct intel_execution_engine2 {
} intel_execution_engines2[];
int gem_execbuf_flags_to_engine_class(unsigned int flags);
+bool gem_engine_can_block_ggtt_binder(int fd,
+ const struct intel_execution_engine2 *engine);
#endif /* IGT_GT_H */
--
2.41.0
More information about the igt-dev
mailing list