summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
diff options
context:
space:
mode:
authorKent Russell <kent.russell@amd.com>2019-08-22 14:17:40 +0200
committerAlex Deucher <alexander.deucher@amd.com>2019-08-23 00:17:35 +0200
commit32e40ffbced3b14ceac1ae13a1a66c5849a6d2d3 (patch)
treebf617e730df6fd4065c7206e06c24709d85ce797 /drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
parentamd/amdgpu: add Arcturus vf DID support (diff)
downloadlinux-32e40ffbced3b14ceac1ae13a1a66c5849a6d2d3.tar.xz
linux-32e40ffbced3b14ceac1ae13a1a66c5849a6d2d3.zip
drm/powerplay: Fix Vega20 Average Power value v4
The SMU changed reading from CurrSocketPower to AverageSocketPower, so reflect this accordingly. This fixes the issue where Average Power Consumption was being reported as 0 from SMU 40.46-onward v2: Fixed headline prefix v3: Add check for SMU version for proper compatibility v4: Style fix Signed-off-by: Kent Russell <kent.russell@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
index 0516c294b377..9f50a12f5c03 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
@@ -2101,7 +2101,10 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,
if (ret)
return ret;
- *query = metrics_table.CurrSocketPower << 8;
+ if (hwmgr->smu_version < 0x282e00)
+ *query = metrics_table.CurrSocketPower << 8;
+ else
+ *query = metrics_table.AverageSocketPower << 8;
return ret;
}