From 0a581e7408a91eec1be7764b945e74668d84f9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Fri, 11 Jul 2025 15:32:13 +0200 Subject: [PATCH] panfrost: Fix modifier conversion shaders search key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The key used to look-up a shader in the modifier conversion shader hash table is incorrect. It currently uses the address of the key argument variable while it should use the address already passed into the key argument. The stack address being different at each call, the search for a previously created shader always fails and a new one is created at each call. This commit fixes that leak. Fixes: ae3fb3089f5 ("panfrost: Add infrastructure for internal AFBC compute shaders") Signed-off-by: Loïc Molinari Acked-by: Mary Guillemard Part-of: --- src/gallium/drivers/panfrost/pan_mod_conv_cso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_mod_conv_cso.c b/src/gallium/drivers/panfrost/pan_mod_conv_cso.c index fc898425692..e996ccaec66 100644 --- a/src/gallium/drivers/panfrost/pan_mod_conv_cso.c +++ b/src/gallium/drivers/panfrost/pan_mod_conv_cso.c @@ -417,7 +417,7 @@ get_mod_convert_shaders(struct panfrost_context *ctx, pthread_mutex_lock(&ctx->mod_convert_shaders.lock); struct hash_entry *he = - _mesa_hash_table_search(ctx->mod_convert_shaders.shaders, &key); + _mesa_hash_table_search(ctx->mod_convert_shaders.shaders, key); struct pan_mod_convert_shader_data *shader = he ? he->data : NULL; pthread_mutex_unlock(&ctx->mod_convert_shaders.lock);