From 7258b4b48d319e7ec16adc577054dc10eaec209d Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Tue, 29 Dec 2020 23:10:41 +1300 Subject: [PATCH] panfrost: Set TLS for compute jobs Fixes CL programs using scratch storage, such as the Piglit test i32-stack-array.cl. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index a0e2ab91918..7707696dbbb 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1048,6 +1048,19 @@ panfrost_emit_shared_memory(struct panfrost_batch *batch, ls.wls_base_pointer = bo->ptr.gpu; ls.wls_instances = instances; ls.wls_size_scale = util_logbase2(single_size) + 1; + + if (ss->stack_size) { + unsigned shift = + panfrost_get_stack_shift(ss->stack_size); + struct panfrost_bo *bo = + panfrost_batch_get_scratchpad(batch, + ss->stack_size, + dev->thread_tls_alloc, + dev->core_count); + + ls.tls_size = shift; + ls.tls_base_pointer = bo->ptr.gpu; + } }; return t.gpu;