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

priyanka.dandamudi at intel.com priyanka.dandamudi at intel.com
Mon Jan 17 08:56:59 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)

v3: Add logic for multiple CCS (Roper Matt)

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 | 20 ++++++++++++++++++++
 lib/igt_gt.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 7c7df95e..2cf7be2b 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -637,3 +637,23 @@ 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;
+	int ccs_count = 0;
+
+	for_each_ctx_engine(fd, ctx, e) {
+		if ((rcs0 && ccs0) || (ccs_count > 1))
+			break;
+		else if (e->class == I915_ENGINE_CLASS_RENDER)
+			rcs0 = true;
+		else if (e->class == I915_ENGINE_CLASS_COMPUTE) {
+			ccs0 = true;
+			ccs_count++;
+		}
+	}
+	return ((rcs0 && ccs0) || (ccs_count > 1));
+}
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