gralloc: Allow non-contiguous allocations for secure buffers

Pass a flag to ion to allow non-contiguous allocations with a sg
(scatter gather) list of 1MB chunks for all secure buffers except
secure display.

Change-Id: Ife2709e94571ab7603b29da17805a857ba73fd72
This commit is contained in:
Shalaj Jain
2014-12-02 16:20:54 -08:00
committed by Gerrit - the friendly Code Review server
parent c18558644f
commit 13cdf813ab
2 changed files with 12 additions and 1 deletions

View File

@@ -292,6 +292,11 @@ int IonController::allocate(alloc_data& data, int usage)
if (usage & GRALLOC_USAGE_PRIVATE_MM_HEAP) {
ionFlags |= ION_HEAP(ION_CP_MM_HEAP_ID);
ionFlags |= ION_SECURE;
#ifdef ION_FLAG_ALLOW_NON_CONTIG
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 IOMMU heap.