[PATCH v2 3/7] drm/xe: Introduce xe_tile_is_root helper

Piotr Piórkowski piotr.piorkowski at intel.com
Fri Jun 27 14:36:21 UTC 2025


Michal Wajdeczko <michal.wajdeczko at intel.com> wrote on pią [2025-cze-27 14:49:12 +0200]:
> Instead of looking at the tile->id member provide a small helper
> to explicitly express our intentions.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device.h    | 5 +++++
>  drivers/gpu/drm/xe/xe_gsc_proxy.c | 2 +-
>  drivers/gpu/drm/xe/xe_irq.c       | 2 +-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index e4da797a984b..741afb7029f5 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -60,6 +60,11 @@ static inline struct xe_tile *xe_device_get_root_tile(struct xe_device *xe)
>  	return &xe->tiles[0];
>  }
>  
> +static inline bool xe_tile_is_root(struct xe_tile *tile)
> +{
> +	return xe_device_get_root_tile(tile->xe) == tile;
> +}
> +
>  #define XE_MAX_GT_PER_TILE 2
>  
>  static inline struct xe_gt *xe_tile_get_gt(struct xe_tile *tile, u8 gt_id)
> diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c b/drivers/gpu/drm/xe/xe_gsc_proxy.c
> index d0519cd6704a..3ca8af721435 100644
> --- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
> +++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
> @@ -483,7 +483,7 @@ int xe_gsc_proxy_init(struct xe_gsc *gsc)
>  	}
>  
>  	/* no multi-tile devices with this feature yet */
> -	if (tile->id > 0) {
> +	if (!xe_tile_is_root(tile)) {
>  		xe_gt_err(gt, "unexpected GSC proxy init on tile %u\n", tile->id);
>  		return -EINVAL;
>  	}
> diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
> index 5362d3174b06..1e6540ce9914 100644
> --- a/drivers/gpu/drm/xe/xe_irq.c
> +++ b/drivers/gpu/drm/xe/xe_irq.c
> @@ -550,7 +550,7 @@ static void xelp_irq_reset(struct xe_tile *tile)
>  
>  static void dg1_irq_reset(struct xe_tile *tile)
>  {
> -	if (tile->id == 0)
> +	if (xe_tile_is_root(tile))
>  		dg1_intr_disable(tile_to_xe(tile));
>  
>  	gt_irq_reset(tile);

LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski at intel.com>

> -- 
> 2.47.1
> 

-- 


More information about the Intel-xe mailing list