Re: [igt-dev] [PATCH v16 5/8] tests: gem_exec_basic: add engine discovery test

Chris Wilson
2019-03-29T23:36:30Z

Quoting Andi Shyti (2019-03-28 19:22:03)
> The "exec-engines-ctx" and "exec-physical-engines-ctx" are two
> demo subtest inserted in the gem_exec_basic
> test. The main goal is to reach the engines by using
> the new uapi interfacing with 'gem_topology_has_engine()'.
>
> The two cases get the list of both virtual and physical and only
> physical engines and makes sure they actually exist.
>
> Signed-off-by: Andi Shyti <andi.shyti@intel.com>
> ---
> tests/i915/gem_exec_basic.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
> index dcb83864b1c1..ed3388952146 100644
> --- a/tests/i915/gem_exec_basic.c
> +++ b/tests/i915/gem_exec_basic.c
> @@ -135,6 +135,32 @@ igt_main
> gtt(fd, e->exec_id | e->flags);
> }
>
> + igt_subtest("exec-engines-ctx") {
> + uint64_t ctx_id;
> + struct intel_execution_engine2 *e2;
> +
> + ctx_id = gem_context_create(fd);
> +
> + for_each_context_engine(fd, ctx_id, e2)
> + igt_assert(gem_context_has_engine(fd, ctx_id,
> + e2->flags));
> +
> + gem_context_destroy(fd, ctx_id);
> + }

Starting subtest: exec-engines-ctx
(gem_exec_basic:17617) CRITICAL: Test assertion failure function __real_main117, file ../tests/i915/gem_exec_basic.c:146:
(gem_exec_basic:17617) CRITICAL: Failed assertion: gem_context_has_engine(fd, ctx_id, e2->flags)
Stack trace:
#0 ../lib/igt_core.c:1474 __igt_fail_assert()
#1 ../tests/i915/gem_exec_basic.c:144 __real_main117()
#2 ../tests/i915/gem_exec_basic.c:117 main()
#3 ../csu/libc-start.c:342 __libc_start_main()
#4 [_start+0x2a]
Subtest exec-engines-ctx failed.
**** DEBUG ****
(gem_exec_basic:17617) CRITICAL: Test assertion failure function __real_main117, file ../tests/i915/gem_exec_basic.c:146:
(gem_exec_basic:17617) CRITICAL: Failed assertion: gem_context_has_engine(fd, ctx_id, e2->flags)
(gem_exec_basic:17617) igt_core-INFO: Stack trace:
(gem_exec_basic:17617) igt_core-INFO: #0 ../lib/igt_core.c:1474 __igt_fail_assert()
(gem_exec_basic:17617) igt_core-INFO: #1 ../tests/i915/gem_exec_basic.c:144 __real_main117()
(gem_exec_basic:17617) igt_core-INFO: #2 ../tests/i915/gem_exec_basic.c:117 main()
(gem_exec_basic:17617) igt_core-INFO: #3 ../csu/libc-start.c:342 __libc_start_main()
(gem_exec_basic:17617) igt_core-INFO: #4 [_start+0x2a]
**** END ****

I'd say that is worth a little polishing on what the error might have
been.
-Chris