[igt-dev] [PATCH i-g-t 2/2] tests/gem_sync: Use softpin path for no-reloc gens

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Tue Nov 2 08:23:55 UTC 2021


On Fri, Oct 29, 2021 at 08:55:40PM -0700, Dixit, Ashutosh wrote:
> On Thu, 28 Oct 2021 11:23:22 -0700, Zbigniew Kempczyński wrote:
> >
> > @@ -384,6 +401,8 @@ active_wakeup_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> >		   int timeout, int wlen)
> >  {
> >	struct intel_engine_data ied;
> > +	uint64_t ahnd0 = get_reloc_ahnd(fd, 0);
> > +	uint64_t ahnd = get_reloc_ahnd(fd, ctx->id);
> >
> >	ied = list_store_engines(fd, ctx, ring);
> >	igt_require(ied.nengines);
> > @@ -397,8 +416,14 @@ active_wakeup_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> >		unsigned long cycles;
> >		igt_spin_t *spin[2];
> >
> > +		ahnd0 = get_reloc_ahnd(fd, 0);
> > +		ahnd = get_reloc_ahnd(fd, ctx->id);
> > +
> >		memset(&object, 0, sizeof(object));
> >		object.handle = gem_create(fd, 4096);
> > +		object.offset = get_offset(ahnd, object.handle, 4096, 0);
> > +		if (ahnd)
> > +			object.offset = EXEC_OBJECT_PINNED;
> >		gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
> >
> >		memset(&execbuf, 0, sizeof(execbuf));
> > @@ -408,12 +433,14 @@ active_wakeup_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> >		execbuf.rsvd1 = ctx->id;
> >
> >		spin[0] = __igt_spin_new(fd,
> > +					 .ahnd = ahnd,
> >					 .engine = execbuf.flags,
> >					 .flags = (IGT_SPIN_POLL_RUN |
> >						   IGT_SPIN_FAST));
> >		igt_assert(igt_spin_has_poll(spin[0]));
> >
> >		spin[1] = __igt_spin_new(fd,
> > +					 .ahnd = ahnd,
> >					 .engine = execbuf.flags,
> >					 .flags = (IGT_SPIN_POLL_RUN |
> >						   IGT_SPIN_FAST));
> > @@ -490,8 +517,13 @@ active_wakeup_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> >		igt_spin_free(fd, spin[1]);
> >		igt_spin_free(fd, spin[0]);
> >		gem_close(fd, object.handle);
> > +		put_offset(ahnd, object.handle);
> > +		put_ahnd(ahnd);
> > +		put_ahnd(ahnd0);
> >	}
> >	igt_waitchildren_timeout(2*timeout, NULL);
> > +	put_ahnd(ahnd);
> > +	put_ahnd(ahnd0);
> >	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> >  }
> 
> Sorry don't see ahnd0 being used in active_wakeup_ring() above? Rest looks
> fine but please let me know about this one issue. Thanks.

Good spot - you're right - it should be used in spinner. I'm going send
in new series.

Thanks for the review.
--
Zbigniew


More information about the igt-dev mailing list