hwc: Refactor of allowing virtual displays to HWC

  1. Since SF doesnt invoke blank for virtual display,
     handle pipe clean up as part of Primary display
     blank.
  2. Support virtual display to query display attributes.

This refactor is done to address Framework reboot issue.

Change-Id: I266a87228193fd85252a22242b66dd4af5f3033f
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 4146787..cf359ee 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -35,10 +35,6 @@
 #define UNLIKELY( exp )     (__builtin_expect( (exp) != 0, false ))
 #define MAX_NUM_APP_LAYERS 32
 
-// For support of virtual displays
-#define HWC_DISPLAY_VIRTUAL     (HWC_DISPLAY_EXTERNAL+1)
-#define MAX_DISPLAYS            (HWC_NUM_DISPLAY_TYPES+1)
-
 //Fwrd decls
 struct hwc_context_t;
 
@@ -305,7 +301,7 @@
     const hwc_procs_t* proc;
 
     //CopyBit objects
-    qhwc::CopyBit *mCopyBit[MAX_DISPLAYS];
+    qhwc::CopyBit *mCopyBit[HWC_NUM_DISPLAY_TYPES];
 
     //Overlay object - NULL for non overlay devices
     overlay::Overlay *mOverlay;
@@ -313,16 +309,16 @@
     overlay::RotMgr *mRotMgr;
 
     //Primary and external FB updater
-    qhwc::IFBUpdate *mFBUpdate[MAX_DISPLAYS];
+    qhwc::IFBUpdate *mFBUpdate[HWC_NUM_DISPLAY_TYPES];
     // External display related information
     qhwc::ExternalDisplay *mExtDisplay;
     qhwc::MDPInfo mMDP;
     qhwc::VsyncState vstate;
-    qhwc::DisplayAttributes dpyAttr[MAX_DISPLAYS];
-    qhwc::ListStats listStats[MAX_DISPLAYS];
-    qhwc::LayerProp *layerProp[MAX_DISPLAYS];
-    qhwc::MDPComp *mMDPComp[MAX_DISPLAYS];
-    qhwc::HwcDebug *mHwcDebug[MAX_DISPLAYS];
+    qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES];
+    qhwc::ListStats listStats[HWC_NUM_DISPLAY_TYPES];
+    qhwc::LayerProp *layerProp[HWC_NUM_DISPLAY_TYPES];
+    qhwc::MDPComp *mMDPComp[HWC_NUM_DISPLAY_TYPES];
+    qhwc::HwcDebug *mHwcDebug[HWC_NUM_DISPLAY_TYPES];
 
     // No animation on External display feature
     // Notifies hwcomposer about the device orientation before animation.
@@ -347,7 +343,7 @@
     int mExtOrientation;
     //Flags the transition of a video session
     bool mVideoTransFlag;
-    qhwc::LayerRotMap *mLayerRotMap[MAX_DISPLAYS];
+    qhwc::LayerRotMap *mLayerRotMap[HWC_NUM_DISPLAY_TYPES];
 };
 
 namespace qhwc {