gralloc: Fix caching for rarely read/write flags
GRALLOC_USAGE_SW_WRITE_RARELY and GRALLOC_USAGE_SW_READ_RARELY need to be compared directly since they share bits with GRALLOC_USAGE_SW_WRITE_OFTEN and GRALLOC_USAGE_SW_READ_OFTEN. Change-Id: I52692027033e1036e3ad960b9e03dd8ee60b4111
This commit is contained in:
@@ -75,9 +75,10 @@ static bool canFallback(int usage, bool triedSystem)
|
||||
|
||||
static bool useUncached(int usage)
|
||||
{
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_UNCACHED ||
|
||||
usage & GRALLOC_USAGE_SW_WRITE_RARELY ||
|
||||
usage & GRALLOC_USAGE_SW_READ_RARELY)
|
||||
if (usage & GRALLOC_USAGE_PRIVATE_UNCACHED)
|
||||
return true;
|
||||
if(((usage & GRALLOC_USAGE_SW_WRITE_MASK) == GRALLOC_USAGE_SW_WRITE_RARELY)
|
||||
||((usage & GRALLOC_USAGE_SW_READ_MASK) == GRALLOC_USAGE_SW_READ_RARELY))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user