diff options
author | Wen Chang Liu <wenchangliu@google.com> | 2023-03-03 04:04:12 +0000 |
---|---|---|
committer | Wen Chang Liu <wenchangliu@google.com> | 2023-03-09 10:50:42 +0000 |
commit | cd699e28fe9e9ac218df09b1340acae34c8725b1 (patch) | |
tree | 1694c02e6f25eb759afc1babc2ceb42103cb88c1 /gralloc4 | |
parent | 1b98381749cb99ab85d00927164f457382eb8368 (diff) |
Revert^2 "gralloc4: Do not map buffer on import"
36922f185ec93280afe71c9e323001a75ba10a0a
Bug: 237824580
Test: No display artifacts after camera shot
Change-Id: I83c285c597e2b153045923945b8c31776481c16c
Diffstat (limited to 'gralloc4')
-rw-r--r-- | gralloc4/src/core/mali_gralloc_reference.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/gralloc4/src/core/mali_gralloc_reference.cpp b/gralloc4/src/core/mali_gralloc_reference.cpp index 8f12975..b84cbb4 100644 --- a/gralloc4/src/core/mali_gralloc_reference.cpp +++ b/gralloc4/src/core/mali_gralloc_reference.cpp @@ -26,10 +26,7 @@ #include <mutex> #include "allocator/mali_gralloc_ion.h" -#include "allocator/mali_gralloc_shared_memory.h" #include "mali_gralloc_buffer.h" -#include "mali_gralloc_bufferallocation.h" -#include "mali_gralloc_usages.h" class BufferManager { private: @@ -48,17 +45,6 @@ private: std::mutex lock; std::map<const private_handle_t *, std::unique_ptr<MappedData>> buffer_map GUARDED_BY(lock); - static bool should_map_dmabuf(buffer_handle_t handle) { - private_handle_t *hnd = (private_handle_t *)handle; - - // TODO(b/187145254): CPU_READ/WRITE buffer is not being properly locked from - // MFC. This is a WA for the time being. - constexpr auto cpu_access_usage = - (GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN | - GRALLOC_USAGE_SW_WRITE_RARELY | GRALLOC_USAGE_SW_READ_RARELY); - return hnd->get_usage() & cpu_access_usage; - } - static off_t get_buffer_size(unsigned int fd) { off_t current = lseek(fd, 0, SEEK_CUR); off_t size = lseek(fd, 0, SEEK_END); @@ -213,8 +199,7 @@ public: auto &data = *(it->second.get()); data.ref_count++; - if (!should_map_dmabuf(handle)) return 0; - return map_locked(handle); + return 0; } int map(buffer_handle_t handle) EXCLUDES(lock) { |