diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-04-28 12:13:06 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 04:21:29 -0400 |
commit | f81f202402640c27b38e1452dcb4d3e447043f48 (patch) | |
tree | 7f081e491e256d792c7b9c5e9df817894227fe05 /drivers/gpu/drm/radeon/r600.c | |
parent | 612e06ce9c78840c3a1a207dfbe489a059d87c28 (diff) |
radeon: Try harder to ensure we reclock in vblank
The vblank interrupt on r600 doesn't seem to be especially reliable, so
perform some sanity checks before the actual reclock.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
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); |