panfrost: Add a parameter to suppress next job prefetching
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 25 Jan 2021 10:40:06 +0000 (11:40 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Mar 2021 14:30:19 +0000 (14:30 +0000)
This is needed for indirect draws so the compute job can patch the
vertex/tiler jobs which are following in the chain.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9520>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_compute.c
src/panfrost/lib/pan_blit.c
src/panfrost/lib/pan_scoreboard.c
src/panfrost/lib/pan_scoreboard.h

index 214aee2..8d8f867 100644 (file)
@@ -2220,11 +2220,13 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
 
         /* If rasterizer discard is enable, only submit the vertex */
 
-        unsigned vertex = panfrost_add_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_VERTEX, false, 0,
-                                           vertex_job, false);
+        unsigned vertex = panfrost_add_job(&batch->pool, &batch->scoreboard,
+                                           MALI_JOB_TYPE_VERTEX, false, false,
+                                           0, vertex_job, false);
 
         if (ctx->rasterizer->base.rasterizer_discard)
                 return;
 
-        panfrost_add_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_TILER, false, vertex, tiler_job, false);
+        panfrost_add_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_TILER,
+                         false, false, vertex, tiler_job, false);
 }
index 049e4ff..c1d04f6 100644 (file)
@@ -160,7 +160,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
         pan_section_pack(t.cpu, COMPUTE_JOB, DRAW_PADDING, cfg);
 
         panfrost_add_job(&batch->pool, &batch->scoreboard,
-                         MALI_JOB_TYPE_COMPUTE, true, 0, &t, true);
+                         MALI_JOB_TYPE_COMPUTE, true, false, 0, &t, true);
         panfrost_flush_all_batches(ctx);
 }
 
index 99fed03..d3433e5 100644 (file)
@@ -487,7 +487,8 @@ panfrost_load_midg(struct pan_pool *pool,
                                                           INVOCATION),
                                           1, vertex_count, 1, 1, 1, 1, true);
 
-        panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, 0, &t, true);
+        panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, false,
+                         0, &t, true);
 }
 
 static void
@@ -683,5 +684,6 @@ panfrost_load_bifrost(struct pan_pool *pool,
                 cfg.address = tiler;
         }
 
-        panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, 0, &t, true);
+        panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, false,
+                         0, &t, true);
 }
index e88fd37..afb13e5 100644 (file)
@@ -110,7 +110,7 @@ panfrost_add_job(
                 struct pan_pool *pool,
                 struct pan_scoreboard *scoreboard,
                 enum mali_job_type type,
-                bool barrier,
+                bool barrier, bool suppress_prefetch,
                 unsigned local_dep,
                 const struct panfrost_ptr *job,
                 bool inject)
@@ -137,6 +137,7 @@ panfrost_add_job(
         pan_pack(job->cpu, JOB_HEADER, header) {
                 header.type = type;
                 header.barrier = barrier;
+                header.suppress_prefetch = suppress_prefetch;
                 header.index = index;
                 header.dependency_1 = local_dep;
                 header.dependency_2 = global_dep;
index c79c6c8..ad9cc10 100644 (file)
@@ -59,7 +59,7 @@ panfrost_add_job(
                 struct pan_pool *pool,
                 struct pan_scoreboard *scoreboard,
                 enum mali_job_type type,
-                bool barrier,
+                bool barrier, bool suppress_prefetch,
                 unsigned local_dep,
                 const struct panfrost_ptr *job,
                 bool inject);