panfrost: Allocate pool BOs against the pool
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 7 Jul 2020 19:11:42 +0000 (15:11 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 9 Jul 2020 14:54:38 +0000 (14:54 +0000)
Instead of against the owning batch, to decouple.

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

src/gallium/drivers/panfrost/pan_allocate.c

index a0ca7eb0e68f81cc0e9b8d3ee65300ca2dbf5120..4785f9a35295a9101e98598fde3c60bc623f861b 100644 (file)
@@ -85,11 +85,14 @@ 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 = panfrost_batch_create_bo(batch, bo_sz, 0,
-                                              PAN_BO_ACCESS_PRIVATE |
-                                              PAN_BO_ACCESS_RW |
-                                              PAN_BO_ACCESS_VERTEX_TILER |
-                                              PAN_BO_ACCESS_FRAGMENT);
+                bo = pan_bo_create(pan_device(batch->ctx->base.screen), bo_sz, 0);
+
+                uintptr_t flags = PAN_BO_ACCESS_PRIVATE |
+                                  PAN_BO_ACCESS_RW |
+                                  PAN_BO_ACCESS_VERTEX_TILER |
+                                  PAN_BO_ACCESS_FRAGMENT;
+
+                _mesa_hash_table_insert(batch->pool.bos, bo, (void *) flags);
 
                 if (sz < TRANSIENT_SLAB_SIZE) {
                         batch->pool.transient_bo = bo;