diff options
author | Kevin Wang <kevin1.wang@amd.com> | 2019-04-17 14:58:28 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-21 18:59:29 -0500 |
commit | 98e1a543c7b1af60efee0f019773ee097bd50bba (patch) | |
tree | 62f2862f4b8dbdf6d11828470b6a8f4d43c0494e /drivers/gpu/drm/amd/powerplay/smu_v11_0.c | |
parent | bbd7a6535002289d3ddaf30b8377b492983712df (diff) | |
download | linux-98e1a543c7b1af60efee0f019773ee097bd50bba.tar.bz2 |
drm/amd/powerplay: add function get current clock freq interface for navi10
add function of get_current_clk_freq_by_table for navi10.
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smu_v11_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index fdd6562b3abf..b0b8aeebe2ba 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -1084,6 +1084,10 @@ static int smu_v11_0_get_current_clk_freq(struct smu_context *smu, if (clk_id >= SMU_CLK_COUNT || !value) 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) + return smu_get_current_clk_freq_by_table(smu, clk_id, value); + ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDpmClockFreq, (smu_clk_get_index(smu, clk_id) << 16)); if (ret) |