Mesa (master): panfrost: Remove wait parameter to flush_all_batches

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 21 14:25:18 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon Jul 20 11:48:16 2020 -0400

panfrost: Remove wait parameter to flush_all_batches

It is always false now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5995>

---

 src/gallium/drivers/panfrost/pan_compute.c |  2 +-
 src/gallium/drivers/panfrost/pan_context.c |  6 +++---
 src/gallium/drivers/panfrost/pan_job.c     | 32 +-----------------------------
 src/gallium/drivers/panfrost/pan_job.h     |  2 +-
 4 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c
index c0009cad437..c11bab409e5 100644
--- a/src/gallium/drivers/panfrost/pan_compute.c
+++ b/src/gallium/drivers/panfrost/pan_compute.c
@@ -135,7 +135,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
         panfrost_new_job(&batch->pool, &batch->scoreboard,
                         JOB_TYPE_COMPUTE, true, 0, &payload,
                          sizeof(payload), false);
-        panfrost_flush_all_batches(ctx, false);
+        panfrost_flush_all_batches(ctx);
 }
 
 static void
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index fba1d3bae4d..884b803581b 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -258,7 +258,7 @@ panfrost_flush(
         }
 
         /* Submit all pending jobs */
-        panfrost_flush_all_batches(ctx, false);
+        panfrost_flush_all_batches(ctx);
 
         if (fence) {
                 struct panfrost_fence *f = panfrost_fence_create(ctx, &fences);
@@ -279,7 +279,7 @@ static void
 panfrost_texture_barrier(struct pipe_context *pipe, unsigned flags)
 {
         struct panfrost_context *ctx = pan_context(pipe);
-        panfrost_flush_all_batches(ctx, false);
+        panfrost_flush_all_batches(ctx);
 }
 
 #define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_##c;
@@ -1417,7 +1417,7 @@ panfrost_get_query_result(struct pipe_context *pipe,
 
         case PIPE_QUERY_PRIMITIVES_GENERATED:
         case PIPE_QUERY_PRIMITIVES_EMITTED:
-                panfrost_flush_all_batches(ctx, false);
+                panfrost_flush_all_batches(ctx);
                 vresult->u64 = query->end - query->start;
                 break;
 
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 5a89825bb86..9109f8c6fa4 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -1171,28 +1171,12 @@ out:
 }
 
 void
-panfrost_flush_all_batches(struct panfrost_context *ctx, bool wait)
+panfrost_flush_all_batches(struct panfrost_context *ctx)
 {
-        struct util_dynarray fences, syncobjs;
-
-        if (wait) {
-                util_dynarray_init(&fences, NULL);
-                util_dynarray_init(&syncobjs, NULL);
-        }
-
         hash_table_foreach(ctx->batches, hentry) {
                 struct panfrost_batch *batch = hentry->data;
-
                 assert(batch);
 
-                if (wait) {
-                        panfrost_batch_fence_reference(batch->out_sync);
-                        util_dynarray_append(&fences, struct panfrost_batch_fence *,
-                                             batch->out_sync);
-                        util_dynarray_append(&syncobjs, uint32_t,
-                                             batch->out_sync->syncobj);
-                }
-
                 panfrost_batch_submit(batch);
         }
 
@@ -1200,20 +1184,6 @@ panfrost_flush_all_batches(struct panfrost_context *ctx, bool wait)
 
         /* Collect batch fences before returning */
         panfrost_gc_fences(ctx);
-
-        if (!wait)
-                return;
-
-        drmSyncobjWait(pan_device(ctx->base.screen)->fd,
-                       util_dynarray_begin(&syncobjs),
-                       util_dynarray_num_elements(&syncobjs, uint32_t),
-                       INT64_MAX, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL, NULL);
-
-        util_dynarray_foreach(&fences, struct panfrost_batch_fence *, fence)
-                panfrost_batch_fence_unreference(*fence);
-
-        util_dynarray_fini(&fences);
-        util_dynarray_fini(&syncobjs);
 }
 
 bool
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index fc958b1482e..68a1b337d66 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -168,7 +168,7 @@ panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
                          uint32_t create_flags, uint32_t access_flags);
 
 void
-panfrost_flush_all_batches(struct panfrost_context *ctx, bool wait);
+panfrost_flush_all_batches(struct panfrost_context *ctx);
 
 bool
 panfrost_pending_batches_access_bo(struct panfrost_context *ctx,



More information about the mesa-commit mailing list