summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2011-09-06 23:34:42 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-09-08 17:21:12 -0700
commit060055eea2082adb6da4cf27462ff699fdf2b4e9 (patch)
treec78a72a942fa9af7e5da7aacb5cc0e5f856bf634
parent84f43c51c4efd45f6d64cd3fbe321c54ea7b15b2 (diff)
video: tegra: nvmap: Add VPR heap support.
Change-Id: I40505c002c70a0c985889bba527f6ca9975fe66b Reviewed-on: http://git-master/r/51026 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Tested-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rw-r--r--drivers/video/tegra/Kconfig8
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c4
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c7
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/video/tegra/Kconfig b/drivers/video/tegra/Kconfig
index 258dec969f87..5d652b013237 100644
--- a/drivers/video/tegra/Kconfig
+++ b/drivers/video/tegra/Kconfig
@@ -104,6 +104,14 @@ config NVMAP_SEARCH_GLOBAL_HANDLES
compatibility with legacy applications.
If unsure, say N.
+config NVMAP_VPR
+ bool "Enable VPR Heap."
+ depends on TEGRA_NVMAP
+ default n
+ help
+ Say Y here to enable Video Protection Region(VPR) heap.
+ if unsure, say N.
+
config TEGRA_DSI
bool "Enable DSI panel."
default n
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c
index b830fd3a6688..a21c6730899a 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -1263,7 +1263,7 @@ static int nvmap_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "couldn't create debug files\n");
for (i = 0; i < plat->nr_carveouts; i++) {
- struct nvmap_carveout_node *node = &dev->heaps[i];
+ struct nvmap_carveout_node *node = &dev->heaps[dev->nr_carveouts];
const struct nvmap_platform_carveout *co = &plat->carveouts[i];
if (!co->size)
continue;
@@ -1275,9 +1275,9 @@ static int nvmap_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "couldn't create %s\n", co->name);
goto fail_heaps;
}
+ node->index = dev->nr_carveouts;
dev->nr_carveouts++;
spin_lock_init(&node->clients_lock);
- node->index = i;
INIT_LIST_HEAD(&node->clients);
node->heap_bit = co->usage_mask;
if (nvmap_heap_create_group(node->carveout,
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c
index 6f9935cfdab7..d3fc7492e71c 100644
--- a/drivers/video/tegra/nvmap/nvmap_handle.c
+++ b/drivers/video/tegra/nvmap/nvmap_handle.c
@@ -49,7 +49,8 @@
#define PR_INFO(...)
#endif
-#define NVMAP_SECURE_HEAPS (NVMAP_HEAP_CARVEOUT_IRAM | NVMAP_HEAP_IOVMM)
+#define NVMAP_SECURE_HEAPS (NVMAP_HEAP_CARVEOUT_IRAM | NVMAP_HEAP_IOVMM | \
+ NVMAP_HEAP_CARVEOUT_VPR)
#ifdef CONFIG_NVMAP_HIGHMEM_ONLY
#define GFP_NVMAP (__GFP_HIGHMEM | __GFP_NOWARN)
#else
@@ -221,7 +222,7 @@ static void alloc_handle(struct nvmap_client *client,
BUG_ON(type & (type - 1));
#ifdef CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM
-#define __NVMAP_HEAP_CARVEOUT NVMAP_HEAP_CARVEOUT_IRAM
+#define __NVMAP_HEAP_CARVEOUT (NVMAP_HEAP_CARVEOUT_IRAM | NVMAP_HEAP_CARVEOUT_VPR)
#define __NVMAP_HEAP_IOVMM (NVMAP_HEAP_IOVMM | NVMAP_HEAP_CARVEOUT_GENERIC)
if (type & NVMAP_HEAP_CARVEOUT_GENERIC) {
#ifdef CONFIG_NVMAP_ALLOW_SYSMEM
@@ -302,6 +303,7 @@ sysheap:
* allocations, and to reduce fragmentation of the graphics heaps with
* sub-page splinters */
static const unsigned int heap_policy_small[] = {
+ NVMAP_HEAP_CARVEOUT_VPR,
NVMAP_HEAP_CARVEOUT_IRAM,
#ifdef CONFIG_NVMAP_ALLOW_SYSMEM
NVMAP_HEAP_SYSMEM,
@@ -312,6 +314,7 @@ static const unsigned int heap_policy_small[] = {
};
static const unsigned int heap_policy_large[] = {
+ NVMAP_HEAP_CARVEOUT_VPR,
NVMAP_HEAP_CARVEOUT_IRAM,
NVMAP_HEAP_IOVMM,
NVMAP_HEAP_CARVEOUT_MASK,