[igt-dev] [PATCH i-g-t 10/10] tests/i915/gem_exec_fence: add engine chaining tests

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 20 22:02:26 UTC 2019


Quoting Lionel Landwerlin (2019-11-20 21:21:43)
> +static void test_syncobj_timeline_chain_engines(int fd, struct intel_engine_data *engines)
> +{
...
> +       gem_sync(fd, ctx.engine_counter_object.handle);
> +
> +       counter_output = gem_mmap__wc(fd, ctx.engine_counter_object.handle, 0, 4096, PROT_READ);
> +
> +       for (uint32_t i = 0; i < ctx.engines->nengines; i++)
> +               igt_debug("engine %i (%s)\t= %016lx\n", i,
> +                         ctx.engines->engines[i].name, counter_output[i]);
> +
> +       /*
> +        * Verify that we get the fibonacci number expected (we start
> +        * at the sequence on the second number : 1).
> +        */
> +       igt_assert_eq(counter_output[engines->nengines - 1],
> +                     fib(ARRAY_SIZE(ctx.iterations) * engines->nengines + 1));
> +
> +       teardown_timeline_chain_engines(&ctx);
> +}
> +
> +static void test_syncobj_stationary_timeline_chain_engines(int fd, struct intel_engine_data *engines)
> +{
...
> +       gem_sync(fd, ctx.engine_counter_object.handle);
> +
> +       counter_output = gem_mmap__wc(fd, ctx.engine_counter_object.handle, 0, 4096, PROT_READ);
> +
> +       for (uint32_t i = 0; i < ctx.engines->nengines; i++)
> +               igt_debug("engine %i (%s)\t= %016lx\n", i,
> +                         ctx.engines->engines[i].name, counter_output[i]);
> +       igt_assert_eq(counter_output[engines->nengines - 1],
> +                     fib(ARRAY_SIZE(ctx.iterations) * engines->nengines + 1));
> +
> +       teardown_timeline_chain_engines(&ctx);
> +}
> +
> +static void test_syncobj_backward_timeline_chain_engines(int fd, struct intel_engine_data *engines)
> +{
...
> +       gem_sync(fd, ctx.engine_counter_object.handle);
> +
> +       counter_output = gem_mmap__wc(fd, ctx.engine_counter_object.handle, 0, 4096, PROT_READ);
> +
> +       for (uint32_t i = 0; i < ctx.engines->nengines; i++)
> +               igt_debug("engine %i (%s)\t= %016lx\n", i,
> +                         ctx.engines->engines[i].name, counter_output[i]);
> +       igt_assert_eq(counter_output[engines->nengines - 1],
> +                     fib(ARRAY_SIZE(ctx.iterations) * engines->nengines + 1));

You probably want to invest in a few munmap...
-Chris


More information about the igt-dev mailing list