panfrost: Tiled to linear layout conversion
authorIcecream95 <ixn@keemail.me>
Sun, 19 Apr 2020 03:44:17 +0000 (15:44 +1200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Jun 2020 19:15:47 +0000 (19:15 +0000)
commit7ef648c0f309c323b0d3c20dec9c58b2cbf70e58
treea6afda1bf714c57ab6382e276763bd0362231c05
parentfafc305600cb8d54ce18494e2b0d961d694b63c8
panfrost: Tiled to linear layout conversion

Tiling is expensive, so this patch converts textures that appear to be
used for streaming to a linear layout.

Performance of mpv is significantly improved, with software-decoded
1080p mp4 playback on RK3288 going from 30fps to 50fps when testing
with `--untimed --no-audio`.

To keep things simple, conversion only happens when updating the whole
texture and no mipmapping is used.

v2: Make it clear that the heuristic doesn't rely on a texture being
uninitialized, since layout switching code can get confusing (Alyssa).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4628>
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_resource.h