summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2013-11-04 22:47:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-11-04 22:47:31 +0000
commitee874caa81ad48d6d0ee34509d3050ca9c046676 (patch)
tree5a71c3c5dafcf88f8383d266c3e78761d3b3825d
parent40da5283ebc6b5cf1e3820740dc274c47cc55f6d (diff)
parent41c3c496ff507554da1c6099c600809608bdbb81 (diff)
downloadnative-ee874caa81ad48d6d0ee34509d3050ca9c046676.tar.gz
Merge "DispSync: remove delay when enabling vsync events" into klp-dev
-rw-r--r--services/surfaceflinger/DispSync.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp
index 167c6f04be..ce07ab56c1 100644
--- a/services/surfaceflinger/DispSync.cpp
+++ b/services/surfaceflinger/DispSync.cpp
@@ -164,7 +164,14 @@ public:
EventListener listener;
listener.mPhase = phase;
listener.mCallback = callback;
- listener.mLastEventTime = systemTime(SYSTEM_TIME_MONOTONIC);
+
+ // We want to allow the firstmost future event to fire without
+ // allowing any past events to fire. Because
+ // computeListenerNextEventTimeLocked filters out events within a half
+ // a period of the last event time, we need to initialize the last
+ // event time to a half a period in the past.
+ listener.mLastEventTime = systemTime(SYSTEM_TIME_MONOTONIC) - mPeriod / 2;
+
mEventListeners.push(listener);
mCond.signal();