From d5812cb30d528d1dd17a19c53ba82a44f24dccba 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_cmdstream.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 ade93212d53..71ca7c6b05c 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_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index a728f4a5e68..bec2617f1fa 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -2801,6 +2801,11 @@ panfrost_draw_emit_vertex(struct panfrost_batch *batch, section = pan_section_ptr(job, COMPUTE_JOB, DRAW); panfrost_draw_emit_vertex_section(batch, vs_vary, varyings, attribs, attrib_bufs, section); + +#if PAN_ARCH == 4 + pan_section_pack(job, COMPUTE_JOB, COMPUTE_PADDING, cfg) + ; +#endif } #endif @@ -3822,6 +3827,11 @@ panfrost_launch_grid_on_batch(struct pipe_context *pipe, 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_compiled_shader *cs = ctx->prog[PIPE_SHADER_COMPUTE]; 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 @@ + + +
+