panfrost: Allocate shared memory in OpenCL
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 30 Mar 2023 22:09:34 +0000 (18:09 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 13 Apr 2023 01:49:33 +0000 (01:49 +0000)
In OpenCL, we can have no shader-defined shared memory but some dispatch-time
variable memory. This is not reflected in ss->info.wls_size, so check the right
variable instead so we allocate the appropriate memory.

Fixes page faults accessing shared memory with Rusticl, e.g. in the vstore_local
test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 309fef6..4b3c29f 100644 (file)
@@ -1604,7 +1604,7 @@ panfrost_emit_shared_memory(struct panfrost_batch *batch,
       info.tls.ptr = bo->ptr.gpu;
    }
 
-   if (ss->info.wls_size) {
+   if (info.wls.size) {
       unsigned size = pan_wls_adjust_size(info.wls.size) * info.wls.instances *
                       dev->core_id_range;