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

Thomas Hellström thomas.hellstrom at linux.intel.com
Mon Jun 26 14:55:29 UTC 2023


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).

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