Don't rely on just rcs0 being well defined, check that we return a list of each engine when asked. Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: "Melkaveri, Arjun" <arjun.melkaveri@xxxxxxxxx> --- tests/i915/gem_ctx_engines.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c index be7d5733f..12c6b84ca 100644 --- a/tests/i915/gem_ctx_engines.c +++ b/tests/i915/gem_ctx_engines.c @@ -230,15 +230,21 @@ static void idempotent(int i915) igt_assert_eq(p.size, base + idx); igt_assert(!memcmp(&expected, &engines, idx)); - memset(&engines, 0, sizeof(engines)); p.size = sizeof(engines); - gem_context_set_param(i915, &p); + __for_each_physical_engine(i915, e) { + memset(&engines, 0, sizeof(engines)); + for (int n = 0; n < I915_EXEC_RING_MASK + 1; n++) { + engine_class(&engines, n) = e->class; + engine_instance(&engines, n) = e->instance; + } + gem_context_set_param(i915, &p); - memcpy(&expected, &engines, sizeof(expected)); + memcpy(&expected, &engines, sizeof(expected)); - gem_context_get_param(i915, &p); - igt_assert_eq(p.size, sizeof(engines)); - igt_assert(!memcmp(&expected, &engines, idx)); + gem_context_get_param(i915, &p); + igt_assert_eq(p.size, sizeof(engines)); + igt_assert(!memcmp(&expected, &engines, p.size)); + } gem_context_destroy(i915, p.ctx_id); } -- 2.30.0.rc2 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx