gralloc: Fix gralloc protected allocations
Protected allocations need to be uncached and don't need the MM
heap flag set
Change-Id: Ib64169e601af1c70a951a06266e70b4e18fc88f5
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index bebb6b4..cb1adec 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -88,11 +88,10 @@
* read or written in software. Any combination with a _RARELY_ flag will be
* treated as uncached. */
static bool useUncached(const int& usage) {
- if((usage & GRALLOC_USAGE_PRIVATE_UNCACHED) or
- ((usage & GRALLOC_USAGE_SW_WRITE_MASK) ==
- GRALLOC_USAGE_SW_WRITE_RARELY) or
- ((usage & GRALLOC_USAGE_SW_READ_MASK) ==
- GRALLOC_USAGE_SW_READ_RARELY))
+ if ((usage & GRALLOC_USAGE_PROTECTED) or
+ (usage & GRALLOC_USAGE_PRIVATE_UNCACHED) or
+ ((usage & GRALLOC_USAGE_SW_WRITE_MASK) == GRALLOC_USAGE_SW_WRITE_RARELY) or
+ ((usage & GRALLOC_USAGE_SW_READ_MASK) == GRALLOC_USAGE_SW_READ_RARELY))
return true;
return false;