drm/amd/pm: revise two names of sensor values for vangogh
authorXiaojian Du <Xiaojian.Du@amd.com>
Wed, 14 Apr 2021 06:55:27 +0000 (14:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Apr 2021 20:32:45 +0000 (16:32 -0400)
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@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c

index 35904315c1f9241893dd2db7322d64b7b1d2e263..77f532a49e37f80fa21207c31310ccaf848721f8 100644 (file)
@@ -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;