zink: merge copy-to-scanout path into non-deferred flush path
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 14 Apr 2021 16:47:53 +0000 (12:47 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 20 Apr 2021 14:29:38 +0000 (14:29 +0000)
this eliminates any desync between scanout presentation and clears

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

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239>

src/gallium/drivers/zink/zink_context.c

index 3ed3a40..0c69403 100644 (file)
@@ -1836,12 +1836,10 @@ zink_flush(struct pipe_context *pctx,
    struct zink_fence *fence = NULL;
    struct zink_screen *screen = zink_screen(ctx->base.screen);
 
-   if (!deferred && ctx->clears_enabled) {
-      /* start rp to do all the clears */
-      zink_begin_render_pass(ctx, batch);
-   }
-
-   if (flags & PIPE_FLUSH_END_OF_FRAME) {
+   if (!deferred) {
+      if (ctx->clears_enabled)
+         /* start rp to do all the clears */
+         zink_begin_render_pass(ctx, batch);
       zink_end_render_pass(ctx, batch);
       if (ctx->flush_res) {
          copy_scanout(ctx, ctx->flush_res);