diff options
author | Qiang Yu <yuq825@gmail.com> | 2020-01-16 16:11:55 +0300 |
---|---|---|
committer | Qiang Yu <yuq825@gmail.com> | 2020-01-27 17:01:09 +0300 |
commit | 6aebc51d7aeff5a30d86485f320f0c871b5f23a4 (patch) | |
tree | 66067f933e78b142401d6cd985fa225514b37c6e /drivers/gpu/drm/lima/lima_vm.c | |
parent | dc76cb7a1fd195348100c2a87eb1d55d2a7ddd09 (diff) | |
download | linux-6aebc51d7aeff5a30d86485f320f0c871b5f23a4.tar.xz |
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_vm.c')
-rw-r--r-- | drivers/gpu/drm/lima/lima_vm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/lima/lima_vm.c b/drivers/gpu/drm/lima/lima_vm.c index 2e513841de6c..5b92fb82674a 100644 --- a/drivers/gpu/drm/lima/lima_vm.c +++ b/drivers/gpu/drm/lima/lima_vm.c @@ -155,6 +155,7 @@ err_out0: void lima_vm_bo_del(struct lima_vm *vm, struct lima_bo *bo) { struct lima_bo_va *bo_va; + u32 size; mutex_lock(&bo->lock); @@ -166,8 +167,9 @@ void lima_vm_bo_del(struct lima_vm *vm, struct lima_bo *bo) mutex_lock(&vm->lock); + size = bo->heap_size ? bo->heap_size : bo_va->node.size; lima_vm_unmap_range(vm, bo_va->node.start, - bo_va->node.start + bo_va->node.size - 1); + bo_va->node.start + size - 1); drm_mm_remove_node(&bo_va->node); |