diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2013-05-13 09:32:11 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-05-31 14:53:54 -0400 |
commit | ed5cbb0355779dc5516b2f7b62cedce185b00439 (patch) | |
tree | e1eb186213eb330d8fb2dcb25dcb0de8fedb4713 /drivers/gpu/drm/i915/i915_irq.c | |
parent | 92cab7345131db7af18f630a799ce6b2e8e624c5 (diff) |
drm/i915: introduce i915_hangcheck_ring_hung
In preparation to track per ring progress in hangcheck,
add i915_hangcheck_ring_hung.
v2: omit dev parameter (Ben Widawsky)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 004ad3455992..6efe3b0d3e84 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -2345,28 +2345,33 @@ static bool kick_ring(struct intel_ring_buffer *ring) | |||
2345 | return false; | 2345 | return false; |
2346 | } | 2346 | } |
2347 | 2347 | ||
2348 | static bool i915_hangcheck_ring_hung(struct intel_ring_buffer *ring) | ||
2349 | { | ||
2350 | if (IS_GEN2(ring->dev)) | ||
2351 | return false; | ||
2352 | |||
2353 | /* Is the chip hanging on a WAIT_FOR_EVENT? | ||
2354 | * If so we can simply poke the RB_WAIT bit | ||
2355 | * and break the hang. This should work on | ||
2356 | * all but the second generation chipsets. | ||
2357 | */ | ||
2358 | return !kick_ring(ring); | ||
2359 | } | ||
2360 | |||
2348 | static bool i915_hangcheck_hung(struct drm_device *dev) | 2361 | static bool i915_hangcheck_hung(struct drm_device *dev) |
2349 | { | 2362 | { |
2350 | drm_i915_private_t *dev_priv = dev->dev_private; | 2363 | drm_i915_private_t *dev_priv = dev->dev_private; |
2351 | 2364 | ||
2352 | if (dev_priv->gpu_error.hangcheck_count++ > 1) { | 2365 | if (dev_priv->gpu_error.hangcheck_count++ > 1) { |
2353 | bool hung = true; | 2366 | bool hung = true; |
2367 | struct intel_ring_buffer *ring; | ||
2368 | int i; | ||
2354 | 2369 | ||
2355 | DRM_ERROR("Hangcheck timer elapsed... GPU hung\n"); | 2370 | DRM_ERROR("Hangcheck timer elapsed... GPU hung\n"); |
2356 | i915_handle_error(dev, true); | 2371 | i915_handle_error(dev, true); |
2357 | 2372 | ||
2358 | if (!IS_GEN2(dev)) { | 2373 | for_each_ring(ring, dev_priv, i) |
2359 | struct intel_ring_buffer *ring; | 2374 | hung &= i915_hangcheck_ring_hung(ring); |
2360 | int i; | ||
2361 | |||
2362 | /* Is the chip hanging on a WAIT_FOR_EVENT? | ||
2363 | * If so we can simply poke the RB_WAIT bit | ||
2364 | * and break the hang. This should work on | ||
2365 | * all but the second generation chipsets. | ||
2366 | */ | ||
2367 | for_each_ring(ring, dev_priv, i) | ||
2368 | hung &= !kick_ring(ring); | ||
2369 | } | ||
2370 | 2375 | ||
2371 | return hung; | 2376 | return hung; |
2372 | } | 2377 | } |