[PATCH v5 02/25] drm/gpuvm: Kill drm_gpuva_init()

Matthew Brost matthew.brost at intel.com
Tue Aug 5 03:45:54 UTC 2025


On Wed, Jul 30, 2025 at 06:30:27PM +0530, Himal Prasad Ghimiray wrote:
> From: Boris Brezillon <boris.brezillon at collabora.com>
> 
> drm_gpuva_init() only has one internal user, and given we are about to
> add new optional fields, it only add maintenance burden for no real
> benefit, so let's kill the thing now.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> Signed-off-by: Caterina Shablia <caterina.shablia at collabora.com>
> Acked-by: Danilo Krummrich <dakr at kernel.org>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  include/drm/drm_gpuvm.h | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h
> index 892ffe75a62f..2d24d000f2ee 100644
> --- a/include/drm/drm_gpuvm.h
> +++ b/include/drm/drm_gpuvm.h
> @@ -160,15 +160,6 @@ struct drm_gpuva *drm_gpuva_find_first(struct drm_gpuvm *gpuvm,
>  struct drm_gpuva *drm_gpuva_find_prev(struct drm_gpuvm *gpuvm, u64 start);
>  struct drm_gpuva *drm_gpuva_find_next(struct drm_gpuvm *gpuvm, u64 end);
>  
> -static inline void drm_gpuva_init(struct drm_gpuva *va, u64 addr, u64 range,
> -				  struct drm_gem_object *obj, u64 offset)
> -{
> -	va->va.addr = addr;
> -	va->va.range = range;
> -	va->gem.obj = obj;
> -	va->gem.offset = offset;
> -}
> -
>  /**
>   * drm_gpuva_invalidate() - sets whether the backing GEM of this &drm_gpuva is
>   * invalidated
> @@ -1079,8 +1070,10 @@ void drm_gpuva_ops_free(struct drm_gpuvm *gpuvm,
>  static inline void drm_gpuva_init_from_op(struct drm_gpuva *va,
>  					  struct drm_gpuva_op_map *op)
>  {
> -	drm_gpuva_init(va, op->va.addr, op->va.range,
> -		       op->gem.obj, op->gem.offset);
> +	va->va.addr = op->va.addr;
> +	va->va.range = op->va.range;
> +	va->gem.obj = op->gem.obj;
> +	va->gem.offset = op->gem.offset;
>  }
>  
>  /**
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list