OSDN Git Service

SurfaceFlinger: give SF its own vsync phase
[android-x86/frameworks-native.git] / services / surfaceflinger / SurfaceFlinger.h
index 0e9955c..f08e66a 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "Barrier.h"
 #include "DisplayDevice.h"
+#include "DispSync.h"
 #include "FrameTracker.h"
 #include "MessageQueue.h"
 
@@ -66,6 +67,7 @@ class Layer;
 class LayerDim;
 class Surface;
 class RenderEngine;
+class EventControlThread;
 
 // ---------------------------------------------------------------------------
 
@@ -378,6 +380,12 @@ private:
      * Display management
      */
 
+    /* ------------------------------------------------------------------------
+     * VSync
+     */
+     void enableHardwareVsync();
+     void disableHardwareVsync(bool makeUnavailable);
+     void resyncToHardwareVsync(bool makeAvailable);
 
     /* ------------------------------------------------------------------------
      * Debugging & dumpsys
@@ -420,6 +428,8 @@ private:
     nsecs_t mBootTime;
     bool mGpuToCpuSupported;
     sp<EventThread> mEventThread;
+    sp<EventThread> mSFEventThread;
+    sp<EventControlThread> mEventControlThread;
     EGLContext mEGLContext;
     EGLConfig mEGLConfig;
     EGLDisplay mEGLDisplay;
@@ -451,11 +461,17 @@ private:
     // these are thread safe
     mutable MessageQueue mEventQueue;
     FrameTracker mAnimFrameTracker;
+    DispSync mPrimaryDispSync;
 
     // protected by mDestroyedLayerLock;
     mutable Mutex mDestroyedLayerLock;
     Vector<Layer const *> mDestroyedLayers;
 
+    // protected by mHWVsyncLock
+    Mutex mHWVsyncLock;
+    bool mPrimaryHWVsyncEnabled;
+    bool mHWVsyncAvailable;
+
     /* ------------------------------------------------------------------------
      * Feature prototyping
      */
@@ -464,7 +480,6 @@ private:
     bool mDaltonize;
 };
 
-// ---------------------------------------------------------------------------
 }; // namespace android
 
 #endif // ANDROID_SURFACE_FLINGER_H