aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-11 04:21:35 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-11 07:33:49 -0400
commit9bec9b1334d687c0a9fcf3d3a1987a61b4826a45 (patch)
treeaa0e192a0a7680365a736edddc211e8268b06873 /drivers/gpu/drm/i915/intel_ringbuffer.c
parent1bee20175f27b46427f10290fdd4a79334d41a60 (diff)
drm/i915: Double check ring is idle before declaring the GPU wedged
During ring initialisation, sometimes we observe, though not in production hardware, that the idle flag is not set even though the ring is empty. Double check before giving up. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 117543e58d48..a059b64a0fb2 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -478,7 +478,12 @@ static bool stop_ring(struct intel_engine_cs *ring)
478 I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING)); 478 I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING));
479 if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) { 479 if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
480 DRM_ERROR("%s : timed out trying to stop ring\n", ring->name); 480 DRM_ERROR("%s : timed out trying to stop ring\n", ring->name);
481 return false; 481 /* Sometimes we observe that the idle flag is not
482 * set even though the ring is empty. So double
483 * check before giving up.
484 */
485 if (I915_READ_HEAD(ring) != I915_READ_TAIL(ring))
486 return false;
482 } 487 }
483 } 488 }
484 489