aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-06-28 14:20:53 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-01 16:08:24 -0400
commit242916a5ee55a0ed49a2c74ee4d835fe9d8ca463 (patch)
treed10974d8f8b7b979d0cf912ab06d3f46f0fb36e2 /drivers/gpu
parent1316b79256062f7a2e66f0833dcb9728ec748805 (diff)
drm/radeon/dpm: add debugfs support for rv6xx
This allows you to look at the current DPM state via debugfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h2
-rw-r--r--drivers/gpu/drm/radeon/rv6xx_dpm.c25
3 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index c3df589715a0..58d4cc5c7c97 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1160,6 +1160,7 @@ static struct radeon_asic rv6xx_asic = {
1160 .get_sclk = &rv6xx_dpm_get_sclk, 1160 .get_sclk = &rv6xx_dpm_get_sclk,
1161 .get_mclk = &rv6xx_dpm_get_mclk, 1161 .get_mclk = &rv6xx_dpm_get_mclk,
1162 .print_power_state = &rv6xx_dpm_print_power_state, 1162 .print_power_state = &rv6xx_dpm_print_power_state,
1163 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
1163 }, 1164 },
1164 .pflip = { 1165 .pflip = {
1165 .pre_page_flip = &rs600_pre_page_flip, 1166 .pre_page_flip = &rs600_pre_page_flip,
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 2497d0a02de5..6b1ede11ed20 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -416,6 +416,8 @@ u32 rv6xx_dpm_get_sclk(struct radeon_device *rdev, bool low);
416u32 rv6xx_dpm_get_mclk(struct radeon_device *rdev, bool low); 416u32 rv6xx_dpm_get_mclk(struct radeon_device *rdev, bool low);
417void rv6xx_dpm_print_power_state(struct radeon_device *rdev, 417void rv6xx_dpm_print_power_state(struct radeon_device *rdev,
418 struct radeon_ps *ps); 418 struct radeon_ps *ps);
419void rv6xx_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
420 struct seq_file *m);
419/* rs780 dpm */ 421/* rs780 dpm */
420int rs780_dpm_init(struct radeon_device *rdev); 422int rs780_dpm_init(struct radeon_device *rdev);
421int rs780_dpm_enable(struct radeon_device *rdev); 423int rs780_dpm_enable(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c
index 0e8b7d9b954b..33705c5c8369 100644
--- a/drivers/gpu/drm/radeon/rv6xx_dpm.c
+++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c
@@ -2027,6 +2027,31 @@ void rv6xx_dpm_print_power_state(struct radeon_device *rdev,
2027 r600_dpm_print_ps_status(rdev, rps); 2027 r600_dpm_print_ps_status(rdev, rps);
2028} 2028}
2029 2029
2030void rv6xx_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
2031 struct seq_file *m)
2032{
2033 struct radeon_ps *rps = rdev->pm.dpm.current_ps;
2034 struct rv6xx_ps *ps = rv6xx_get_ps(rps);
2035 struct rv6xx_pl *pl;
2036 u32 current_index =
2037 (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_PROFILE_INDEX_MASK) >>
2038 CURRENT_PROFILE_INDEX_SHIFT;
2039
2040 if (current_index > 2) {
2041 seq_printf(m, "invalid dpm profile %d\n", current_index);
2042 } else {
2043 if (current_index == 0)
2044 pl = &ps->low;
2045 else if (current_index == 1)
2046 pl = &ps->medium;
2047 else /* current_index == 2 */
2048 pl = &ps->high;
2049 seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
2050 seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u\n",
2051 current_index, pl->sclk, pl->mclk, pl->vddc);
2052 }
2053}
2054
2030void rv6xx_dpm_fini(struct radeon_device *rdev) 2055void rv6xx_dpm_fini(struct radeon_device *rdev)
2031{ 2056{
2032 int i; 2057 int i;