diff options
author | Shalaj Jain <shalajj@codeaurora.org> | 2015-03-04 17:53:49 -0800 |
---|---|---|
committer | Shalaj Jain <shalajj@codeaurora.org> | 2015-03-30 14:41:36 -0700 |
commit | 1f9725a2964c4f6366edaa55865b6d24908a6b73 (patch) | |
tree | 0251747204765c85038e0d1ef8c509eada3c2994 /libgralloc/alloc_controller.cpp | |
parent | a4ccb3fddd001cb6b20122887fedb5de83ba7e97 (diff) | |
download | android_hardware_qcom_display-1f9725a2964c4f6366edaa55865b6d24908a6b73.tar.gz android_hardware_qcom_display-1f9725a2964c4f6366edaa55865b6d24908a6b73.tar.bz2 android_hardware_qcom_display-1f9725a2964c4f6366edaa55865b6d24908a6b73.zip |
gralloc: App support for new secure system heap and flags
Add support for new secure system heap and corresponding flags
for all pixel buffers. Keep the old mm heap for secure display
buffers.
Change-Id: Ic0ee7783a2d1ff420c34396f7cc4bd5ac3058c44
Diffstat (limited to 'libgralloc/alloc_controller.cpp')
-rw-r--r-- | libgralloc/alloc_controller.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 1d0a40a63..c3431b6c3 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -49,6 +49,17 @@ #define ASTC_BLOCK_SIZE 16 +#ifdef ION_FLAG_CP_PIXEL +#define CP_HEAP_ID ION_SECURE_HEAP_ID +#else +#define ION_FLAG_CP_PIXEL 0 +#define CP_HEAP_ID ION_CP_MM_HEAP_ID +#endif + +#ifndef ION_FLAG_ALLOW_NON_CONTIG +#define ION_FLAG_ALLOW_NON_CONTIG 0 +#endif + using namespace gralloc; using namespace qdutils; @@ -331,13 +342,22 @@ int IonController::allocate(alloc_data& data, int usage) if(usage & GRALLOC_USAGE_PROTECTED) { if (usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) { - ionHeapId |= ION_HEAP(ION_CP_MM_HEAP_ID); + ionHeapId = ION_HEAP(CP_HEAP_ID); ionFlags |= ION_SECURE; -#ifdef ION_FLAG_ALLOW_NON_CONTIG + if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) { + /* + * There is currently no flag in ION for Secure Display + * VM. Please add it here once available. + * + ionFlags |= <Ion flag for Secure Display>; + */ + } else { + ionFlags |= ION_FLAG_CP_PIXEL; + } + if (!(usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY)) { ionFlags |= ION_FLAG_ALLOW_NON_CONTIG; } -#endif } else { // for targets/OEMs which do not need HW level protection // do not set ion secure flag & MM heap. Fallback to system heap. |