diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2014-09-30 19:21:23 +0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-03-19 19:26:36 +0300 |
commit | 9b23bad03263c5496bac2cbb2c2630cb3b8b38be (patch) | |
tree | 72fb80e60891350eba25817a06c3c9bd66d067c7 /drivers/gpu/drm/radeon/kv_dpm.c | |
parent | 7ce9cdaec35db4c13f2f34dcb63d8bf6f290ffd0 (diff) | |
download | linux-9b23bad03263c5496bac2cbb2c2630cb3b8b38be.tar.xz |
drm/radeon/kv: implement get_current_sclk/mclk
Will be used for exposing current clocks via INFO ioctl.
Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/kv_dpm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/kv_dpm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 0e236d067d66..2d71da448487 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -2820,6 +2820,29 @@ void kv_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, } } +u32 kv_dpm_get_current_sclk(struct radeon_device *rdev) +{ + struct kv_power_info *pi = kv_get_pi(rdev); + u32 current_index = + (RREG32_SMC(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_SCLK_INDEX_MASK) >> + CURR_SCLK_INDEX_SHIFT; + u32 sclk; + + if (current_index >= SMU__NUM_SCLK_DPM_STATE) { + return 0; + } else { + sclk = be32_to_cpu(pi->graphics_level[current_index].SclkFrequency); + return sclk; + } +} + +u32 kv_dpm_get_current_mclk(struct radeon_device *rdev) +{ + struct kv_power_info *pi = kv_get_pi(rdev); + + return pi->sys_info.bootup_uma_clk; +} + void kv_dpm_print_power_state(struct radeon_device *rdev, struct radeon_ps *rps) { |