[Intel-gfx] [PATCH 3/4] drm/i915: adjust ring->add_request to no longer pass back the seqno
Daniel Vetter
daniel.vetter at ffwll.ch
Wed Jan 25 14:03:59 CET 2012
The seqno is now allocated ahead of calling ring->add_request, so this
is just unncessery and can be removed.
Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
drivers/gpu/drm/i915/i915_gem.c | 2 +-
drivers/gpu/drm/i915/intel_ringbuffer.c | 24 +++++++-----------------
drivers/gpu/drm/i915/intel_ringbuffer.h | 2 +-
3 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index dc8e45f..a72100c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1682,7 +1682,7 @@ i915_add_request(struct intel_ring_buffer *ring,
BUG_ON(request == NULL);
seqno = i915_gem_next_request_seqno(ring);
- ret = ring->add_request(ring, &seqno);
+ ret = ring->add_request(ring, seqno);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index bc0d791..117004f 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -440,7 +440,7 @@ update_mboxes(struct intel_ring_buffer *ring,
*/
static int
gen6_add_request(struct intel_ring_buffer *ring,
- u32 *seqno)
+ u32 seqno)
{
u32 mbox1_reg;
u32 mbox2_reg;
@@ -453,13 +453,11 @@ gen6_add_request(struct intel_ring_buffer *ring,
mbox1_reg = ring->signal_mbox[0];
mbox2_reg = ring->signal_mbox[1];
- *seqno = ring->outstanding_lazy_request;
-
- update_mboxes(ring, *seqno, mbox1_reg);
- update_mboxes(ring, *seqno, mbox2_reg);
+ update_mboxes(ring, seqno, mbox1_reg);
+ update_mboxes(ring, seqno, mbox2_reg);
intel_ring_emit(ring, MI_STORE_DWORD_INDEX);
intel_ring_emit(ring, I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
- intel_ring_emit(ring, *seqno);
+ intel_ring_emit(ring, seqno);
intel_ring_emit(ring, MI_USER_INTERRUPT);
intel_ring_advance(ring);
@@ -549,9 +547,8 @@ do { \
static int
pc_render_add_request(struct intel_ring_buffer *ring,
- u32 *result)
+ u32 seqno)
{
- u32 seqno = ring->outstanding_lazy_request;
struct pipe_control *pc = ring->private;
u32 scratch_addr = pc->gtt_offset + 128;
int ret;
@@ -594,15 +591,13 @@ pc_render_add_request(struct intel_ring_buffer *ring,
intel_ring_emit(ring, 0);
intel_ring_advance(ring);
- *result = seqno;
return 0;
}
static int
render_ring_add_request(struct intel_ring_buffer *ring,
- u32 *result)
+ u32 seqno)
{
- u32 seqno = ring->outstanding_lazy_request;
int ret;
ret = intel_ring_begin(ring, 4);
@@ -615,7 +610,6 @@ render_ring_add_request(struct intel_ring_buffer *ring,
intel_ring_emit(ring, MI_USER_INTERRUPT);
intel_ring_advance(ring);
- *result = seqno;
return 0;
}
@@ -767,24 +761,20 @@ bsd_ring_flush(struct intel_ring_buffer *ring,
static int
ring_add_request(struct intel_ring_buffer *ring,
- u32 *result)
+ u32 seqno)
{
- u32 seqno;
int ret;
ret = intel_ring_begin(ring, 4);
if (ret)
return ret;
- seqno = ring->outstanding_lazy_request;
-
intel_ring_emit(ring, MI_STORE_DWORD_INDEX);
intel_ring_emit(ring, I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
intel_ring_emit(ring, seqno);
intel_ring_emit(ring, MI_USER_INTERRUPT);
intel_ring_advance(ring);
- *result = seqno;
return 0;
}
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 68281c9..1638f32 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -70,7 +70,7 @@ struct intel_ring_buffer {
u32 invalidate_domains,
u32 flush_domains);
int (*add_request)(struct intel_ring_buffer *ring,
- u32 *seqno);
+ u32 seqno);
u32 (*get_seqno)(struct intel_ring_buffer *ring);
int (*dispatch_execbuffer)(struct intel_ring_buffer *ring,
u32 offset, u32 length);
--
1.7.7.5
More information about the Intel-gfx
mailing list