Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38b59415 authored by Robin Lee's avatar Robin Lee
Browse files

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
parent fe423e31
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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() {