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

Andi Shyti andi.shyti at intel.com
Wed Feb 13 01:19:56 UTC 2019


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:

   [...]
   struct intel_execution_engine2 *e2;

   for_each_engine2(fd, ctx_id, e2) {
      /* whatever */
   }

Thanks,
Andi


> That's one for test/gem_query.c, making sure that set_ctx_engine_map()
> is fully iterable by gem_has_ring(fd, id).
> -Chris


More information about the igt-dev mailing list