[igt-dev] [PATCH i-g-t 1/2] tests/gem_exec_store: Support gens without relocations
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Thu Mar 31 06:54:03 UTC 2022
On Tue, Mar 29, 2022 at 11:08:11PM -0700, Dixit, Ashutosh wrote:
> On Tue, 10 Aug 2021 12:14:24 -0700, Andrzej Turko wrote:
> >
> > @@ -213,24 +257,41 @@ static void store_all(int fd, const intel_ctx_t *ctx)
> > execbuf.flags |= I915_EXEC_SECURE;
> > execbuf.rsvd1 = ctx->id;
> >
> > + ahnd = intel_allocator_open(fd, ctx->id, INTEL_ALLOCATOR_SIMPLE);
> > +
> > memset(obj, 0, sizeof(obj));
> > obj[0].handle = gem_create(fd, nengine*sizeof(uint32_t));
> > + obj[0].offset = intel_allocator_alloc(ahnd, obj[0].handle,
> > + nengine*sizeof(uint32_t), ALIGNMENT);
> > + obj[0].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_WRITE;
> > + obj[0].offset = CANONICAL(obj[0].offset);
> > obj[1].handle = gem_create(fd, 2*nengine*sizeof(batch));
> > - obj[1].relocation_count = 1;
> > + obj[1].offset = intel_allocator_alloc(ahnd, obj[1].handle,
> > + nengine*sizeof(uint32_t), ALIGNMENT);
>
> Is this correct, or should the size argument be 2*nengine*sizeof(batch)
> (instead of nengine*sizeof(uint32_t))?
Definitely yes. Further allocations still can fit into hole between objects.
I would remove ALIGNMENT at all. It should work because we now use safe
alignment as you proposed couple of weeks ago (that was very good idea).
--
Zbigniew
>
> > + obj[1].offset = CANONICAL(obj[1].offset);
> > + obj[1].flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
More information about the igt-dev
mailing list