[v2 14/31] drm/xe: Introduce helper to get tile from memory region

Matthew Brost matthew.brost at intel.com
Wed Apr 10 21:17:28 UTC 2024


On Tue, Apr 09, 2024 at 04:17:25PM -0400, Oak Zeng wrote:
> Introduce a simple helper to retrieve tile from memory region
> 
> v1: move the function to xe_device.h (Matt)
>     improve commit message, add kerneldoc (Thomas)
> 
> Signed-off-by: Oak Zeng <oak.zeng at intel.com>

This LGTM but can it be moved to xe_tile.h? That might be a better place
but I know xe_device.h and xe_tile.h are intertwined a bit.

Matt

> ---
>  drivers/gpu/drm/xe/xe_device.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index 74eb9833d4d8..68082357aebd 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -178,4 +178,12 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address);
>  
>  void xe_device_put_deferred(struct xe_device *xe, struct llist_node *deferred);
>  
> +/**
> + * xe_mem_region_to_tile() - retrieve tile from memory region
> + * @mr: the memory region we retrieve tile from
> + */
> +static inline struct xe_tile *xe_mem_region_to_tile(struct xe_mem_region *mr)
> +{
> +	return container_of(mr, struct xe_tile, mem.vram);
> +}
>  #endif
> -- 
> 2.26.3
> 


More information about the Intel-xe mailing list