summaryrefslogtreecommitdiff
path: root/libs/ui/GraphicBufferMapper.cpp
diff options
context:
space:
mode:
author Chia-I Wu <olv@google.com> 2017-04-11 10:03:38 -0700
committer Chia-I Wu <olv@google.com> 2017-04-11 12:03:32 -0700
commita3c428afbfd8ecfafb7712dafa2cc51aa042a9ba (patch)
tree53970e8f641b8b5dc6dfc5f78f3c3159f1f70357 /libs/ui/GraphicBufferMapper.cpp
parentd5de418cf53c50a5a1286bd2c832cbb6a0f52b37 (diff)
libui: support GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE
Honor GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE in GraphicBufferMapper and advertise the cap in the adapter. Bug: 36355756 Test: boots on gralloc0 and gralloc1 devices Change-Id: I54a4855883904255fba9a0821ff9d866d265d25a
Diffstat (limited to 'libs/ui/GraphicBufferMapper.cpp')
-rw-r--r--libs/ui/GraphicBufferMapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 2f4d5fbc77..87519bf3b8 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -122,8 +122,10 @@ status_t GraphicBufferMapper::freeBuffer(buffer_handle_t handle)
error = GRALLOC1_ERROR_NONE;
} else {
error = mDevice->release(handle);
- native_handle_close(handle);
- native_handle_delete(const_cast<native_handle_t*>(handle));
+ if (!mDevice->hasCapability(GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE)) {
+ native_handle_close(handle);
+ native_handle_delete(const_cast<native_handle_t*>(handle));
+ }
}
ALOGW_IF(error != GRALLOC1_ERROR_NONE, "freeBuffer(%p): failed %d",