panfrost: Pad compute jobs with zeros on v4

Apparently, Midgard GPUs don't like when the last 2 words of
compute/vertex jobs contain garbage. Extend the compute job definition
to include a padding section thus aligning the job on a 64-byte boundary,
and add the according pan_section_pack() calls where we have a
compute job filled.

Fixes: b76420be1f ("panfrost: Split command stream descriptor definitions per-gen")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10558
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Anton Bambura <jenneron@postmarketos.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27515>
This commit is contained in:
Boris Brezillon
2024-02-07 21:48:57 +01:00
committed by Marge Bot
parent 0bc26efdc4
commit 5b1b76e9cd
2 changed files with 14 additions and 0 deletions

View File

@@ -302,6 +302,11 @@ GENX(jm_launch_grid)(struct panfrost_batch *batch,
cfg.textures = batch->textures[PIPE_SHADER_COMPUTE]; cfg.textures = batch->textures[PIPE_SHADER_COMPUTE];
cfg.samplers = batch->samplers[PIPE_SHADER_COMPUTE]; cfg.samplers = batch->samplers[PIPE_SHADER_COMPUTE];
} }
#if PAN_ARCH == 4
pan_section_pack(t.cpu, COMPUTE_JOB, COMPUTE_PADDING, cfg)
;
#endif
#else #else
struct panfrost_context *ctx = batch->ctx; struct panfrost_context *ctx = batch->ctx;
struct panfrost_compiled_shader *cs = ctx->prog[PIPE_SHADER_COMPUTE]; struct panfrost_compiled_shader *cs = ctx->prog[PIPE_SHADER_COMPUTE];
@@ -453,6 +458,11 @@ jm_emit_vertex_job(struct panfrost_batch *batch,
section = pan_section_ptr(job, COMPUTE_JOB, DRAW); section = pan_section_ptr(job, COMPUTE_JOB, DRAW);
jm_emit_vertex_draw(batch, section); jm_emit_vertex_draw(batch, section);
#if PAN_ARCH == 4
pan_section_pack(job, COMPUTE_JOB, COMPUTE_PADDING, cfg)
;
#endif
} }
#endif /* PAN_ARCH <= 7 */ #endif /* PAN_ARCH <= 7 */

View File

@@ -979,12 +979,16 @@
<field name="Job Task Split" size="4" start="0:26" type="uint"/> <field name="Job Task Split" size="4" start="0:26" type="uint"/>
</struct> </struct>
<struct name="Compute Padding" size="2">
</struct>
<!-- Compute job also covers vertex and geometry operations --> <!-- Compute job also covers vertex and geometry operations -->
<aggregate name="Compute Job" align="64"> <aggregate name="Compute Job" align="64">
<section name="Header" offset="0" type="Job Header"/> <section name="Header" offset="0" type="Job Header"/>
<section name="Invocation" offset="32" type="Invocation"/> <section name="Invocation" offset="32" type="Invocation"/>
<section name="Parameters" offset="40" type="Compute Job Parameters"/> <section name="Parameters" offset="40" type="Compute Job Parameters"/>
<section name="Draw" offset="64" type="Draw"/> <section name="Draw" offset="64" type="Draw"/>
<section name="Compute padding" offset="184" type="Compute Padding"/>
</aggregate> </aggregate>
<struct name="Primitive Size"> <struct name="Primitive Size">