From fd7ba26524b2baaa30dd583b07e8a9e53831f44d Mon Sep 17 00:00:00 2001 From: Vinod G Date: Fri, 2 Dec 2016 11:28:11 -0800 Subject: [PATCH] video: tegra: pva: Remove dynamic memory for task Removing the dynamic memory allocation done for task in the submit call. Allocate the fixed task memory array based on maximum task that can be supported per queue during nvhost_queue_alloc call. On task submit call obtain a task memory from pool based on availability. Free that memory when task is done. Deallocate task pool memory on nvhost_queue_free call. JIRA PVA-189 Change-Id: I93e89325c1c35a46bdf579dce6aae18c2bfe7183 Signed-off-by: Vinod G Reviewed-on: http://git-master/r/1264027 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/video/tegra/host/nvdla/nvdla.h | 5 +++++ drivers/video/tegra/host/nvdla/nvdla_ioctl.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla.h b/drivers/video/tegra/host/nvdla/nvdla.h index d5aab6a2..519a9a58 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.h +++ b/drivers/video/tegra/host/nvdla/nvdla.h @@ -41,6 +41,11 @@ */ #define MAX_NVDLA_QUEUE_COUNT 16 +/** + * Maximum number of tasks per queue + */ +#define MAX_NVDLA_TASK_COUNT 32 + /** * Trace Buffer Size */ diff --git a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c index 4643a98c..0fc7d230 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c +++ b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c @@ -332,7 +332,8 @@ static int nvdla_open(struct inode *inode, struct file *file) goto err_alloc_buffer; } - priv->queue = nvhost_queue_alloc(nvdla_dev->pool); + priv->queue = nvhost_queue_alloc(nvdla_dev->pool, + MAX_NVDLA_TASK_COUNT); if (IS_ERR(priv->queue)) { err = PTR_ERR(priv->queue); goto err_alloc_queue;