libui: filter out invalid buffer usage bits
Before fixing callers to omit the invalid bits, we need to make sure
HALs do not use those bits. Let's filter the invalid bits out and
see if anything breaks.
Bug: 72323293
Bug: 72703005
Test: play videos on Pixels
Change-Id: I539f9b785f9010b7b7cdc5f72d59391211f337e5
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index eaba1ed..51b3a0a 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -108,6 +108,9 @@
if (layerCount < 1)
layerCount = 1;
+ // TODO(b/72323293, b/72703005): Remove these invalid bits from callers
+ usage &= ~static_cast<uint64_t>((1 << 10) | (1 << 13));
+
Gralloc2::IMapper::BufferDescriptorInfo info = {};
info.width = width;
info.height = height;