aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-12-19 16:17:47 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-12-24 17:56:50 -0500
commite14cd2bbcb98541e199b7223f38d61527dfe45c9 (patch)
tree21b85dd82b3ef306fb1a92c4131fbc3029f86334
parentd8852c3446ddeab300c4ae397d658b8715535102 (diff)
drm/radeon/dpm: switch on new late_enable callback
Right now it's called right after enable, but after reworking the dpm init order, it will get called later to accomodate loading the smc early, but enabling thermal interrupts and block powergating later after the ring tests are complete. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/btc_dpm.c15
-rw-r--r--drivers/gpu/drm/radeon/ci_dpm.c21
-rw-r--r--drivers/gpu/drm/radeon/cypress_dpm.c15
-rw-r--r--drivers/gpu/drm/radeon/kv_dpm.c17
-rw-r--r--drivers/gpu/drm/radeon/ni_dpm.c15
-rw-r--r--drivers/gpu/drm/radeon/r600_dpm.c4
-rw-r--r--drivers/gpu/drm/radeon/r600_dpm.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c87
-rw-r--r--drivers/gpu/drm/radeon/rs780_dpm.c8
-rw-r--r--drivers/gpu/drm/radeon/rv6xx_dpm.c10
-rw-r--r--drivers/gpu/drm/radeon/rv770_dpm.c19
-rw-r--r--drivers/gpu/drm/radeon/rv770_dpm.h4
-rw-r--r--drivers/gpu/drm/radeon/si_dpm.c15
-rw-r--r--drivers/gpu/drm/radeon/sumo_dpm.c13
-rw-r--r--drivers/gpu/drm/radeon/trinity_dpm.c13
15 files changed, 53 insertions, 205 deletions
diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index 9b6950d9b3c0..2eb985a0242c 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -2510,21 +2510,6 @@ int btc_dpm_enable(struct radeon_device *rdev)
2510 if (eg_pi->ls_clock_gating) 2510 if (eg_pi->ls_clock_gating)
2511 btc_ls_clock_gating_enable(rdev, true); 2511 btc_ls_clock_gating_enable(rdev, true);
2512 2512
2513 if (rdev->irq.installed &&
2514 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
2515 PPSMC_Result result;
2516
2517 ret = rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
2518 if (ret)
2519 return ret;
2520 rdev->irq.dpm_thermal = true;
2521 radeon_irq_set(rdev);
2522 result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
2523
2524 if (result != PPSMC_Result_OK)
2525 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
2526 }
2527
2528 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 2513 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
2529 2514
2530 btc_init_stutter_mode(rdev); 2515 btc_init_stutter_mode(rdev);
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 13ee5af3437e..6eab12d1641b 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -4656,30 +4656,9 @@ int ci_dpm_enable(struct radeon_device *rdev)
4656 DRM_ERROR("ci_enable_power_containment failed\n"); 4656 DRM_ERROR("ci_enable_power_containment failed\n");
4657 return ret; 4657 return ret;
4658 } 4658 }
4659 if (rdev->irq.installed &&
4660 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
4661#if 0
4662 PPSMC_Result result;
4663#endif
4664 ret = ci_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
4665 if (ret) {
4666 DRM_ERROR("ci_set_thermal_temperature_range failed\n");
4667 return ret;
4668 }
4669 rdev->irq.dpm_thermal = true;
4670 radeon_irq_set(rdev);
4671#if 0
4672 result = ci_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
4673
4674 if (result != PPSMC_Result_OK)
4675 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
4676#endif
4677 }
4678 4659
4679 ci_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 4660 ci_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
4680 4661
4681 ci_dpm_powergate_uvd(rdev, true);
4682
4683 ci_update_current_ps(rdev, boot_ps); 4662 ci_update_current_ps(rdev, boot_ps);
4684 4663
4685 return 0; 4664 return 0;
diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c
index 920e1e4a52c5..cf783fc0ef21 100644
--- a/drivers/gpu/drm/radeon/cypress_dpm.c
+++ b/drivers/gpu/drm/radeon/cypress_dpm.c
@@ -1905,21 +1905,6 @@ int cypress_dpm_enable(struct radeon_device *rdev)
1905 if (pi->mg_clock_gating) 1905 if (pi->mg_clock_gating)
1906 cypress_mg_clock_gating_enable(rdev, true); 1906 cypress_mg_clock_gating_enable(rdev, true);
1907 1907
1908 if (rdev->irq.installed &&
1909 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1910 PPSMC_Result result;
1911
1912 ret = rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1913 if (ret)
1914 return ret;
1915 rdev->irq.dpm_thermal = true;
1916 radeon_irq_set(rdev);
1917 result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
1918
1919 if (result != PPSMC_Result_OK)
1920 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
1921 }
1922
1923 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 1908 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
1924 1909
1925 return 0; 1910 return 0;
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index eced97975952..b6e01d5d2cce 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -1210,29 +1210,12 @@ int kv_dpm_enable(struct radeon_device *rdev)
1210 1210
1211 kv_reset_acp_boot_level(rdev); 1211 kv_reset_acp_boot_level(rdev);
1212 1212
1213 if (rdev->irq.installed &&
1214 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1215 ret = kv_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1216 if (ret) {
1217 DRM_ERROR("kv_set_thermal_temperature_range failed\n");
1218 return ret;
1219 }
1220 rdev->irq.dpm_thermal = true;
1221 radeon_irq_set(rdev);
1222 }
1223
1224 ret = kv_smc_bapm_enable(rdev, false); 1213 ret = kv_smc_bapm_enable(rdev, false);
1225 if (ret) { 1214 if (ret) {
1226 DRM_ERROR("kv_smc_bapm_enable failed\n"); 1215 DRM_ERROR("kv_smc_bapm_enable failed\n");
1227 return ret; 1216 return ret;
1228 } 1217 }
1229 1218
1230 /* powerdown unused blocks for now */
1231 kv_dpm_powergate_acp(rdev, true);
1232 kv_dpm_powergate_samu(rdev, true);
1233 kv_dpm_powergate_vce(rdev, true);
1234 kv_dpm_powergate_uvd(rdev, true);
1235
1236 kv_update_current_ps(rdev, rdev->pm.dpm.boot_ps); 1219 kv_update_current_ps(rdev, rdev->pm.dpm.boot_ps);
1237 1220
1238 return ret; 1221 return ret;
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index 49c4d48f54d6..cb92287ca985 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -3710,21 +3710,6 @@ int ni_dpm_enable(struct radeon_device *rdev)
3710 if (eg_pi->ls_clock_gating) 3710 if (eg_pi->ls_clock_gating)
3711 ni_ls_clockgating_enable(rdev, true); 3711 ni_ls_clockgating_enable(rdev, true);
3712 3712
3713 if (rdev->irq.installed &&
3714 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
3715 PPSMC_Result result;
3716
3717 ret = rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, 0xff * 1000);
3718 if (ret)
3719 return ret;
3720 rdev->irq.dpm_thermal = true;
3721 radeon_irq_set(rdev);
3722 result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
3723
3724 if (result != PPSMC_Result_OK)
3725 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
3726 }
3727
3728 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 3713 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
3729 3714
3730 ni_update_current_ps(rdev, boot_ps); 3715 ni_update_current_ps(rdev, boot_ps);
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
index 12e35dd2246e..e4cc9b314ce9 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.c
+++ b/drivers/gpu/drm/radeon/r600_dpm.c
@@ -729,8 +729,8 @@ bool r600_is_uvd_state(u32 class, u32 class2)
729 return false; 729 return false;
730} 730}
731 731
732int r600_set_thermal_temperature_range(struct radeon_device *rdev, 732static int r600_set_thermal_temperature_range(struct radeon_device *rdev,
733 int min_temp, int max_temp) 733 int min_temp, int max_temp)
734{ 734{
735 int low_temp = 0 * 1000; 735 int low_temp = 0 * 1000;
736 int high_temp = 255 * 1000; 736 int high_temp = 255 * 1000;
diff --git a/drivers/gpu/drm/radeon/r600_dpm.h b/drivers/gpu/drm/radeon/r600_dpm.h
index 1000bf9719f2..07eab2b04e81 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.h
+++ b/drivers/gpu/drm/radeon/r600_dpm.h
@@ -213,8 +213,6 @@ void r600_wait_for_power_level(struct radeon_device *rdev,
213void r600_start_dpm(struct radeon_device *rdev); 213void r600_start_dpm(struct radeon_device *rdev);
214void r600_stop_dpm(struct radeon_device *rdev); 214void r600_stop_dpm(struct radeon_device *rdev);
215 215
216int r600_set_thermal_temperature_range(struct radeon_device *rdev,
217 int min_temp, int max_temp);
218bool r600_is_internal_thermal_sensor(enum radeon_int_thermal_type sensor); 216bool r600_is_internal_thermal_sensor(enum radeon_int_thermal_type sensor);
219 217
220int r600_parse_extended_power_table(struct radeon_device *rdev); 218int r600_parse_extended_power_table(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index d4e5bcfeb77d..7fc76d165e89 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1032,25 +1032,31 @@ static void radeon_pm_resume_dpm(struct radeon_device *rdev)
1032 radeon_dpm_setup_asic(rdev); 1032 radeon_dpm_setup_asic(rdev);
1033 ret = radeon_dpm_enable(rdev); 1033 ret = radeon_dpm_enable(rdev);
1034 mutex_unlock(&rdev->pm.mutex); 1034 mutex_unlock(&rdev->pm.mutex);
1035 if (ret) { 1035 if (ret)
1036 DRM_ERROR("radeon: dpm resume failed\n"); 1036 goto dpm_resume_fail;
1037 if ((rdev->family >= CHIP_BARTS) && 1037 ret = radeon_pm_late_init(rdev);
1038 (rdev->family <= CHIP_CAYMAN) && 1038 if (ret)
1039 rdev->mc_fw) { 1039 goto dpm_resume_fail;
1040 if (rdev->pm.default_vddc) 1040
1041 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc, 1041 rdev->pm.dpm_enabled = true;
1042 SET_VOLTAGE_TYPE_ASIC_VDDC); 1042 radeon_pm_compute_clocks(rdev);
1043 if (rdev->pm.default_vddci) 1043 return;
1044 radeon_atom_set_voltage(rdev, rdev->pm.default_vddci, 1044
1045 SET_VOLTAGE_TYPE_ASIC_VDDCI); 1045dpm_resume_fail:
1046 if (rdev->pm.default_sclk) 1046 DRM_ERROR("radeon: dpm resume failed\n");
1047 radeon_set_engine_clock(rdev, rdev->pm.default_sclk); 1047 if ((rdev->family >= CHIP_BARTS) &&
1048 if (rdev->pm.default_mclk) 1048 (rdev->family <= CHIP_CAYMAN) &&
1049 radeon_set_memory_clock(rdev, rdev->pm.default_mclk); 1049 rdev->mc_fw) {
1050 } 1050 if (rdev->pm.default_vddc)
1051 } else { 1051 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
1052 rdev->pm.dpm_enabled = true; 1052 SET_VOLTAGE_TYPE_ASIC_VDDC);
1053 radeon_pm_compute_clocks(rdev); 1053 if (rdev->pm.default_vddci)
1054 radeon_atom_set_voltage(rdev, rdev->pm.default_vddci,
1055 SET_VOLTAGE_TYPE_ASIC_VDDCI);
1056 if (rdev->pm.default_sclk)
1057 radeon_set_engine_clock(rdev, rdev->pm.default_sclk);
1058 if (rdev->pm.default_mclk)
1059 radeon_set_memory_clock(rdev, rdev->pm.default_mclk);
1054 } 1060 }
1055} 1061}
1056 1062
@@ -1170,25 +1176,11 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev)
1170 radeon_dpm_setup_asic(rdev); 1176 radeon_dpm_setup_asic(rdev);
1171 ret = radeon_dpm_enable(rdev); 1177 ret = radeon_dpm_enable(rdev);
1172 mutex_unlock(&rdev->pm.mutex); 1178 mutex_unlock(&rdev->pm.mutex);
1173 if (ret) { 1179 if (ret)
1174 rdev->pm.dpm_enabled = false; 1180 goto dpm_failed;
1175 if ((rdev->family >= CHIP_BARTS) && 1181 ret = radeon_pm_late_init(rdev);
1176 (rdev->family <= CHIP_CAYMAN) && 1182 if (ret)
1177 rdev->mc_fw) { 1183 goto dpm_failed;
1178 if (rdev->pm.default_vddc)
1179 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
1180 SET_VOLTAGE_TYPE_ASIC_VDDC);
1181 if (rdev->pm.default_vddci)
1182 radeon_atom_set_voltage(rdev, rdev->pm.default_vddci,
1183 SET_VOLTAGE_TYPE_ASIC_VDDCI);
1184 if (rdev->pm.default_sclk)
1185 radeon_set_engine_clock(rdev, rdev->pm.default_sclk);
1186 if (rdev->pm.default_mclk)
1187 radeon_set_memory_clock(rdev, rdev->pm.default_mclk);
1188 }
1189 DRM_ERROR("radeon: dpm initialization failed\n");
1190 return ret;
1191 }
1192 rdev->pm.dpm_enabled = true; 1184 rdev->pm.dpm_enabled = true;
1193 radeon_pm_compute_clocks(rdev); 1185 radeon_pm_compute_clocks(rdev);
1194 1186
@@ -1213,6 +1205,25 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev)
1213 DRM_INFO("radeon: dpm initialized\n"); 1205 DRM_INFO("radeon: dpm initialized\n");
1214 1206
1215 return 0; 1207 return 0;
1208
1209dpm_failed:
1210 rdev->pm.dpm_enabled = false;
1211 if ((rdev->family >= CHIP_BARTS) &&
1212 (rdev->family <= CHIP_CAYMAN) &&
1213 rdev->mc_fw) {
1214 if (rdev->pm.default_vddc)
1215 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
1216 SET_VOLTAGE_TYPE_ASIC_VDDC);
1217 if (rdev->pm.default_vddci)
1218 radeon_atom_set_voltage(rdev, rdev->pm.default_vddci,
1219 SET_VOLTAGE_TYPE_ASIC_VDDCI);
1220 if (rdev->pm.default_sclk)
1221 radeon_set_engine_clock(rdev, rdev->pm.default_sclk);
1222 if (rdev->pm.default_mclk)
1223 radeon_set_memory_clock(rdev, rdev->pm.default_mclk);
1224 }
1225 DRM_ERROR("radeon: dpm initialization failed\n");
1226 return ret;
1216} 1227}
1217 1228
1218int radeon_pm_init(struct radeon_device *rdev) 1229int radeon_pm_init(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c
index 6af8505cf4d2..8512085b0aef 100644
--- a/drivers/gpu/drm/radeon/rs780_dpm.c
+++ b/drivers/gpu/drm/radeon/rs780_dpm.c
@@ -623,14 +623,6 @@ int rs780_dpm_enable(struct radeon_device *rdev)
623 if (pi->gfx_clock_gating) 623 if (pi->gfx_clock_gating)
624 r600_gfx_clockgating_enable(rdev, true); 624 r600_gfx_clockgating_enable(rdev, true);
625 625
626 if (rdev->irq.installed && (rdev->pm.int_thermal_type == THERMAL_TYPE_RV6XX)) {
627 ret = r600_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
628 if (ret)
629 return ret;
630 rdev->irq.dpm_thermal = true;
631 radeon_irq_set(rdev);
632 }
633
634 return 0; 626 return 0;
635} 627}
636 628
diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c
index 26633a025252..bebf31c4d841 100644
--- a/drivers/gpu/drm/radeon/rv6xx_dpm.c
+++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c
@@ -1546,7 +1546,6 @@ int rv6xx_dpm_enable(struct radeon_device *rdev)
1546{ 1546{
1547 struct rv6xx_power_info *pi = rv6xx_get_pi(rdev); 1547 struct rv6xx_power_info *pi = rv6xx_get_pi(rdev);
1548 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; 1548 struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps;
1549 int ret;
1550 1549
1551 if (r600_dynamicpm_enabled(rdev)) 1550 if (r600_dynamicpm_enabled(rdev))
1552 return -EINVAL; 1551 return -EINVAL;
@@ -1594,15 +1593,6 @@ int rv6xx_dpm_enable(struct radeon_device *rdev)
1594 r600_power_level_enable(rdev, R600_POWER_LEVEL_MEDIUM, true); 1593 r600_power_level_enable(rdev, R600_POWER_LEVEL_MEDIUM, true);
1595 r600_power_level_enable(rdev, R600_POWER_LEVEL_HIGH, true); 1594 r600_power_level_enable(rdev, R600_POWER_LEVEL_HIGH, true);
1596 1595
1597 if (rdev->irq.installed &&
1598 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1599 ret = r600_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1600 if (ret)
1601 return ret;
1602 rdev->irq.dpm_thermal = true;
1603 radeon_irq_set(rdev);
1604 }
1605
1606 rv6xx_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 1596 rv6xx_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
1607 1597
1608 r600_start_dpm(rdev); 1598 r600_start_dpm(rdev);
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c
index 024e34f82d6b..4aaeb118a3ff 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -1863,8 +1863,8 @@ void rv770_enable_auto_throttle_source(struct radeon_device *rdev,
1863 } 1863 }
1864} 1864}
1865 1865
1866int rv770_set_thermal_temperature_range(struct radeon_device *rdev, 1866static int rv770_set_thermal_temperature_range(struct radeon_device *rdev,
1867 int min_temp, int max_temp) 1867 int min_temp, int max_temp)
1868{ 1868{
1869 int low_temp = 0 * 1000; 1869 int low_temp = 0 * 1000;
1870 int high_temp = 255 * 1000; 1870 int high_temp = 255 * 1000;
@@ -1966,21 +1966,6 @@ int rv770_dpm_enable(struct radeon_device *rdev)
1966 if (pi->mg_clock_gating) 1966 if (pi->mg_clock_gating)
1967 rv770_mg_clock_gating_enable(rdev, true); 1967 rv770_mg_clock_gating_enable(rdev, true);
1968 1968
1969 if (rdev->irq.installed &&
1970 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1971 PPSMC_Result result;
1972
1973 ret = rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1974 if (ret)
1975 return ret;
1976 rdev->irq.dpm_thermal = true;
1977 radeon_irq_set(rdev);
1978 result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
1979
1980 if (result != PPSMC_Result_OK)
1981 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
1982 }
1983
1984 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 1969 rv770_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
1985 1970
1986 return 0; 1971 return 0;
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.h b/drivers/gpu/drm/radeon/rv770_dpm.h
index 9244effc6b59..f776634840c9 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.h
+++ b/drivers/gpu/drm/radeon/rv770_dpm.h
@@ -283,8 +283,4 @@ int rv770_read_smc_soft_register(struct radeon_device *rdev,
283int rv770_write_smc_soft_register(struct radeon_device *rdev, 283int rv770_write_smc_soft_register(struct radeon_device *rdev,
284 u16 reg_offset, u32 value); 284 u16 reg_offset, u32 value);
285 285
286/* thermal */
287int rv770_set_thermal_temperature_range(struct radeon_device *rdev,
288 int min_temp, int max_temp);
289
290#endif 286#endif
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index 1c547b0fb844..05cdd8ddabc4 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -5890,21 +5890,6 @@ int si_dpm_enable(struct radeon_device *rdev)
5890 si_enable_sclk_control(rdev, true); 5890 si_enable_sclk_control(rdev, true);
5891 si_start_dpm(rdev); 5891 si_start_dpm(rdev);
5892 5892
5893 if (rdev->irq.installed &&
5894 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
5895 PPSMC_Result result;
5896
5897 ret = si_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
5898 if (ret)
5899 return ret;
5900 rdev->irq.dpm_thermal = true;
5901 radeon_irq_set(rdev);
5902 result = si_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
5903
5904 if (result != PPSMC_Result_OK)
5905 DRM_DEBUG_KMS("Could not enable thermal interrupts.\n");
5906 }
5907
5908 si_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true); 5893 si_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
5909 5894
5910 ni_update_current_ps(rdev, boot_ps); 5895 ni_update_current_ps(rdev, boot_ps);
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index b63640f47d38..78d839f8d37d 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1202,14 +1202,10 @@ static void sumo_update_requested_ps(struct radeon_device *rdev,
1202int sumo_dpm_enable(struct radeon_device *rdev) 1202int sumo_dpm_enable(struct radeon_device *rdev)
1203{ 1203{
1204 struct sumo_power_info *pi = sumo_get_pi(rdev); 1204 struct sumo_power_info *pi = sumo_get_pi(rdev);
1205 int ret;
1206 1205
1207 if (sumo_dpm_enabled(rdev)) 1206 if (sumo_dpm_enabled(rdev))
1208 return -EINVAL; 1207 return -EINVAL;
1209 1208
1210 ret = sumo_enable_clock_power_gating(rdev);
1211 if (ret)
1212 return ret;
1213 sumo_program_bootup_state(rdev); 1209 sumo_program_bootup_state(rdev);
1214 sumo_init_bsp(rdev); 1210 sumo_init_bsp(rdev);
1215 sumo_reset_am(rdev); 1211 sumo_reset_am(rdev);
@@ -1233,15 +1229,6 @@ int sumo_dpm_enable(struct radeon_device *rdev)
1233 if (pi->enable_boost) 1229 if (pi->enable_boost)
1234 sumo_enable_boost_timer(rdev); 1230 sumo_enable_boost_timer(rdev);
1235 1231
1236 if (rdev->irq.installed &&
1237 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1238 ret = sumo_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1239 if (ret)
1240 return ret;
1241 rdev->irq.dpm_thermal = true;
1242 radeon_irq_set(rdev);
1243 }
1244
1245 sumo_update_current_ps(rdev, rdev->pm.dpm.boot_ps); 1232 sumo_update_current_ps(rdev, rdev->pm.dpm.boot_ps);
1246 1233
1247 return 0; 1234 return 0;
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c
index ee0ce0a423ca..0f4d70337e81 100644
--- a/drivers/gpu/drm/radeon/trinity_dpm.c
+++ b/drivers/gpu/drm/radeon/trinity_dpm.c
@@ -1082,7 +1082,6 @@ void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable)
1082int trinity_dpm_enable(struct radeon_device *rdev) 1082int trinity_dpm_enable(struct radeon_device *rdev)
1083{ 1083{
1084 struct trinity_power_info *pi = trinity_get_pi(rdev); 1084 struct trinity_power_info *pi = trinity_get_pi(rdev);
1085 int ret;
1086 1085
1087 trinity_acquire_mutex(rdev); 1086 trinity_acquire_mutex(rdev);
1088 1087
@@ -1091,7 +1090,6 @@ int trinity_dpm_enable(struct radeon_device *rdev)
1091 return -EINVAL; 1090 return -EINVAL;
1092 } 1091 }
1093 1092
1094 trinity_enable_clock_power_gating(rdev);
1095 trinity_program_bootup_state(rdev); 1093 trinity_program_bootup_state(rdev);
1096 sumo_program_vc(rdev, 0x00C00033); 1094 sumo_program_vc(rdev, 0x00C00033);
1097 trinity_start_am(rdev); 1095 trinity_start_am(rdev);
@@ -1105,17 +1103,6 @@ int trinity_dpm_enable(struct radeon_device *rdev)
1105 trinity_dpm_bapm_enable(rdev, false); 1103 trinity_dpm_bapm_enable(rdev, false);
1106 trinity_release_mutex(rdev); 1104 trinity_release_mutex(rdev);
1107 1105
1108 if (rdev->irq.installed &&
1109 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
1110 ret = trinity_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
1111 if (ret) {
1112 trinity_release_mutex(rdev);
1113 return ret;
1114 }
1115 rdev->irq.dpm_thermal = true;
1116 radeon_irq_set(rdev);
1117 }
1118
1119 trinity_update_current_ps(rdev, rdev->pm.dpm.boot_ps); 1106 trinity_update_current_ps(rdev, rdev->pm.dpm.boot_ps);
1120 1107
1121 return 0; 1108 return 0;