summaryrefslogtreecommitdiff
path: root/libgralloc
diff options
context:
space:
mode:
authorSushil Chauhan <sushilchauhan@codeaurora.org>2016-09-12 15:48:29 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-04 06:54:20 -0700
commitdfe55a20363da5e8b9d34b481406d339d395d92b (patch)
tree40b3588b97e1be78ca53d7a11873722faeeb90b2 /libgralloc
parent2197ae270b862e6ee08d4f1c4b8d00644fc580c5 (diff)
downloaddisplay-dfe55a20363da5e8b9d34b481406d339d395d92b.tar.gz
sdm: gralloc: Add support for Secure Camera use-case
1. Add support for Secure Camera use-case in SDM and gralloc. 2. Set the appropriate ION Heap ID, secure camera/preview ION flags and the alignment requirement for Secure Camera use-case. CRs-Fixed: 1065934 Change-Id: I9e80f3093d598eec7bf717ddd0e3adbbc3382d5e
Diffstat (limited to 'libgralloc')
-rw-r--r--libgralloc/alloc_controller.cpp11
-rw-r--r--libgralloc/gpu.cpp3
2 files changed, 13 insertions, 1 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index c5ec2764..ae167baf 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -59,16 +59,24 @@
#define ION_FLAG_ALLOW_NON_CONTIG 0
#endif
+#ifndef ION_FLAG_CP_CAMERA_PREVIEW
+#define ION_FLAG_CP_CAMERA_PREVIEW 0
+#endif
+
#ifdef MASTER_SIDE_CP
#define CP_HEAP_ID ION_SECURE_HEAP_ID
#define SD_HEAP_ID ION_SECURE_DISPLAY_HEAP_ID
#define ION_CP_FLAGS (ION_SECURE | ION_FLAG_CP_PIXEL)
#define ION_SD_FLAGS (ION_SECURE | ION_FLAG_CP_SEC_DISPLAY)
+#define ION_SC_FLAGS (ION_SECURE | ION_FLAG_CP_CAMERA)
+#define ION_SC_PREVIEW_FLAGS (ION_SECURE | ION_FLAG_CP_CAMERA_PREVIEW)
#else // SLAVE_SIDE_CP
#define CP_HEAP_ID ION_CP_MM_HEAP_ID
#define SD_HEAP_ID CP_HEAP_ID
#define ION_CP_FLAGS (ION_SECURE | ION_FLAG_ALLOW_NON_CONTIG)
#define ION_SD_FLAGS ION_SECURE
+#define ION_SC_FLAGS ION_SECURE
+#define ION_SC_PREVIEW_FLAGS ION_SECURE
#endif
using namespace gralloc;
@@ -473,6 +481,9 @@ int IonController::allocate(alloc_data& data, int usage)
* VM. Please add it to the define once available.
*/
ionFlags |= ION_SD_FLAGS;
+ } else if (usage & GRALLOC_USAGE_HW_CAMERA_MASK) {
+ ionHeapId = ION_HEAP(SD_HEAP_ID);
+ ionFlags |= (usage & GRALLOC_USAGE_HW_COMPOSER) ? ION_SC_PREVIEW_FLAGS : ION_SC_FLAGS;
} else {
ionHeapId = ION_HEAP(CP_HEAP_ID);
ionFlags |= ION_CP_FLAGS;
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 8bae9264..545903a5 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -74,7 +74,8 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
data.align = getpagesize();
if (usage & GRALLOC_USAGE_PROTECTED) {
- if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) {
+ if ((usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) ||
+ (usage & GRALLOC_USAGE_HW_CAMERA_MASK)) {
/* The alignment here reflects qsee mmu V7L/V8L requirement */
data.align = SZ_2M;
} else {