summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc4.cpp
diff options
context:
space:
mode:
author Robin Lee <rgl@google.com> 2022-02-02 22:53:15 +0100
committer Robin Lee <rgl@google.com> 2022-02-03 08:06:03 +0000
commit38b59415d336b4f0de1441deb87a39a8e3e390cc (patch)
tree2d545833e5673c7fbe08e41f2969c4c35f62f57e /libs/ui/Gralloc4.cpp
parentfe423e31c13ebb0e46350651474bd5164d407351 (diff)
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
Diffstat (limited to 'libs/ui/Gralloc4.cpp')
-rw-r--r--libs/ui/Gralloc4.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp
index c97cc94dd5..1a42642838 100644
--- a/libs/ui/Gralloc4.cpp
+++ b/libs/ui/Gralloc4.cpp
@@ -62,6 +62,9 @@ namespace {
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 @@ uint64_t getValidUsageBits() {
}
return bits;
}();
- return validUsageBits;
+ return validUsageBits | kRemovedUsageBits;
}
uint64_t getValidUsageBits41() {