From patchwork Thu Feb 18 18:08:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaime Velasco Juan X-Patchwork-Id: 80388 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 o1III2Zu002759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Feb 2010 18:18:39 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NiAvg-0002WA-Tv; Thu, 18 Feb 2010 18:16:48 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NiAoF-0007Kn-UR for dri-devel@lists.sourceforge.net; Thu, 18 Feb 2010 18:09:07 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.223 as permitted sender) client-ip=209.85.220.223; envelope-from=jsagarribay@gmail.com; helo=mail-fx0-f223.google.com; Received: from mail-fx0-f223.google.com ([209.85.220.223]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NiAoE-0007Rr-HB for dri-devel@lists.sourceforge.net; Thu, 18 Feb 2010 18:09:07 +0000 Received: by fxm23 with SMTP id 23so365836fxm.2 for ; Thu, 18 Feb 2010 10:08:53 -0800 (PST) Received: by 10.223.61.208 with SMTP id u16mr8520026fah.100.1266516533695; Thu, 18 Feb 2010 10:08:53 -0800 (PST) Received: from pogo ([95.124.27.136]) by mx.google.com with ESMTPS id 15sm4801741fxm.6.2010.02.18.10.08.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Feb 2010 10:08:51 -0800 (PST) Received: from jaime by pogo with local (Exim 4.71) (envelope-from ) id 1NiAnn-0000vy-Ai; Thu, 18 Feb 2010 18:08:39 +0000 Date: Thu, 18 Feb 2010 18:08:39 +0000 From: Jaime Velasco Juan To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH] drm/radeon/kms: really wait for VBLANK in PM code Message-ID: <20100218180839.GA3386@pogo> References: <1266434608-802-1-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1266434608-802-1-git-send-email-zajec5@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: -1.5 (-) 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 X-Headers-End: 1NiAoE-0007Rr-HB X-Mailman-Approved-At: Thu, 18 Feb 2010 18:16:47 +0000 Cc: dri-devel@lists.sourceforge.net 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]); Thu, 18 Feb 2010 18:18:39 +0000 (UTC) >From b44da60bce551b7119b0eb2e521e2e7635b9b98e Mon Sep 17 00:00:00 2001 From: Jaime Velasco Juan Date: Mon, 15 Feb 2010 14:50:46 +0000 Subject: [PATCH] radeon/PM Really wait for vblank before reclocking The old code used a false condition so it always waited until timeout. Signed-off-by: Jaime Velasco Juan --- drivers/gpu/drm/radeon/radeon_pm.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index a8e151e..7d8c5d9 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -337,10 +337,18 @@ 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( - rdev->irq.vblank_queue, 0, - msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT)); + if (rdev->pm.active_crtcs) { + /* We code the wait istead of using the usual + wait_event_interruptible_timeout because there is not + condition to check, we want to be always waken up by + the vblank IRQ handler */ + DEFINE_WAIT(reclock_wait); + prepare_to_wait(&rdev->irq.vblank_queue, + &reclock_wait, TASK_INTERRUPTIBLE); + if (!signal_pending(current)) + schedule_timeout(msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT)); + finish_wait(&rdev->irq.vblank_queue, &reclock_wait); + } if (rdev->pm.req_vblank & (1 << 0)) { rdev->pm.req_vblank &= ~(1 << 0); drm_vblank_put(rdev->ddev, 0); -- 1.7.0