panfrost: AFBC buffers must be cache-line aligned
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 15 Jul 2019 22:34:50 +0000 (15:34 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 16 Jul 2019 14:19:28 +0000 (07:19 -0700)
Fixes a DATA_INVALID_FAULT when AFBC is paried with mipmapping.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_resource.c

index e630f1b579a31dbcca60179a9c676e0759ee4c65..7b46acaf58b590c1fe2d215f3111fe2f210aadf1 100644 (file)
@@ -287,6 +287,11 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size)
                         /* We don't need to align depth */
                 }
 
+                /* Align levels to cache-line as a performance improvement for
+                 * linear/tiled and as a requirement for AFBC */
+
+                offset = ALIGN_POT(offset, 64);
+
                 slice->offset = offset;
 
                 /* Compute the would-be stride */