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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user