iris: reduce redundant tile cache flushes
authorFelix DeGrood <felix.j.degrood@intel.com>
Tue, 30 Mar 2021 00:11:42 +0000 (17:11 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 15 Apr 2021 04:54:40 +0000 (04:54 +0000)
commitc85ea824bcab971dc2d9052b5dc937ee4b139cf5
treecf3fd1ff0b2945102fb70dd5d8c480b1cf86fc99
parentbfe2c5f667b594108d151e754da6289086495538
iris: reduce redundant tile cache flushes

We are flushing tile cache more often than is necessary. In
unified cache mode, tile cache flushing is expensive, evicting all
depth/pixel data from the L3$. This is only need for a handful of
cases, such as: making cpu or gpu changes globally visible
(e.g. map), fast color clears, or slow depth clears. Tile cache
flushing is a gen12+ feature.

Remove blanket flushing of tile cache on all depth/RT flushes.
Replace with selective tile cache flushing.

Improves performance in several workloads:
AztecRuins.ogl-high-offscreen-1440p 1%
UnigineValley.ogl-g2                1%
Dota 2 (replay Jul 2020).ogl-g2     1%
Counter-Strike GO.ogl-g2            1%
Manhattan.ogl-Off-19x10             2%
CarChase.ogl-Off-19x10              1%
Bioshock Infinite.ogl-g2            1%

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
src/gallium/drivers/iris/iris_clear.c
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_fine_fence.c
src/gallium/drivers/iris/iris_pipe_control.c
src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/iris/iris_state.c