zink: rework oom flushing
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 15 May 2021 14:20:43 +0000 (10:20 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Jul 2021 00:22:24 +0000 (00:22 +0000)
commitd8905446d656d51634af5cb243ab14e7833ac598
tree9183032a5e79be5c30da15e8de73edd80d722d14
parent0dc77c8aa537fbea4ebfc2ceb49a4df6843901cd
zink: rework oom flushing

tracking mem usage on the context is bad because if an app is always using
a large amount of memory across multiple batches, it triggers the oom flushes
on every flush and forces fencing

instead, add an explicit flag for oom flushing and another for stalling, then
flag oom flushing and stalling as needed, with set_framebuffer_state being an
additional flush point now since it's guaranteed not to split renderpasses

also proactively prune pending batch states if there's a lot of them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11965>
src/gallium/drivers/zink/zink_batch.c
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_screen.c
src/gallium/drivers/zink/zink_screen.h