OSDN Git Service

STPK-1429 Offload poll mode sensors data acquisition to threads
authorPatrick Porlan <patrick.porlan@intel.com>
Tue, 1 Jul 2014 11:46:23 +0000 (13:46 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Wed, 16 Jul 2014 15:36:31 +0000 (18:36 +0300)
commit74e77ce16dc58791f66e88ff02f37908ff786aaf
treea84de08253a2a52ef21c11d5614286ed50a5c914
parentfb6b3b46c9570770938e2b9567686aa6407f3d50
STPK-1429 Offload poll mode sensors data acquisition to threads

I have seen sysfs reads blocking for 200 ms on the MRD 7 ALS,
with proximity, temperature and combined magnetometer x,y,z
in the 100 ms ballpark. This ended up blocking the main sensor
poll loop for large windows, with the effect that high frequency
sensors events were not delivered for extended amounts of time.

This offloads these sysfs reads to dedicated threads: there is
is one of these per enabled poll-mode sensor, and they communicate
their data through a pollable fd (something we can't have directly
on sysfs files). As a result we get much smoother and timely
event delivery overall, while simplifying the code somewhat: the
poll call can always use an infinite timeout, thereby voiding
the need for a wakeup fd, as well as complex timeout calculations.

Issue: STPK-1429

Change-Id: I4a45ede2369bcca03b9da78e98abb83ff5879c73
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
Android.mk
common.h
control.c
enumeration.c