summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2024-04-05 22:03:38 +0200
committerEric Engestrom <eric@engestrom.ch>2024-05-07 18:11:38 +0200
commit2c3d8d76aa01fd210e129e7d6e7bd70a43ffcef1 (patch)
treecff02f06f680c03180ac63bc46cba704146af703
parentc849ee432d8007274dd187d11c029ffdac50ce75 (diff)
panfrost: Add the BO containing fragment program descriptor to the batch
On pre-Valhall HW, the fragment shader metadata was part of the RSD (renderer state descriptor), which was emitted at draw time, but Valhall introduces a shader program descriptor containing only the shader information, and this one is emitted at shader preparation time. If we don't add the FS state BO to batch, we might end up with a batch being executed after the shader object has been destroyed, leading to page faults when the GPU tries to access the shader program descriptor. We make the panfrost_batch_add_bo() unconditional since it gracefully handles the NULL case (which will happen on v7-). Fixes: 087b63cb0771 ("panfrost: Allow uploading fragment SPDs") Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28926> (cherry picked from commit 2cc317763ccc2f33bbff0920bb0833d09300f60c)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 3e4bedf18ac..0230b1b5b8f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -74,7 +74,7 @@
"description": "panfrost: Add the BO containing fragment program descriptor to the batch",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "087b63cb07717e83ea606648f2551fc9586b9165",
"notes": null
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 2b3ce2275b4..3565588f113 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -622,6 +622,7 @@ panfrost_emit_frag_shader_meta(struct panfrost_batch *batch)
struct panfrost_compiled_shader *ss = ctx->prog[PIPE_SHADER_FRAGMENT];
panfrost_batch_add_bo(batch, ss->bin.bo, PIPE_SHADER_FRAGMENT);
+ panfrost_batch_add_bo(batch, ss->state.bo, PIPE_SHADER_FRAGMENT);
struct panfrost_ptr xfer;