gralloc: Allow SF to use IOMMU heap

(cherry picked from commit 9ff9a8df77ce6887b6d45fdb7dc7400690d408c5)

Change-Id: Ia079f4c68b88201f638cfc2b4618de381d246e49
This commit is contained in:
Naseer Ahmed 2012-01-13 11:40:38 +05:30 committed by Andrew Sutherland
parent 9089a0e4ca
commit b904eeeec8

View File

@ -78,7 +78,8 @@ static bool canFallback(int compositionType, int usage, bool triedSystem)
static bool useUncached(int usage)
{
// System heaps cannot be uncached
if(usage & GRALLOC_USAGE_PRIVATE_SYSTEM_HEAP)
if(usage & (GRALLOC_USAGE_PRIVATE_SYSTEM_HEAP |
GRALLOC_USAGE_PRIVATE_IOMMU_HEAP))
return false;
if (usage & GRALLOC_USAGE_PRIVATE_UNCACHED)
return true;
@ -148,11 +149,11 @@ int IonController::allocate(alloc_data& data, int usage,
data.allocType &= ~(private_handle_t::PRIV_FLAGS_NOT_MAPPED);
// if no flags are set, default to
// EBI heap, so that bypass can work
// SF + IOMMU heaps, so that bypass can work
// we can fall back to system heap if
// we run out.
if(!ionFlags)
ionFlags = ION_HEAP(ION_SF_HEAP_ID);
ionFlags = ION_HEAP(ION_SF_HEAP_ID) | ION_HEAP(ION_IOMMU_HEAP_ID);
data.flags = ionFlags;
ret = mIonAlloc->alloc_buffer(data);