[PATCH 1/2] drm/amdgpu/smu12: fix power reporting on CZN/BCL
Alex Deucher
alexander.deucher at amd.com
Thu Jan 12 16:24:42 UTC 2023
The metrics interface exposes the socket power in W, but
apparently RN systems exposed the power as mW. See
commit 137aac26a2ed ("drm/amdgpu/smu12: fix power reporting on renoir").
So leave RN as mW and use W for CZN/BCL.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2321
Fixes: 137aac26a2ed ("drm/amdgpu/smu12: fix power reporting on renoir")
Cc: jesse.zhang at amd.com
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
index 85e22210963f..77308d481c54 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
@@ -1196,7 +1196,10 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
*value = metrics->AverageUvdActivity / 100;
break;
case METRICS_AVERAGE_SOCKETPOWER:
- *value = (metrics->CurrentSocketPower << 8) / 1000;
+ if (smu->adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0))
+ *value = (metrics->CurrentSocketPower << 8) / 1000; /* mW */
+ else
+ *value = metrics->CurrentSocketPower << 8; /* W */
break;
case METRICS_TEMPERATURE_EDGE:
*value = (metrics->GfxTemperature / 100) *
--
2.39.0
More information about the amd-gfx
mailing list