diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-07 08:58:16 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-10 06:44:56 -0700 |
commit | a38583e352e4718aaf6f8947bf385407128b137e (patch) | |
tree | 6e36491cdf41e6899eb2a13cb4a580d086728fac /src/gallium | |
parent | 0534fcf57d10be36e04a76841b20500134655e94 (diff) |
panfrost: Always align strides to cache line (64)
(Performance tweak.)
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |