diff options
-rw-r--r-- | drivers/gpu/drm/radeon/ni_dpm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index 6c398a456d78..f26339028154 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c | |||
@@ -787,6 +787,7 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, | |||
787 | bool disable_mclk_switching; | 787 | bool disable_mclk_switching; |
788 | u32 mclk, sclk; | 788 | u32 mclk, sclk; |
789 | u16 vddc, vddci; | 789 | u16 vddc, vddci; |
790 | u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc; | ||
790 | int i; | 791 | int i; |
791 | 792 | ||
792 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || | 793 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || |
@@ -813,6 +814,29 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, | |||
813 | } | 814 | } |
814 | } | 815 | } |
815 | 816 | ||
817 | /* limit clocks to max supported clocks based on voltage dependency tables */ | ||
818 | btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk, | ||
819 | &max_sclk_vddc); | ||
820 | btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk, | ||
821 | &max_mclk_vddci); | ||
822 | btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk, | ||
823 | &max_mclk_vddc); | ||
824 | |||
825 | for (i = 0; i < ps->performance_level_count; i++) { | ||
826 | if (max_sclk_vddc) { | ||
827 | if (ps->performance_levels[i].sclk > max_sclk_vddc) | ||
828 | ps->performance_levels[i].sclk = max_sclk_vddc; | ||
829 | } | ||
830 | if (max_mclk_vddci) { | ||
831 | if (ps->performance_levels[i].mclk > max_mclk_vddci) | ||
832 | ps->performance_levels[i].mclk = max_mclk_vddci; | ||
833 | } | ||
834 | if (max_mclk_vddc) { | ||
835 | if (ps->performance_levels[i].mclk > max_mclk_vddc) | ||
836 | ps->performance_levels[i].mclk = max_mclk_vddc; | ||
837 | } | ||
838 | } | ||
839 | |||
816 | /* XXX validate the min clocks required for display */ | 840 | /* XXX validate the min clocks required for display */ |
817 | 841 | ||
818 | if (disable_mclk_switching) { | 842 | if (disable_mclk_switching) { |