Skip to content

Commit

Permalink
drm/i915: Unroll wrapping of the ringbuffer.
Browse files Browse the repository at this point in the history
The tail is quadword aligned, so we can add two MI_NOOP as a time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
  • Loading branch information
Chris Wilson authored and Eric Anholt committed Aug 9, 2010
1 parent ae7d49d commit 1741dd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,11 @@ int intel_wrap_ring_buffer(struct drm_device *dev,
}

virt = (unsigned int *)(ring->virtual_start + ring->tail);
rem /= 4;
while (rem--)
rem /= 8;
while (rem--) {
*virt++ = MI_NOOP;
*virt++ = MI_NOOP;
}

ring->tail = 0;
ring->space = ring->head - 8;
Expand Down

0 comments on commit 1741dd4

Please sign in to comment.