diff options
author | Hridya Valsaraju <hridya@google.com> | 2021-08-11 11:15:12 -0700 |
---|---|---|
committer | Hridya Valsaraju <hridya@google.com> | 2021-08-11 11:34:39 -0700 |
commit | 0f2cc9e07eece3faf22b738819675e9a7eaa0870 (patch) | |
tree | f71e233c230fb661f6af0aa5c05e6760a7f243fb | |
parent | 72bc22888ac905f62f7caf945dcc461ad699f25f (diff) | |
download | libdmabufheap-0f2cc9e07eece3faf22b738819675e9a7eaa0870.tar.gz |
libdmabufheap: Do not create heap mappings without ION supportandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-s-beta-5android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android12-tests-releaseandroid12-tests-devandroid-s-beta-5
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.cpp | 3 |
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()) { |