freedreno: Optimize no-op submits

In some cases we need to emit a no-op batch/submit, just to get a fence.
No need to emit all the boilerplate state-resture and flushing in this
case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
This commit is contained in:
Rob Clark
2021-09-30 08:39:53 -07:00
committed by Marge Bot
parent 383df59987
commit 6223f29a87
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -256,6 +256,13 @@ fd_ringbuffer_size(struct fd_ringbuffer *ring)
return offset_bytes(ring->cur, ring->start);
}
static inline bool
fd_ringbuffer_empty(struct fd_ringbuffer *ring)
{
return (fd_ringbuffer_cmd_count(ring) == 1) &&
(offset_bytes(ring->cur, ring->start) == 0);
}
#define LOG_DWORDS 0
static inline void
@@ -724,7 +724,8 @@ fd_gmem_render_tiles(struct fd_batch *batch)
if (batch->nondraw) {
DBG("%p: rendering non-draw", batch);
render_sysmem(batch);
if (!fd_ringbuffer_empty(batch->draw))
render_sysmem(batch);
ctx->stats.batch_nondraw++;
} else if (sysmem) {
trace_render_sysmem(&batch->trace, batch->gmem);