Re: [igt-dev] [RFC v2 18/43] tests/i915/gem_exec_create: use the gem_engine_topology library

Chris Wilson
2019-06-21T10:22:04Z

Quoting Ramalingam C (2019-06-21 11:03:20)
> Replace the legacy for_each_engine* defines with the ones
> implemented in the gem_engine_topology library.
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
> tests/i915/gem_exec_create.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
> index 54a2429e49d9..9e21320d0221 100644
> --- a/tests/i915/gem_exec_create.c
> +++ b/tests/i915/gem_exec_create.c
> @@ -63,11 +63,11 @@ static void all(int fd, unsigned flags, int timeout, int ncpus)
> struct drm_i915_gem_exec_object2 obj;
> unsigned engines[16];
> unsigned nengine;
> - unsigned engine;
> + const struct intel_execution_engine2 *e;
>
> nengine = 0;
> - for_each_physical_engine(fd, engine)
> - engines[nengine++] = engine;
> + __for_each_physical_engine(fd, e)
> + engines[nengine++] = e->flags;
> igt_require(nengine);

You will have noticed this pattern quite frequently, and possibly
considered a helper to simply return the engine map?
-Chris