Module: Mesa
Branch: master
Commit: e7362a9cbd11662781bc01f34720203740077bc2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7362a9cbd11662781bc01f34720203740077bc2

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Nov  2 13:35:33 2020 -0500

zink: move zink_flush_compute() users to zink_flush_queue()

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>

---

 src/gallium/drivers/zink/zink_context.c  | 8 +-------
 src/gallium/drivers/zink/zink_context.h  | 3 ---
 src/gallium/drivers/zink/zink_draw.c     | 2 +-
 src/gallium/drivers/zink/zink_query.c    | 6 +++---
 src/gallium/drivers/zink/zink_resource.c | 4 ++--
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 577180a4a2c..b2ce18b3638 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1364,12 +1364,6 @@ zink_batch_no_rp(struct zink_context *ctx)
    return batch;
 }
 
-void
-zink_flush_compute(struct zink_context *ctx)
-{
-   flush_batch(ctx, ZINK_QUEUE_COMPUTE);
-}
-
 void
 zink_flush_queue(struct zink_context *ctx, enum zink_queue queue)
 {
@@ -1888,7 +1882,7 @@ zink_texture_barrier(struct pipe_context *pctx, unsigned 
flags)
    struct zink_context *ctx = zink_context(pctx);
    if (zink_batch_g(ctx)->has_work)
       pctx->flush(pctx, NULL, 0);
-   zink_flush_compute(ctx);
+   zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
 }
 
 static void
diff --git a/src/gallium/drivers/zink/zink_context.h 
b/src/gallium/drivers/zink/zink_context.h
index 8f296b16612..3a192bd6ff2 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -260,9 +260,6 @@ zink_fence_wait(struct pipe_context *ctx);
 void
 zink_wait_on_batch(struct zink_context *ctx, enum zink_queue queue, uint32_t 
batch_id);
 
-void
-zink_flush_compute(struct zink_context *ctx);
-
 void
 zink_flush_queue(struct zink_context *ctx, enum zink_queue queue);
 
diff --git a/src/gallium/drivers/zink/zink_draw.c 
b/src/gallium/drivers/zink/zink_draw.c
index 189fe5de5b2..a79db5ef25a 100644
--- a/src/gallium/drivers/zink/zink_draw.c
+++ b/src/gallium/drivers/zink/zink_draw.c
@@ -801,7 +801,7 @@ update_descriptors(struct zink_context *ctx, struct 
zink_screen *screen, bool is
       ctx->base.flush(&ctx->base, NULL, PIPE_FLUSH_HINT_FINISH);
    else {
       /* flush compute batch */
-      zink_flush_compute(ctx);
+      zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
    }
 }
 
diff --git a/src/gallium/drivers/zink/zink_query.c 
b/src/gallium/drivers/zink/zink_query.c
index 0b0a93b72df..2ec4c52b70a 100644
--- a/src/gallium/drivers/zink/zink_query.c
+++ b/src/gallium/drivers/zink/zink_query.c
@@ -409,7 +409,7 @@ force_cpu_read(struct zink_context *ctx, struct pipe_query 
*pquery, bool wait, e
    if (zink_batch_usage_matches(&query->batch_id, ZINK_QUEUE_GFX, 
zink_batch_g(ctx)->state->fence.batch_id))
       pctx->flush(pctx, NULL, PIPE_FLUSH_HINT_FINISH);
    else if (is_cs_query(query))
-      zink_flush_compute(ctx);
+      zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
 
    bool success = get_query_result(pctx, pquery, wait, &result);
    if (!success) {
@@ -460,7 +460,7 @@ copy_results_to_buffer(struct zink_context *ctx, struct 
zink_query *query, struc
                              offset, 0, flags);
    /* this is required for compute batch sync and will be removed later */
    if (is_cs_query(query))
-      zink_flush_compute(ctx);
+      zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
    else
       ctx->base.flush(&ctx->base, NULL, PIPE_FLUSH_HINT_FINISH);
 
@@ -617,7 +617,7 @@ zink_get_query_result(struct pipe_context *pctx,
          uint32_t batch_id = 
p_atomic_read(&query->batch_id.usage[ZINK_QUEUE_COMPUTE]);
          zink_wait_on_batch(ctx, ZINK_QUEUE_COMPUTE, batch_id);
       } else {
-         zink_flush_compute(ctx);
+         zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
       }
    } else {
       if (wait) {
diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index caad9a325bc..2005555e713 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -789,7 +789,7 @@ zink_transfer_map(struct pipe_context *pctx,
             /* TODO: can probably just do a full cs copy if it's already in a 
cs batch */
             if (zink_resource_has_usage(res, ZINK_RESOURCE_ACCESS_WRITE, 
ZINK_QUEUE_COMPUTE))
                /* don't actually have to stall here, only ensure batch is 
submitted */
-               zink_flush_compute(ctx);
+               zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
             struct zink_context *ctx = zink_context(pctx);
             zink_transfer_copy_bufimage(ctx, staging_res, res, trans);
             /* need to wait for rendering to finish */
@@ -868,7 +868,7 @@ zink_transfer_flush_region(struct pipe_context *pctx,
          struct zink_resource *staging_res = zink_resource(trans->staging_res);
          if (zink_resource_has_usage(res, ZINK_RESOURCE_ACCESS_WRITE, 
ZINK_QUEUE_COMPUTE))
             /* don't actually have to stall here, only ensure batch is 
submitted */
-            zink_flush_compute(ctx);
+            zink_flush_queue(ctx, ZINK_QUEUE_COMPUTE);
 
          if (ptrans->resource->target == PIPE_BUFFER)
             zink_copy_buffer(ctx, NULL, res, staging_res, box->x, box->x, 
box->width);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to