[igt-dev] [PATCH i-g-t 11/20] tests/i915/perf: Only iterate over render engines for xe

Ashutosh Dixit ashutosh.dixit at intel.com
Tue Aug 8 01:00:08 UTC 2023


Return a render engine (class == instance == 0) from __ci_to_e2. This
causes __for_random_engine_in_each_group to return only a render engine
from the render group.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 tests/i915/perf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index 6f10e1d035cb..7cbf3f7ca287 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -5564,13 +5564,18 @@ __ci_to_e2(const intel_ctx_t *ctx, struct i915_engine_class_instance *ci)
 	static struct intel_execution_engine2 e2;
 	struct intel_execution_engine2 *e;
 
+	if (is_xe_device(drm_fd)) {
+		strncpy(e2.name, "rcs", sizeof(e2.name));
+		goto exit;
+	}
+
 	for_each_ctx_engine(drm_fd, ctx, e) {
 		if (e->class == ci->engine_class && e->instance == ci->engine_instance) {
 			e2 = *e;
 			break;
 		}
 	}
-
+exit:
 	return &e2;
 }
 
-- 
2.41.0



More information about the igt-dev mailing list