HDMI: Fallback to MM heap.

- IOMMU heap is not available for all targets. we should
  have a fallback heap always as IOMMU can be disabled.

Change-Id: I7e987ac69ba5e5fdd6228b50930e064a4420a472
This commit is contained in:
Prabhanjan Kandula
2012-07-25 11:18:15 +05:30
committed by Naseer Ahmed
parent bf3c454efe
commit 8d90904f86

View File

@@ -139,11 +139,21 @@ inline bool OvMem::open(uint32_t numbufs,
data.uncached = true;
err = mAlloc->allocate(data, allocFlags, 0);
if (err != 0) {
ALOGE("OvMem: error allocating memory");
//see if we can fallback to other heap
//we can try MM_HEAP once if it's not secure playback
if (err != 0 && !isSecure) {
allocFlags |= GRALLOC_USAGE_PRIVATE_MM_HEAP;
err = mAlloc->allocate(data, allocFlags, 0);
if (err != 0) {
ALOGE(" could not allocate from fallback heap");
return false;
}
} else if (err != 0) {
ALOGE("OvMem: error allocating memory can not fall back");
return false;
}
mFd = data.fd;
mBaseAddr = data.base;
mAllocType = data.allocType;