diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2020-12-01 10:42:49 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-12-02 17:37:18 -0500 |
commit | 2139d12b3b5bba20f967ee8152e4ac05dbb5d089 (patch) | |
tree | 61bbd1e22773b14df4c40705594bf8311823a8b4 /drivers/gpu/drm/amd/pm/swsmu | |
parent | 6cc24d8d48e3fcdaca6154ab4e0db114e4d37b19 (diff) |
drm/amdgpu/swsmu/vangogh: use metrics table for voltages (v2)
Fixes voltage reading for vddgfx and adds support for vddsoc.
v2: use new voltage enum
Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu')
-rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 20 |
1 files changed, 17 insertions, 3 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 a1c582395c67..ddaa6a705fa6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -265,6 +265,12 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu, case METRICS_THROTTLER_STATUS: *value = metrics->ThrottlerStatus; break; + case METRICS_VOLTAGE_VDDGFX: + *value = metrics->Voltage[2]; + break; + case METRICS_VOLTAGE_VDDSOC: + *value = metrics->Voltage[1]; + break; default: *value = UINT_MAX; break; @@ -469,13 +475,21 @@ static int vangogh_read_sensor(struct smu_context *smu, break; case AMDGPU_PP_SENSOR_GFX_SCLK: ret = vangogh_get_smu_metrics_data(smu, - METRICS_AVERAGE_GFXCLK, - (uint32_t *)data); + METRICS_AVERAGE_GFXCLK, + (uint32_t *)data); *(uint32_t *)data *= 100; *size = 4; break; case AMDGPU_PP_SENSOR_VDDGFX: - ret = smu_v11_0_get_gfx_vdd(smu, (uint32_t *)data); + ret = vangogh_get_smu_metrics_data(smu, + METRICS_VOLTAGE_VDDGFX, + (uint32_t *)data); + *size = 4; + break; + case AMDGPU_PP_SENSOR_VDDNB: + ret = vangogh_get_smu_metrics_data(smu, + METRICS_VOLTAGE_VDDSOC, + (uint32_t *)data); *size = 4; break; default: |