summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-04-02 11:15:37 -0400
committerMarge Bot <eric+marge@anholt.net>2021-04-05 22:45:52 +0000
commit1ba6dcb40f84288f8698c031e169c47f111c8eb2 (patch)
tree62dfe407ad5c7b1f411d2a5bfb3a377dfc4617fb
parente4426d78285aac961e0f21e9992dd2ba5b2f62cd (diff)
zink: relax maybe_flush mem threshold
10% of video mem ends up being way too aggressive and causes constant stalls really this is supposed to be a failsafe against ooming in a single batch, so using 50% here ends up serving that purpose much more effectively Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10006>
-rw-r--r--src/gallium/drivers/zink/zink_context.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index d43635dfced..d16ededc947 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1983,11 +1983,11 @@ void
zink_maybe_flush_or_stall(struct zink_context *ctx)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
- /* flush anytime our total batch memory usage is potentially >= 1/10 of total system memory */
- if (ctx->batch.state->resource_size >= screen->total_video_mem / 10)
+ /* flush anytime our total batch memory usage is potentially >= 50% of total video memory */
+ if (ctx->batch.state->resource_size >= screen->total_video_mem / 2)
flush_batch(ctx, true);
- if (ctx->resource_size >= screen->total_video_mem / 10 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) {
+ if (ctx->resource_size >= screen->total_video_mem / 2 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) {
sync_flush(ctx, zink_batch_state(ctx->last_fence));
zink_vkfence_wait(screen, ctx->last_fence, PIPE_TIMEOUT_INFINITE);
zink_batch_reset_all(ctx);