Gralloc4: accept invalid 0x2400 usage bits
- 0x2000 is EXTERNAL_DISP which acodec2 sets. See b/72323293
- 0x0400 is USAGE_HW_2D which hikey sets. See b/72703005
Bug: 217506693
Change-Id: I3260e9e78ef62fc3f216d4478191ad3013047658
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp
index c97cc94..1a42642 100644
--- a/libs/ui/Gralloc4.cpp
+++ b/libs/ui/Gralloc4.cpp
@@ -62,6 +62,9 @@
static constexpr Error kTransactionError = Error::NO_RESOURCES;
static const auto kAidlAllocatorServiceName = AidlIAllocator::descriptor + std::string("/default");
+// TODO(b/72323293, b/72703005): Remove these invalid bits from callers
+static constexpr uint64_t kRemovedUsageBits = static_cast<uint64_t>((1 << 10) | (1 << 13));
+
uint64_t getValidUsageBits() {
static const uint64_t validUsageBits = []() -> uint64_t {
uint64_t bits = 0;
@@ -71,7 +74,7 @@
}
return bits;
}();
- return validUsageBits;
+ return validUsageBits | kRemovedUsageBits;
}
uint64_t getValidUsageBits41() {