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

Andi Shyti
2019-06-25T12:42:09Z

> > 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?

I think that just calling "intel_init_engine_list()" and retrieve
a "struct inte_engine_data" does it without making any other
helper.

you would get the list of engines/flags in:

(struct intel_engine_data *)->engines[n].flags

where we also have the flags.

Andi