[PATCH v4 3/7] drm/gpuvm: Pass map arguments through a struct

Boris Brezillon boris.brezillon at collabora.com
Thu Aug 21 11:53:20 UTC 2025


On Mon, 07 Jul 2025 20:44:49 +0200
"Danilo Krummrich" <dakr at kernel.org> wrote:

> On Mon Jul 7, 2025 at 7:04 PM CEST, Caterina Shablia wrote:
> > +/**
> > + * struct drm_gpuvm_map_req - arguments passed to drm_gpuvm_sm_map[_ops_create]()
> > + */
> > +struct drm_gpuvm_map_req {
> > +	/** @va: virtual address related fields */
> > +	struct {
> > +		/** @va.addr: start of the virtual address range to map to */
> > +		u64 addr;
> > +
> > +		/** @va.size: size of the virtual address range to map to */
> > +		u64 range;
> > +	} va;
> > +
> > +	/** @gem: GEM related fields */
> > +	struct {
> > +		/**
> > +		 * @obj: GEM object to map.
> > +		 *
> > +		 * Can be NULL if the virtual range is not backed by a GEM object.
> > +		 */
> > +		struct drm_gem_object *obj;
> > +
> > +		/** @offset: offset in the GEM */
> > +		u64 offset;
> > +	} gem;
> > +};  
> 
> Can't we just use struct drm_gpuva_op_map instead? The structure is identical
> and represents exactly what we want, a map operation.

Sure, we can do that. The only reason I didn't is because I thought it
was preferable to distinguish a map request from the sub-operation it
might be split into (the latter being described by drm_gpuva_op_map).

> 
> Let's use that instead of redefining an identical structure.
> 
> With that,
> 
> 	Acked-by: Danilo Krummrich <dakr at kernel.org>



More information about the Intel-xe mailing list