Mesa (master): panfrost: Fix tiled NPOT textures with bpp<4

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 15:24:07 UTC 2019


Module: Mesa
Branch: master
Commit: 7b46f09f26c3f4377f46d145344f98d5b27b0b00
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b46f09f26c3f4377f46d145344f98d5b27b0b00

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Jun 20 08:19:06 2019 -0700

panfrost: Fix tiled NPOT textures with bpp<4

Panfrost's tiling routines (incorrectly) ignored the source stride,
masking this bug; lima's routines respect this stride, causing issues
when tiling NPOT textures whose stride is not a multiple of 64
(for instance, NPOT textures with bpp=1).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/pan_resource.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 332208d4e2f..4f4499aa403 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -198,10 +198,10 @@ panfrost_setup_slices(const struct pipe_resource *tmpl, struct panfrost_bo *bo)
 
         /* We don't know how to specify a 2D stride for 3D textures */
 
-        bool should_align_stride =
+        bool can_align_stride =
                 tmpl->target != PIPE_TEXTURE_3D;
 
-        should_align &= should_align_stride;
+        should_align &= can_align_stride;
 
         unsigned offset = 0;
         unsigned size_2d = 0;
@@ -226,7 +226,7 @@ panfrost_setup_slices(const struct pipe_resource *tmpl, struct panfrost_bo *bo)
                 unsigned stride = bytes_per_pixel * effective_width;
 
                 /* ..but cache-line align it for performance */
-                if (should_align_stride)
+                if (can_align_stride && bo->layout == PAN_LINEAR)
                         stride = ALIGN(stride, 64);
 
                 slice->stride = stride;




More information about the mesa-commit mailing list