aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/sumo_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-09-30 10:58:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-03-19 12:26:34 -0400
commit2f8e1eb7d665ca060fc93e9dfd268dee59bd8697 (patch)
treebcef8117777f356d9eb082272d5f912e72a70dae /drivers/gpu/drm/radeon/sumo_dpm.c
parentdbbd3c81b042ea2e87b37a6945ed8a31aaaaafec (diff)
drm/radeon/sumo: 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/sumo_dpm.c')
-rw-r--r--drivers/gpu/drm/radeon/sumo_dpm.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index 25fd4ced36c8..cd0862809adf 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1837,6 +1837,34 @@ void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev
1837 } 1837 }
1838} 1838}
1839 1839
1840u32 sumo_dpm_get_current_sclk(struct radeon_device *rdev)
1841{
1842 struct sumo_power_info *pi = sumo_get_pi(rdev);
1843 struct radeon_ps *rps = &pi->current_rps;
1844 struct sumo_ps *ps = sumo_get_ps(rps);
1845 struct sumo_pl *pl;
1846 u32 current_index =
1847 (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_INDEX_MASK) >>
1848 CURR_INDEX_SHIFT;
1849
1850 if (current_index == BOOST_DPM_LEVEL) {
1851 pl = &pi->boost_pl;
1852 return pl->sclk;
1853 } else if (current_index >= ps->num_levels) {
1854 return 0;
1855 } else {
1856 pl = &ps->levels[current_index];
1857 return pl->sclk;
1858 }
1859}
1860
1861u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev)
1862{
1863 struct sumo_power_info *pi = sumo_get_pi(rdev);
1864
1865 return pi->sys_info.bootup_uma_clk;
1866}
1867
1840void sumo_dpm_fini(struct radeon_device *rdev) 1868void sumo_dpm_fini(struct radeon_device *rdev)
1841{ 1869{
1842 int i; 1870 int i;