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: I8fa265a50004550baccb0fe803c957529886ba0b
Acked-by: Prabhanjan Kandula <pkandula@codeaurora.org>
diff --git a/liboverlay/overlayMem.h b/liboverlay/overlayMem.h
index c743741..60ed8fe 100644
--- a/liboverlay/overlayMem.h
+++ b/liboverlay/overlayMem.h
@@ -137,11 +137,21 @@
data.uncached = true;
err = mAlloc->allocate(data, allocFlags);
- 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);
+ 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;