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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8358>
This commit is contained in:
Icecream95 2020-12-29 23:10:41 +13:00 committed by Marge Bot
parent 3f7e7495fc
commit 7258b4b48d

View file

@ -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;