[igt-dev] [PATCH i-g-t] lib/i915: Use intel_ctx_0() for submission tests (v2)

Jason Ekstrand jason at jlekstrand.net
Thu Jun 17 16:16:47 UTC 2021


On Wed, Jun 16, 2021 at 3:28 PM Dixit, Ashutosh
<ashutosh.dixit at intel.com> wrote:
>
> On Wed, 16 Jun 2021 10:08:39 -0700, Jason Ekstrand wrote:
> >
> > This does make the assumption that ctx0 has the default set of engines
> > but, now that we've converted everything to intel_ctx_t, this assumption
> > should be ok.
> >
> > v2 (Zbigniew Kempczyński):
> >  - Use for_each_ctx_engine with intel_ctx_0() instead of
> >    for_each_physical_ring()
> >
> > Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> > ---
> >  lib/i915/gem_submission.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
> > index bd4bbb3ef..1af009fb1 100644
> > --- a/lib/i915/gem_submission.c
> > +++ b/lib/i915/gem_submission.c
> > @@ -202,7 +202,7 @@ void gem_test_engine(int i915, unsigned int engine)
> >       if (engine == ALL_ENGINES) {
> >               const struct intel_execution_engine2 *e2;
> >
> > -             __for_each_physical_engine(i915, e2) {
> > +             for_each_ctx_engine(i915, intel_ctx_0(i915), e2) {
> >                       execbuf.flags = e2->flags;
> >                       gem_execbuf(i915, &execbuf);
> >               }
> > @@ -385,7 +385,7 @@ unsigned int gem_submission_measure(int i915, unsigned int engine)
> >               struct intel_execution_engine2 *e;
> >
> >               size = -1;
> > -             __for_each_physical_engine(i915, e) {
> > +             for_each_ctx_engine(i915, intel_ctx_0(i915), e) {
>
> Maybe I am missing something but I really am not following why we are
> changing these loops to iterate only on legacy/static engines when
> previously __for_each_physical_engine iterates on all present engines?

Well, this is annoying.  For gem_test_engine, we always call it with
ALL_ENGINES.  I'm going to rename that one to gem_test_all_engines()
and make it create its own context.  For gem_submission_measure, I'm
less sure what to do.  I'd like to keep both sides consistent.  Maybe
the answer is that it needs to take an intel_ctx_t?  I'll look deeper.

--Jason


More information about the igt-dev mailing list