Skip to content

Commit

Permalink
Merge "gralloc : Don't fallback to system heap for framebuffer alloca…
Browse files Browse the repository at this point in the history
…tions"
  • Loading branch information
Linux Build Service Account authored and Gerrit - the friendly Code Review server committed Feb 14, 2013
2 parents 678231d + 7f582b1 commit 6d2415c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion libgralloc/alloc_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,19 @@ int IonController::allocate(alloc_data& data, int usage)
data.flags = ionFlags;
ret = mIonAlloc->alloc_buffer(data);

// Fallback
// Fallback to CAMERA PREVIEW heap if
// allocation is for fb1 AND
// allocation from SF heap fails
// Reason : fb1 had to go to MDP and MDP can't use system heap
// TODO : don't hardcode based on 'usage'

if(ret < 0 && (usage == 6659)) {
ALOGW("Falling back to CAMERA_PREVIEW heap for fb allocations");
data.flags = ION_HEAP(ION_CAMERA_HEAP_ID);
ret = mIonAlloc->alloc_buffer(data);
}

// Fallback to system heap
if(ret < 0 && canFallback(usage,
(ionFlags & ION_SYSTEM_HEAP_ID)))
{
Expand Down

0 comments on commit 6d2415c

Please sign in to comment.