[PATCH] tests/intel/xe_exec_reset: fix mixed-engine reset stress to use actual GT engines
From: <hidden>
Date: 2026-09-07 09:51:45
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Nishit Sharma <redacted> This patch fixes the mixed-engine reset stress subtest by selecting only engine class/instance pairs that are actually exposed by the target GT instead of using a hardcoded class list with engine instance 0. Signed-off-by: Nishit Sharma <redacted> Suggested-by: Gajendra Uttamchand <redacted> I talked with Gajendra and he suggested this change to me, but I made a mistake and added his s-o-b instead of suggested-by, so resending this with correct tags --- tests/intel/xe_exec_reset.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index 34232f433..e12279d23 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c@@ -702,17 +702,20 @@ static void bo_ctx_create(int fd, int gt, uint64_t addr, size_t bo_size, static void fill_mixed_engine(struct gt_thread_data *t, int iter, struct drm_xe_engine_class_instance *instance) { - const uint16_t classes[] = { - DRM_XE_ENGINE_CLASS_COPY, - DRM_XE_ENGINE_CLASS_RENDER, - DRM_XE_ENGINE_CLASS_COMPUTE, - DRM_XE_ENGINE_CLASS_VIDEO_DECODE, - DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, - }; + struct drm_xe_engine_class_instance *hwe; + struct drm_xe_engine_class_instance engines[64]; + int n = 0; + + xe_for_each_engine(t->fd, hwe) { + if (hwe->gt_id != t->gt) + continue; + engines[n++] = *hwe; + if (n == ARRAY_SIZE(engines)) + break; + } - instance->gt_id = t->gt; - instance->engine_instance = 0; - instance->engine_class = classes[(iter + t->id) % ARRAY_SIZE(classes)]; + igt_assert_f(n > 0, "GT %d exposes no engines\n", t->gt); + *instance = engines[(iter + t->id) % n]; } static void pressure_bo_create(int fd, uint32_t vm, int gt,
--
2.43.0