gralloc: Initialize and handle allocType correctly.

CRs-fixed: 346154
(cherry picked from commit a235dd6b4e8efe3cc432057806b3d5fb2cb4881d)

Change-Id: Ie657f6e52df5a4b39c9fa04e74aabe1135e5bdd5
This commit is contained in:
Naseer Ahmed 2012-03-29 14:30:17 -04:00 committed by Andrew Sutherland
parent 873b6a9a79
commit 840a257b9e

View File

@ -115,6 +115,7 @@ int IonController::allocate(alloc_data& data, int usage,
bool noncontig = false;
data.uncached = useUncached(usage);
data.allocType = 0;
if(usage & GRALLOC_USAGE_PRIVATE_UI_CONTIG_HEAP)
ionFlags |= ION_HEAP(ION_SF_HEAP_ID);
@ -140,9 +141,10 @@ int IonController::allocate(alloc_data& data, int usage,
ionFlags |= ION_SECURE;
if(usage & GRALLOC_USAGE_PRIVATE_DO_NOT_MAP)
data.allocType = private_handle_t::PRIV_FLAGS_NOT_MAPPED;
data.allocType |= private_handle_t::PRIV_FLAGS_NOT_MAPPED;
else
data.allocType &= ~(private_handle_t::PRIV_FLAGS_NOT_MAPPED);
// if no flags are set, default to
// EBI heap, so that bypass can work
// we can fall back to system heap if
@ -164,7 +166,7 @@ int IonController::allocate(alloc_data& data, int usage,
}
if(ret >= 0 ) {
data.allocType = private_handle_t::PRIV_FLAGS_USES_ION;
data.allocType |= private_handle_t::PRIV_FLAGS_USES_ION;
if(noncontig)
data.allocType |= private_handle_t::PRIV_FLAGS_NONCONTIGUOUS_MEM;
if(ionFlags & ION_SECURE)
@ -265,6 +267,7 @@ int PmemAshmemController::allocate(alloc_data& data, int usage,
int compositionType)
{
int ret = 0;
data.allocType = 0;
// Make buffers cacheable by default
data.uncached = false;