summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Artamonov <kartamonov@nvidia.com>2010-09-10 08:17:25 +0300
committerBharat Nihalani <bnihalani@nvidia.com>2010-09-19 21:51:01 -0700
commit49513423ede836d93628a11a85b7d78dd1b827eb (patch)
treead372ba7f3ca348a8c203845fca378a68d4ffff1
parent98242b67666a43a1e42a634def39545bec6406ed (diff)
nvrm: single pages allocation policy corrected
When user doesn't use default heap policy and selects GART or carveout allocation, automatic single-page-to-sysmem rule doesn't work. Because of broken rule many single page allocations go to GART and carveout. The fix adds sysmem bit to heap mask when allocation is single page and GART or carveout is present in heap mask. bug 730124 bug 731923 (cherry picked from commit 3ca9989c922420a57215d297189738a0464c4073) Change-Id: I2ea8018ae5ed9d31e90659479d0e44052ebf9431 Reviewed-on: http://git-master/r/6701 Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com> Tested-by: Kirill Artamonov <kartamonov@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/video/tegra/nvmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/video/tegra/nvmap.c b/drivers/video/tegra/nvmap.c
index 9b24e3ff259c..b407644a90f3 100644
--- a/drivers/video/tegra/nvmap.c
+++ b/drivers/video/tegra/nvmap.c
@@ -1832,6 +1832,14 @@ static int _nvmap_do_alloc(struct nvmap_file_priv *priv,
heap_mask &= NVMAP_SECURE_HEAPS;
if (!heap_mask) return -EINVAL;
}
+ else if ((numpages == 1) &&
+ (heap_mask & (NVMEM_HEAP_CARVEOUT_MASK | NVMEM_HEAP_IOVMM) !=
+ NVMEM_HEAP_CARVEOUT_IRAM)) {
+ // Non-secure single page iovmm and carveout allocations
+ // should be allowed to go to sysmem
+ heap_mask |= NVMEM_HEAP_SYSMEM;
+ }
+
/* can't do greater than page size alignment with page alloc */
if (align > PAGE_SIZE)
heap_mask &= NVMEM_HEAP_CARVEOUT_MASK;