freedreno: Promote non-drawing batches to sysmem
authorRob Clark <robdclark@chromium.org>
Sun, 26 Feb 2023 19:58:21 +0000 (11:58 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Mar 2023 04:10:45 +0000 (04:10 +0000)
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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21747>

src/gallium/drivers/freedreno/freedreno_gmem.c

index 57c3db1..f0f7dc5 100644 (file)
@@ -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