diff options
-rw-r--r-- | drivers/gpu/drm/radeon/ci_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/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 9eebf1f7e223..6e3d387a7388 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c | |||
@@ -682,6 +682,19 @@ static void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) | |||
682 | ci_update_uvd_dpm(rdev, gate); | 682 | ci_update_uvd_dpm(rdev, gate); |
683 | } | 683 | } |
684 | 684 | ||
685 | bool ci_dpm_vblank_too_short(struct radeon_device *rdev) | ||
686 | { | ||
687 | struct ci_power_info *pi = ci_get_pi(rdev); | ||
688 | u32 vblank_time = r600_dpm_get_vblank_time(rdev); | ||
689 | u32 switch_limit = pi->mem_gddr5 ? 450 : 300; | ||
690 | |||
691 | if (vblank_time < switch_limit) | ||
692 | return true; | ||
693 | else | ||
694 | return false; | ||
695 | |||
696 | } | ||
697 | |||
685 | static void ci_apply_state_adjust_rules(struct radeon_device *rdev, | 698 | static void ci_apply_state_adjust_rules(struct radeon_device *rdev, |
686 | struct radeon_ps *rps) | 699 | struct radeon_ps *rps) |
687 | { | 700 | { |
@@ -692,7 +705,8 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev, | |||
692 | u32 sclk, mclk; | 705 | u32 sclk, mclk; |
693 | int i; | 706 | int i; |
694 | 707 | ||
695 | if (rdev->pm.dpm.new_active_crtc_count > 1) | 708 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || |
709 | ci_dpm_vblank_too_short(rdev)) | ||
696 | disable_mclk_switching = true; | 710 | disable_mclk_switching = true; |
697 | else | 711 | else |
698 | disable_mclk_switching = false; | 712 | disable_mclk_switching = false; |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 705bc7498ff2..2d7bdda90bba 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -2469,6 +2469,7 @@ static struct radeon_asic ci_asic = { | |||
2469 | .print_power_state = &ci_dpm_print_power_state, | 2469 | .print_power_state = &ci_dpm_print_power_state, |
2470 | .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level, | 2470 | .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level, |
2471 | .force_performance_level = &ci_dpm_force_performance_level, | 2471 | .force_performance_level = &ci_dpm_force_performance_level, |
2472 | .vblank_too_short = &ci_dpm_vblank_too_short, | ||
2472 | }, | 2473 | }, |
2473 | .pflip = { | 2474 | .pflip = { |
2474 | .pre_page_flip = &evergreen_pre_page_flip, | 2475 | .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 a88792865fa4..b5f4e431c493 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -767,6 +767,7 @@ void ci_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, | |||
767 | struct seq_file *m); | 767 | struct seq_file *m); |
768 | int ci_dpm_force_performance_level(struct radeon_device *rdev, | 768 | int ci_dpm_force_performance_level(struct radeon_device *rdev, |
769 | enum radeon_dpm_forced_level level); | 769 | enum radeon_dpm_forced_level level); |
770 | bool ci_dpm_vblank_too_short(struct radeon_device *rdev); | ||
770 | 771 | ||
771 | int kv_dpm_init(struct radeon_device *rdev); | 772 | int kv_dpm_init(struct radeon_device *rdev); |
772 | int kv_dpm_enable(struct radeon_device *rdev); | 773 | int kv_dpm_enable(struct radeon_device *rdev); |