gralloc: Allow UBWC for explicitly defined UBWC HAL pixel format
1. Allow UBWC allocation, if client is using an explicitly defined
UBWC HAL pixel format OR if client sets UBWC gralloc usage flag and
GPU supports the format.
2. EGL wants gralloc to set PRIV_FLAGS_UBWC_ALIGNED bit in private
handle flags, only if GPU supports UBWC for that format.
Change-Id: I4194a046217cbc4c0a8ac2b2fb4b73ebd5076fc2
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 9ab9d09..48da09e 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -149,7 +149,8 @@
flags |= private_handle_t::PRIV_FLAGS_TILE_RENDERED;
}
- if (isUBwcEnabled(format, usage)) {
+ if (AdrenoMemInfo::getInstance().isUBWCSupportedByGPU(format) &&
+ isUBwcEnabled(format, usage)) {
flags |= private_handle_t::PRIV_FLAGS_UBWC_ALIGNED;
}