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

Commit 629e8941 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915/ringbuffer: Ignore failure to setup the ring on Sandybridge

The ring buffer registers return 0 whilst idle (for some values of idle)
on early Sandybridge hw. Persevere even when all appears hopeless...
Fortunately the head auto-reporting prevents most hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31370


Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent ae69b42a
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -180,6 +180,21 @@ static int init_ring_common(struct intel_ring_buffer *ring)
	if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
	if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
	    I915_READ_START(ring) != obj_priv->gtt_offset ||
	    I915_READ_START(ring) != obj_priv->gtt_offset ||
	    (I915_READ_HEAD(ring) & HEAD_ADDR) != 0) {
	    (I915_READ_HEAD(ring) & HEAD_ADDR) != 0) {
		if (IS_GEN6(ring->dev) && ring->dev->pdev->revision <= 8) {
			/* Early revisions of Sandybridge do not like
			 * revealing the contents of the ring buffer
			 * registers whilst idle. Fortunately, the
			 * auto-reporting mechanism prevents most hangs,
			 * but this will bite us eventually...
			 */
			DRM_DEBUG("%s initialization failed "
				  "ctl %08x head %08x tail %08x start %08x. Ignoring, hope for the best!\n",
				  ring->name,
				  I915_READ_CTL(ring),
				  I915_READ_HEAD(ring),
				  I915_READ_TAIL(ring),
				  I915_READ_START(ring));
		} else {
			DRM_ERROR("%s initialization failed "
			DRM_ERROR("%s initialization failed "
				  "ctl %08x head %08x tail %08x start %08x\n",
				  "ctl %08x head %08x tail %08x start %08x\n",
				  ring->name,
				  ring->name,
@@ -189,6 +204,7 @@ static int init_ring_common(struct intel_ring_buffer *ring)
				  I915_READ_START(ring));
				  I915_READ_START(ring));
			return -EIO;
			return -EIO;
		}
		}
	}


	if (!drm_core_check_feature(ring->dev, DRIVER_MODESET))
	if (!drm_core_check_feature(ring->dev, DRIVER_MODESET))
		i915_kernel_lost_context(ring->dev);
		i915_kernel_lost_context(ring->dev);