libgralloc: disable UBWC for video encoder usecase
check for target specific system property "video.disable.ubwc"
to disable UBWC for the targets where encoder doesn't
support UBWC color-format.
Change-Id: Ifd050c3b44768870fc74a16e941e8286e3ea0c13
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 7411c38..430d7fd 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -413,6 +413,10 @@
IonController::IonController()
{
allocateIonMem();
+
+ char property[PROPERTY_VALUE_MAX];
+ property_get("video.disable.ubwc", property, "0");
+ mDisableUBWCForEncode = atoi(property);
}
void IonController::allocateIonMem()
@@ -906,6 +910,11 @@
if (isUBwcFormat(format))
return true;
+ if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) &&
+ gralloc::IAllocController::getInstance()->isDisableUBWCForEncoder()) {
+ return false;
+ }
+
// Allow UBWC, if an OpenGL client sets UBWC usage flag and GPU plus MDP
// support the format. OR if a non-OpenGL client like Rotator, sets UBWC
// usage flag and MDP supports the format.