Merge "Add tools specific annotations to the API."
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
index dccc164..a281377 100644
--- a/include/gui/DisplayEventReceiver.h
+++ b/include/gui/DisplayEventReceiver.h
@@ -63,7 +63,9 @@
public:
/*
* DisplayEventReceiver creates and registers an event connection with
- * SurfaceFlinger. Events start being delivered immediately.
+ * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate
+ * or requestNextVsync to receive them.
+ * Other events start being delivered immediately.
*/
DisplayEventReceiver();
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 732af53..fc211e5 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -36,7 +36,6 @@
endif
ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY -DNEVER_DEFAULT_TO_ASYNC_MODE
- LOCAL_CFLAGS += -DREFRESH_RATE=56
endif
LOCAL_SHARED_LIBRARIES := \
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 92d4266..af0da0b 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -151,9 +151,9 @@
mLastVSyncTimestamp = timestamp;
// now see if we still need to report this VSYNC event
- bool reportVsync = false;
- size_t count = mDisplayEventConnections.size();
+ const size_t count = mDisplayEventConnections.size();
for (size_t i=0 ; i<count ; i++) {
+ bool reportVsync = false;
const ConnectionInfo& info(
mDisplayEventConnections.valueAt(i));
if (info.count >= 1) {
@@ -174,11 +174,7 @@
displayEventConnections.add(mDisplayEventConnections.keyAt(i));
}
}
-
- if (reportVsync) {
- break;
- }
- } while (true);
+ } while (!displayEventConnections.size());
// dispatch vsync events to listeners...
vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC;
diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp
index 4f79080..b0d54c4 100644
--- a/services/surfaceflinger/tests/vsync/vsync.cpp
+++ b/services/surfaceflinger/tests/vsync/vsync.cpp
@@ -55,6 +55,8 @@
loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
&myDisplayEvent);
+ myDisplayEvent.setVsyncRate(1);
+
do {
//printf("about to poll...\n");
int32_t ret = loop->pollOnce(-1);