gralloc: Fix uncached settings on CPU rare read/write
Change-Id: I4187b4beaacf26388cdd4c9f2b7d4e49a5882983
diff --git a/gralloc/gr_allocator.cpp b/gralloc/gr_allocator.cpp
index 34a5c03..912ada0 100644
--- a/gralloc/gr_allocator.cpp
+++ b/gralloc/gr_allocator.cpp
@@ -236,12 +236,13 @@
}
// CPU read rarely
- if ((usage & BufferUsage::CPU_READ_RARELY) && !(usage & BufferUsage::CPU_READ_OFTEN)) {
+ if ((usage & BufferUsage::CPU_READ_MASK) == static_cast<uint64_t>(BufferUsage::CPU_READ_RARELY)) {
return true;
}
// CPU write rarely
- if ((usage & BufferUsage::CPU_WRITE_RARELY) && !(usage & BufferUsage::CPU_WRITE_OFTEN)) {
+ if ((usage & BufferUsage::CPU_WRITE_MASK) ==
+ static_cast<uint64_t>(BufferUsage::CPU_WRITE_RARELY)) {
return true;
}