freedreno: introduce fd_batch

Graphics / Mesa 3D Graphics Library / Mesa - Rob Clark [freedesktop.org] - 30 July 2016 08:23 UTC

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.

9bbd239 freedreno: introduce fd_batch
src/gallium/drivers/freedreno/Makefile.sources | 2 +
src/gallium/drivers/freedreno/a2xx/fd2_draw.c | 6 +-
src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 7 +-
src/gallium/drivers/freedreno/a3xx/fd3_draw.c | 8 +-
src/gallium/drivers/freedreno/a3xx/fd3_emit.c | 8 +-
src/gallium/drivers/freedreno/a3xx/fd3_emit.h | 2 +-
src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 7 +-
src/gallium/drivers/freedreno/a4xx/fd4_draw.c | 30 ++++---
src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 8 +-
src/gallium/drivers/freedreno/a4xx/fd4_emit.h | 2 +-
src/gallium/drivers/freedreno/a4xx/fd4_gmem.c | 7 +-
src/gallium/drivers/freedreno/freedreno_batch.c | 93 ++++++++++++++++++++
src/gallium/drivers/freedreno/freedreno_batch.h | 72 +++++++++++++++
src/gallium/drivers/freedreno/freedreno_context.c | 85 +++---------------
src/gallium/drivers/freedreno/freedreno_context.h | 38 +++-----
src/gallium/drivers/freedreno/freedreno_draw.c | 17 +---
src/gallium/drivers/freedreno/freedreno_gmem.c | 20 ++---
src/gallium/drivers/freedreno/freedreno_query_hw.c | 4 +-
src/gallium/drivers/freedreno/freedreno_resource.c | 4 +-
src/gallium/drivers/freedreno/freedreno_util.h | 9 +-
20 files changed, 252 insertions(+), 177 deletions(-)

Upstream: cgit.freedesktop.org


  • Share