diff options
author | Praveen Chavan <pchavan@codeaurora.org> | 2018-07-06 18:19:46 -0700 |
---|---|---|
committer | Praveen Chavan <pchavan@codeaurora.org> | 2018-07-10 23:15:56 -0700 |
commit | 0957bedef83c372238cd71388fab11de8e5feb1b (patch) | |
tree | f6e19061fca0bf227f3f47c893bc7750236a47f9 /gralloc | |
parent | 8aefef0b385405f689a0eea1e80f1c67f441787c (diff) | |
download | display-0957bedef83c372238cd71388fab11de8e5feb1b.tar.gz |
qdMetaData: Add get/setMetaData variants that unmap metadata
Add get/setMetaDataAndUnmap(..) api that remove the meta-data
mapping and reset the mapped pointer in handle.
Use these versions in setMetaData called during alloc to
ensure allocating process does not duplicate invalid
base address of metadata (i.e when native_handle is cloned
without importing)
CRs-Fixed: 2265196
Change-Id: I0481ad8d59950256723871a089aeb3d143afac5a
Diffstat (limited to 'gralloc')
-rw-r--r-- | gralloc/gr_buf_mgr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp index 8c8c66f8..c8309525 100644 --- a/gralloc/gr_buf_mgr.cpp +++ b/gralloc/gr_buf_mgr.cpp @@ -359,11 +359,11 @@ Error BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_h hnd->layer_count = layer_count; ColorSpace_t colorSpace = ITU_R_601; - setMetaData(hnd, UPDATE_COLOR_SPACE, reinterpret_cast<void *>(&colorSpace)); + setMetaDataAndUnmap(hnd, UPDATE_COLOR_SPACE, reinterpret_cast<void *>(&colorSpace)); bool use_adreno_for_size = CanUseAdrenoForSize(buffer_type, usage); if (use_adreno_for_size) { - setMetaData(hnd, SET_GRAPHICS_METADATA, reinterpret_cast<void *>(&graphics_metadata)); + setMetaDataAndUnmap(hnd, SET_GRAPHICS_METADATA, reinterpret_cast<void *>(&graphics_metadata)); } *handle = hnd; |