From patchwork Sun Aug 22 11:05:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 122241 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7MB9Mqo022364 for ; Sun, 22 Aug 2010 11:09:57 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 791EC9EB0D for ; Sun, 22 Aug 2010 04:09:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 556E99E94B for ; Sun, 22 Aug 2010 04:06:08 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 22 Aug 2010 04:06:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,251,1280732400"; d="scan'208";a="547572194" Received: from unknown (HELO cantiga.alporthouse.com) ([10.255.17.166]) by orsmga002.jf.intel.com with ESMTP; 22 Aug 2010 04:06:06 -0700 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sun, 22 Aug 2010 12:05:28 +0100 Message-Id: <1282475148-15951-10-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1282475148-15951-1-git-send-email-chris@chris-wilson.co.uk> References: <1282475148-15951-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 09/29] drm/i915: Fixup intel_wait_for_vblank*() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 22 Aug 2010 11:09:58 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6ccb797..d50830e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -993,7 +993,7 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) /* Wait for vblank interrupt bit to set */ if (wait_for((I915_READ(pipestat_reg) & PIPE_VBLANK_INTERRUPT_STATUS) == 0, - 50, 0)) + 50, 1)) DRM_DEBUG_KMS("vblank wait timed out\n"); } @@ -1019,9 +1019,12 @@ void intel_wait_for_vblank_off(struct drm_device *dev, int pipe) /* Wait for the display line to settle */ do { last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; - mdelay(5); + if (in_dbg_master()) + mdelay(5); + else + msleep(5); } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && - time_after(timeout, jiffies)); + !time_after(timeout, jiffies)); if (time_after(jiffies, timeout)) DRM_DEBUG_KMS("vblank wait timed out\n");