diff mbox

drm/radeon/kms: really wait for VBLANK in PM code

Message ID 1266434608-802-1-git-send-email-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rafał Miłecki Feb. 17, 2010, 7:23 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index a8e151e..520197f 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -337,10 +337,15 @@  static void radeon_pm_set_clocks(struct radeon_device *rdev)
 		rdev->pm.req_vblank |= (1 << 1);
 		drm_vblank_get(rdev->ddev, 1);
 	}
-	if (rdev->pm.active_crtcs)
-		wait_event_interruptible_timeout(
+	if (rdev->pm.active_crtcs) {
+		/* We call __wait_* directly because of double condition check
+		   which we do not use. This call is suppossed to sleep until
+		   a wake_up happens or a timeout elapses */
+		long timeout = msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT);
+		__wait_event_interruptible_timeout(
 			rdev->irq.vblank_queue, 0,
-			msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT));
+			timeout);
+	}
 	if (rdev->pm.req_vblank & (1 << 0)) {
 		rdev->pm.req_vblank &= ~(1 << 0);
 		drm_vblank_put(rdev->ddev, 0);