Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357886
b: refs/heads/master
c: cbcc80d
h: refs/heads/master
v: v3
  • Loading branch information
Mika Kuoppala authored and Daniel Vetter committed Dec 6, 2012
1 parent aef8fa3 commit a3722da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 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: 43a7b924a920729ff775e6a847f671d0ea456801
refs/heads/master: cbcc80dff3896015385c67d6be0beb3399999e5c
37 changes: 22 additions & 15 deletions trunk/drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,11 +1363,31 @@ intel_ring_alloc_seqno(struct intel_ring_buffer *ring)
return i915_gem_get_seqno(ring->dev, &ring->outstanding_lazy_request);
}

static int __intel_ring_begin(struct intel_ring_buffer *ring,
int bytes)
{
int ret;

if (unlikely(ring->tail + bytes > ring->effective_size)) {
ret = intel_wrap_ring_buffer(ring);
if (unlikely(ret))
return ret;
}

if (unlikely(ring->space < bytes)) {
ret = ring_wait_for_space(ring, bytes);
if (unlikely(ret))
return ret;
}

ring->space -= bytes;
return 0;
}

int intel_ring_begin(struct intel_ring_buffer *ring,
int num_dwords)
{
drm_i915_private_t *dev_priv = ring->dev->dev_private;
int n = 4*num_dwords;
int ret;

ret = i915_gem_check_wedge(dev_priv, dev_priv->mm.interruptible);
Expand All @@ -1379,20 +1399,7 @@ int intel_ring_begin(struct intel_ring_buffer *ring,
if (ret)
return ret;

if (unlikely(ring->tail + n > ring->effective_size)) {
ret = intel_wrap_ring_buffer(ring);
if (unlikely(ret))
return ret;
}

if (unlikely(ring->space < n)) {
ret = ring_wait_for_space(ring, n);
if (unlikely(ret))
return ret;
}

ring->space -= n;
return 0;
return __intel_ring_begin(ring, num_dwords * sizeof(uint32_t));
}

void intel_ring_advance(struct intel_ring_buffer *ring)
Expand Down

0 comments on commit a3722da

Please sign in to comment.