summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson2010-10-28 12:18:07 +0200
committerChris Wilson2010-10-28 13:33:17 +0200
commit176f28ebf4303b4f7e3a5bd8be7842a8bbecd9c3 (patch)
tree40f64c5d115779aea9661af851c9459741894ea0 /drivers/gpu/drm/i915/intel_ringbuffer.c
parentdrm/i915: Use pci_iomap for remapping the MMIO registers. (diff)
downloadkernel-qcow2-linux-176f28ebf4303b4f7e3a5bd8be7842a8bbecd9c3.tar.gz
kernel-qcow2-linux-176f28ebf4303b4f7e3a5bd8be7842a8bbecd9c3.tar.xz
kernel-qcow2-linux-176f28ebf4303b4f7e3a5bd8be7842a8bbecd9c3.zip
drm/i915/ringbuffer: Check that we setup the ringbuffer
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 8eaa60cc5d25..e88214ef24b1 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -176,9 +176,10 @@ static int init_ring_common(struct intel_ring_buffer *ring)
((ring->gem_object->size - PAGE_SIZE) & RING_NR_PAGES)
| RING_NO_REPORT | RING_VALID);
- head = I915_READ_HEAD(ring) & HEAD_ADDR;
/* If the head is still not zero, the ring is dead */
- if (head != 0) {
+ 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,