[igt-dev] [RFC PATCH v8 3/5] lib/igt_gt: use for_each_engine2 to loop through engines

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 13 09:20:08 UTC 2019


Quoting Andi Shyti (2019-02-13 01:19:56)
> Hi Chris,
> 
> > > +#define for_each_engine2(fd, ctx, e) \
> > > +               for (__set_ctx_engine_map(fd, ctx_id), \
> > > +                    e = intel_active_engines2; e->name; e++) \
> > > +                       for_if (gem_has_get_set_param() || \
> > > +                               gem_has_engine(fd, e->class, e->instance))
> > 
> > intel_active_engines2 can define e->flags, and then you can just use
> > gem_has_ring(fd, e->flags) for both ctx->engines[] and legacy.
> 
> Sorry, I haven't understood: 'e' is 'intel_execution_engine2' and
> doesn't have flags. Indeed I call it as:

Then fix it.
-Chris


More information about the igt-dev mailing list