diff options
author | Evan Quan <evan.quan@amd.com> | 2020-06-09 12:03:58 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-01 01:59:19 -0400 |
commit | b9fe63d2a030d04c876dc801f5953a54d81f527a (patch) | |
tree | bedd5841869f4c7920c05f81861376709c82b215 /drivers | |
parent | 947119a3f9c9f9212a89fe864f0c40e903b24af0 (diff) |
drm/amd/powerplay: drop unnecessary SMU_MSG_GetDpmClockFreq check
Since SMU_MSG_GetDpmClockFreq is known to be supported for Vega20
and before ASICs only. For those ASICs supporting swSMU, it is not
supported.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 9d29aa4e3a5d..1420426ab7d6 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -1089,24 +1089,13 @@ int smu_v11_0_get_current_clk_freq(struct smu_context *smu, { int ret = 0; uint32_t freq = 0; - int asic_clk_id; if (clk_id >= SMU_CLK_COUNT || !value) return -EINVAL; - asic_clk_id = smu_clk_get_index(smu, clk_id); - if (asic_clk_id < 0) - return -EINVAL; - - /* if don't has GetDpmClockFreq Message, try get current clock by SmuMetrics_t */ - if (smu_msg_get_index(smu, SMU_MSG_GetDpmClockFreq) < 0) - ret = smu_get_current_clk_freq_by_table(smu, clk_id, &freq); - else { - ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq, - (asic_clk_id << 16), &freq); - if (ret) - return ret; - } + ret = smu_get_current_clk_freq_by_table(smu, clk_id, &freq); + if (ret) + return ret; freq *= 100; *value = freq; |