diff options
| author | sai gowtham <sai.gowtham.ch@intel.com> | 2020-05-06 20:32:18 +0530 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-11 12:39:06 +0100 |
| commit | 609572dd1d3bd91bb035f7742ab705aa9136b639 (patch) | |
| tree | f795b5de7ece6a8413656e6e47b1a32af6763e22 /tests | |
| parent | 06b9702c14330df8526e9743ad178e0cec004def (diff) | |
i915/gem_ringfill: Adjusted test to utilize all available engines.
Replaced the legacy for_each_engine* defines with the ones implemented
in the gem_engine_topology library.
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: satyavat <satyavathi.k@intel.com>
Signed-off-by: sai gowtham <sai.gowtham.ch@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i915/gem_ringfill.c | 75 |
1 files changed, 52 insertions, 23 deletions
diff --git a/tests/i915/gem_ringfill.c b/tests/i915/gem_ringfill.c index de2778b3..3e24ccf1 100644 --- a/tests/i915/gem_ringfill.c +++ b/tests/i915/gem_ringfill.c @@ -198,7 +198,12 @@ static void run_test(int fd, unsigned ring, unsigned flags, unsigned timeout) igt_debug("Forking %d children\n", nchild); igt_fork(child, nchild) { if (flags & NEWFD) { - fd = drm_open_driver(DRIVER_INTEL); + int this; + + this = gem_reopen_driver(fd); + gem_context_copy_engines(fd, 0, this, 0); + fd = this; + setup_execbuf(fd, &execbuf, obj, reloc, ring); } fill_ring(fd, &execbuf, flags, timeout); @@ -267,17 +272,16 @@ igt_main const char *suffix; unsigned flags; unsigned timeout; - bool basic; } modes[] = { - { "", 0, 0, true}, - { "-interruptible", INTERRUPTIBLE, 1, true }, - { "-hang", HANG, 10, true }, - { "-child", CHILD, 0 }, - { "-forked", FORKED, 0, true }, - { "-fd", FORKED | NEWFD, 0, true }, - { "-bomb", BOMB | NEWFD | INTERRUPTIBLE, 150 }, - { "-S3", BOMB | SUSPEND, 30 }, - { "-S4", BOMB | HIBERNATE, 30 }, + { "basic", 0, 0 }, + { "interruptible", INTERRUPTIBLE, 1 }, + { "hang", HANG, 10 }, + { "child", CHILD, 0 }, + { "forked", FORKED, 0 }, + { "fd", FORKED | NEWFD, 0 }, + { "bomb", BOMB | NEWFD | INTERRUPTIBLE, 150 }, + { "S3", BOMB | SUSPEND, 30 }, + { "S4", BOMB | HIBERNATE, 30 }, { NULL } }, *m; bool master = false; @@ -302,19 +306,44 @@ igt_main igt_require(ring_size); } + /* Legacy path for selecting "rings". */ + for (m = modes; m->suffix; m++) { + igt_subtest_with_dynamic_f("legacy-%s", m->suffix) { + const struct intel_execution_engine *e; + + igt_skip_on(m->flags & NEWFD && master); + + for (e = intel_execution_engines; e->name; e++) { + if (!gem_has_ring(fd, eb_ring(e))) + continue; + + igt_dynamic_f("%s", e->name) { + igt_require(gem_can_store_dword(fd, eb_ring(e))); + run_test(fd, eb_ring(e), + m->flags, + m->timeout); + gem_quiescent_gpu(fd); + } + } + } + } + + /* New interface for selecting "engines". */ for (m = modes; m->suffix; m++) { - const struct intel_execution_engine *e; - - for (e = intel_execution_engines; e->name; e++) { - igt_subtest_f("%s%s%s", - m->basic && !e->exec_id ? "basic-" : "", - e->name, - m->suffix) { - igt_skip_on(m->flags & NEWFD && master); - gem_require_ring(fd, eb_ring(e)); - igt_require(gem_can_store_dword(fd, eb_ring(e))); - run_test(fd, eb_ring(e), m->flags, m->timeout); - gem_quiescent_gpu(fd); + igt_subtest_with_dynamic_f("engines-%s", m->suffix) { + const struct intel_execution_engine2 *e; + + igt_skip_on(m->flags & NEWFD && master); + __for_each_physical_engine(fd, e) { + if (!gem_class_can_store_dword(fd, e->class)) + continue; + + igt_dynamic_f("%s", e->name) { + run_test(fd, e->flags, + m->flags, + m->timeout); + gem_quiescent_gpu(fd); + } } } } |
