From: Alyssa Rosenzweig Date: Fri, 7 Jun 2019 15:58:16 +0000 (-0700) Subject: panfrost: Always align strides to cache line (64) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a38583e352e4718aaf6f8947bf385407128b137e;p=mesa.git panfrost: Always align strides to cache line (64) (Performance tweak.) Signed-off-by: Alyssa Rosenzweig --- 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;