Skip to content

Commit 679fe80

Browse files
committed
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 <[email protected]>
1 parent 1ff60dd commit 679fe80

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/radeon/ci_dpm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,6 +5179,12 @@ int ci_dpm_init(struct radeon_device *rdev)
51795179

51805180
pi->uvd_power_gated = false;
51815181

5182+
/* make sure dc limits are valid */
5183+
if ((rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc.sclk == 0) ||
5184+
(rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc.mclk == 0))
5185+
rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc =
5186+
rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac;
5187+
51825188
return 0;
51835189
}
51845190

0 commit comments

Comments
 (0)