panvk/v10+: Remove unnecessary alloc in dispatch_precomp

The CSF version of dispatch_precomp allocates TLS/WLS prior to calling
cmd_dispatch_prepare_tls, which will do the same.

This commit removes this unnecessary allocation.

Fixes: cc02c5deb4 ("panvk: Implement precomp dispatch")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34979>
(cherry picked from commit a6c7a774ab)
This commit is contained in:
Lars-Ivar Hesselberg Simonsen 2025-05-15 13:39:56 +02:00 committed by Eric Engestrom
parent 84e66ae44a
commit de8423ef2a
2 changed files with 1 additions and 34 deletions

View file

@ -5164,7 +5164,7 @@
"description": "panvk/v10+: Remove unnecessary alloc in dispatch_precomp",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "cc02c5deb42f1f89b227ac3e4816a32a573b6bcf",
"notes": null

View file

@ -46,39 +46,6 @@ panvk_per_arch(dispatch_precomp)(struct panvk_precomp_ctx *ctx,
bifrost_precompiled_kernel_prepare_push_uniforms(push_uniforms.cpu, data,
data_size, &sysvals);
struct pan_tls_info tlsinfo = {.tls = {.size = shader->info.tls_size},
.wls = {.size = shader->info.wls_size}};
if (tlsinfo.tls.size) {
unsigned thread_tls_alloc =
panfrost_query_thread_tls_alloc(&phys_dev->kmod.props);
unsigned core_id_range;
panfrost_query_core_count(&phys_dev->kmod.props, &core_id_range);
unsigned size = panfrost_get_total_stack_size(
tlsinfo.tls.size, thread_tls_alloc, core_id_range);
tlsinfo.tls.ptr = panvk_cmd_alloc_dev_mem(cmdbuf, tls, size, 4096).gpu;
assert(tlsinfo.tls.ptr);
}
if (tlsinfo.wls.size) {
unsigned core_id_range;
panfrost_query_core_count(&phys_dev->kmod.props, &core_id_range);
struct pan_compute_dim wg_count = {.x = grid.count[0],
.y = grid.count[1],
.z = grid.count[2]};
tlsinfo.wls.instances = pan_wls_instances(&wg_count);
unsigned wls_total_size = pan_wls_adjust_size(tlsinfo.wls.size) *
tlsinfo.wls.instances * core_id_range;
tlsinfo.wls.ptr =
panvk_cmd_alloc_dev_mem(cmdbuf, tls, wls_total_size, 4096).gpu;
assert(tlsinfo.wls.ptr);
}
struct pan_compute_dim dim = {.x = grid.count[0],
.y = grid.count[1],
.z = grid.count[2]};