Commit 2139d12b authored by Alex Deucher's avatar Alex Deucher

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: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6cc24d8d
...@@ -265,6 +265,12 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu, ...@@ -265,6 +265,12 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu,
case METRICS_THROTTLER_STATUS: case METRICS_THROTTLER_STATUS:
*value = metrics->ThrottlerStatus; *value = metrics->ThrottlerStatus;
break; break;
case METRICS_VOLTAGE_VDDGFX:
*value = metrics->Voltage[2];
break;
case METRICS_VOLTAGE_VDDSOC:
*value = metrics->Voltage[1];
break;
default: default:
*value = UINT_MAX; *value = UINT_MAX;
break; break;
...@@ -469,13 +475,21 @@ static int vangogh_read_sensor(struct smu_context *smu, ...@@ -469,13 +475,21 @@ static int vangogh_read_sensor(struct smu_context *smu,
break; break;
case AMDGPU_PP_SENSOR_GFX_SCLK: case AMDGPU_PP_SENSOR_GFX_SCLK:
ret = vangogh_get_smu_metrics_data(smu, ret = vangogh_get_smu_metrics_data(smu,
METRICS_AVERAGE_GFXCLK, METRICS_AVERAGE_GFXCLK,
(uint32_t *)data); (uint32_t *)data);
*(uint32_t *)data *= 100; *(uint32_t *)data *= 100;
*size = 4; *size = 4;
break; break;
case AMDGPU_PP_SENSOR_VDDGFX: 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; *size = 4;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment