Commit 28e732dc authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: correct Vega20 gfxclk readout under DS

Current implementation cannot report the correct gfxclk under DS.
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 d2c460e7
...@@ -2013,16 +2013,20 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx, ...@@ -2013,16 +2013,20 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,
{ {
struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);
struct amdgpu_device *adev = hwmgr->adev; struct amdgpu_device *adev = hwmgr->adev;
SmuMetrics_t metrics_table;
uint32_t val_vid; uint32_t val_vid;
int ret = 0; int ret = 0;
switch (idx) { switch (idx) {
case AMDGPU_PP_SENSOR_GFX_SCLK: case AMDGPU_PP_SENSOR_GFX_SCLK:
ret = vega20_get_current_clk_freq(hwmgr, ret = smum_smc_table_manager(hwmgr, (uint8_t *)&metrics_table,
PPCLK_GFXCLK, TABLE_SMU_METRICS, true);
(uint32_t *)value); PP_ASSERT_WITH_CODE(!ret,
if (!ret) "Failed to export SMU METRICS table!",
*size = 4; return ret);
*((uint32_t *)value) = metrics_table.AverageGfxclkFrequency * 100;
*size = 4;
break; break;
case AMDGPU_PP_SENSOR_GFX_MCLK: case AMDGPU_PP_SENSOR_GFX_MCLK:
ret = vega20_get_current_clk_freq(hwmgr, ret = vega20_get_current_clk_freq(hwmgr,
......
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