From f12a9ed870017f35cf6d2a82b1405e843aae42ac Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Oct 2013 15:24:11 +1000 Subject: [PATCH 1/3] configure: remove a comment 94ed0ba1b5043ad9fc33b42756af447d5ab15bbd moved backtracing into the DIX, so this comment is outdated. since no-one noticed and it's easier to just grep than update file references, remove the comment. Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e7385f89c6..75ec70bb30 100644 --- a/configure.ac +++ b/configure.ac @@ -300,7 +300,7 @@ AC_CHECK_HEADER([machine/apmvar.h],[ AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) -dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c) +dnl glibc backtrace support check AC_CHECK_HEADER([execinfo.h],[ AC_CHECK_LIB(c, backtrace, [ AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) From e8961b718d82f1c081ec110d8d962f64e8406b82 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 22 Oct 2013 14:24:52 +1000 Subject: [PATCH 2/3] os: use a constant for backtrace array size Signed-off-by: Peter Hutterer Reviewed-by: Jasper St. Pierre --- os/backtrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 426f9b15b0..3d1195b86c 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -114,14 +114,15 @@ xorg_backtrace(void) void xorg_backtrace(void) { - void *array[64]; + const int BT_SIZE = 64; + void *array[BT_SIZE]; const char *mod; int size, i; Dl_info info; ErrorFSigSafe("\n"); ErrorFSigSafe("Backtrace:\n"); - size = backtrace(array, 64); + size = backtrace(array, BT_SIZE); for (i = 0; i < size; i++) { int rc = dladdr(array[i], &info); From f36f5a65f639b6524191d888d5bf89e73027156c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 30 Oct 2013 15:40:58 +1000 Subject: [PATCH 3/3] sync: fix corner-case in triggering idle alarms ProcessInputEvent() resets the device idle times. If idle time was higher than the lower bracket, this should trigger an event in the idle time wakeup handler. If processing is slow, the idle time may advance past the lower bracket between the reset and the time the BlockHandler is called. In that case, we'd never schedule a wakeup to handle the event, causing us to randomly miss events. Ran tests with a neg transition trigger on 5ms with 200 repeats of the test and it succeeded. Anything below that gets a bit tricky to make sure the server sees the same idle time as the client usleeps for. Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard --- Xext/sync.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Xext/sync.c b/Xext/sync.c index b2ee92e377..53f769d341 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2654,7 +2654,16 @@ IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMa IdleTimeQueryValue(counter, &idle); counter->value = idle; /* push, so CheckTrigger works */ - if (less && XSyncValueLessOrEqual(idle, *less)) { + /** + * There's an indefinite amount of time between ProcessInputEvents() + * where the idle time is reset and the time we actually get here. idle + * may be past the lower bracket if we dawdled with the events, so + * check for whether we did reset and bomb out of select immediately. + */ + if (less && XSyncValueGreaterThan(idle, *less) && + LastEventTimeWasReset(priv->deviceid)) { + AdjustWaitForDelay(wt, 0); + } else if (less && XSyncValueLessOrEqual(idle, *less)) { /* * We've been idle for less than the threshold value, and someone * wants to know about that, but now we need to know whether they