Commit ab5793ad authored by Chris Wilson's avatar Chris Wilson

drm/i915: Tweak on-error bbaddr parsing for clarity

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 312817a3
...@@ -525,26 +525,23 @@ i915_ringbuffer_last_batch(struct drm_device *dev, ...@@ -525,26 +525,23 @@ i915_ringbuffer_last_batch(struct drm_device *dev,
/* Locate the current position in the ringbuffer and walk back /* Locate the current position in the ringbuffer and walk back
* to find the most recently dispatched batch buffer. * to find the most recently dispatched batch buffer.
*/ */
bbaddr = 0;
head = I915_READ_HEAD(ring) & HEAD_ADDR; head = I915_READ_HEAD(ring) & HEAD_ADDR;
val = (u32 *)(ring->virtual_start + head);
val = (u32 *)(ring->virtual_start + head);
while (--val >= (u32 *)ring->virtual_start) { while (--val >= (u32 *)ring->virtual_start) {
bbaddr = i915_get_bbaddr(dev, val); bbaddr = i915_get_bbaddr(dev, val);
if (bbaddr) if (bbaddr)
break; return bbaddr;
} }
if (bbaddr == 0) { val = (u32 *)(ring->virtual_start + ring->size);
val = (u32 *)(ring->virtual_start + ring->size); while (--val >= (u32 *)ring->virtual_start) {
while (--val >= (u32 *)ring->virtual_start) { bbaddr = i915_get_bbaddr(dev, val);
bbaddr = i915_get_bbaddr(dev, val); if (bbaddr)
if (bbaddr) return bbaddr;
break;
}
} }
return bbaddr; return 0;
} }
static u32 capture_bo_list(struct drm_i915_error_buffer *err, static u32 capture_bo_list(struct drm_i915_error_buffer *err,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment