gralloc: Disable UBWC for writeback buffers

Disables UBWC for buffers with usage HWC and HW_VIDEO_ENCODER to
allow writeback input to be always uncompressed

Bug: 30191188
Change-Id: I62e2609cb71bc5fcd555459beb694de0b1bbb164
CRs-Fixed: 1047578
diff --git a/msm8996/libgralloc/alloc_controller.cpp b/msm8996/libgralloc/alloc_controller.cpp
index e9cdc73..158fb68 100644
--- a/msm8996/libgralloc/alloc_controller.cpp
+++ b/msm8996/libgralloc/alloc_controller.cpp
@@ -958,6 +958,11 @@
             return false;
     }
 
+    // Workaround for bug 30191188/ CR 1047578
+    if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) && (usage & GRALLOC_USAGE_HW_COMPOSER)) {
+        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.