Mesa (main): panfrost: Use row stride to calculate slice size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 3 14:38:09 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Apr 27 11:37:40 2022 -0400

panfrost: Use row stride to calculate slice size

This expresses what's actually happening. Equivalent to the old calculation due
to some cancellation.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>

---

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

diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c
index 0d9f56c590f..32417404bfd 100644
--- a/src/panfrost/lib/pan_layout.c
+++ b/src/panfrost/lib/pan_layout.c
@@ -261,7 +261,7 @@ pan_image_layout_init(struct pan_image_layout *layout,
                 slice->line_stride = row_stride / block_size.height;
                 slice->row_stride = row_stride;
 
-                unsigned slice_one_size = slice->line_stride * effective_height;
+                unsigned slice_one_size = row_stride * (effective_height / block_size.height);
 
                 /* Compute AFBC sizes if necessary */
                 if (afbc) {



More information about the mesa-commit mailing list