Commit 951e15c2 authored by Kent Russell's avatar Kent Russell Committed by Alex Deucher

drm/powerplay: Fix Vega20 power reading again

For the 40.46 SMU release, they changed CurrSocketPower to
AverageSocketPower, but this was changed back in 40.47 so just check if
it's 40.46 and make the appropriate change

Tested with 40.45, 40.46 and 40.47 successfully
Signed-off-by: default avatarKent Russell <kent.russell@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b313bbeb
...@@ -2101,10 +2101,11 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr, ...@@ -2101,10 +2101,11 @@ static int vega20_get_gpu_power(struct pp_hwmgr *hwmgr,
if (ret) if (ret)
return ret; return ret;
if (hwmgr->smu_version < 0x282e00) /* For the 40.46 release, they changed the value name */
*query = metrics_table.CurrSocketPower << 8; if (hwmgr->smu_version == 0x282e00)
else
*query = metrics_table.AverageSocketPower << 8; *query = metrics_table.AverageSocketPower << 8;
else
*query = metrics_table.CurrSocketPower << 8;
return ret; return ret;
} }
......
...@@ -2932,10 +2932,11 @@ static int vega20_get_gpu_power(struct smu_context *smu, uint32_t *value) ...@@ -2932,10 +2932,11 @@ static int vega20_get_gpu_power(struct smu_context *smu, uint32_t *value)
if (ret) if (ret)
return ret; return ret;
if (smu_version < 0x282e00) /* For the 40.46 release, they changed the value name */
*value = metrics.CurrSocketPower << 8; if (smu_version == 0x282e00)
else
*value = metrics.AverageSocketPower << 8; *value = metrics.AverageSocketPower << 8;
else
*value = metrics.CurrSocketPower << 8;
return 0; return 0;
} }
......
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