summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayHardware/DisplayHardware.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/DisplayHardware/DisplayHardware.h')
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index f02c954..02be4dc 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -32,6 +32,7 @@
#include "GLExtensions.h"
#include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/VSyncBarrier.h"
namespace android {
@@ -74,6 +75,11 @@ public:
uint32_t getMaxTextureSize() const;
uint32_t getMaxViewportDims() const;
+ // waits for the next vsync and returns the timestamp of when it happened
+ nsecs_t waitForRefresh() const;
+ nsecs_t getRefreshPeriod() const;
+ nsecs_t getRefreshTimestamp() const;
+
uint32_t getPageFlipCount() const;
EGLDisplay getEGLDisplay() const { return mDisplay; }
@@ -89,12 +95,10 @@ public:
}
inline Rect bounds() const { return getBounds(); }
- // only for debugging
- int getCurrentBufferIndex() const;
-
private:
void init(uint32_t displayIndex) __attribute__((noinline));
void fini() __attribute__((noinline));
+ int32_t getDelayToNextVSyncUs(nsecs_t* timestamp) const;
sp<SurfaceFlinger> mFlinger;
EGLDisplay mDisplay;
@@ -112,7 +116,13 @@ private:
mutable uint32_t mPageFlipCount;
GLint mMaxViewportDims[2];
GLint mMaxTextureSize;
-
+ VSyncBarrier mVSync;
+
+ mutable Mutex mFakeVSyncMutex;
+ mutable nsecs_t mNextFakeVSync;
+ nsecs_t mRefreshPeriod;
+ mutable nsecs_t mLastHwVSync;
+
HWComposer* mHwc;
sp<FramebufferNativeWindow> mNativeWindow;