This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 407c969f354f0d0234750ec1d6ac07b1a3de7140 (commit) from 0d4b41e7f7e0e3df0c3c05e5bdb4ef4aa7f1a678 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/407c969f354f0d0234750ec1d6ac07b1a3de7...
commit 407c969f354f0d0234750ec1d6ac07b1a3de7140 Author: Cyril Hrubis metan@ucw.cz Date: Thu Dec 12 22:04:42 2013 +0100
input: TimeStamp: Fallback to CLOCK_MONOTOMIC if available
On some machines no clock is precise enough to have 1ms resolution (notably small ARM machines). This commit makes the TimeStamp to fallback to CLOCK_MONOTONIC to have at least some timestamps.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/input/GP_TimeStamp.c b/libs/input/GP_TimeStamp.c index c22b478..4c33b5e 100644 --- a/libs/input/GP_TimeStamp.c +++ b/libs/input/GP_TimeStamp.c @@ -57,6 +57,7 @@ static int choose_clock(clockid_t *clock)
if (clock_getres(CLOCK_MONOTONIC, &ts)) { GP_DEBUG(1, "CLOCK_MONOTONIC: %s", strerror(errno)); + //TODO: Fallback to gettimeofday? return 1; }
@@ -68,8 +69,15 @@ static int choose_clock(clockid_t *clock) return 0; }
- GP_DEBUG(1, "No suitable clock id found."); - //TODO: Fallback to gettimeofday? + if (ts.tv_sec) { + GP_FATAL("No suitable clock found"); + return 1; + } + + GP_WARN("Timers running with %lims granularityn", + ts.tv_nsec/MS_IN_US); + + *clock = CLOCK_MONOTONIC;
return 1; }
-----------------------------------------------------------------------
Summary of changes: libs/input/GP_TimeStamp.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.