libui: Allow extension of valid gralloc 1.0 buffer usage bits
* Change I7f4174581e24e361577640b9263514a168ed482d implemented
validation of the buffer description info prior to creating
the descriptor. Some of our legacy devices need to whitelist
additional usage bits to support various functionality.
Change-Id: Ie369e78f78e9ac0b18ab3dfea520d4f123005d92
libui: Extend adb95ae to Gralloc3
Change-Id: I96a9f86f5c834a4282a172e7134422caf560b238
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
index 5dc4530..2dd11b1 100644
--- a/libs/ui/Gralloc2.cpp
+++ b/libs/ui/Gralloc2.cpp
@@ -48,6 +48,13 @@
for (const auto bit : hardware::hidl_enum_range<BufferUsage>()) {
bits = bits | bit;
}
+
+#ifdef ADDNL_GRALLOC_10_USAGE_BITS
+ uint64_t addnl_bits = static_cast<uint64_t>(ADDNL_GRALLOC_10_USAGE_BITS);
+ ALOGI("Adding additional valid usage bits: 0x%" PRIx64, addnl_bits);
+ bits = bits | addnl_bits;
+#endif
+
return bits;
}();
return valid10UsageBits;