[igt-dev] [PATCH i-g-t v2 1/2] lib/igt_gt: Check for shared reset domain

priyanka.dandamudi at intel.com priyanka.dandamudi at intel.com
Mon Jan 10 06:11:40 UTC 2022


From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>

Function to check if a platform has shared reset domain.

v2: Some minor fixes (Ashutosh)

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..daec5c0c 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)
+			rcs0 = true;
+		else if (e->class == I915_ENGINE_CLASS_COMPUTE)
+			ccs0 = true;
+	}
+	return (rcs0 && ccs0);
+}
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index c5059817..f0340552 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);
+
 #endif /* IGT_GT_H */
-- 
2.25.1



More information about the igt-dev mailing list