Mesa (master): panfrost: Hoist add_fbo_bo call

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 19 08:55:51 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Aug 14 18:31:05 2020 -0400

panfrost: Hoist add_fbo_bo call

Move it to batch initialization, to take it out of the clear/draw path.
This should make sense - as soon as the batch is created, we need to
hold the refference. Functionally there shouldn't be unused batches
floating around anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6327>

---

 src/gallium/drivers/panfrost/pan_context.c | 7 +------
 src/gallium/drivers/panfrost/pan_job.c     | 8 +++++++-
 src/gallium/drivers/panfrost/pan_job.h     | 2 --
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 84843ac8786..f3f1aa55362 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -139,8 +139,6 @@ panfrost_clear(
          * fragment jobs.
          */
         struct panfrost_batch *batch = panfrost_get_fresh_batch_for_fbo(ctx);
-
-        panfrost_batch_add_fbo_bos(batch);
         panfrost_batch_clear(batch, buffers, color, depth, stencil);
 }
 
@@ -309,12 +307,9 @@ panfrost_draw_vbo(
                 return;
         }
 
-        /* Now that we have a guaranteed terminating path, find the job.
-         * Assignment commented out to prevent unused warning */
+        /* Now that we have a guaranteed terminating path, find the job. */
 
         struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
-
-        panfrost_batch_add_fbo_bos(batch);
         panfrost_batch_set_requirements(batch);
 
         /* Take into account a negative bias */
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 33b8bce4df8..b0665da6b6e 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -92,6 +92,9 @@ panfrost_batch_fence_reference(struct panfrost_batch_fence *fence)
         pipe_reference(NULL, &fence->reference);
 }
 
+static void
+panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
+
 static struct panfrost_batch *
 panfrost_create_batch(struct panfrost_context *ctx,
                       const struct pipe_framebuffer_state *key)
@@ -111,6 +114,8 @@ panfrost_create_batch(struct panfrost_context *ctx,
 
         batch->pool = panfrost_create_pool(batch, pan_device(ctx->base.screen));
 
+        panfrost_batch_add_fbo_bos(batch);
+
         return batch;
 }
 
@@ -559,7 +564,8 @@ panfrost_batch_add_resource_bos(struct panfrost_batch *batch,
                 panfrost_batch_add_bo(batch, rsrc->separate_stencil->bo, flags);
 }
 
-void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
+static void
+panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
 {
         uint32_t flags = PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_WRITE |
                          PAN_BO_ACCESS_VERTEX_TILER |
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 68e1f40b99e..e94dd76ad0c 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -147,8 +147,6 @@ void
 panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo,
                       uint32_t flags);
 
-void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
-
 struct panfrost_bo *
 panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
                          uint32_t create_flags, uint32_t access_flags);



More information about the mesa-commit mailing list