diff options
author | Rob Clark <[email protected]> | 2016-05-20 15:36:10 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-07-30 09:23:42 -0400 |
commit | 9bbd239a4039522d7c1023ecb21764679447bb2d (patch) | |
tree | de6633fb1936d05c929e34a88987c69884ed45f9 /src/gallium/drivers/freedreno/freedreno_util.h | |
parent | 12aec78993edface7f530eede9e018b5fa1897b7 (diff) |
freedreno: introduce fd_batch
Introduce the batch object, to track a batch/submit's worth of
ringbuffers and other bookkeeping. In this first step, just move
the ringbuffers into batch, since that is mostly uninteresting
churn.
For now there is just a single batch at a time. Note that one
outcome of this change is that rb's are allocated/freed on each
use. But the expectation is that the bo pool in libdrm_freedreno
will save us the GEM bo alloc/free which was the initial reason
to implement a rb pool in gallium.
The purpose of the batch is to eventually facilitate out-of-order
rendering, with batches associated to framebuffer state, and
tracking the dependencies on other batches.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_util.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 330cff9c0fb..b6b91f92c7c 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -182,7 +182,7 @@ OUT_RING(struct fd_ringbuffer *ring, uint32_t data) DBG("ring[%p]: OUT_RING %04x: %08x", ring, (uint32_t)(ring->cur - ring->last_start), data); } - *(ring->cur++) = data; + fd_ringbuffer_emit(ring, data); } /* like OUT_RING() but appends a cmdstream patch point to 'buf' */ @@ -269,10 +269,9 @@ OUT_WFI(struct fd_ringbuffer *ring) } static inline void -__OUT_IB(struct fd_ringbuffer *ring, bool prefetch, - struct fd_ringmarker *start, struct fd_ringmarker *end) +__OUT_IB(struct fd_ringbuffer *ring, bool prefetch, struct fd_ringbuffer *target) { - uint32_t dwords = fd_ringmarker_dwords(start, end); + uint32_t dwords = target->cur - target->start; assert(dwords > 0); @@ -285,7 +284,7 @@ __OUT_IB(struct fd_ringbuffer *ring, bool prefetch, emit_marker(ring, 6); OUT_PKT3(ring, prefetch ? CP_INDIRECT_BUFFER_PFE : CP_INDIRECT_BUFFER_PFD, 2); - fd_ringbuffer_emit_reloc_ring(ring, start, end); + fd_ringbuffer_emit_reloc_ring_full(ring, target, 0); OUT_RING(ring, dwords); emit_marker(ring, 6); |