Mesa (master): broadcom/vc5: Fix regression in the page-cache slice size alignment.

Eric Anholt anholt at kemper.freedesktop.org
Wed Feb 28 22:01:30 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Feb 23 15:35:25 2018 -0800

broadcom/vc5: Fix regression in the page-cache slice size alignment.

We need to align the size of the slice, not the offset of the next slice.
Fixes KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_clamp_to_edge.

Fixes: b4b4ada7616d ("broadcom/vc5: Fix layout of 3D textures.")

---

 src/gallium/drivers/vc5/vc5_resource.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/vc5/vc5_resource.c b/src/gallium/drivers/vc5/vc5_resource.c
index e1645a4fde..86a0a0c139 100644
--- a/src/gallium/drivers/vc5/vc5_resource.c
+++ b/src/gallium/drivers/vc5/vc5_resource.c
@@ -488,8 +488,7 @@ vc5_setup_slices(struct vc5_resource *rsc)
                 slice->padded_height = level_height;
                 slice->size = level_height * slice->stride;
 
-                offset += slice->size * level_depth;
-
+                uint32_t slice_total_size = slice->size * level_depth;
 
                 /* The HW aligns level 1's base to a page if any of level 1 or
                  * below could be UIF XOR.  The lower levels then inherit the
@@ -499,8 +498,12 @@ vc5_setup_slices(struct vc5_resource *rsc)
                 if (i == 1 &&
                     level_width > 4 * uif_block_w &&
                     level_height > PAGE_CACHE_MINUS_1_5_UB_ROWS * uif_block_h) {
-                        offset = align(offset, VC5_UIFCFG_PAGE_SIZE);
+                        slice_total_size = align(slice_total_size,
+                                                 VC5_UIFCFG_PAGE_SIZE);
                 }
+
+                offset += slice_total_size;
+
         }
         rsc->size = offset;
 




More information about the mesa-commit mailing list