zink: move wsi flush info conditional to queue submission

having a resource pointer on batch states is now a requirement for
keeping scanout objects in sync

Fixes: 104603fa76 ("zink: create separate linear tiling image for scanout")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
This commit is contained in:
Mike Blumenkrantz 2021-04-20 15:05:37 -04:00 committed by Marge Bot
parent 4dcd477d12
commit 7af40bb595
2 changed files with 2 additions and 3 deletions

View File

@ -337,7 +337,7 @@ submit_queue(void *data, int thread_index)
.pNext = si.pNext,
};
if (bs->flush_res) {
if (bs->flush_res && zink_screen(bs->ctx->base.screen)->needs_mesa_flush_wsi) {
mem_signal.memory = bs->flush_res->scanout_obj ? bs->flush_res->scanout_obj->mem : bs->flush_res->obj->mem;
si.pNext = &mem_signal;
}

View File

@ -1723,8 +1723,7 @@ zink_flush(struct pipe_context *pctx,
zink_begin_render_pass(ctx, batch);
zink_end_render_pass(ctx, batch);
if (ctx->flush_res) {
if (zink_screen(pctx->screen)->needs_mesa_flush_wsi)
batch->state->flush_res = ctx->flush_res;
batch->state->flush_res = ctx->flush_res;
ctx->flush_res = NULL;
}
}