From a38583e352e4718aaf6f8947bf385407128b137e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 7 Jun 2019 08:58:16 -0700 Subject: [PATCH] panfrost: Always align strides to cache line (64) (Performance tweak.) Signed-off-by: Alyssa Rosenzweig --- 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 23a05ee..9e8f305 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; -- 2.7.4