diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-02-06 14:29:42 -0500 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-02-16 09:16:46 -0500 |
commit | 9603126b74d03bc6974ea116ce4f7d80fb9573aa (patch) | |
tree | d4edbdae46ebd8b67094a4f4cc2a096ed05c3c40 /src/gallium/drivers/panfrost/pan_job.c | |
parent | 50138abb5a0328b530723dfef5e9a8ac9dea2692 (diff) |
panfrost: Allocate RAM backing of shared memory
Unlike other GPUs, Mali does not have dedicated shared memory for
compute workloads. Instead, we allocate shared memory (backed to RAM),
and the general memory access functions have modes to access shared
memory (essentially, think of these modes as adding this allocates base
+ workgroupid * stride in harder). So let's allocate enough memory
based on the shared_size parameter and supply it.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_job.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 8f3acd24e1b..fb9812d29fd 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -671,6 +671,24 @@ panfrost_batch_get_scratchpad(struct panfrost_batch *batch, } struct panfrost_bo * +panfrost_batch_get_shared_memory(struct panfrost_batch *batch, + unsigned size, + unsigned workgroup_count) +{ + if (batch->shared_memory) { + assert(batch->shared_memory->size >= size); + } else { + batch->shared_memory = panfrost_batch_create_bo(batch, size, + PAN_BO_INVISIBLE, + PAN_BO_ACCESS_PRIVATE | + PAN_BO_ACCESS_RW | + PAN_BO_ACCESS_VERTEX_TILER); + } + + return batch->shared_memory; +} + +struct panfrost_bo * panfrost_batch_get_tiler_heap(struct panfrost_batch *batch) { if (batch->tiler_heap) |