[PATCH] drm/amd/pm: revise two names of sensor values for vangogh

Huang Rui ray.huang at amd.com
Thu Apr 15 08:18:08 UTC 2021


On Wed, Apr 14, 2021 at 03:25:55PM +0800, Du, Xiaojian wrote:
> This patch is to revise two names of  sensor values for vangogh.
> New smu metrics table is supported by new pmfw
> (from version 4.63.36.00 ), it includes two parts, one part is
> the current smu metrics table data and the other part is the
> average smu metrics table data. The hwmon will read the current gfxclk
> and mclk from the current smu metrics table data.
> 
> Signed-off-by: Xiaojian Du <Xiaojian.Du at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 35904315c1f9..77f532a49e37 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -270,7 +270,7 @@ static int vangogh_get_legacy_smu_metrics_data(struct smu_context *smu,
>  	}
>  
>  	switch (member) {
> -	case METRICS_AVERAGE_GFXCLK:
> +	case METRICS_CURR_GFXCLK:
>  		*value = metrics->GfxclkFrequency;
>  		break;
>  	case METRICS_AVERAGE_SOCCLK:
> @@ -282,7 +282,7 @@ static int vangogh_get_legacy_smu_metrics_data(struct smu_context *smu,
>  	case METRICS_AVERAGE_DCLK:
>  		*value = metrics->DclkFrequency;
>  		break;
> -	case METRICS_AVERAGE_UCLK:
> +	case METRICS_CURR_UCLK:
>  		*value = metrics->MemclkFrequency;
>  		break;
>  	case METRICS_AVERAGE_GFXACTIVITY:
> @@ -345,7 +345,7 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu,
>  	}
>  
>  	switch (member) {
> -	case METRICS_AVERAGE_GFXCLK:
> +	case METRICS_CURR_GFXCLK:
>  		*value = metrics->Current.GfxclkFrequency;
>  		break;
>  	case METRICS_AVERAGE_SOCCLK:
> @@ -357,7 +357,7 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu,
>  	case METRICS_AVERAGE_DCLK:
>  		*value = metrics->Current.DclkFrequency;
>  		break;
> -	case METRICS_AVERAGE_UCLK:
> +	case METRICS_CURR_UCLK:
>  		*value = metrics->Current.MemclkFrequency;
>  		break;
>  	case METRICS_AVERAGE_GFXACTIVITY:
> @@ -1529,14 +1529,14 @@ static int vangogh_read_sensor(struct smu_context *smu,
>  		break;
>  	case AMDGPU_PP_SENSOR_GFX_MCLK:
>  		ret = vangogh_common_get_smu_metrics_data(smu,
> -						   METRICS_AVERAGE_UCLK,
> +						   METRICS_CURR_UCLK,
>  						   (uint32_t *)data);
>  		*(uint32_t *)data *= 100;
>  		*size = 4;
>  		break;
>  	case AMDGPU_PP_SENSOR_GFX_SCLK:
>  		ret = vangogh_common_get_smu_metrics_data(smu,
> -						   METRICS_AVERAGE_GFXCLK,
> +						   METRICS_CURR_GFXCLK,
>  						   (uint32_t *)data);
>  		*(uint32_t *)data *= 100;
>  		*size = 4;
> -- 
> 2.25.1
> 


More information about the amd-gfx mailing list