summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-11-07 11:50:02 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-11-07 13:19:40 +0000
commit629e894173c9de589913cf649deaadec4b0579bd (patch)
tree151112b1646ae39b6a0ccfa755158938b606f3f1 /drivers/gpu/drm/i915/intel_ringbuffer.c
parentae69b42a10dafe61adb016e0e52ec1e8d1ba11b4 (diff)
downloadlwn-629e894173c9de589913cf649deaadec4b0579bd.tar.gz
lwn-629e894173c9de589913cf649deaadec4b0579bd.zip
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: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 9033697783b9..f5d6151c953f 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -180,14 +180,30 @@ static int init_ring_common(struct intel_ring_buffer *ring)
if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
I915_READ_START(ring) != obj_priv->gtt_offset ||
(I915_READ_HEAD(ring) & HEAD_ADDR) != 0) {
- DRM_ERROR("%s initialization failed "
- "ctl %08x head %08x tail %08x start %08x\n",
- ring->name,
- I915_READ_CTL(ring),
- I915_READ_HEAD(ring),
- I915_READ_TAIL(ring),
- I915_READ_START(ring));
- return -EIO;
+ 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 "
+ "ctl %08x head %08x tail %08x start %08x\n",
+ ring->name,
+ I915_READ_CTL(ring),
+ I915_READ_HEAD(ring),
+ I915_READ_TAIL(ring),
+ I915_READ_START(ring));
+ return -EIO;
+ }
}
if (!drm_core_check_feature(ring->dev, DRIVER_MODESET))