From 41b9381046a2e12d9c7a849eef0827805643ff1c 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: (cherry picked from commit 5b1b76e9cdd8b44538aa327c7705381fa68b891b) --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_jm.c | 10 ++++++++++ src/panfrost/lib/genxml/v4.xml | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index ebc5e487953..f525862aa49 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2634,7 +2634,7 @@ "description": "panfrost: Pad compute jobs with zeros on v4", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b76420be1f1f3a0ceb7808131b9c8aa8e970a415", "notes": null diff --git a/src/gallium/drivers/panfrost/pan_jm.c b/src/gallium/drivers/panfrost/pan_jm.c index 30737f7d157..58110588879 100644 --- a/src/gallium/drivers/panfrost/pan_jm.c +++ b/src/gallium/drivers/panfrost/pan_jm.c @@ -300,6 +300,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]; @@ -449,6 +454,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 63b7f7f57ac..a804cd2acfc 100644 --- a/src/panfrost/lib/genxml/v4.xml +++ b/src/panfrost/lib/genxml/v4.xml @@ -992,12 +992,16 @@ + + +
+