zink: split total_mem off to total_video_mem, use total_mem for tc

tc needs the total host memory available, not the total video memory

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10006>
This commit is contained in:
Mike Blumenkrantz 2021-04-02 11:08:46 -04:00 committed by Marge Bot
parent c624489968
commit e4426d7828
3 changed files with 6 additions and 3 deletions

View file

@ -1984,10 +1984,10 @@ 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_mem / 10)
if (ctx->batch.state->resource_size >= screen->total_video_mem / 10)
flush_batch(ctx, true);
if (ctx->resource_size >= screen->total_mem / 10 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) {
if (ctx->resource_size >= screen->total_video_mem / 10 || _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);

View file

@ -1494,7 +1494,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
screen->driconf.dual_color_blend_by_location = driQueryOptionb(config->options, "dual_color_blend_by_location");
#endif
screen->total_mem = get_video_mem(screen);
screen->total_video_mem = get_video_mem(screen);
if (!os_get_total_physical_memory(&screen->total_mem))
goto fail;
simple_mtx_init(&screen->surface_mtx, mtx_plain);
simple_mtx_init(&screen->bufferview_mtx, mtx_plain);

View file

@ -76,6 +76,7 @@ struct zink_screen {
unsigned shader_id;
uint64_t total_video_mem;
uint64_t total_mem;
VkInstance instance;