Commit e3618249 authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/powerplay: fix dpm freq unit error (10KHz -> Mhz)

the interface smu_v11_0_get_current_clk_freq should be return 10Khz not
Mhz unit to adapt vega20 and navi10 asic at the same time.
Signed-off-by: default avatarKevin Wang <kevin1.wang@amd.com>
Acked-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 162aa5c3
...@@ -581,6 +581,8 @@ static int navi10_print_clk_levels(struct smu_context *smu, ...@@ -581,6 +581,8 @@ static int navi10_print_clk_levels(struct smu_context *smu,
ret = smu_get_current_clk_freq(smu, clk_type, &cur_value); ret = smu_get_current_clk_freq(smu, clk_type, &cur_value);
if (ret) if (ret)
return size; return size;
/* 10KHz -> MHz */
cur_value = cur_value / 100;
size += sprintf(buf, "current clk: %uMhz\n", cur_value); size += sprintf(buf, "current clk: %uMhz\n", cur_value);
......
...@@ -1098,8 +1098,8 @@ static int smu_v11_0_get_current_clk_freq(struct smu_context *smu, ...@@ -1098,8 +1098,8 @@ static int smu_v11_0_get_current_clk_freq(struct smu_context *smu,
/* if don't has GetDpmClockFreq Message, try get current clock by SmuMetrics_t */ /* if don't has GetDpmClockFreq Message, try get current clock by SmuMetrics_t */
if (smu_msg_get_index(smu, SMU_MSG_GetDpmClockFreq) == 0) if (smu_msg_get_index(smu, SMU_MSG_GetDpmClockFreq) == 0)
return smu_get_current_clk_freq_by_table(smu, clk_id, value); ret = smu_get_current_clk_freq_by_table(smu, clk_id, &freq);
else {
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq, ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq,
(smu_clk_get_index(smu, clk_id) << 16)); (smu_clk_get_index(smu, clk_id) << 16));
if (ret) if (ret)
...@@ -1108,6 +1108,7 @@ static int smu_v11_0_get_current_clk_freq(struct smu_context *smu, ...@@ -1108,6 +1108,7 @@ static int smu_v11_0_get_current_clk_freq(struct smu_context *smu,
ret = smu_read_smc_arg(smu, &freq); ret = smu_read_smc_arg(smu, &freq);
if (ret) if (ret)
return ret; return ret;
}
freq *= 100; freq *= 100;
*value = freq; *value = freq;
......
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