gralloc: Do not set ION_SECURE for non-contiguous heaps
The GRALLOC_USAGE_PROTECTED flag is being used for non TZ DRM if non contiguous heaps such as IOMMU are used. Hence do not set the ION_SECURE flag for such heaps as they cannot be secured through trustzone. Change-Id: I48e9460ef66abb827c9df1b3c55037e8e4214f81
This commit is contained in:
@@ -114,8 +114,10 @@ int IonController::allocate(alloc_data& data, int usage)
|
||||
noncontig = true;
|
||||
}
|
||||
|
||||
if(usage & GRALLOC_USAGE_PRIVATE_IOMMU_HEAP)
|
||||
if(usage & GRALLOC_USAGE_PRIVATE_IOMMU_HEAP) {
|
||||
ionFlags |= ION_HEAP(ION_IOMMU_HEAP_ID);
|
||||
noncontig = true;
|
||||
}
|
||||
|
||||
if(usage & GRALLOC_USAGE_PRIVATE_MM_HEAP)
|
||||
ionFlags |= ION_HEAP(ION_CP_MM_HEAP_ID);
|
||||
@@ -123,7 +125,7 @@ int IonController::allocate(alloc_data& data, int usage)
|
||||
if(usage & GRALLOC_USAGE_PRIVATE_CAMERA_HEAP)
|
||||
ionFlags |= ION_HEAP(ION_CAMERA_HEAP_ID);
|
||||
|
||||
if(usage & GRALLOC_USAGE_PROTECTED)
|
||||
if(usage & GRALLOC_USAGE_PROTECTED && !noncontig)
|
||||
ionFlags |= ION_SECURE;
|
||||
|
||||
// if no flags are set, default to
|
||||
|
||||
Reference in New Issue
Block a user