hwc: Clean up ExternalDisplay class

1. Remove hwc_context_t from libexternal since this is a construct
   that should only be used in libhwcomposer.
2. Clean up redundant code by creating utility functions to
   a. open a sysfs node in a given mode
   b. improving EDID mode storage/manipulation
   c. creating/destroying composition objects
3. Add utility functions to
   a. get the connected state of the external display
   b. determine which interface the external display is connected to
      (primary or external)
   c. activate the hdmi interface by setting the resolution via an
      ioctl
   d. update/reset external display information when a device
      connected/disconnected

Change-Id: Iba34c9e43b39ccb9c9436deb726587bd1b26b779
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index f7885b8..041ca74 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -284,6 +284,10 @@
 bool isAbcInUse(hwc_context_t *ctx);
 
 void dumpBuffer(private_handle_t *ohnd, char *bufferName);
+void updateDisplayInfo(hwc_context_t* ctx, int dpy);
+void resetDisplayInfo(hwc_context_t* ctx, int dpy);
+void initCompositionResources(hwc_context_t* ctx, int dpy);
+void destroyCompositionResources(hwc_context_t* ctx, int dpy);
 
 //Helper function to dump logs
 void dumpsys_log(android::String8& buf, const char* fmt, ...);
@@ -584,9 +588,6 @@
     bool mPanelResetStatus;
     // number of active Displays
     int numActiveDisplays;
-    // Downscale feature switch, set via system property
-    // sys.hwc.mdp_downscale_enabled
-    bool mMDPDownscaleEnabled;
     struct gpu_hint_info mGPUHintInfo;
     //App Buffer Composition
     bool enableABC;