asahi: Align linear texture's strides to 64 bytes

Required to pack the stride, and should improve cache performance.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
This commit is contained in:
Alyssa Rosenzweig 2022-02-06 10:06:00 -05:00 committed by Marge Bot
parent 5d957011ff
commit 2c490cd4e3
1 changed files with 5 additions and 2 deletions

View File

@ -178,8 +178,11 @@ agx_resource_create(struct pipe_screen *screen,
height = ALIGN_POT(height, tile);
}
nresource->slices[l].line_stride =
util_format_get_stride(templ->format, width);
/* Align stride to presumed cache line */
nresource->slices[l].line_stride = util_format_get_stride(templ->format, width);
if (nresource->modifier == DRM_FORMAT_MOD_LINEAR) {
nresource->slices[l].line_stride = ALIGN_POT(nresource->slices[l].line_stride, 64);
}
nresource->slices[l].offset = offset;
offset += ALIGN_POT(nresource->slices[l].line_stride * height, 0x80);