[igt-dev] [PATCH i-g-t v18 24/31] tests/gem_linear_blits: Use intel allocator

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 1 08:41:18 UTC 2021


Quoting Zbigniew Kempczyński (2021-02-01 08:31:04)
> On Fri, Jan 29, 2021 at 03:49:38PM +0000, Chris Wilson wrote:
> > Why leave them as zero though? You can seed them with sensible
> > placements. Sell me on some benefits of this allocator.
> 
> For relocs using allocator doesn't makes sense (buffers offsets can be
> migrated within the kernel). And we have no method to synchronize it.
> I see no additional value of using offsets passed by allocator which
> could lead to confusion on the reader side.

Confusion or trying to find edge cases in the kernel? :)

For this, I was just looking for

src_offset = (*last_assigned_address += ALIGN(src_size, WORSTALIGN)) % gtt_size;
dst_offset = (*last_assigned_address += ALIGN(dst_size, WORSTALIGN)) % gtt_size;

As a means of pre-seeding the batch buffer. Which is [more or less] the
simple allocator. Call it the dumb allocator :) Or we just use the
random allocator, but in this case dumb would actually be better.
-Chris


More information about the igt-dev mailing list