Mesa (staging/21.1): zink: directly set batch->state->flush_res from flush_resource hook

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 21 19:46:41 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 9988f53d51d17a39bff2c48952c3d3eb5edc0fe0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9988f53d51d17a39bff2c48952c3d3eb5edc0fe0

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Apr 20 15:07:26 2021 -0400

zink: directly set batch->state->flush_res from flush_resource hook

there's no need to have an intermediate pointer here since that only
complicates keeping scanout synchronized

this also eliminates the pointer on the context since it isn't used anymore

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

Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
(cherry picked from commit be6532ecdfa448919f277c07391d38dcc50a6ab4)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_context.c | 6 +-----
 src/gallium/drivers/zink/zink_context.h | 1 -
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 436a493f146..5c3a3c20f1b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -67,7 +67,7 @@
         "description": "zink: directly set batch->state->flush_res from flush_resource hook",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "104603fa763c52e98a79785dd514beab949546db"
     },
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 403ff69d94a..dc054884a0a 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1704,10 +1704,6 @@ zink_flush(struct pipe_context *pctx,
          /* start rp to do all the clears */
          zink_begin_render_pass(ctx, batch);
       zink_end_render_pass(ctx, batch);
-      if (ctx->flush_res) {
-         batch->state->flush_res = ctx->flush_res;
-         ctx->flush_res = NULL;
-      }
    }
 
    if (!batch->has_work) {
@@ -2053,7 +2049,7 @@ zink_flush_resource(struct pipe_context *pctx,
     * WSI support is added
     */
    if (pres->bind & (PIPE_BIND_SHARED | PIPE_BIND_SCANOUT))
-      ctx->flush_res = zink_resource(pres);
+      ctx->batch.state->flush_res = zink_resource(pres);
 }
 
 void
diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h
index b79467c0b30..e4de6448e32 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -181,7 +181,6 @@ struct zink_context {
 
    struct primconvert_context *primconvert;
 
-   struct zink_resource *flush_res;
    struct zink_framebuffer *framebuffer;
    struct zink_framebuffer_clear fb_clears[PIPE_MAX_COLOR_BUFS + 1];
    uint16_t clears_enabled;



More information about the mesa-commit mailing list