summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2021-08-11 11:15:12 -0700
committerHridya Valsaraju <hridya@google.com>2021-08-11 11:34:39 -0700
commit0f2cc9e07eece3faf22b738819675e9a7eaa0870 (patch)
treef71e233c230fb661f6af0aa5c05e6760a7f243fb
parent72bc22888ac905f62f7caf945dcc461ad699f25f (diff)
downloadlibdmabufheap-0f2cc9e07eece3faf22b738819675e9a7eaa0870.tar.gz
When ION is not supported, do not create mappings from DMA-BUF heap names to ION heap names/masks. Bug: 196079974 Test: atest dmabufheap-vts-unit-tests Change-Id: Iadb11e35b9dd2cc30779f425079da10690e3fa36 Signed-off-by: Hridya Valsaraju <hridya@google.com>
-rw-r--r--BufferAllocator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/BufferAllocator.cpp b/BufferAllocator.cpp
index ce075d6..6dc3f68 100644
--- a/BufferAllocator.cpp
+++ b/BufferAllocator.cpp
@@ -165,6 +165,9 @@ int BufferAllocator::MapNameToIonHeap(const std::string& heap_name,
if (ret >= 0)
return 0;
+ /* If ION support is not detected, ignore the mappings */
+ if (ion_fd_ < 0) return 0;
+
if (uses_legacy_ion_iface_ || ion_heap_name == "") {
ret = MapNameToIonMask(heap_name, legacy_ion_heap_mask, legacy_ion_heap_flags);
} else if (!ion_heap_name.empty()) {