[igt-dev] [PATCH i-g-t v3 01/52] lib/igt_dummyload: Add support of using allocator in igt spinner

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed Aug 4 06:19:58 UTC 2021


On Tue, Aug 03, 2021 at 04:07:07PM -0700, Dixit, Ashutosh wrote:
> On Mon, 26 Jul 2021 12:59:35 -0700, Zbigniew Kempczyński wrote:
> >
> > @@ -164,16 +171,34 @@ emit_recursive_batch(igt_spin_t *spin,
> >	execbuf->buffer_count++;
> >	cs = spin->batch;
> >
> > -	obj[BATCH].offset = addr;
> > +	if (ahnd)
> > +		addr = intel_allocator_alloc_with_strategy(ahnd, obj[BATCH].handle,
> > +							   BATCH_SIZE, 0,
> > +							   ALLOC_STRATEGY_LOW_TO_HIGH);
> 
> Is the strategy argument just for debug, so that spin offsets look
> different from offsets for other objects? Since everyone should be
> allocating from the same allocator which is managing offsets this should
> probably not be needed?

I wanted to be consisted with reloc version. Currently it randomize offsets
within first 32bit gtt space (see comment in emit_recursive_batch()).

Simple allocator starts from high->low from default so to be consisted 
I've added LOW_TO_HIGH flag to alloc offsets on low vm address space.

--
Zbigniew

> 
> In any case, the patch is great, so this is:
> 
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>


More information about the igt-dev mailing list