diff options
author | Evan Quan <evan.quan@amd.com> | 2018-06-19 11:32:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-09-14 10:37:06 -0400 |
commit | fa27203f8af9c6ed5ab88860f9a83cbc13ab786f (patch) | |
tree | c53b1cf8329b2bdd298f42e66bd835d11d5689b5 /drivers/gpu | |
parent | 3e9d06b56f405aa53675efdc81a5417da6fc130a (diff) |
drm/amd/powerplay: round up the Mhz convertion (v2)
Since the clock value there may be like 29999 10Khz.
v2: rebase (Alex)
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c index 26d130a91725..5b55c709fb1c 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | |||
@@ -211,12 +211,18 @@ static int smu10_set_clock_limit(struct pp_hwmgr *hwmgr, const void *input) | |||
211 | return 0; | 211 | return 0; |
212 | } | 212 | } |
213 | 213 | ||
214 | static inline uint32_t convert_10k_to_mhz(uint32_t clock) | ||
215 | { | ||
216 | return (clock + 99) / 100; | ||
217 | } | ||
218 | |||
214 | static int smu10_set_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clock) | 219 | static int smu10_set_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clock) |
215 | { | 220 | { |
216 | struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend); | 221 | struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend); |
217 | 222 | ||
218 | if (smu10_data->need_min_deep_sleep_dcefclk && smu10_data->deep_sleep_dcefclk != clock/100) { | 223 | if (smu10_data->need_min_deep_sleep_dcefclk && |
219 | smu10_data->deep_sleep_dcefclk = clock/100; | 224 | smu10_data->deep_sleep_dcefclk != convert_10k_to_mhz(clock)) { |
225 | smu10_data->deep_sleep_dcefclk = convert_10k_to_mhz(clock); | ||
220 | smum_send_msg_to_smc_with_parameter(hwmgr, | 226 | smum_send_msg_to_smc_with_parameter(hwmgr, |
221 | PPSMC_MSG_SetMinDeepSleepDcefclk, | 227 | PPSMC_MSG_SetMinDeepSleepDcefclk, |
222 | smu10_data->deep_sleep_dcefclk); | 228 | smu10_data->deep_sleep_dcefclk); |