panfrost: Allow swizzled AFBC on v9+
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 14 Dec 2022 01:12:58 +0000 (20:12 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 16 Dec 2022 18:27:47 +0000 (18:27 +0000)
commitf159ff530e1fafe2ca40afe7f3b938607341f568
tree1caa16eeef1cbd72f88695c87a2c309a483658ff
parentcb5e417c01bb9a4509a4583be3fb19723dbe5abc
panfrost: Allow swizzled AFBC on v9+

On v6 and earlier, the hardware supports arbitrary format swizzles for AFBC, so
there's no restriction on AFBC. On v8 and newer, the format swizzle gets applied
to the *decompressed* interchange format, so we can effectively support BGRA of
AFBC images without any special handling. (Confirmed working on v9. Obviously I
can't test on v8 but the expression is cleaner if we assume optimistically it's
like v9. Without hardware, we get to make that assumption :-p)

That just leaves v7 as the only architecture where format swizzles are
restricted for compression but there are no plane descriptor. Don't apply the
restriction to the newer parts.

This gets us AFBC of window surfaces on v9+. As the limiting case, fullscreen
glmark2-es2-wayland -btexture (1080p) in sway on Mali-G57 from 1300fps to
2353fps.

45% reduction in frame time is nothing to sneeze at.

Achoo.

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>
src/panfrost/lib/pan_afbc.c