panfrost: Ensure nonlinear strides are 16-aligned
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 27 May 2020 14:58:17 +0000 (10:58 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 27 May 2020 20:49:43 +0000 (16:49 -0400)
To match how they are encoded.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: bde19c0e7ba ("panfrost: Fix tiled texture "stride"s on Bifrost")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>

src/panfrost/encoder/pan_texture.c

index fd9e1ea9e3a405f6fe0b89bc11f2814f79074543..22ff30828cadb04bbf98be9293c8e41d4d5f8769 100644 (file)
@@ -178,7 +178,7 @@ panfrost_nonlinear_stride(enum mali_texture_layout layout,
                 unsigned width)
 {
         if (layout == MALI_TEXTURE_TILED) {
-                return (width < 16) ? 0 : (16 * bytes_per_pixel * width);
+                return (width < 16) ? 0 : (16 * bytes_per_pixel * ALIGN_POT(width, 16));
         } else {
                 unreachable("TODO: AFBC on Bifrost");
         }