diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index c76b31b..1ff19d8 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -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;