[Intel-xe] [PATCH v3] drm/xe/bo: Return object bo size on create

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Jun 26 15:22:34 UTC 2023


On Mon, Jun 26, 2023 at 04:55:29PM +0200, Thomas Hellström wrote:
> Hi, Zbigniew,
> 
> On 6/26/23 16:42, Zbigniew Kempczyński wrote:
> > Driver may alter bo size requested by the user. Return real object
> > size to make userspace aware how to arrange vm bindings.
> 
> I think for Xe VM_BIND, the space needed for a bo with given size must be
> 
> ALIGN_TO(bo->size, xe_get_default_alignment())
> 
> (xe_get_default_alignment() being an igt xe lib function).

You mean I can't glue 4K system object with 64K one after another,
for example:

* bo on system: offset = 0x1000, size 0x1000
* bo on vram:   offset = 0x2000, size 0x10000

This won't work as vram object should be aligned on vm to 0x10000?

--
Zbigniew

> 
> Even the padded bo->size returned with this patch is lower than the value
> above. If you use that value, will the value assigned below still be needed.
> 
> /Thomas
> 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura at intel.com>
> > Reviewed-by: Matthew Brost <matthew.brost at intel.com>
> > ---
> >   drivers/gpu/drm/xe/xe_bo.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> > index 71a14e1f25be..55dbb374a787 100644
> > --- a/drivers/gpu/drm/xe/xe_bo.c
> > +++ b/drivers/gpu/drm/xe/xe_bo.c
> > @@ -1744,6 +1744,7 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
> >   		return err;
> >   	args->handle = handle;
> > +	args->size = bo->size;
> >   	return 0;
> >   }


More information about the Intel-xe mailing list