When calculating legacy WSI strides for tiled AFBC, we need to account for the
greater alignment requirement of tiled AFBC, or importing resources will fail
later.
Since tiled AFBC is only supported on v7 and later, and AFBC of window surfaces
isn't being used on Linux on v7 and later, this probably hasn't been hit in
practice. Probably.
We're about to fix AFBC of window surfaces so we need to fix this side first.
Fixes:
0255f554f39 ("panfrost: Advertise 16x16 tiled AFBC")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
if (drm_is_afbc(layout->modifier)) {
unsigned width = u_minify(layout->width, level);
- width = ALIGN_POT(width, block_size.width);
+ unsigned alignment = block_size.width *
+ pan_afbc_tile_size(layout->modifier);
+ width = ALIGN_POT(width, alignment);
return width * util_format_get_blocksize(layout->format);
} else {
return row_stride / block_size.height;