diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 5b37e283ec38..7ae606600107 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #define RADEON_IDLE_LOOP_MS 100 | 34 | #define RADEON_IDLE_LOOP_MS 100 |
35 | #define RADEON_RECLOCK_DELAY_MS 200 | 35 | #define RADEON_RECLOCK_DELAY_MS 200 |
36 | #define RADEON_WAIT_VBLANK_TIMEOUT 200 | 36 | #define RADEON_WAIT_VBLANK_TIMEOUT 200 |
37 | #define RADEON_WAIT_IDLE_TIMEOUT 200 | ||
38 | 37 | ||
39 | static const char *radeon_pm_state_type_name[5] = { | 38 | static const char *radeon_pm_state_type_name[5] = { |
40 | "Default", | 39 | "Default", |
@@ -251,21 +250,14 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) | |||
251 | return; | 250 | return; |
252 | 251 | ||
253 | mutex_lock(&rdev->ddev->struct_mutex); | 252 | mutex_lock(&rdev->ddev->struct_mutex); |
254 | mutex_lock(&rdev->vram_mutex); | 253 | down_write(&rdev->pm.mclk_lock); |
255 | mutex_lock(&rdev->ring_lock); | 254 | mutex_lock(&rdev->ring_lock); |
256 | 255 | ||
257 | /* gui idle int has issues on older chips it seems */ | 256 | /* gui idle int has issues on older chips it seems */ |
258 | if (rdev->family >= CHIP_R600) { | 257 | if (rdev->family >= CHIP_R600) { |
259 | if (rdev->irq.installed) { | 258 | if (rdev->irq.installed) { |
260 | /* wait for GPU idle */ | 259 | /* wait for GPU to become idle */ |
261 | rdev->pm.gui_idle = false; | 260 | radeon_irq_kms_wait_gui_idle(rdev); |
262 | rdev->irq.gui_idle = true; | ||
263 | radeon_irq_set(rdev); | ||
264 | wait_event_interruptible_timeout( | ||
265 | rdev->irq.idle_queue, rdev->pm.gui_idle, | ||
266 | msecs_to_jiffies(RADEON_WAIT_IDLE_TIMEOUT)); | ||
267 | rdev->irq.gui_idle = false; | ||
268 | radeon_irq_set(rdev); | ||
269 | } | 261 | } |
270 | } else { | 262 | } else { |
271 | struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; | 263 | struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; |
@@ -303,7 +295,7 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) | |||
303 | rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE; | 295 | rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE; |
304 | 296 | ||
305 | mutex_unlock(&rdev->ring_lock); | 297 | mutex_unlock(&rdev->ring_lock); |
306 | mutex_unlock(&rdev->vram_mutex); | 298 | up_write(&rdev->pm.mclk_lock); |
307 | mutex_unlock(&rdev->ddev->struct_mutex); | 299 | mutex_unlock(&rdev->ddev->struct_mutex); |
308 | } | 300 | } |
309 | 301 | ||