summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-06-08 06:25:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-06-08 06:25:44 +0000
commitbf5b36d2dc1198fbfd86ebd81066cdf4e9264333 (patch)
tree929089ae37e04240bb0e9cb99981f402ebc2c0f4
parent35314f9c5305057a840b8f99037defa563dbf561 (diff)
parent9c49ea272cd546f2cbd0742f26d39f17caf24a06 (diff)
downloadgchips-bf5b36d2dc1198fbfd86ebd81066cdf4e9264333.tar.gz
Merge "Separate camera and App dmabuf heap allocation path" into udc-d1-dev
-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;