panfrost: Use row stride to calculate slice size
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 27 Apr 2022 15:37:40 +0000 (11:37 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 May 2022 14:20:15 +0000 (14:20 +0000)
This expresses what's actually happening. Equivalent to the old calculation due
to some cancellation.

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

src/panfrost/lib/pan_layout.c

index 0d9f56c..3241740 100644 (file)
@@ -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) {