split HWComposer out of DisplayHardware

we will only ever have a single instance of HWComposer, so
it's now an attribute of SurfaceFlinger, instead of being part
of DisplayHardware.

DisplayHardware now just represents a "display" (it should be renamed).

Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
diff --git a/services/surfaceflinger/DisplayHardware.h b/services/surfaceflinger/DisplayHardware.h
index a1a4764..88a8c0d 100644
--- a/services/surfaceflinger/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware.h
@@ -27,30 +27,24 @@
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 
+#include <utils/Mutex.h>
+#include <utils/Timers.h>
+
 #include "Transform.h"
 
 #include "DisplayHardware/DisplayHardwareBase.h"
-#include "DisplayHardware/HWComposer.h"
-#include "DisplayHardware/PowerHAL.h"
 
 namespace android {
 
 class FramebufferSurface;
+class LayerBase;
+class SurfaceFlinger;
 class SurfaceTextureClient;
 
-class DisplayHardware :
-    public DisplayHardwareBase,
-    public HWComposer::EventHandler
+class DisplayHardware : public DisplayHardwareBase
 {
 public:
 
-    class VSyncHandler : virtual public RefBase {
-        friend class DisplayHardware;
-        virtual void onVSyncReceived(int dpy, nsecs_t timestamp) = 0;
-    protected:
-        virtual ~VSyncHandler() {}
-    };
-
     enum {
         PARTIAL_UPDATES             = 0x00020000,   // video driver feature
         SWAP_RECTANGLE              = 0x00080000,
@@ -64,13 +58,12 @@
 
     virtual ~DisplayHardware();
 
-    void releaseScreen() const;
-    void acquireScreen() const;
-
     // Flip the front and back buffers if the back buffer is "dirty".  Might
     // be instantaneous, might involve copying the frame buffer around.
     void flip(const Region& dirty) const;
 
+    void onVSyncReceived(nsecs_t timestamp);
+
     float       getDpiX() const;
     float       getDpiY() const;
     float       getRefreshRate() const;
@@ -92,23 +85,11 @@
     int                     getOrientation() const { return mOrientation; }
     const Transform&        getTransform() const { return mGlobalTransform; }
 
-    void setVSyncHandler(const sp<VSyncHandler>& handler);
-
-    enum {
-        EVENT_VSYNC = HWC_EVENT_VSYNC
-    };
-
-    void eventControl(int event, int enabled);
-
-
     uint32_t getPageFlipCount() const;
     EGLDisplay getEGLDisplay() const { return mDisplay; }
 
     void dump(String8& res) const;
 
-    // Hardware Composer
-    HWComposer& getHwComposer() const;
-    
     status_t compositionComplete() const;
     
     Rect getBounds() const {
@@ -119,15 +100,11 @@
 private:
     void init(EGLConfig config);
 
-    virtual void onVSyncReceived(int dpy, nsecs_t timestamp);
-
     /*
      *  Constants, set during initialization
      */
     sp<SurfaceFlinger> mFlinger;
     int mDisplayId;
-    HWComposer* mHwc;
-    PowerHAL mPowerHAL;
     // ANativeWindow this display is rendering into
     sp<SurfaceTextureClient> mNativeWindow;
     // set if mNativeWindow is a FramebufferSurface
@@ -148,8 +125,6 @@
     mutable uint32_t mPageFlipCount;
 
     nsecs_t         mRefreshPeriod;
-    mutable nsecs_t mLastHwVSync;
-
 
     /*
      * Can only accessed from the main thread, these members
@@ -171,7 +146,7 @@
      *  protected by mLock
      */
     mutable Mutex mLock;
-    wp<VSyncHandler>    mVSyncHandler;
+    mutable nsecs_t mLastHwVSync;
 };
 
 }; // namespace android