panvk/csf: Fix missing TSD pointer initialization on RUN_IDVS

The global thread storage descriptor can be allocated in the dispatch
path, which means the test on tsd != NULL might be true when the first
RUN_IDVS() happens, and we never set r24 to the TSD address.

Fix that by keeping a tsd field in panvk_cmd_graphics_state that's only
set in the draw path.

Reported-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Tested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Alexandre ARNOUD <aarnoud@me.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31147>
This commit is contained in:
Boris Brezillon
2024-09-12 13:42:32 +02:00
committed by Marge Bot
parent d8645aa03a
commit a5c660d78a
2 changed files with 9 additions and 4 deletions
@@ -399,6 +399,7 @@ struct panvk_cmd_graphics_state {
} render;
mali_ptr push_uniforms;
mali_ptr tsd;
};
struct panvk_cmd_buffer {
+8 -4
View File
@@ -446,10 +446,14 @@ update_tls(struct panvk_cmd_buffer *cmdbuf)
struct cs_builder *b =
panvk_get_cs_builder(cmdbuf, PANVK_SUBQUEUE_VERTEX_TILER);
if (!state->desc.gpu) {
state->desc = panvk_cmd_alloc_desc(cmdbuf, LOCAL_STORAGE);
if (!state->desc.gpu)
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
if (!cmdbuf->state.gfx.tsd) {
if (!state->desc.gpu) {
state->desc = panvk_cmd_alloc_desc(cmdbuf, LOCAL_STORAGE);
if (!state->desc.gpu)
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
cmdbuf->state.gfx.tsd = state->desc.gpu;
cs_update_vt_ctx(b)
cs_move64_to(b, cs_sr_reg64(b, 24), state->desc.gpu);