Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f01db988 authored by Sean Paul's avatar Sean Paul Committed by Daniel Vetter
Browse files

drm/i915: Add wait_for in init_ring_common



I have seen a number of "blt ring initialization failed" messages
where the ctl or start registers are not the correct value. Upon further
inspection, if the code just waited a little bit, it would read the
correct value. Adding the wait_for to these reads should eliminate the
issue.

Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9e984bc1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -290,9 +290,9 @@ static int init_ring_common(struct intel_ring_buffer *ring)
			| RING_REPORT_64K | RING_VALID);

	/* If the head is still not zero, the ring is dead */
	if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
	    I915_READ_START(ring) != obj->gtt_offset ||
	    (I915_READ_HEAD(ring) & HEAD_ADDR) != 0) {
	if (wait_for((I915_READ_CTL(ring) & RING_VALID) != 0 &&
		     I915_READ_START(ring) == obj->gtt_offset &&
		     (I915_READ_HEAD(ring) & HEAD_ADDR) == 0, 50)) {
		DRM_ERROR("%s initialization failed "
				"ctl %08x head %08x tail %08x start %08x\n",
				ring->name,