All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: check ACTHD of all rings
@ 2011-11-27 17:58 Daniel Vetter
  2011-11-27 18:24 ` Chris Wilson
  2011-11-28 17:09 ` Eugeni Dodonov
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Vetter @ 2011-11-27 17:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

Otherwise hangcheck spuriously fires when running blitter/bsd-only
workloads.

Contrary to a similar patch by Ben Widawsky this does not check
INSTDONE of the other rings. Chris Wilson implied that in a failure to
detect a hang, most likely because INSTDONE was fluctuating. Thus only
check ACTHD, which as far as I know is rather reliable. Also, blitter
and bsd rings can't launch complex tasks from a single instruction
(like 3D_PRIM on the render with complex or even infinite shaders).

This fixes spurious gpu hang detection when running
tests/gem_hangcheck_forcewake on snb/ivb.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.h |    2 ++
 drivers/gpu/drm/i915/i915_irq.c |   13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4d6b794..9f4b147 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -334,6 +334,8 @@ typedef struct drm_i915_private {
 	struct timer_list hangcheck_timer;
 	int hangcheck_count;
 	uint32_t last_acthd;
+	uint32_t last_acthd_bsd;
+	uint32_t last_acthd_blt;
 	uint32_t last_instdone;
 	uint32_t last_instdone1;
 
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index c9b0766..60e4224 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1672,7 +1672,7 @@ void i915_hangcheck_elapsed(unsigned long data)
 {
 	struct drm_device *dev = (struct drm_device *)data;
 	drm_i915_private_t *dev_priv = dev->dev_private;
-	uint32_t acthd, instdone, instdone1;
+	uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt;
 	bool err = false;
 
 	if (!i915_enable_hangcheck)
@@ -1689,16 +1689,21 @@ void i915_hangcheck_elapsed(unsigned long data)
 	}
 
 	if (INTEL_INFO(dev)->gen < 4) {
-		acthd = I915_READ(ACTHD);
 		instdone = I915_READ(INSTDONE);
 		instdone1 = 0;
 	} else {
-		acthd = I915_READ(ACTHD_I965);
 		instdone = I915_READ(INSTDONE_I965);
 		instdone1 = I915_READ(INSTDONE1);
 	}
+	acthd = intel_ring_get_active_head(&dev_priv->ring[RCS]);
+	acthd_bsd = HAS_BSD(dev) ?
+		intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0;
+	acthd_blt = HAS_BLT(dev) ?
+		intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0;
 
 	if (dev_priv->last_acthd == acthd &&
+	    dev_priv->last_acthd_bsd == acthd_bsd &&
+	    dev_priv->last_acthd_blt == acthd_blt &&
 	    dev_priv->last_instdone == instdone &&
 	    dev_priv->last_instdone1 == instdone1) {
 		if (dev_priv->hangcheck_count++ > 1) {
@@ -1730,6 +1735,8 @@ void i915_hangcheck_elapsed(unsigned long data)
 		dev_priv->hangcheck_count = 0;
 
 		dev_priv->last_acthd = acthd;
+		dev_priv->last_acthd_bsd = acthd_bsd;
+		dev_priv->last_acthd_blt = acthd_blt;
 		dev_priv->last_instdone = instdone;
 		dev_priv->last_instdone1 = instdone1;
 	}
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: check ACTHD of all rings
  2011-11-27 17:58 [PATCH] drm/i915: check ACTHD of all rings Daniel Vetter
@ 2011-11-27 18:24 ` Chris Wilson
  2011-11-28 17:09 ` Eugeni Dodonov
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2011-11-27 18:24 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

On Sun, 27 Nov 2011 18:58:17 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Otherwise hangcheck spuriously fires when running blitter/bsd-only
> workloads.
> 
> Contrary to a similar patch by Ben Widawsky this does not check
> INSTDONE of the other rings. Chris Wilson implied that in a failure to
> detect a hang, most likely because INSTDONE was fluctuating. Thus only
> check ACTHD, which as far as I know is rather reliable. Also, blitter
> and bsd rings can't launch complex tasks from a single instruction
> (like 3D_PRIM on the render with complex or even infinite shaders).
> 
> This fixes spurious gpu hang detection when running
> tests/gem_hangcheck_forcewake on snb/ivb.
> 
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: check ACTHD of all rings
  2011-11-27 17:58 [PATCH] drm/i915: check ACTHD of all rings Daniel Vetter
  2011-11-27 18:24 ` Chris Wilson
@ 2011-11-28 17:09 ` Eugeni Dodonov
  1 sibling, 0 replies; 3+ messages in thread
From: Eugeni Dodonov @ 2011-11-28 17:09 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 850 bytes --]

On Sun, Nov 27, 2011 at 15:58, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> Otherwise hangcheck spuriously fires when running blitter/bsd-only
> workloads.
>
> Contrary to a similar patch by Ben Widawsky this does not check
> INSTDONE of the other rings. Chris Wilson implied that in a failure to
> detect a hang, most likely because INSTDONE was fluctuating. Thus only
> check ACTHD, which as far as I know is rather reliable. Also, blitter
> and bsd rings can't launch complex tasks from a single instruction
> (like 3D_PRIM on the render with complex or even infinite shaders).
>
> This fixes spurious gpu hang detection when running
> tests/gem_hangcheck_forcewake on snb/ivb.
>
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>

-- 
Eugeni Dodonov
<http://eugeni.dodonov.net/>

[-- Attachment #1.2: Type: text/html, Size: 1300 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-28 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-27 17:58 [PATCH] drm/i915: check ACTHD of all rings Daniel Vetter
2011-11-27 18:24 ` Chris Wilson
2011-11-28 17:09 ` Eugeni Dodonov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.