Mesa (master): panfrost: Track the device through the pool

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 9 15:06:17 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Jul  7 15:15:04 2020 -0400

panfrost: Track the device through the pool

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

---

 src/gallium/drivers/panfrost/pan_allocate.c | 5 +++--
 src/gallium/drivers/panfrost/pan_allocate.h | 5 ++++-
 src/gallium/drivers/panfrost/pan_job.c      | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_allocate.c b/src/gallium/drivers/panfrost/pan_allocate.c
index 4785f9a3529..d9cbd0c3fb1 100644
--- a/src/gallium/drivers/panfrost/pan_allocate.c
+++ b/src/gallium/drivers/panfrost/pan_allocate.c
@@ -40,9 +40,10 @@
  * into the pool and copy there */
 
 struct pan_pool
-panfrost_create_pool(void *memctx)
+panfrost_create_pool(void *memctx, struct panfrost_device *dev)
 {
         struct pan_pool pool = {
+                .dev = dev,
                 .transient_offset = 0,
                 .transient_bo = NULL
         };
@@ -85,7 +86,7 @@ panfrost_allocate_transient(struct panfrost_batch *batch, size_t sz)
                  * flags to this function and keep the read/write,
                  * fragment/vertex+tiler pools separate.
                  */
-                bo = pan_bo_create(pan_device(batch->ctx->base.screen), bo_sz, 0);
+                bo = pan_bo_create(batch->pool.dev, bo_sz, 0);
 
                 uintptr_t flags = PAN_BO_ACCESS_PRIVATE |
                                   PAN_BO_ACCESS_RW |
diff --git a/src/gallium/drivers/panfrost/pan_allocate.h b/src/gallium/drivers/panfrost/pan_allocate.h
index 2eff640045c..1f30ee143b6 100644
--- a/src/gallium/drivers/panfrost/pan_allocate.h
+++ b/src/gallium/drivers/panfrost/pan_allocate.h
@@ -41,6 +41,9 @@ struct panfrost_batch;
  * command pool */
 
 struct pan_pool {
+        /* Parent device for allocation */
+        struct panfrost_device *dev;
+
         /* panfrost_bo -> access_flags owned by the pool */
         struct hash_table *bos;
 
@@ -52,7 +55,7 @@ struct pan_pool {
 };
 
 struct pan_pool
-panfrost_create_pool(void *memctx);
+panfrost_create_pool(void *memctx, struct panfrost_device *dev);
 
 /* Represents a fat pointer for GPU-mapped memory, returned from the transient
  * allocator and not used for much else */
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index f5cfc6a1ec8..0945a9cef67 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -117,7 +117,7 @@ panfrost_create_batch(struct panfrost_context *ctx,
         batch->out_sync = panfrost_create_batch_fence(batch);
         util_copy_framebuffer_state(&batch->key, key);
 
-        batch->pool = panfrost_create_pool(batch);
+        batch->pool = panfrost_create_pool(batch, pan_device(ctx->base.screen));
 
         return batch;
 }



More information about the mesa-commit mailing list