panfrost: Allow passing an explicit global dependency when queuing a job

We will have 2 compute jobs per indexed indirect draw, one doing the
min-max index search and one patching the cmdstream. The second compute
job needs to depend on the first one, as well as the previous indirect
draw job to avoid corrupting the indirect draw context which is shared
at the batch level (global dependency).

Instead of handling that case in panfrost_add_job(), extend
panfrost_add_job() to accept an explicit global dependency.

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>
This commit is contained in:
Boris Brezillon
2021-02-27 11:50:51 +01:00
committed by Marge Bot
parent 0bb091fd7c
commit 1758da0a7e
5 changed files with 7 additions and 9 deletions
+2 -2
View File
@@ -2222,11 +2222,11 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
unsigned vertex = panfrost_add_job(&batch->pool, &batch->scoreboard,
MALI_JOB_TYPE_VERTEX, false, false,
0, vertex_job, false);
0, 0, vertex_job, false);
if (ctx->rasterizer->base.rasterizer_discard)
return;
panfrost_add_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_TILER,
false, false, vertex, tiler_job, false);
false, false, vertex, 0, tiler_job, false);
}
+1 -1
View 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, false, 0, &t, true);
MALI_JOB_TYPE_COMPUTE, true, false, 0, 0, &t, true);
panfrost_flush_all_batches(ctx);
}
+2 -2
View File
@@ -488,7 +488,7 @@ panfrost_load_midg(struct pan_pool *pool,
1, vertex_count, 1, 1, 1, 1, true);
panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, false,
0, &t, true);
0, 0, &t, true);
}
static void
@@ -685,5 +685,5 @@ panfrost_load_bifrost(struct pan_pool *pool,
}
panfrost_add_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, false,
0, &t, true);
0, 0, &t, true);
}
+1 -3
View File
@@ -111,12 +111,10 @@ panfrost_add_job(
struct pan_scoreboard *scoreboard,
enum mali_job_type type,
bool barrier, bool suppress_prefetch,
unsigned local_dep,
unsigned local_dep, unsigned global_dep,
const struct panfrost_ptr *job,
bool inject)
{
unsigned global_dep = 0;
if (type == MALI_JOB_TYPE_TILER) {
/* Tiler jobs must be chained, and on Midgard, the first tiler
* job must depend on the write value job, whose index we
+1 -1
View File
@@ -60,7 +60,7 @@ panfrost_add_job(
struct pan_scoreboard *scoreboard,
enum mali_job_type type,
bool barrier, bool suppress_prefetch,
unsigned local_dep,
unsigned local_dep, unsigned global_dep,
const struct panfrost_ptr *job,
bool inject);