From a172230f1907f073d893ee56ce82593f833722b8 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 26 Mar 2013 19:23:19 -0400 Subject: drm/radeon/dpm/rs780: 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 --- drivers/gpu/drm/radeon/rs780_dpm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c index 8af1a0417c7a..e844c737ef7a 100644 --- a/drivers/gpu/drm/radeon/rs780_dpm.c +++ b/drivers/gpu/drm/radeon/rs780_dpm.c @@ -546,14 +546,16 @@ int rs780_dpm_enable(struct radeon_device *rdev) { struct igp_power_info *pi = rs780_get_pi(rdev); struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; + int ret; rs780_get_pm_mode_parameters(rdev); rs780_disable_vbios_powersaving(rdev); if (r600_dynamicpm_enabled(rdev)) return -EINVAL; - if (rs780_initialize_dpm_parameters(rdev, boot_ps)) - return -EINVAL; + ret = rs780_initialize_dpm_parameters(rdev, boot_ps); + if (ret) + return ret; rs780_start_dpm(rdev); rs780_preset_ranges_slow_clk_fbdiv_en(rdev); @@ -571,7 +573,9 @@ int rs780_dpm_enable(struct radeon_device *rdev) r600_gfx_clockgating_enable(rdev, true); if (rdev->irq.installed && (rdev->pm.int_thermal_type == THERMAL_TYPE_RV6XX)) { - r600_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX); + ret = r600_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); } @@ -603,6 +607,7 @@ int rs780_dpm_set_power_state(struct radeon_device *rdev) struct igp_power_info *pi = rs780_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; rs780_get_pm_mode_parameters(rdev); @@ -611,7 +616,9 @@ int rs780_dpm_set_power_state(struct radeon_device *rdev) mdelay(5); } - rs780_set_engine_clock_scaling(rdev, new_ps, old_ps); + ret = rs780_set_engine_clock_scaling(rdev, new_ps, old_ps); + if (ret) + return ret; rs780_set_engine_clock_spc(rdev, new_ps, old_ps); rs780_activate_engine_clk_scaling(rdev, new_ps, old_ps); -- cgit v1.2.3