video: tegra: nvmap: single page allocation policy corrected
authorKirill Artamonov <kartamonov@nvidia.com>
Tue, 24 May 2011 10:12:43 +0000 (13:12 +0300)
committerDan Willemsen <dwillemsen@nvidia.com>
Thu, 1 Dec 2011 05:45:04 +0000 (21:45 -0800)
commitb0bf5067c63be08898d33e92af416e64c421fec5
treed73273c1829501163f7ff8272badc48a71024508
parent431fa116af6295a15ed77bd35b560ffd56dadf52
video: tegra: nvmap: single page 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 take extra space in carveout and create
unnecessary page mappings in GART and SMMU.

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

The change also does sanity check of available system memory
before adding sysmem bit for carveout allocations.

bug 777839

Original-Change-Id: I13a62653825f6c80581adcd2682fb2608d3a284e
Reviewed-on: http://git-master/r/31383
Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com>
Tested-by: Kirill Artamonov <kartamonov@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R278606210f20aacc885fa9eb06b3a2a3d8677b55
drivers/video/tegra/nvmap/nvmap_handle.c