diff options
author | Rob Clark <[email protected]> | 2017-11-24 10:37:22 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-12-17 12:41:32 -0500 |
commit | b852c3bf67cf1a047b8d17391506b19b5d1bdb70 (patch) | |
tree | 5ad211f396896f763f521ac20c220acc88bab0cb /src/gallium/drivers/freedreno/freedreno_gmem.c | |
parent | 2697480c923e4c811d9b9f11169de6be55ae38da (diff) |
freedreno: add non-draw batches for compute/blit
Get rid of "gmem" (ie. tiling) ringbuffer, and just emit setup commands
directly to "draw" ringbuffer for compute (and in future for blits not
using the 3d pipe). This way we can have a simple flat cmdstream buffer
and bypass setup related to 3d pipe.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_gmem.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_gmem.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index 79fdb1102c3..37a2f33365d 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -372,13 +372,15 @@ render_sysmem(struct fd_batch *batch) static void flush_ring(struct fd_batch *batch) { + /* for compute/blit batch, there is no batch->gmem, only batch->draw: */ + struct fd_ringbuffer *ring = batch->nondraw ? batch->draw : batch->gmem; uint32_t timestamp; int out_fence_fd = -1; - fd_ringbuffer_flush2(batch->gmem, batch->in_fence_fd, + fd_ringbuffer_flush2(ring, batch->in_fence_fd, batch->needs_out_fence_fd ? &out_fence_fd : NULL); - timestamp = fd_ringbuffer_timestamp(batch->gmem); + timestamp = fd_ringbuffer_timestamp(ring); fd_fence_populate(batch->fence, timestamp, out_fence_fd); } @@ -389,8 +391,9 @@ fd_gmem_render_tiles(struct fd_batch *batch) struct pipe_framebuffer_state *pfb = &batch->framebuffer; bool sysmem = false; - if (ctx->emit_sysmem_prep) { - if (batch->cleared || batch->gmem_reason || (batch->num_draws > 5)) { + if (ctx->emit_sysmem_prep && !batch->nondraw) { + if (batch->cleared || batch->gmem_reason || + ((batch->num_draws > 5) && !batch->blit)) { DBG("GMEM: cleared=%x, gmem_reason=%x, num_draws=%u", batch->cleared, batch->gmem_reason, batch->num_draws); } else if (!(fd_mesa_debug & FD_DBG_NOBYPASS)) { @@ -407,7 +410,10 @@ fd_gmem_render_tiles(struct fd_batch *batch) ctx->stats.batch_total++; - if (sysmem) { + if (batch->nondraw) { + DBG("%p: rendering non-draw", batch); + ctx->stats.batch_nondraw++; + } else if (sysmem) { DBG("%p: rendering sysmem %ux%u (%s/%s)", batch, pfb->width, pfb->height, util_format_short_name(pipe_surface_format(pfb->cbufs[0])), @@ -447,13 +453,6 @@ fd_gmem_render_noop(struct fd_batch *batch) flush_ring(batch); } -void -fd_gmem_flush_compute(struct fd_batch *batch) -{ - render_sysmem(batch); - flush_ring(batch); -} - /* tile needs restore if it isn't completely contained within the * cleared scissor: */ |