[PATCH 1/2] drm/xe: Add has_wmtp GT info

Nirmoy Das nirmoy.das at linux.intel.com
Fri Aug 9 11:55:52 UTC 2024


On 8/9/2024 12:47 PM, Nirmoy Das wrote:
> Add a GT info member to reflect wmtp feature status.
>
> Cc: Francois Dugast <francois.dugast at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Cc: Mateusz Jablonski <mateusz.jablonski at intel.com>
> Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_gt_types.h  |  2 ++
>   drivers/gpu/drm/xe/xe_hw_engine.c | 15 +++++++++++----
>   2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
> index 631928258d71..bba212924e21 100644
> --- a/drivers/gpu/drm/xe/xe_gt_types.h
> +++ b/drivers/gpu/drm/xe/xe_gt_types.h
> @@ -131,6 +131,8 @@ struct xe_gt {
>   		u8 id;
>   		/** @info.has_indirect_ring_state: GT has indirect ring state support */
>   		u8 has_indirect_ring_state:1;
> +		/** @has_wmtp: gt supports mid-thread preemption */


It should be @info.has_wmtp. I will fix it in future rev.


Thanks,

Nirmoy

> +		bool has_wmtp;
>   	} info;
>   
>   	/**
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index 402dfa748e16..7ddffc596dc1 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> @@ -347,14 +347,11 @@ static bool xe_hw_engine_match_fixed_cslice_mode(const struct xe_gt *gt,
>   static bool xe_rtp_cfeg_wmtp_disabled(const struct xe_gt *gt,
>   				      const struct xe_hw_engine *hwe)
>   {
> -	if (GRAPHICS_VER(gt_to_xe(gt)) < 20)
> -		return false;
> -
>   	if (hwe->class != XE_ENGINE_CLASS_COMPUTE &&
>   	    hwe->class != XE_ENGINE_CLASS_RENDER)
>   		return false;
>   
> -	return xe_mmio_read32(hwe->gt, XEHP_FUSE4) & CFEG_WMTP_DISABLE;
> +	return !gt->info.has_wmtp;
>   }
>   
>   void
> @@ -736,6 +733,15 @@ static void read_compute_fuses(struct xe_gt *gt)
>   		read_compute_fuses_from_dss(gt);
>   }
>   
> +static void read_wmtp_fuses(struct xe_gt *gt)
> +{
> +	if (GRAPHICS_VER(gt_to_xe(gt)) < 20)
> +		return;
> +
> +	gt->info.has_wmtp = !(xe_mmio_read32(gt, XEHP_FUSE4) &
> +			    CFEG_WMTP_DISABLE);
> +}
> +
>   static void check_gsc_availability(struct xe_gt *gt)
>   {
>   	struct xe_device *xe = gt_to_xe(gt);
> @@ -766,6 +772,7 @@ int xe_hw_engines_init_early(struct xe_gt *gt)
>   	read_media_fuses(gt);
>   	read_copy_fuses(gt);
>   	read_compute_fuses(gt);
> +	read_wmtp_fuses(gt);
>   	check_gsc_availability(gt);
>   
>   	BUILD_BUG_ON(XE_HW_ENGINE_PREEMPT_TIMEOUT < XE_HW_ENGINE_PREEMPT_TIMEOUT_MIN);


More information about the Intel-xe mailing list