panvk/csf: Fix TLS pointer copy

The source/destination was inverted. While at it, make this copy
conditional on tlsinfo.tls.size > 0.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31248>
This commit is contained in:
Boris Brezillon
2024-09-18 19:12:19 +02:00
committed by Marge Bot
parent 28e4d22497
commit ae9df204e9

View File

@@ -160,12 +160,14 @@ panvk_per_arch(CmdDispatchBase)(VkCommandBuffer commandBuffer,
unsigned task_increment = 0;
/* Copy the global TLS pointer to the per-job TSD. */
cs_move64_to(b, cs_scratch_reg64(b, 0), tsd.gpu);
cs_load64_to(b, cs_scratch_reg64(b, 2), cs_scratch_reg64(b, 0), 8);
cs_wait_slot(b, SB_ID(LS), false);
cs_move64_to(b, cs_scratch_reg64(b, 0), cmdbuf->state.tls.desc.gpu);
cs_store64(b, cs_scratch_reg64(b, 2), cs_scratch_reg64(b, 0), 8);
cs_wait_slot(b, SB_ID(LS), false);
if (tlsinfo.tls.size) {
cs_move64_to(b, cs_scratch_reg64(b, 0), cmdbuf->state.tls.desc.gpu);
cs_load64_to(b, cs_scratch_reg64(b, 2), cs_scratch_reg64(b, 0), 8);
cs_wait_slot(b, SB_ID(LS), false);
cs_move64_to(b, cs_scratch_reg64(b, 0), tsd.gpu);
cs_store64(b, cs_scratch_reg64(b, 2), cs_scratch_reg64(b, 0), 8);
cs_wait_slot(b, SB_ID(LS), false);
}
cs_update_compute_ctx(b) {
cs_move64_to(b, cs_sr_reg64(b, 0), cs_desc_state->res_table);