From c421c6ac191326dbd79b60aa47eda3daf88ba890 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Tue, 6 Dec 2011 12:14:55 +0530 Subject: [PATCH] gralloc: Limit fallback case for SMI For pmem, do not fall back to the ADSP heap if SMI was requested explicitly Change-Id: I31d85aa7bef3db53ca9ba108170df7ef4841843b --- libgralloc/alloc_controller.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp index 53f4354..b7ec509 100644 --- a/libgralloc/alloc_controller.cpp +++ b/libgralloc/alloc_controller.cpp @@ -164,6 +164,8 @@ int PmemKernelController::allocate(alloc_data& data, int usage, { int ret = 0; bool adspFallback = false; + if (!(usage & GRALLOC_USAGE_PRIVATE_SMI_HEAP)) + adspFallback = true; // Try SMI first if ((usage & GRALLOC_USAGE_PRIVATE_SMI_HEAP) || @@ -179,8 +181,8 @@ int PmemKernelController::allocate(alloc_data& data, int usage, if(ret >= 0) return ret; else { - adspFallback = true; - LOGW("Allocation from SMI failed, trying ADSP"); + if(adspFallback) + LOGW("Allocation from SMI failed, trying ADSP"); } } }