summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2023-10-12 14:36:10 -0700
committerAnkit Goyal <layog@google.com>2023-10-23 17:47:10 -0700
commitea8b8475cc986b303c4896d56a3c0dcae1aaff83 (patch)
tree50415ed885b03945b9e9a3445298beb17ec4a4ad
parent0fe76ece0e7ccbd1f65b38101545c66707764c87 (diff)
downloadgchips-ea8b8475cc986b303c4896d56a3c0dcae1aaff83.tar.gz
gralloc4: Add support for faeval-secure heap
Bug: 302685353 Test: Manually tested with buffer dump Change-Id: I4273cee408caae3a1ab840e4e61ad0005608466d
-rw-r--r--gralloc4/src/allocator/mali_gralloc_ion.cpp8
-rw-r--r--gralloc4/src/mali_gralloc_usages.h3
2 files changed, 10 insertions, 1 deletions
diff --git a/gralloc4/src/allocator/mali_gralloc_ion.cpp b/gralloc4/src/allocator/mali_gralloc_ion.cpp
index 7d04eb0..3a955d9 100644
--- a/gralloc4/src/allocator/mali_gralloc_ion.cpp
+++ b/gralloc4/src/allocator/mali_gralloc_ion.cpp
@@ -55,6 +55,7 @@ static const char kDmabufSensorDirectHeapName[] = "sensor_direct_heap";
static const char kDmabufFaceauthTpuHeapName[] = "faceauth_tpu-secure";
static const char kDmabufFaceauthImgHeapName[] = "faimg-secure";
static const char kDmabufFaceauthRawImgHeapName[] = "farawimg-secure";
+static const char kDmabufFaceauthEvalHeapName[] = "faeval-secure";
static const char kDmabufFaceauthPrevHeapName[] = "faprev-secure";
static const char kDmabufFaceauthModelHeapName[] = "famodel-secure";
static const char kDmabufVframeSecureHeapName[] = "vframe-secure";
@@ -87,9 +88,14 @@ std::string select_dmabuf_heap(uint64_t usage)
std::string name;
};
- static const std::array<HeapSpecifier, 7> exact_usage_heaps =
+ static const std::array<HeapSpecifier, 8> exact_usage_heaps =
{{
// Faceauth heaps
+ { // faceauth_evaluation_heap - used mostly on debug builds
+ GRALLOC_USAGE_PROTECTED | GRALLOC_USAGE_HW_CAMERA_WRITE | GRALLOC_USAGE_HW_CAMERA_READ |
+ GS101_GRALLOC_USAGE_FACEAUTH_RAW_EVAL,
+ kDmabufFaceauthEvalHeapName
+ },
{ // isp_image_heap
GRALLOC_USAGE_PROTECTED | GRALLOC_USAGE_HW_CAMERA_WRITE | GS101_GRALLOC_USAGE_TPU_INPUT,
kDmabufFaceauthImgHeapName
diff --git a/gralloc4/src/mali_gralloc_usages.h b/gralloc4/src/mali_gralloc_usages.h
index a6dad28..f6559c4 100644
--- a/gralloc4/src/mali_gralloc_usages.h
+++ b/gralloc4/src/mali_gralloc_usages.h
@@ -84,6 +84,8 @@ typedef enum
GS101_GRALLOC_USAGE_TPU_INPUT = GRALLOC_USAGE_PRIVATE_5,
GS101_GRALLOC_USAGE_TPU_OUTPUT = GRALLOC_USAGE_PRIVATE_3,
GS101_GRALLOC_USAGE_CAMERA_STATS = GRALLOC_USAGE_PRIVATE_2,
+
+ GS101_GRALLOC_USAGE_FACEAUTH_RAW_EVAL = ::pixel::graphics::Usage::FACEAUTH_RAW_EVAL,
} mali_gralloc_usage_type;
#define GRALLOC_USAGE_SW_WRITE_RARELY static_cast<uint64_t>(hidl_common::BufferUsage::CPU_WRITE_RARELY)
@@ -151,6 +153,7 @@ static const uint64_t VALID_USAGE =
GS101_GRALLOC_USAGE_TPU_INPUT | /* 1U << 62 */
GS101_GRALLOC_USAGE_TPU_OUTPUT | /* 1U << 31 */
+ GS101_GRALLOC_USAGE_FACEAUTH_RAW_EVAL | /* 1U << 63 */
GS101_GRALLOC_USAGE_CAMERA_STATS | /* 1U << 30 */
GRALLOC_USAGE_ROIINFO | /* 1U << 52 */