[Intel-xe] [PATCH] drm/xe/guc_pc: Replace platform check with IP version

Matt Roper matthew.d.roper at intel.com
Thu Aug 24 19:38:33 UTC 2023


On Tue, Aug 22, 2023 at 01:37:20PM -0700, Lucas De Marchi wrote:
> Instead of checking for MTL to decide what RPS registers to use, check
> for IP version, assuming new platforms will use the more recent
> functions rather than the oldest.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_guc_pc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> index c03bb58e7049..b01ac684d631 100644
> --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> @@ -340,7 +340,7 @@ static void pc_update_rp_values(struct xe_guc_pc *pc)
>  	struct xe_gt *gt = pc_to_gt(pc);
>  	struct xe_device *xe = gt_to_xe(gt);
>  
> -	if (xe->info.platform == XE_METEORLAKE)
> +	if (GRAPHICS_VERx100(xe) >= 1270)
>  		mtl_update_rpe_value(pc);
>  	else
>  		tgl_update_rpe_value(pc);
> @@ -365,7 +365,7 @@ static ssize_t freq_act_show(struct device *dev,
>  	xe_device_mem_access_get(gt_to_xe(gt));
>  
>  	/* When in RC6, actual frequency reported will be 0. */
> -	if (xe->info.platform == XE_METEORLAKE) {
> +	if (GRAPHICS_VERx100(xe) >= 1270) {
>  		freq = xe_mmio_read32(gt, MTL_MIRROR_TARGET_WP1);
>  		freq = REG_FIELD_GET(MTL_CAGF_MASK, freq);
>  	} else {
> @@ -680,7 +680,7 @@ static void pc_init_fused_rp_values(struct xe_guc_pc *pc)
>  	struct xe_gt *gt = pc_to_gt(pc);
>  	struct xe_device *xe = gt_to_xe(gt);
>  
> -	if (xe->info.platform == XE_METEORLAKE)
> +	if (GRAPHICS_VERx100(xe) >= 1270)
>  		mtl_init_fused_rp_values(pc);
>  	else
>  		tgl_init_fused_rp_values(pc);
> -- 
> 2.40.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list