summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv770_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-03-26 19:09:18 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-06-27 19:16:50 -0400
commitb97721f311c68440144a95e345955284c25b69a2 (patch)
treec6a6bfe182f1b07dcd606a9df30917bdff3edba8 /drivers/gpu/drm/radeon/rv770_dpm.c
parentc3efac0d5b728daac457421b5fe1494169457568 (diff)
drm/radeon/dpm/r7xx: properly catch errors in dpm setup
We weren't properly catching errors in dpm_enable() and dpm_set_power_state(). Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rv770_dpm.c')
-rw-r--r--drivers/gpu/drm/radeon/rv770_dpm.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c
index 2039802e882..0c9a495aba8 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -1875,6 +1875,7 @@ int rv770_dpm_enable(struct radeon_device *rdev)
{
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps;
+ int ret;
if (pi->gfx_clock_gating)
rv770_restore_cgcg(rdev);
@@ -1884,14 +1885,19 @@ int rv770_dpm_enable(struct radeon_device *rdev)
if (pi->voltage_control) {
rv770_enable_voltage_control(rdev, true);
- rv770_construct_vddc_table(rdev);
+ ret = rv770_construct_vddc_table(rdev);
+ if (ret)
+ return ret;
}
if (pi->dcodt)
rv770_retrieve_odt_values(rdev);
- if (pi->mvdd_control)
- rv770_get_mvdd_configuration(rdev);
+ if (pi->mvdd_control) {
+ ret = rv770_get_mvdd_configuration(rdev);
+ if (ret)
+ return ret;
+ }
if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS)
rv770_enable_backbias(rdev, true);
@@ -1914,11 +1920,14 @@ int rv770_dpm_enable(struct radeon_device *rdev)
if (pi->dynamic_pcie_gen2)
rv770_enable_dynamic_pcie_gen2(rdev, true);
- if (rv770_upload_firmware(rdev))
- return -EINVAL;
- /* get ucode version ? */
- if (rv770_init_smc_table(rdev, boot_ps))
- return -EINVAL;
+ ret = rv770_upload_firmware(rdev);
+ if (ret)
+ return ret;
+
+ ret = rv770_init_smc_table(rdev, boot_ps);
+ if (ret)
+ return ret;
+
rv770_program_response_times(rdev);
r7xx_start_smc(rdev);
@@ -1937,7 +1946,9 @@ int rv770_dpm_enable(struct radeon_device *rdev)
r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
PPSMC_Result result;
- rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+ ret = rv770_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
+ if (ret)
+ return ret;
rdev->irq.dpm_thermal = true;
radeon_irq_set(rdev);
result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt);
@@ -1994,20 +2005,33 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev)
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
struct radeon_ps *new_ps = rdev->pm.dpm.requested_ps;
struct radeon_ps *old_ps = rdev->pm.dpm.current_ps;
+ int ret;
- rv770_restrict_performance_levels_before_switch(rdev);
+ ret = rv770_restrict_performance_levels_before_switch(rdev);
+ if (ret)
+ return ret;
rv770_set_uvd_clock_before_set_eng_clock(rdev, new_ps, old_ps);
- rv770_halt_smc(rdev);
- rv770_upload_sw_state(rdev, new_ps);
+ ret = rv770_halt_smc(rdev);
+ if (ret)
+ return ret;
+ ret = rv770_upload_sw_state(rdev, new_ps);
+ if (ret)
+ return ret;
r7xx_program_memory_timing_parameters(rdev, new_ps);
if (pi->dcodt)
rv770_program_dcodt_before_state_switch(rdev, new_ps, old_ps);
- rv770_resume_smc(rdev);
- rv770_set_sw_state(rdev);
+ ret = rv770_resume_smc(rdev);
+ if (ret)
+ return ret;
+ ret = rv770_set_sw_state(rdev);
+ if (ret)
+ return ret;
if (pi->dcodt)
rv770_program_dcodt_after_state_switch(rdev, new_ps, old_ps);
rv770_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps);
- rv770_unrestrict_performance_levels_after_switch(rdev);
+ ret = rv770_unrestrict_performance_levels_after_switch(rdev);
+ if (ret)
+ return ret;
return 0;
}