hwc: enable vsync for external display

- wait for hdmi vsync when connected to hdmi
- add commit to call PANDISPLAY for updating ext display
- add functions to close fb and reset info

Change-Id: I49afbeb85935b111055a872b29a1f65d87ab72c9
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
diff --git a/libhwcomposer/hwc_external.h b/libhwcomposer/hwc_external.h
index 9e5f455..55773c0 100644
--- a/libhwcomposer/hwc_external.h
+++ b/libhwcomposer/hwc_external.h
@@ -21,6 +21,8 @@
 #ifndef HWC_EXTERNAL_DISPLAY_H
 #define HWC_EXTERNAL_DISPLAY_H
 
+#include <fb_priv.h>
+
 struct hwc_context_t;
 
 namespace qhwc {
@@ -43,26 +45,31 @@
     ExternalDisplay(hwc_context_t* ctx);
     ~ExternalDisplay();
     int getExternalDisplay() const;
-    void setExternalDisplayStatus(int connected);
+    void setExternalDisplay(int connected);
+    bool commit();
+    int enableHDMIVsync(int enable);
 
     private:
     bool readResolution();
-    int parseResolution(char* edidStr, int* edidModes, int len);
+    int parseResolution(char* edidStr, int* edidModes);
     void setResolution(int ID);
     bool openFramebuffer();
+    bool closeFrameBuffer();
     bool writeHPDOption(int userOption) const;
     bool isValidMode(int ID);
     void handleUEvent(char* str, int len);
     int getModeOrder(int mode);
     int getBestMode();
+    void resetInfo();
 
-    int fd;
+    int mFd;
     int mExternalDisplay;
-    int mCurrentID;
+    int mCurrentMode;
     char mEDIDs[128];
     int mEDIDModes[64];
     int mModeCount;
     hwc_context_t *mHwcContext;
+    fb_var_screeninfo mVInfo;
 };
 
 }; //qhwc