Commit 34e0954f authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

panfrost: Track the device through the pool


Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!5794>
parent 6ef7c057
......@@ -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 |
......
......@@ -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 */
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment