diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-03-31 15:47:56 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-04-01 11:04:40 +0100 |
commit | dc2a58fac5d0002cfbe3c25a70f785a19fe231d4 (patch) | |
tree | e18e88b635a49bec6f2845c3c40577e4ecd3abe3 /tests/i915/gem_exec_reloc.c | |
parent | 98927dfde17aecaecfe67bb9853ceca326ca2b23 (diff) |
i915/gem_exec_reloc: Dynamic active engine tests
Use igt_subtest_with_dynamic for the flexible approach to engine
dependent test discovery.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_exec_reloc.c')
-rw-r--r-- | tests/i915/gem_exec_reloc.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c index 1aa03fba..275cf6ae 100644 --- a/tests/i915/gem_exec_reloc.c +++ b/tests/i915/gem_exec_reloc.c @@ -261,13 +261,13 @@ static void active(int fd, unsigned engine) nengine = 0; if (engine == ALL_ENGINES) { - for_each_physical_engine(e, fd) { - if (gem_can_store_dword(fd, eb_ring(e))) - engines[nengine++] = eb_ring(e); + const struct intel_execution_engine2 *e; + + __for_each_physical_engine(fd, e) { + if (gem_class_can_store_dword(fd, e->class)) + engines[nengine++] = e->flags; } } else { - igt_require(gem_has_ring(fd, engine)); - igt_require(gem_can_store_dword(fd, engine)); engines[nengine++] = engine; } igt_require(nengine); @@ -706,6 +706,7 @@ static void basic_softpin(int fd) igt_main { + const struct intel_execution_engine2 *e; const struct mode { const char *name; unsigned before, after; @@ -805,15 +806,26 @@ igt_main igt_subtest("gpu") from_gpu(fd); - igt_subtest("basic-active") - active(fd, ALL_ENGINES); - for (const struct intel_execution_engine *e = intel_execution_engines; - e->name; e++) { - igt_subtest_f("basic-active-%s", e->name) - active(fd, eb_ring(e)); - igt_subtest_f("basic-spin-%s", e->name) - active_spin(fd, eb_ring(e)); + igt_subtest_with_dynamic("basic-active") { + igt_dynamic("all") + active(fd, ALL_ENGINES); + + __for_each_physical_engine(fd, e) { + if (!gem_class_can_store_dword(fd, e->class)) + continue; + + igt_dynamic_f("%s", e->name) + active(fd, e->flags); + } + } + + igt_subtest_with_dynamic("basic-spin") { + __for_each_physical_engine(fd, e) { + igt_dynamic_f("%s", e->name) + active_spin(fd, e->flags); + } } + igt_fixture close(fd); } |