Commit c59a722c authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: expose Vega12 current power

Provide the real sensor information for current power.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2adc1156
...@@ -1260,19 +1260,16 @@ static int vega12_get_metrics_table(struct pp_hwmgr *hwmgr, SmuMetrics_t *metric ...@@ -1260,19 +1260,16 @@ static int vega12_get_metrics_table(struct pp_hwmgr *hwmgr, SmuMetrics_t *metric
static int vega12_get_gpu_power(struct pp_hwmgr *hwmgr, uint32_t *query) static int vega12_get_gpu_power(struct pp_hwmgr *hwmgr, uint32_t *query)
{ {
#if 0 SmuMetrics_t metrics_table;
uint32_t value; int ret = 0;
PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr, ret = vega12_get_metrics_table(hwmgr, &metrics_table);
PPSMC_MSG_GetCurrPkgPwr), if (ret)
"Failed to get current package power!", return ret;
return -EINVAL);
value = smum_get_argument(hwmgr); *query = metrics_table.CurrSocketPower << 8;
/* power value is an integer */
*query = value << 8; return ret;
#endif
return 0;
} }
static int vega12_get_current_gfx_clk_freq(struct pp_hwmgr *hwmgr, uint32_t *gfx_freq) static int vega12_get_current_gfx_clk_freq(struct pp_hwmgr *hwmgr, uint32_t *gfx_freq)
...@@ -1389,6 +1386,8 @@ static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx, ...@@ -1389,6 +1386,8 @@ static int vega12_read_sensor(struct pp_hwmgr *hwmgr, int idx,
break; break;
case AMDGPU_PP_SENSOR_GPU_POWER: case AMDGPU_PP_SENSOR_GPU_POWER:
ret = vega12_get_gpu_power(hwmgr, (uint32_t *)value); ret = vega12_get_gpu_power(hwmgr, (uint32_t *)value);
if (!ret)
*size = 4;
break; break;
case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK: case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK:
ret = vega12_get_enabled_smc_features(hwmgr, (uint64_t *)value); ret = vega12_get_enabled_smc_features(hwmgr, (uint64_t *)value);
......
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