From 69b8372fbf98da6e81ba6b22a13e160ea6784928 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 16 Apr 2026 15:47:33 +0200 Subject: [PATCH] pan/lib: fix up afbc and linear layout A few cases of UINT32_MAX were missed, whoops. Fixes: c2c91e78fdc ("pan/layout: Allow bigger size/surface stride on v12+") Reviewed-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/lib/pan_mod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panfrost/lib/pan_mod.c b/src/panfrost/lib/pan_mod.c index 9004773a3b6..ede832d56ec 100644 --- a/src/panfrost/lib/pan_mod.c +++ b/src/panfrost/lib/pan_mod.c @@ -179,8 +179,8 @@ pan_mod_afbc_init_slice_layout( slayout->afbc.surface_stride_B = surf_stride_B; slayout->size_B = surf_stride_B * mip_extent_px.depth; - if (hdr_surf_size_B > UINT32_MAX || surf_stride_B > UINT32_MAX || - slayout->size_B > UINT32_MAX) + if (hdr_surf_size_B > UINT32_MAX || surf_stride_B > MAX_SLICE_STRIDE_B || + slayout->size_B > MAX_SIZE_B) return false; return true; @@ -804,7 +804,7 @@ pan_mod_linear_init_slice_layout( /* Surface stride is passed as a 32-bit unsigned integer to RT/ZS and texture * descriptors, make sure it fits. */ - if (surf_stride_B > UINT32_MAX) + if (surf_stride_B > MAX_SLICE_STRIDE_B) return false; slayout->tiled_or_linear.surface_stride_B = surf_stride_B;