gralloc: In lock use writer info from allocation time
lock() can be called from a CpuConsumer with only the READ_OFTEN flag
so relying only on that makes gralloc assume there are no non cpu
writers.
Store the writer information during allocation in private flags of
handle and refer to those during lock()
Change-Id: Ifbf25ebc74dbf4e422a2fdec52ec000cd75e549b
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 9b98f1b..551f188 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -141,6 +141,14 @@
flags |= private_handle_t::PRIV_FLAGS_HW_TEXTURE;
}
+ if (usage & GRALLOC_USAGE_HW_RENDER) {
+ flags |= private_handle_t::PRIV_FLAGS_HW_RENDER;
+ }
+
+ if (usage & GRALLOC_USAGE_HW_FB) {
+ flags |= private_handle_t::PRIV_FLAGS_HW_FB;
+ }
+
if(usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) {
flags |= private_handle_t::PRIV_FLAGS_SECURE_DISPLAY;
}