freedreno: threaded batch flush

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

With the state accessed from GMEM+submit factored out of fd_context and into fd_batch, now it is possible to punt this off to a helper thread. And more importantly, since there are cases where one context might force the batch-cache to flush another context's batches (ie. when there are too many in-flight batches), using a per-context helper thread keeps
various different flushes for a given context serialized.

TODO as with batch-cache, there are a few places where we'll need a mutex to protect critical sections, which is completely missing at the moment.

00bed8a freedreno: threaded batch flush
src/gallium/drivers/freedreno/freedreno_batch.c | 64 +++++++++++++++++---
src/gallium/drivers/freedreno/freedreno_batch.h | 6 +-
.../drivers/freedreno/freedreno_batch_cache.c | 15 +++--
src/gallium/drivers/freedreno/freedreno_context.c | 10 ++-
src/gallium/drivers/freedreno/freedreno_context.h | 4 ++
src/gallium/drivers/freedreno/freedreno_gmem.c | 2 -
src/gallium/drivers/freedreno/freedreno_query_hw.c | 4 +-
src/gallium/drivers/freedreno/freedreno_resource.c | 16 +++--
src/gallium/drivers/freedreno/freedreno_state.c | 4 +-
9 files changed, 99 insertions(+), 26 deletions(-)

Upstream: cgit.freedesktop.org


  • Share