diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1696cc277d8b..d3a79e0a9125 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -289,8 +289,34 @@ void r600_set_power_state(struct radeon_device *rdev, bool static_switch) | |||
289 | } | 289 | } |
290 | 290 | ||
291 | } else { | 291 | } else { |
292 | u32 position; | ||
293 | u32 vbl; | ||
294 | |||
292 | radeon_sync_with_vblank(rdev); | 295 | radeon_sync_with_vblank(rdev); |
293 | 296 | ||
297 | if (!radeon_pm_in_vbl(rdev)) | ||
298 | return; | ||
299 | |||
300 | if (rdev->pm.active_crtcs & (1 << 0)) { | ||
301 | vbl = RREG32(AVIVO_D1CRTC_V_BLANK_START_END); | ||
302 | position = RREG32(AVIVO_D1CRTC_STATUS_POSITION); | ||
303 | position &= 0xfff; | ||
304 | vbl &= 0xfff; | ||
305 | |||
306 | if (position < vbl && position > 1) | ||
307 | return; | ||
308 | } | ||
309 | |||
310 | if (rdev->pm.active_crtcs & (1 << 1)) { | ||
311 | vbl = RREG32(AVIVO_D2CRTC_V_BLANK_START_END); | ||
312 | position = RREG32(AVIVO_D2CRTC_STATUS_POSITION); | ||
313 | position &= 0xfff; | ||
314 | vbl &= 0xfff; | ||
315 | |||
316 | if (position < vbl && position > 1) | ||
317 | return; | ||
318 | } | ||
319 | |||
294 | if (sclk != rdev->pm.current_sclk) { | 320 | if (sclk != rdev->pm.current_sclk) { |
295 | radeon_pm_debug_check_in_vbl(rdev, false); | 321 | radeon_pm_debug_check_in_vbl(rdev, false); |
296 | radeon_set_engine_clock(rdev, sclk); | 322 | radeon_set_engine_clock(rdev, sclk); |