From 5b1b76e9cdd8b44538aa327c7705381fa68b891b Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 7 Feb 2024 21:48:57 +0100 Subject: [PATCH] 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: b76420be1f1f ("panfrost: Split command stream descriptor definitions per-gen") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10558 Signed-off-by: Boris Brezillon Acked-by: Erik Faye-Lund Tested-by: Anton Bambura Part-of: --- src/gallium/drivers/panfrost/pan_jm.c | 10 ++++++++++ src/panfrost/lib/genxml/v4.xml | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_jm.c b/src/gallium/drivers/panfrost/pan_jm.c index 81a75609235..4e92039798d 100644 --- a/src/gallium/drivers/panfrost/pan_jm.c +++ b/src/gallium/drivers/panfrost/pan_jm.c @@ -302,6 +302,11 @@ GENX(jm_launch_grid)(struct panfrost_batch *batch, cfg.textures = batch->textures[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 struct panfrost_context *ctx = batch->ctx; 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); jm_emit_vertex_draw(batch, section); + +#if PAN_ARCH == 4 + pan_section_pack(job, COMPUTE_JOB, COMPUTE_PADDING, cfg) + ; +#endif } #endif /* PAN_ARCH <= 7 */ diff --git a/src/panfrost/lib/genxml/v4.xml b/src/panfrost/lib/genxml/v4.xml index 2c0669f975f..f0d114c784c 100644 --- a/src/panfrost/lib/genxml/v4.xml +++ b/src/panfrost/lib/genxml/v4.xml @@ -979,12 +979,16 @@ + + +
+