vc4: Handle partial loads/stores of tiled textures.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jan 2017 22:08:10 +0000 (14:08 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 8 Aug 2018 23:45:44 +0000 (16:45 -0700)
commit25bee5ef9ea923bf0d99f5f8eb19082c449f3e53
tree1fa6ac86f339ec7ffce5664ba8f450d1a2fe3a12
parent3e06b918aab3c6a4ca30f5e935aa6996f7009d56
vc4: Handle partial loads/stores of tiled textures.

Previously, we would load out the tile-aligned area, update the raster
copy, and store it back.  This was a huge cost for XPutImage calls to the
screen under glamor.

Instead, implement a general load/store path that walks over the source
x/y writing into the corresponding pixel of the destination (using clever
math from
https://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/).
If things are aligned, we go through the previous utile-at-a-time loop.

Improves x11perf -putimage10 performance by 139.777% +/- 2.83464% (n=5)
Improves x11perf -putimage100 performance by 383.908% +/- 22.6297% (n=11)
Improves x11perf -getimage10 performance by 2.75731% +/- 0.585054% (n=145)
src/gallium/drivers/vc4/vc4_resource.c
src/gallium/drivers/vc4/vc4_tiling.c
src/gallium/drivers/vc4/vc4_tiling_lt.c