summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-08 23:16:12 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-08 23:16:12 +0000
commite0a1b866a7a3f1f14a15a6d67337bbf481facd8b (patch)
tree929089ae37e04240bb0e9cb99981f402ebc2c0f4
parentdc4b0ba205b3586af340b4706735f0236679614e (diff)
parentbf5b36d2dc1198fbfd86ebd81066cdf4e9264333 (diff)
downloadgchips-e0a1b866a7a3f1f14a15a6d67337bbf481facd8b.tar.gz
Snap for 10286956 from bf5b36d2dc1198fbfd86ebd81066cdf4e9264333 to udc-d1-release
Change-Id: I722563d2199af3aef8e3758d8deaafc3f04c3527
-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;