gralloc: Use PROTECTED flag for L1 allocations

This is in keeping with the gralloc spec.

Change-Id: Id796a55e2ea51d3abdf9274140dc0404a42e1cab
CRs-fixed: 999994
This commit is contained in:
Naseer Ahmed
2016-04-11 17:20:02 -04:00
committed by Gerrit - the friendly Code Review server
parent abecb17c14
commit 934a4c33e3

View File

@@ -446,23 +446,16 @@ int IonController::allocate(alloc_data& data, int usage)
data.allocType = 0; data.allocType = 0;
if(usage & GRALLOC_USAGE_PROTECTED) { if(usage & GRALLOC_USAGE_PROTECTED) {
if (usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) { if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) {
if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) { ionHeapId = ION_HEAP(SD_HEAP_ID);
ionHeapId = ION_HEAP(SD_HEAP_ID); /*
/* * There is currently no flag in ION for Secure Display
* There is currently no flag in ION for Secure Display * VM. Please add it to the define once available.
* VM. Please add it to the define once available. */
*/ ionFlags |= ION_SD_FLAGS;
ionFlags |= ION_SD_FLAGS;
} else {
ionHeapId = ION_HEAP(CP_HEAP_ID);
ionFlags |= ION_CP_FLAGS;
}
} else { } else {
// for targets/OEMs which do not need HW level protection ionHeapId = ION_HEAP(CP_HEAP_ID);
// do not set ion secure flag & MM heap. Fallback to system heap. ionFlags |= ION_CP_FLAGS;
ionHeapId |= ION_HEAP(ION_SYSTEM_HEAP_ID);
data.allocType |= private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER;
} }
} else if(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) { } else if(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) {
//MM Heap is exclusively a secure heap. //MM Heap is exclusively a secure heap.