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:
Naseer Ahmed
2013-08-21 15:16:24 -04:00
parent e36a9c2f1a
commit 2686788a4b

View File

@@ -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;
}