From 34e0954f1d2566f978ce7403b554dea3fcd4df45 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 7 Jul 2020 15:15:04 -0400 Subject: [PATCH] panfrost: Track the device through the pool Signed-off-by: Alyssa Rosenzweig Part-of: --- 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; } -- 2.30.2