aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-06-28 10:47:56 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-01 16:08:41 -0400
commitfb70160c5f2ae1b0648801f39138b25990f7ae18 (patch)
treedf92f421cbef15d34e6c7a57a5651c5884e1895b
parentbd210d11cd37bee3da729e56288b5b4a038f88bd (diff)
drm/radeon/dpm: add debugfs support for ON/LN
This allows you to look at the current DPM state via debugfs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-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/sumo_dpm.c28
3 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index a2a34f86434b..6d4304cce83f 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1638,6 +1638,7 @@ static struct radeon_asic sumo_asic = {
1638 .get_sclk = &sumo_dpm_get_sclk, 1638 .get_sclk = &sumo_dpm_get_sclk,
1639 .get_mclk = &sumo_dpm_get_mclk, 1639 .get_mclk = &sumo_dpm_get_mclk,
1640 .print_power_state = &sumo_dpm_print_power_state, 1640 .print_power_state = &sumo_dpm_print_power_state,
1641 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
1641 }, 1642 },
1642 .pflip = { 1643 .pflip = {
1643 .pre_page_flip = &evergreen_pre_page_flip, 1644 .pre_page_flip = &evergreen_pre_page_flip,
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 39f5d96d7c49..958d30f33066 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -565,6 +565,8 @@ u32 sumo_dpm_get_sclk(struct radeon_device *rdev, bool low);
565u32 sumo_dpm_get_mclk(struct radeon_device *rdev, bool low); 565u32 sumo_dpm_get_mclk(struct radeon_device *rdev, bool low);
566void sumo_dpm_print_power_state(struct radeon_device *rdev, 566void sumo_dpm_print_power_state(struct radeon_device *rdev,
567 struct radeon_ps *ps); 567 struct radeon_ps *ps);
568void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
569 struct seq_file *m);
568 570
569/* 571/*
570 * cayman 572 * cayman
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index 0c3d7526cda5..68fefb916582 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1752,6 +1752,34 @@ void sumo_dpm_print_power_state(struct radeon_device *rdev,
1752 r600_dpm_print_ps_status(rdev, rps); 1752 r600_dpm_print_ps_status(rdev, rps);
1753} 1753}
1754 1754
1755void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
1756 struct seq_file *m)
1757{
1758 struct sumo_power_info *pi = sumo_get_pi(rdev);
1759 struct radeon_ps *rps = rdev->pm.dpm.current_ps;
1760 struct sumo_ps *ps = sumo_get_ps(rps);
1761 struct sumo_pl *pl;
1762 u32 current_index =
1763 (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_INDEX_MASK) >>
1764 CURR_INDEX_SHIFT;
1765
1766 if (current_index == BOOST_DPM_LEVEL) {
1767 pl = &pi->boost_pl;
1768 seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
1769 seq_printf(m, "power level %d sclk: %u vddc: %u\n",
1770 current_index, pl->sclk,
1771 sumo_convert_voltage_index_to_value(rdev, pl->vddc_index));
1772 } else if (current_index >= ps->num_levels) {
1773 seq_printf(m, "invalid dpm profile %d\n", current_index);
1774 } else {
1775 pl = &ps->levels[current_index];
1776 seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
1777 seq_printf(m, "power level %d sclk: %u vddc: %u\n",
1778 current_index, pl->sclk,
1779 sumo_convert_voltage_index_to_value(rdev, pl->vddc_index));
1780 }
1781}
1782
1755void sumo_dpm_fini(struct radeon_device *rdev) 1783void sumo_dpm_fini(struct radeon_device *rdev)
1756{ 1784{
1757 int i; 1785 int i;