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
This commit is contained in:
@@ -15,10 +15,14 @@
|
||||
#include "lima_vm.h"
|
||||
|
||||
int lima_sched_timeout_ms;
|
||||
uint lima_heap_init_nr_pages = 8;
|
||||
|
||||
MODULE_PARM_DESC(sched_timeout_ms, "task run timeout in ms");
|
||||
module_param_named(sched_timeout_ms, lima_sched_timeout_ms, int, 0444);
|
||||
|
||||
MODULE_PARM_DESC(heap_init_nr_pages, "heap buffer init number of pages");
|
||||
module_param_named(heap_init_nr_pages, lima_heap_init_nr_pages, uint, 0444);
|
||||
|
||||
static int lima_ioctl_get_param(struct drm_device *dev, void *data, struct drm_file *file)
|
||||
{
|
||||
struct drm_lima_get_param *args = data;
|
||||
@@ -68,7 +72,7 @@ static int lima_ioctl_gem_create(struct drm_device *dev, void *data, struct drm_
|
||||
if (args->pad)
|
||||
return -EINVAL;
|
||||
|
||||
if (args->flags)
|
||||
if (args->flags & ~(LIMA_BO_FLAG_HEAP))
|
||||
return -EINVAL;
|
||||
|
||||
if (args->size == 0)
|
||||
|
Reference in New Issue
Block a user