Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223524
b: refs/heads/master
c: 8c0a6bf
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson committed Dec 9, 2010
1 parent 93124a9 commit 6350ba9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8316f33766a82907c694267ff911e45e256f09f9
refs/heads/master: 8c0a6bfef165ccdbf5d73afb9dd660107b0c98d5
19 changes: 8 additions & 11 deletions trunk/drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,20 +696,17 @@ int intel_wait_ring_buffer(struct drm_device *dev,
drm_i915_private_t *dev_priv = dev->dev_private;
u32 head;

head = intel_read_status_page(ring, 4);
if (head) {
ring->head = head & HEAD_ADDR;
ring->space = ring->head - (ring->tail + 8);
if (ring->space < 0)
ring->space += ring->size;
if (ring->space >= n)
return 0;
}

trace_i915_ring_wait_begin (dev);
end = jiffies + 3 * HZ;
do {
ring->head = I915_READ_HEAD(ring) & HEAD_ADDR;
/* If the reported head position has wrapped or hasn't advanced,
* fallback to the slow and accurate path.
*/
head = intel_read_status_page(ring, 4);
if (head < ring->actual_head)
head = I915_READ_HEAD(ring);
ring->actual_head = head;
ring->head = head & HEAD_ADDR;
ring->space = ring->head - (ring->tail + 8);
if (ring->space < 0)
ring->space += ring->size;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/gpu/drm/i915/intel_ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ struct intel_ring_buffer {
struct drm_device *dev;
struct drm_gem_object *gem_object;

unsigned int head;
unsigned int tail;
u32 actual_head;
u32 head;
u32 tail;
int space;
struct intel_hw_status_page status_page;

Expand Down

0 comments on commit 6350ba9

Please sign in to comment.