diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-07-08 12:09:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-07-08 17:41:01 -0400 |
commit | 76ad73e549ff39cbb235dae3a14902bb6ca12d53 (patch) | |
tree | 63f72af32e0e06ddee422b70c530e83cc7587c9e /drivers/gpu | |
parent | a84301c65d256d8aa23a254a6f2d51ecf67e9ee5 (diff) |
drm/radeon/dpm: implement vblank_too_short callback for cayman
Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/ni_dpm.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index bd96eaa3f015..559cf24d51af 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c | |||
@@ -765,6 +765,19 @@ static void ni_calculate_leakage_for_v_and_t(struct radeon_device *rdev, | |||
765 | ni_calculate_leakage_for_v_and_t_formula(coeff, v, t, i_leakage, leakage); | 765 | ni_calculate_leakage_for_v_and_t_formula(coeff, v, t, i_leakage, leakage); |
766 | } | 766 | } |
767 | 767 | ||
768 | bool ni_dpm_vblank_too_short(struct radeon_device *rdev) | ||
769 | { | ||
770 | struct rv7xx_power_info *pi = rv770_get_pi(rdev); | ||
771 | u32 vblank_time = r600_dpm_get_vblank_time(rdev); | ||
772 | u32 switch_limit = pi->mem_gddr5 ? 450 : 300; | ||
773 | |||
774 | if (vblank_time < switch_limit) | ||
775 | return true; | ||
776 | else | ||
777 | return false; | ||
778 | |||
779 | } | ||
780 | |||
768 | static void ni_apply_state_adjust_rules(struct radeon_device *rdev, | 781 | static void ni_apply_state_adjust_rules(struct radeon_device *rdev, |
769 | struct radeon_ps *rps) | 782 | struct radeon_ps *rps) |
770 | { | 783 | { |
@@ -775,7 +788,8 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, | |||
775 | u16 vddc, vddci; | 788 | u16 vddc, vddci; |
776 | int i; | 789 | int i; |
777 | 790 | ||
778 | if (rdev->pm.dpm.new_active_crtc_count > 1) | 791 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || |
792 | ni_dpm_vblank_too_short(rdev)) | ||
779 | disable_mclk_switching = true; | 793 | disable_mclk_switching = true; |
780 | else | 794 | else |
781 | disable_mclk_switching = false; | 795 | disable_mclk_switching = false; |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index c42b3674b426..c62428be9bed 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -1945,6 +1945,7 @@ static struct radeon_asic cayman_asic = { | |||
1945 | .print_power_state = &ni_dpm_print_power_state, | 1945 | .print_power_state = &ni_dpm_print_power_state, |
1946 | .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level, | 1946 | .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level, |
1947 | .force_performance_level = &ni_dpm_force_performance_level, | 1947 | .force_performance_level = &ni_dpm_force_performance_level, |
1948 | .vblank_too_short = &ni_dpm_vblank_too_short, | ||
1948 | }, | 1949 | }, |
1949 | .pflip = { | 1950 | .pflip = { |
1950 | .pre_page_flip = &evergreen_pre_page_flip, | 1951 | .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 bca9a8bc062b..45d0693cddd5 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -624,6 +624,7 @@ void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, | |||
624 | struct seq_file *m); | 624 | struct seq_file *m); |
625 | int ni_dpm_force_performance_level(struct radeon_device *rdev, | 625 | int ni_dpm_force_performance_level(struct radeon_device *rdev, |
626 | enum radeon_dpm_forced_level level); | 626 | enum radeon_dpm_forced_level level); |
627 | bool ni_dpm_vblank_too_short(struct radeon_device *rdev); | ||
627 | int trinity_dpm_init(struct radeon_device *rdev); | 628 | int trinity_dpm_init(struct radeon_device *rdev); |
628 | int trinity_dpm_enable(struct radeon_device *rdev); | 629 | int trinity_dpm_enable(struct radeon_device *rdev); |
629 | void trinity_dpm_disable(struct radeon_device *rdev); | 630 | void trinity_dpm_disable(struct radeon_device *rdev); |