Mesa (main): panfrost: Stop overallocating compressed textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 16 16:32:29 UTC 2022


Module: Mesa
Branch: main
Commit: f267000240b629c48d4935ff38bbe70fe85435ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f267000240b629c48d4935ff38bbe70fe85435ce

Author: Icecream95 <ixn at disroot.org>
Date:   Fri Apr 15 23:50:33 2022 +1200

panfrost: Stop overallocating compressed textures

The line stride uses the number of bytes in the entire block, so both
the width and height need to be reduced for compressed textures so
that the surface stride is calculated correctly.

Fixes: 051d62cf041 ("panfrost: Add a pan_image_layout_init() helper")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6286
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15989>

---

 src/panfrost/lib/pan_texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c
index 9a9b5a6d7d5..c5a4e1cecbf 100644
--- a/src/panfrost/lib/pan_texture.c
+++ b/src/panfrost/lib/pan_texture.c
@@ -202,7 +202,7 @@ pan_image_layout_init(const struct panfrost_device *dev,
 
                 if (should_align) {
                         effective_width = ALIGN_POT(effective_width, tile_w) >> tile_shift;
-                        effective_height = ALIGN_POT(effective_height, tile_h);
+                        effective_height = ALIGN_POT(effective_height, tile_h) >> tile_shift;
 
                         /* We don't need to align depth */
                 }



More information about the mesa-commit mailing list