summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-06-08 08:04:24 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-06-08 08:04:24 +0000
commitf03af09dfd819bd6b4ee56f04915299191b0f151 (patch)
tree929089ae37e04240bb0e9cb99981f402ebc2c0f4
parente78eeaab2d56ffd943b44713077b421390ddc7b4 (diff)
parent0967f6befd7120acb727df4fa898af1435e6dde4 (diff)
downloadgchips-f03af09dfd819bd6b4ee56f04915299191b0f151.tar.gz
Merge "Separate camera and App dmabuf heap allocation path" into udc-d1-dev am: bf5b36d2dc am: 0967f6befd
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/22322433 Change-Id: I1f2bcd050df7ab87dbccafea0a6657d8389f1550 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--gralloc4/src/allocator/mali_gralloc_ion.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/gralloc4/src/allocator/mali_gralloc_ion.cpp b/gralloc4/src/allocator/mali_gralloc_ion.cpp
index 8bfc6d8..183d8a0 100644
--- a/gralloc4/src/allocator/mali_gralloc_ion.cpp
+++ b/gralloc4/src/allocator/mali_gralloc_ion.cpp
@@ -60,6 +60,8 @@ static const char kDmabufVframeSecureHeapName[] = "vframe-secure";
static const char kDmabufVstreamSecureHeapName[] = "vstream-secure";
static const char kDmabufVscalerSecureHeapName[] = "vscaler-secure";
static const char kDmabufFramebufferSecureHeapName[] = "framebuffer-secure";
+static const char kDmabufGcmaCameraHeapName[] = "gcma_camera";
+static const char kDmabufGcmaCameraUncachedHeapName[] = "gcma_camera-uncached";
BufferAllocator& get_allocator() {
static BufferAllocator allocator;
@@ -116,7 +118,7 @@ std::string select_dmabuf_heap(uint64_t usage)
},
}};
- static const std::array<HeapSpecifier, 6> inexact_usage_heaps =
+ static const std::array<HeapSpecifier, 8> inexact_usage_heaps =
{{
// If GPU, use vframe-secure
{
@@ -146,6 +148,18 @@ std::string select_dmabuf_heap(uint64_t usage)
kDmabufSensorDirectHeapName
},
+ // Camera GCMA heap
+ {
+ GRALLOC_USAGE_HW_CAMERA_WRITE,
+ find_first_available_heap({kDmabufGcmaCameraUncachedHeapName, kDmabufSystemUncachedHeapName})
+ },
+
+ // Camera GCMA heap
+ {
+ GRALLOC_USAGE_HW_CAMERA_READ,
+ find_first_available_heap({kDmabufGcmaCameraUncachedHeapName, kDmabufSystemUncachedHeapName})
+ },
+
// Catchall to system
{
0,
@@ -165,7 +179,10 @@ std::string select_dmabuf_heap(uint64_t usage)
{
if ((usage & heap.usage_bits) == heap.usage_bits)
{
- if (heap.name == kDmabufSystemUncachedHeapName &&
+ if (heap.name == kDmabufGcmaCameraUncachedHeapName &&
+ ((usage & GRALLOC_USAGE_SW_READ_MASK) == GRALLOC_USAGE_SW_READ_OFTEN))
+ return kDmabufGcmaCameraHeapName;
+ else if (heap.name == kDmabufSystemUncachedHeapName &&
((usage & GRALLOC_USAGE_SW_READ_MASK) == GRALLOC_USAGE_SW_READ_OFTEN))
return kDmabufSystemHeapName;