From 2953656a39510059321543bd36ca5368d7fc73a3 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 18 Mar 2026 16:06:03 +0100 Subject: [PATCH] pan/lib: divide extent by tile-extend, not itself Dividing this by itself is nonsensical, and just always gives us one. That's obviously not what we want here. But in this case we also know that the extent is divisible by the tile extent, so there's no need for DIV_ROUND_UP, we can just divide. Fixes: e6f8cab6989 ("pan/layout: Split the logic per modifier") Reviewed-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen (cherry picked from commit 5280b8028153580b77b6d6cb2b43abfc8ec500a0) Part-of: --- .pick_status.json | 2 +- src/panfrost/lib/pan_mod.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b5443479ac4..039660cf980 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5864,7 +5864,7 @@ "description": "pan/lib: divide extent by tile-extend, not itself", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e6f8cab69890e1b814bd58ec7cab06ba52aa7bb9", "notes": null diff --git a/src/panfrost/lib/pan_mod.c b/src/panfrost/lib/pan_mod.c index 1a09476bacf..089282f1751 100644 --- a/src/panfrost/lib/pan_mod.c +++ b/src/panfrost/lib/pan_mod.c @@ -407,7 +407,7 @@ pan_mod_afrc_init_slice_layout( uint64_t surf_stride_B = (uint64_t)slayout->tiled_or_linear.row_stride_B * - DIV_ROUND_UP(aligned_extent_px.height, aligned_extent_px.height); + (aligned_extent_px.height / tile_extent_px.height); slayout->tiled_or_linear.surface_stride_B = surf_stride_B; slayout->size_B =