diff options
author | Qiang Yu <yuq825@gmail.com> | 2020-01-16 21:11:55 +0800 |
---|---|---|
committer | Qiang Yu <yuq825@gmail.com> | 2020-01-27 22:01:09 +0800 |
commit | 6aebc51d7aeff5a30d86485f320f0c871b5f23a4 (patch) | |
tree | 66067f933e78b142401d6cd985fa225514b37c6e /drivers/gpu/drm/lima/lima_gem.h | |
parent | dc76cb7a1fd195348100c2a87eb1d55d2a7ddd09 (diff) | |
download | lwn-6aebc51d7aeff5a30d86485f320f0c871b5f23a4.tar.gz lwn-6aebc51d7aeff5a30d86485f320f0c871b5f23a4.zip |
drm/lima: support heap buffer creation
heap buffer is used as output of GP and input of PP for
Mali Utgard GPU. Size of heap buffer depends on the task
so is a runtime variable.
Previously we just create a large enough buffer as heap
buffer. Now we add a heap buffer type to be able to
increase the backup memory dynamically when GP fail due
to lack of heap memory.
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Andreas Baierl <ichgeh@imkreisrum.de>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200116131157.13346-4-yuq825@gmail.com
Diffstat (limited to 'drivers/gpu/drm/lima/lima_gem.h')
-rw-r--r-- | drivers/gpu/drm/lima/lima_gem.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/lima/lima_gem.h b/drivers/gpu/drm/lima/lima_gem.h index 1800feb3e47f..ccea06142f4b 100644 --- a/drivers/gpu/drm/lima/lima_gem.h +++ b/drivers/gpu/drm/lima/lima_gem.h @@ -7,12 +7,15 @@ #include <drm/drm_gem_shmem_helper.h> struct lima_submit; +struct lima_vm; struct lima_bo { struct drm_gem_shmem_object base; struct mutex lock; struct list_head va; + + size_t heap_size; }; static inline struct lima_bo * @@ -31,6 +34,7 @@ static inline struct dma_resv *lima_bo_resv(struct lima_bo *bo) return bo->base.base.resv; } +int lima_heap_alloc(struct lima_bo *bo, struct lima_vm *vm); struct drm_gem_object *lima_gem_create_object(struct drm_device *dev, size_t size); int lima_gem_create_handle(struct drm_device *dev, struct drm_file *file, u32 size, u32 flags, u32 *handle); |