summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2022-06-27 15:16:48 -0700
committerAnkit Goyal <layog@google.com>2023-02-14 17:21:53 -0800
commit43ab868f19edb307808e3c40b7df2bca5c0ecb4e (patch)
tree42e421c843e6e6858fe63b40891e4bab2d5b64e4
parent2818a8cfe88388af03c45806e1fc8074335a1aba (diff)
gralloc4: Do not map buffer on import
Bug: 182885532 Bug: 237824580 Test: Video playback (AV1, H264) on P10 Test: Tested manually by wenchangliu@ Change-Id: I388d722c98cf68d0a1bfadff1d047b9921a80714
-rw-r--r--gralloc4/src/core/mali_gralloc_reference.cpp17
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) {