From 2cc317763ccc2f33bbff0920bb0833d09300f60c Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 5 Apr 2024 22:03:38 +0200 Subject: [PATCH] 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 Reviewed-by: Erik Faye-Lund Reviewed-by: Antonino Maniscalco Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 034d77d2bb7..82383949e94 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -646,6 +646,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;