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;
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user