summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_irq.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-11-22 13:24:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-11-25 15:03:24 +0000
commitab5793ad3ae11a5cbe2194b449e5fdd80b19f14f (patch)
treef4e6c86471319bfac3b3fc2e377773cc7c51b407 /drivers/gpu/drm/i915/i915_irq.c
parent312817a39f17dbb4de000165b5b724e3728cd91c (diff)
drm/i915: Tweak on-error bbaddr parsing for clarity
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index de95c7bb6db..9aa1e1dc5fd 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -525,26 +525,23 @@ i915_ringbuffer_last_batch(struct drm_device *dev,
/* Locate the current position in the ringbuffer and walk back
* to find the most recently dispatched batch buffer.
*/
- bbaddr = 0;
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) {
bbaddr = i915_get_bbaddr(dev, val);
if (bbaddr)
- break;
+ return bbaddr;
}
- if (bbaddr == 0) {
- val = (u32 *)(ring->virtual_start + ring->size);
- while (--val >= (u32 *)ring->virtual_start) {
- bbaddr = i915_get_bbaddr(dev, val);
- if (bbaddr)
- break;
- }
+ val = (u32 *)(ring->virtual_start + ring->size);
+ while (--val >= (u32 *)ring->virtual_start) {
+ bbaddr = i915_get_bbaddr(dev, val);
+ if (bbaddr)
+ return bbaddr;
}
- return bbaddr;
+ return 0;
}
static u32 capture_bo_list(struct drm_i915_error_buffer *err,