aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-07-08 11:35:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-08 17:40:20 -0400
commit48783069350a2963e97696a3c3ed0a40cbe35210 (patch)
treef2d75ed1954a444927bd263611df0c5d42926fb2 /drivers/gpu
parent66edc1c95d75d66b11f1d2e2332c0c27b3f89a77 (diff)
drm/radeon/dpm: add checks against vblank time
If the vblank time is too short to adjust mclk, assume multiple displays (no mclk adjustments). Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index b4681313646c..9b7025d02cd0 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1678,6 +1678,7 @@ struct radeon_asic {
1678 void (*print_power_state)(struct radeon_device *rdev, struct radeon_ps *ps); 1678 void (*print_power_state)(struct radeon_device *rdev, struct radeon_ps *ps);
1679 void (*debugfs_print_current_performance_level)(struct radeon_device *rdev, struct seq_file *m); 1679 void (*debugfs_print_current_performance_level)(struct radeon_device *rdev, struct seq_file *m);
1680 int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level); 1680 int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level);
1681 bool (*vblank_too_short)(struct radeon_device *rdev);
1681 } dpm; 1682 } dpm;
1682 /* pageflipping */ 1683 /* pageflipping */
1683 struct { 1684 struct {
@@ -2446,6 +2447,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
2446#define radeon_dpm_print_power_state(rdev, ps) rdev->asic->dpm.print_power_state((rdev), (ps)) 2447#define radeon_dpm_print_power_state(rdev, ps) rdev->asic->dpm.print_power_state((rdev), (ps))
2447#define radeon_dpm_debugfs_print_current_performance_level(rdev, m) rdev->asic->dpm.debugfs_print_current_performance_level((rdev), (m)) 2448#define radeon_dpm_debugfs_print_current_performance_level(rdev, m) rdev->asic->dpm.debugfs_print_current_performance_level((rdev), (m))
2448#define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l)) 2449#define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l))
2450#define radeon_dpm_vblank_too_short(rdev) rdev->asic->dpm.vblank_too_short((rdev))
2449 2451
2450/* Common functions */ 2452/* Common functions */
2451/* AGP */ 2453/* AGP */
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index b163102eccd4..f374c467aaca 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -633,6 +633,14 @@ static struct radeon_ps *radeon_dpm_pick_power_state(struct radeon_device *rdev,
633 int i; 633 int i;
634 struct radeon_ps *ps; 634 struct radeon_ps *ps;
635 u32 ui_class; 635 u32 ui_class;
636 bool single_display = (rdev->pm.dpm.new_active_crtc_count < 2) ?
637 true : false;
638
639 /* check if the vblank period is too short to adjust the mclk */
640 if (single_display && rdev->asic->dpm.vblank_too_short) {
641 if (radeon_dpm_vblank_too_short(rdev))
642 single_display = false;
643 }
636 644
637 /* certain older asics have a separare 3D performance state, 645 /* certain older asics have a separare 3D performance state,
638 * so try that first if the user selected performance 646 * so try that first if the user selected performance
@@ -653,7 +661,7 @@ restart_search:
653 case POWER_STATE_TYPE_BATTERY: 661 case POWER_STATE_TYPE_BATTERY:
654 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_BATTERY) { 662 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_BATTERY) {
655 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) { 663 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) {
656 if (rdev->pm.dpm.new_active_crtc_count < 2) 664 if (single_display)
657 return ps; 665 return ps;
658 } else 666 } else
659 return ps; 667 return ps;
@@ -662,7 +670,7 @@ restart_search:
662 case POWER_STATE_TYPE_BALANCED: 670 case POWER_STATE_TYPE_BALANCED:
663 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_BALANCED) { 671 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_BALANCED) {
664 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) { 672 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) {
665 if (rdev->pm.dpm.new_active_crtc_count < 2) 673 if (single_display)
666 return ps; 674 return ps;
667 } else 675 } else
668 return ps; 676 return ps;
@@ -671,7 +679,7 @@ restart_search:
671 case POWER_STATE_TYPE_PERFORMANCE: 679 case POWER_STATE_TYPE_PERFORMANCE:
672 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE) { 680 if (ui_class == ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE) {
673 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) { 681 if (ps->caps & ATOM_PPLIB_SINGLE_DISPLAY_ONLY) {
674 if (rdev->pm.dpm.new_active_crtc_count < 2) 682 if (single_display)
675 return ps; 683 return ps;
676 } else 684 } else
677 return ps; 685 return ps;