Mesa (master): panfrost: Always align strides to cache line (64)
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jun 10 14:06:02 UTC 2019
Module: Mesa
Branch: master
Commit: a38583e352e4718aaf6f8947bf385407128b137e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a38583e352e4718aaf6f8947bf385407128b137e
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Fri Jun 7 08:58:16 2019 -0700
panfrost: Always align strides to cache line (64)
(Performance tweak.)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
src/gallium/drivers/panfrost/pan_resource.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 23a05ee43cc..9e8f305c849 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -210,7 +210,13 @@ panfrost_setup_slices(const struct pipe_resource *tmpl, struct panfrost_bo *bo)
}
slice->offset = offset;
- slice->stride = bytes_per_pixel * effective_width;
+
+ /* Compute the would-be stride */
+ unsigned stride = bytes_per_pixel * effective_width;
+
+ /* ..but cache-line align it for performance */
+ stride = ALIGN(stride, 64);
+ slice->stride = stride;
offset += slice->stride * effective_height;
More information about the mesa-commit
mailing list