freedreno/a6xx: LRZ rework and early-lrz-late-z mode
Updates the *_DEPTH_PLANE_CNTL
regs with a new depth-test mode I discovered, and enables it by:
- rework LRZ to track direction once we start doing LRZ writes, and invalidate one direction switch
- don't invalidate lrz simply due to blend/alpha-test/stencil-test, we only need to disable writes. Invalidating in these cases was just papering over bugs due to not invalidating on direction switch
- use new
DEPTH_PLANE_CNTL
mode to preserve early-lrz test when FS has kill. This is the part that is worth most of the perf win in gfxbench, and matches what blob does. But setting this mode when we don't have lrz causes GPU hangs, so these two registers move into the lrz stategroup.
Overall seem to be worth more than +10% for mh/trex and +40% for mh31.
Edited by Rob Clark