From: Daniel Vetter Subject: [PATCH] drm/i915: increase the default timeout in wait_seqno to 60s Date: Wed, 7 Aug 2013 00:45:14 +0200 Message-ID: <1375829114-9990-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BCC8E5E9E for ; Tue, 6 Aug 2013 15:45:11 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id b13so905617wgh.7 for ; Tue, 06 Aug 2013 15:45:10 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Intel Graphics Development Cc: Daniel Vetter , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org We'll loop forever, but if we wake up before the hangcheck time has a chance to complain that we're stuck waiting for the interrupt we'll loose that valuable debug tool. And silently blocking for 1 second is just not the right approach. Noticed since Paulo reported a suspicious 2 fps when running glxgears with pc8+ enabled. Since mesa stalls for the second-last frame before rendering a new one this is perfectly explained by hitting the 1 second timeout. This regression has been introduced in Ben's wait with timeout ioctl work in: commit 5c81fe85dad3c8c2bcec03e3fc2bfd4ea198763c Author: Ben Widawsky Date: Thu May 24 15:03:08 2012 -0700 drm/i915: timeout parameter for seqno wait Also fix whitespace in that line while at it and add an explicit comment. Cc: Ben Widawsky Cc: Paulo Zanoni Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 8508b3d..84170fe 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -986,7 +986,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, bool interruptible, struct timespec *timeout) { drm_i915_private_t *dev_priv = ring->dev->dev_private; - struct timespec before, now, wait_time={1,0}; + struct timespec before, now, wait_time; unsigned long timeout_jiffies; long end; bool wait_forever = true; @@ -1000,6 +1000,14 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, if (timeout != NULL) { wait_time = *timeout; wait_forever = false; + } else { + /* + * The timeout here must be longer than the hangcheck timeout, + * otherwise we'll no longer detect missed interrupts but end up + * with dead-slow rendering. + */ + wait_time.tv_sec = 60; + wait_time.tv_nsec = 0; } timeout_jiffies = timespec_to_jiffies_timeout(&wait_time); -- 1.8.3.2