From 547c4ff8cbbcedbe021ba4a2188ba072e5d93549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Wed, 25 Mar 2026 14:51:37 +0100 Subject: [PATCH] panfrost: Fix MTK tiled resources mapped as shader images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MTK tiled resources, like AFBC/AFRC resources, must be converted to linear before being used as a shader image in a CS. Signed-off-by: Loïc Molinari Reviewed-by: Ashley Smith Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index c6c66d11330..94303193d55 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -262,9 +262,10 @@ panfrost_set_shader_images(struct pipe_context *pctx, struct panfrost_resource *rsrc = pan_resource(image->resource); - /* Images don't work with AFBC/AFRC, since they require pixel-level - * granularity */ - if (drm_is_afbc(rsrc->modifier) || drm_is_afrc(rsrc->modifier)) { + /* Images don't work with AFBC/AFRC/tiled, since they require + * pixel-level granularity */ + if (drm_is_afbc(rsrc->modifier) || drm_is_afrc(rsrc->modifier) || + drm_is_mtk_tiled(rsrc->modifier)) { pan_resource_modifier_convert( ctx, rsrc, DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED, true, "Shader image");