Mesa (main): panfrost: Inline add_fbo_bos

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 19:22:31 UTC 2021


Module: Mesa
Branch: main
Commit: 3622562e44979160689bb45acd3aeba680ab29e8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3622562e44979160689bb45acd3aeba680ab29e8

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Aug 16 23:55:50 2021 +0000

panfrost: Inline add_fbo_bos

Only used once, it's just complicating the batch cache interface.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12525>

---

 src/gallium/drivers/panfrost/pan_job.c | 36 ++++++++++++++--------------------
 src/gallium/drivers/panfrost/pan_job.h |  3 ---
 2 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index a935d4f61aa..6265cd175bf 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -46,6 +46,17 @@ panfrost_batch_idx(struct panfrost_batch *batch)
         return batch - batch->ctx->batches.slots;
 }
 
+/* Adds the BO backing surface to a batch if the surface is non-null */
+
+static void
+panfrost_batch_add_surface(struct panfrost_batch *batch, struct pipe_surface *surf)
+{
+        if (surf) {
+                struct panfrost_resource *rsrc = pan_resource(surf->texture);
+                panfrost_batch_write_rsrc(batch, rsrc, PIPE_SHADER_FRAGMENT);
+        }
+}
+
 static void
 panfrost_batch_init(struct panfrost_context *ctx,
                     const struct pipe_framebuffer_state *key,
@@ -79,7 +90,10 @@ panfrost_batch_init(struct panfrost_context *ctx,
         panfrost_pool_init(&batch->invisible_pool, NULL, dev,
                         PAN_BO_INVISIBLE, 65536, "Varyings", false, true);
 
-        panfrost_batch_add_fbo_bos(batch);
+        for (unsigned i = 0; i < batch->key.nr_cbufs; ++i)
+                panfrost_batch_add_surface(batch, batch->key.cbufs[i]);
+
+        panfrost_batch_add_surface(batch, batch->key.zsbuf);
 
         screen->vtbl.init_batch(batch);
 }
@@ -320,26 +334,6 @@ panfrost_batch_write_rsrc(struct panfrost_batch *batch,
         panfrost_batch_update_access(batch, rsrc, true);
 }
 
-/* Adds the BO backing surface to a batch if the surface is non-null */
-
-static void
-panfrost_batch_add_surface(struct panfrost_batch *batch, struct pipe_surface *surf)
-{
-        if (surf) {
-                struct panfrost_resource *rsrc = pan_resource(surf->texture);
-                panfrost_batch_write_rsrc(batch, rsrc, PIPE_SHADER_FRAGMENT);
-        }
-}
-
-void
-panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
-{
-        for (unsigned i = 0; i < batch->key.nr_cbufs; ++i)
-                panfrost_batch_add_surface(batch, batch->key.cbufs[i]);
-
-        panfrost_batch_add_surface(batch, batch->key.zsbuf);
-}
-
 struct panfrost_bo *
 panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
                          uint32_t create_flags, enum pipe_shader_type stage,
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 5881869c606..a4eaf92fece 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -157,9 +157,6 @@ panfrost_batch_write_rsrc(struct panfrost_batch *batch,
                           struct panfrost_resource *rsrc,
                           enum pipe_shader_type stage);
 
-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