From d8c7d7eb014add796733e5b994c6241858b9d0e6 Mon Sep 17 00:00:00 2001 From: Andi Shyti Date: Mon, 13 May 2019 02:10:28 +0300 Subject: test/i915: gem_ctx_exec: use the gem_engine_topology library Replace the legacy for_each_engine* defines with the ones implemented in the gem_engine_topology library. Signed-off-by: Andi Shyti Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Daniel Vetter --- tests/i915/gem_ctx_exec.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c index b8e0e074..c3543bfe 100644 --- a/tests/i915/gem_ctx_exec.c +++ b/tests/i915/gem_ctx_exec.c @@ -111,7 +111,8 @@ static void big_exec(int fd, uint32_t handle, int ring) gem_sync(fd, handle); } -static void invalid_context(int fd, unsigned ring, uint32_t handle) +static void invalid_context(int fd, struct intel_execution_engine2 *e, + uint32_t handle) { struct drm_i915_gem_exec_object2 obj = { .handle = handle, @@ -119,7 +120,7 @@ static void invalid_context(int fd, unsigned ring, uint32_t handle) struct drm_i915_gem_execbuffer2 execbuf = { .buffers_ptr = to_user_pointer(&obj), .buffer_count = 1, - .flags = ring, + .flags = e->flags, }; unsigned int i; uint32_t ctx; @@ -198,7 +199,7 @@ static void norecovery(int i915) igt_main { const uint32_t batch[2] = { 0, MI_BATCH_BUFFER_END }; - const struct intel_execution_engine *e; + struct intel_execution_engine2 *e; uint32_t handle; uint32_t ctx_id; int fd; @@ -228,11 +229,9 @@ igt_main gem_sync(fd, handle); } - for (e = intel_execution_engines; e->name; e++) { - igt_subtest_f("basic-invalid-context-%s", e->name) { - gem_require_ring(fd, e->exec_id | e->flags); - invalid_context(fd, e->exec_id | e->flags, handle); - } + __for_each_physical_engine(fd, e) { + igt_subtest_f("basic-invalid-context-%s", e->name) + invalid_context(fd, e, handle); } igt_subtest("eviction") -- cgit v1.2.3