From d5376c3feb2d544fc90ef73a772938ea6255c983 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 26 Feb 2023 11:58:21 -0800 Subject: [PATCH] freedreno: Promote non-drawing batches to sysmem Sometimes we can end up with a sequence where we need to flush a batch with no clears and no draws (for ex, to get a fence). Promote these to sysmem. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_gmem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index 57c3db1cfed..f0f7dc5f689 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -716,6 +716,12 @@ fd_gmem_render_tiles(struct fd_batch *batch) ctx->submit_count++; + /* Sometimes we need to flush a batch just to get a fence, with no + * clears or draws.. in this case promote to nondraw: + */ + if (!(batch->fast_cleared || batch->num_draws)) + sysmem = true; + if (!batch->nondraw) { #if HAVE_PERFETTO /* For non-draw batches, we don't really have a good place to