Mesa (main): panfrost: Add a pool to sampler_view

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 18:02:37 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu Apr  7 10:26:24 2022 -0400

panfrost: Add a pool to sampler_view

So we can allocate temporary sampler views for writeable images on Valhall.

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

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 20b3dcb75ea..f4f9055466f 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -87,6 +87,12 @@ struct panfrost_sampler_view {
         struct mali_texture_packed bifrost_descriptor;
         mali_ptr texture_bo;
         uint64_t modifier;
+
+        /* Pool used to allocate the descriptor. If NULL, defaults to the global
+         * descriptor pool. Can be set for short lived descriptors, useful for
+         * shader images on Valhall.
+         */
+        struct panfrost_pool *pool;
 };
 
 /* Statically assert that PIPE_* enums match the hardware enums.
@@ -1345,7 +1351,8 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                 (PAN_ARCH <= 5 ? pan_size(TEXTURE) : 0) +
                 GENX(panfrost_estimate_texture_payload_size)(&iview);
 
-        struct panfrost_ptr payload = pan_pool_alloc_aligned(&ctx->descs.base, size, 64);
+        struct panfrost_pool *pool = so->pool ?: &ctx->descs;
+        struct panfrost_ptr payload = pan_pool_alloc_aligned(&pool->base, size, 64);
         so->state = panfrost_pool_take_ref(&ctx->descs, payload.gpu);
 
         void *tex = (PAN_ARCH >= 6) ? &so->bifrost_descriptor : payload.cpu;



More information about the mesa-commit mailing list