[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 11:07:16 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:
>
> Then fix it.
If we want to add flags in 'intel_execution_engine2' (I tried to
minimize the amount of changes outside of my part), then the
whole thing can come out nicer and I guess could get rid of the
'gem_class_instance_to_eb_flags()' function.
But I think this is a bit off-topic from this patch series and I
can add it in my to-do list (which would this way have already
two items) for the next days.
Andi
More information about the igt-dev
mailing list