summaryrefslogtreecommitdiff
path: root/services/input/EventHub.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-03-22 17:21:17 -0700
committer Jeff Brown <jeffbrown@google.com> 2012-01-19 14:16:09 -0800
commit214f459b2c35ac0d95ad8ae9e2a68b94807ceba0 (patch)
treec9070f7a5d0e8acf07c7a8603cb253edf4d0aabe /services/input/EventHub.cpp
parent4130554b452a8462a83f97051240f1aec8590650 (diff)
Remove no longer needed EventHub usleep() optimization.
This optimization is no longer needed now that the kernel evdev driver's poll() implementation only wakes up the poll after the final sync. Change-Id: If237776861df9cfac3086e744d3bbf3484d4c53b
Diffstat (limited to 'services/input/EventHub.cpp')
-rw-r--r--services/input/EventHub.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 990892384181..1f8cf630bc88 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -156,8 +156,6 @@ EventHub::EventHub(void) :
mPendingEventCount(0), mPendingEventIndex(0), mPendingINotify(false) {
acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID);
- mNumCpus = sysconf(_SC_NPROCESSORS_ONLN);
-
mEpollFd = epoll_create(EPOLL_SIZE_HINT);
LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance. errno=%d", errno);
@@ -775,19 +773,6 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz
} else {
// Some events occurred.
mPendingEventCount = size_t(pollResult);
-
- // On an SMP system, it is possible for the framework to read input events
- // faster than the kernel input device driver can produce a complete packet.
- // Because poll() wakes up as soon as the first input event becomes available,
- // the framework will often end up reading one event at a time until the
- // packet is complete. Instead of one call to read() returning 71 events,
- // it could take 71 calls to read() each returning 1 event.
- //
- // Sleep for a short period of time after waking up from the poll() to give
- // the kernel time to finish writing the entire packet of input events.
- if (mNumCpus > 1) {
- usleep(250);
- }
}
}