From: Alex Deucher Date: Fri, 30 Aug 2013 20:24:33 +0000 (-0400) Subject: drm/radeon/dpm: make sure dc performance level limits are valid (CI) X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~10251^2~13^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=679fe80fbe964ea7f9f71781c2ca65b630949da3;p=mirror_ubuntu-zesty-kernel.git drm/radeon/dpm: make sure dc performance level limits are valid (CI) Check to make sure the dc limits are valid before using them. Some systems may not have a dc limits table. In that case just use the ac limits. This fixes hangs on systems when the power state is changed when on battery (dc) due to invalid performance state parameters. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=68708 Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index dd2a07c44c3a..916630fdc796 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -5179,6 +5179,12 @@ int ci_dpm_init(struct radeon_device *rdev) pi->uvd_power_gated = false; + /* make sure dc limits are valid */ + if ((rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc.sclk == 0) || + (rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc.mclk == 0)) + rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc = + rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac; + return 0; }