Merge "gralloc: Use PROTECTED flag for L1 allocations"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
7e0e63159d
@@ -457,23 +457,16 @@ int IonController::allocate(alloc_data& data, int usage)
|
||||
data.allocType = 0;
|
||||
|
||||
if(usage & GRALLOC_USAGE_PROTECTED) {
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) {
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) {
|
||||
ionHeapId = ION_HEAP(SD_HEAP_ID);
|
||||
/*
|
||||
* There is currently no flag in ION for Secure Display
|
||||
* VM. Please add it to the define once available.
|
||||
*/
|
||||
ionFlags |= ION_SD_FLAGS;
|
||||
} else {
|
||||
ionHeapId = ION_HEAP(CP_HEAP_ID);
|
||||
ionFlags |= ION_CP_FLAGS;
|
||||
}
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) {
|
||||
ionHeapId = ION_HEAP(SD_HEAP_ID);
|
||||
/*
|
||||
* There is currently no flag in ION for Secure Display
|
||||
* VM. Please add it to the define once available.
|
||||
*/
|
||||
ionFlags |= ION_SD_FLAGS;
|
||||
} else {
|
||||
// for targets/OEMs which do not need HW level protection
|
||||
// do not set ion secure flag & MM heap. Fallback to system heap.
|
||||
ionHeapId |= ION_HEAP(ION_SYSTEM_HEAP_ID);
|
||||
data.allocType |= private_handle_t::PRIV_FLAGS_PROTECTED_BUFFER;
|
||||
ionHeapId = ION_HEAP(CP_HEAP_ID);
|
||||
ionFlags |= ION_CP_FLAGS;
|
||||
}
|
||||
} else if(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) {
|
||||
//MM Heap is exclusively a secure heap.
|
||||
|
||||
Reference in New Issue
Block a user