From patchwork Wed Feb 17 19:23:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 80018 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1HJP7an020176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2010 19:25:45 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NhpUw-0006sn-M7; Wed, 17 Feb 2010 19:23:46 +0000 Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.124] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NhpUv-0006sV-LV for dri-devel@lists.sourceforge.net; Wed, 17 Feb 2010 19:23:45 +0000 Received-SPF: pass (sfi-mx-4.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.219.221 as permitted sender) client-ip=209.85.219.221; envelope-from=zajec5@gmail.com; helo=mail-ew0-f221.google.com; Received: from mail-ew0-f221.google.com ([209.85.219.221]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NhpUu-0000yL-NO for dri-devel@lists.sourceforge.net; Wed, 17 Feb 2010 19:23:45 +0000 Received: by ewy21 with SMTP id 21so1471591ewy.2 for ; Wed, 17 Feb 2010 11:23:37 -0800 (PST) Received: by 10.213.109.212 with SMTP id k20mr3108477ebp.32.1266434617307; Wed, 17 Feb 2010 11:23:37 -0800 (PST) Received: from localhost.localdomain (c3-107.icpnet.pl [62.21.3.107]) by mx.google.com with ESMTPS id 5sm158272eyh.0.2010.02.17.11.23.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Feb 2010 11:23:36 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: dri-devel@lists.sourceforge.net, Dave Airlie , Jaime Velasco Juan Subject: [PATCH] drm/radeon/kms: really wait for VBLANK in PM code Date: Wed, 17 Feb 2010 20:23:28 +0100 Message-Id: <1266434608-802-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.6.4.2 MIME-Version: 1.0 X-Spam-Score: -0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NhpUu-0000yL-NO X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 17 Feb 2010 19:25:45 +0000 (UTC) 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);