summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayHardware
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.cpp34
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.h12
2 files changed, 1 insertions, 45 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 3bbc75e..f94d321 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -140,7 +140,6 @@ void DisplayHardware::init(uint32_t dpy)
mDpiX = mNativeWindow->xdpi;
mDpiY = mNativeWindow->ydpi;
mRefreshRate = fbDev->fps;
- mNextFakeVSync = 0;
/* FIXME: this is a temporary HACK until we are able to report the refresh rate
@@ -153,8 +152,6 @@ void DisplayHardware::init(uint32_t dpy)
#warning "refresh rate set via makefile to REFRESH_RATE"
#endif
- mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
-
EGLint w, h, dummy;
EGLint numConfigs=0;
EGLSurface surface;
@@ -349,37 +346,6 @@ uint32_t DisplayHardware::getPageFlipCount() const {
return mPageFlipCount;
}
-// this needs to be thread safe
-nsecs_t DisplayHardware::waitForVSync() const {
- nsecs_t timestamp;
- if (mVSync.wait(&timestamp) < 0) {
- // vsync not supported!
- usleep( getDelayToNextVSyncUs(&timestamp) );
- }
- return timestamp;
-}
-
-int32_t DisplayHardware::getDelayToNextVSyncUs(nsecs_t* timestamp) const {
- Mutex::Autolock _l(mFakeVSyncMutex);
- const nsecs_t period = mRefreshPeriod;
- const nsecs_t now = systemTime(CLOCK_MONOTONIC);
- nsecs_t next_vsync = mNextFakeVSync;
- nsecs_t sleep = next_vsync - now;
- if (sleep < 0) {
- // we missed, find where the next vsync should be
- sleep = (period - ((now - next_vsync) % period));
- next_vsync = now + sleep;
- }
- mNextFakeVSync = next_vsync + period;
- timestamp[0] = next_vsync;
-
- // round to next microsecond
- int32_t sleep_us = (sleep + 999LL) / 1000LL;
-
- // guaranteed to be > 0
- return sleep_us;
-}
-
status_t DisplayHardware::compositionComplete() const {
return mNativeWindow->compositionComplete();
}
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index 45d4b45..f02c954 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -32,7 +32,6 @@
#include "GLExtensions.h"
#include "DisplayHardware/DisplayHardwareBase.h"
-#include "DisplayHardware/VSyncBarrier.h"
namespace android {
@@ -75,9 +74,6 @@ public:
uint32_t getMaxTextureSize() const;
uint32_t getMaxViewportDims() const;
- // waits for the next vsync and returns the timestamp of when it happened
- nsecs_t waitForVSync() const;
-
uint32_t getPageFlipCount() const;
EGLDisplay getEGLDisplay() const { return mDisplay; }
@@ -99,7 +95,6 @@ public:
private:
void init(uint32_t displayIndex) __attribute__((noinline));
void fini() __attribute__((noinline));
- int32_t getDelayToNextVSyncUs(nsecs_t* timestamp) const;
sp<SurfaceFlinger> mFlinger;
EGLDisplay mDisplay;
@@ -117,12 +112,7 @@ private:
mutable uint32_t mPageFlipCount;
GLint mMaxViewportDims[2];
GLint mMaxTextureSize;
- VSyncBarrier mVSync;
-
- mutable Mutex mFakeVSyncMutex;
- mutable nsecs_t mNextFakeVSync;
- nsecs_t mRefreshPeriod;
-
+
HWComposer* mHwc;
sp<FramebufferNativeWindow> mNativeWindow;