[PATCH 2/5] drm/xe: Helper to get memory region from tile

Matthew Brost matthew.brost at intel.com
Thu Mar 14 17:33:21 UTC 2024


On Wed, Mar 13, 2024 at 11:35:50PM -0400, Oak Zeng wrote:
> Signed-off-by: Oak Zeng <oak.zeng at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device_types.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index f27c3bee8ce7..bbea40b57e84 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -571,4 +571,9 @@ struct xe_file {
>  	struct xe_drm_client *client;
>  };
>  
> +static inline struct xe_tile *mem_region_to_tile(struct xe_mem_region *mr)
> +{
> +	return container_of(mr, struct xe_tile, mem.vram);
> +}

Helper shouldn't be in *_types.h files, only struct def should be.

Also s/mem_region_to_tile/xe_mem_region_to_tile/

Matt

> +
>  #endif
> -- 
> 2.26.3
> 


More information about the Intel-xe mailing list