hwc: 8994: Disable BWC when HDMI intf is active

Due to h/w limitations hwc cannot use bwc when video-mode panels are
active in system. Disable bwc when HDMI intf is active.

For video-mode primary the driver disables the feature via
capabilities node.

Change-Id: I5b101dffe443a8ca2a508c6ca1b0966006bbe284
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 34132eb..82c1f37 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -2707,6 +2707,12 @@
 // Handles online events when HDMI is the primary display. In particular,
 // online events for hdmi connected before AND after boot up and HWC init.
 void handle_online(hwc_context_t* ctx, int dpy) {
+    //On 8994 due to hardware limitations, we disable bwc completely when HDMI
+    //intf is active
+    if(qdutils::MDPVersion::getInstance().is8994() and
+            qdutils::MDPVersion::getInstance().supportsBWC()) {
+        ctx->mBWCEnabled = false;
+    }
     // Close the current fd if it was opened earlier on when HWC
     // was initialized.
     if (ctx->dpyAttr[dpy].fd >= 0) {
@@ -2737,6 +2743,12 @@
     resetDisplayInfo(ctx, dpy);
     ctx->dpyAttr[dpy].connected = false;
     ctx->dpyAttr[dpy].isActive = false;
+    //On 8994 due to hardware limitations, we enable bwc only when HDMI
+    //intf is inactive
+    if(qdutils::MDPVersion::getInstance().is8994() and
+            qdutils::MDPVersion::getInstance().supportsBWC()) {
+        ctx->mBWCEnabled = true;
+    }
 }
 
 };//namespace qhwc