[igt-dev] [PATCH i-g-t 1/2] lib/igt_gt: Check for shared reset domain
priyanka.dandamudi at intel.com
priyanka.dandamudi at intel.com
Fri Jan 7 16:19:19 UTC 2022
From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
Function to check if a platform has shared reset domain.
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
Cc: John Harrison <John.C.Harrison at Intel.com>
Cc: Melkaveri, Arjun <arjun.melkaveri at intel.com>
---
lib/igt_gt.c | 17 +++++++++++++++++
lib/igt_gt.h | 2 ++
2 files changed, 19 insertions(+)
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 7c7df95e..e5cd7b26 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -637,3 +637,20 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags)
igt_assert(0);
}
}
+
+bool has_shared_reset_domain(int fd, const intel_ctx_t *ctx, const struct intel_execution_engine2 *e)
+{
+ bool rcs0 = false;
+ bool ccs0 = false;
+
+ for_each_ctx_engine (fd, ctx, e) {
+ if (rcs0 && ccs0)
+ break;
+ else if (e->class == I915_ENGINE_CLASS_RENDER && e->instance == 0)
+ rcs0 = true;
+ else if (e->class == I915_ENGINE_CLASS_COMPUTE && e->instance == 0)
+ ccs0 = true;
+ }
+ return (rcs0 && ccs0);
+
+}
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index c5059817..e54a695c 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -84,4 +84,6 @@ extern const struct intel_execution_engine2 {
int gem_execbuf_flags_to_engine_class(unsigned int flags);
+bool has_shared_reset_domain(int fd, const intel_ctx_t *ctx, const struct intel_execution_engine2 *e);
+
#endif /* IGT_GT_H */
--
2.25.1
More information about the igt-dev
mailing list