display: External display refactor

- cleans up external library
- add separate library for virtual display
- process virtual updates in its separate path
  in hwc.
- Acquire blank mutex lock for one complete drawing
  cycle

Change-Id: Ib984c578464a131ecdb27ee48960f58d68b7a5a7
diff --git a/liboverlay/pipes/overlayGenPipe.cpp b/liboverlay/pipes/overlayGenPipe.cpp
index 0de7129..35f686c 100644
--- a/liboverlay/pipes/overlayGenPipe.cpp
+++ b/liboverlay/pipes/overlayGenPipe.cpp
@@ -47,13 +47,10 @@
     ALOGE_IF(DEBUG_OVERLAY, "GenericPipe init");
     mRotDownscaleOpt = false;
 
-    int fbNum = 0;
-    //TODO Remove the if block. What's in else block should be the standard way
-    //EXTERNAL's meaning has been overloaded in hwc to mean WFD also!
-    if(mDpy == Overlay::DPY_EXTERNAL) {
-        fbNum = Overlay::getInstance()->getExtFbNum();
-    } else if(mDpy == Overlay::DPY_WRITEBACK) {
-        fbNum = Overlay::getFbForDpy(mDpy);
+    int fbNum = Overlay::getFbForDpy(mDpy);
+    if( fbNum < 0 ) {
+        ALOGE("%s: Invalid FB for the display: %d",__FUNCTION__, mDpy);
+        return false;
     }
 
     ALOGD_IF(DEBUG_OVERLAY,"%s: mFbNum:%d",__FUNCTION__, fbNum);