1
0
xorg-x11-server/b_sync-fix.patch
Egbert Eich 7286d85738 - Dropped:
* N_0001-Check-harder-for-primary-PCI-device.patch
    Whith libpciaccess code path irrelevant for Linux. 
  * N_0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch
    Solved differently upstream
  * N_bug-197858_dpms.diff
    This one is upstream already - apparently nobody check this when
    it no longer applied...
  * N_bug534768-prefer_local_symbols.patch
    Upstream has a better suggestion how to solve this. However this
    patch is no longer needed     
  * N_dpms_screensaver.diff
    This topic was solved slightly differently upstream - still patch
    got ported without checking it's context.
  * N_randr1_1-sig11.diff
    No longer needed. Problem was fixed differently upstream.
  * u_vgaHW-no-legacy.patch
    Problem solved in the nv driver.
- Renamed:
  Those patches will go upstream, thus they are prefixed by a u_:
  * n__confine_to_shape.diff ->  u_confine_to_shape.diff
  * N_fbdevhw.diff -> u_fbdevhw.diff
  * n_x86emu-include-order.patch -> u_x86emu-include-order.patch
  * N_xorg-server-xdmcp.patchA -> u_xorg-server-xdmcp.patch
  Those patches no longer apply but are kept for reference thus prefixed by b_:
  * N_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch ->
    b_0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
  * N_cache-xkbcomp-output-for-fast-start-up.patch ->
    b_cache-xkbcomp-output-for-fast-start-up.patch
  * N_sync-fix.patch -> b_sync-fix.patch

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=478
2013-12-11 15:46:05 +00:00

59 lines
2.2 KiB
Diff

Index: xorg-server-1.12.1/Xext/sync.c
===================================================================
--- xorg-server-1.12.1.orig/Xext/sync.c
+++ xorg-server-1.12.1/Xext/sync.c
@@ -2615,9 +2615,43 @@ static XSyncValue *pIdleTimeValueGreater
static void
IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return)
{
- CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
+ static CARD32 previousLastDeviceEventTimeMilliseconds = 0;
+ CARD32 now = GetTimeInMillis();
+ CARD32 idle = now - lastDeviceEventTime.milliseconds;
+ CARD32 previousIdle = now - previousLastDeviceEventTimeMilliseconds;
+ SyncCounter *pIdleTimeCounter = (SyncCounter*)pCounter;
XSyncIntsToValue(pValue_return, idle, 0);
+ if (pCounter == NULL)
+ {
+ return;
+ }
+ if (previousLastDeviceEventTimeMilliseconds == 0)
+ {
+ /* initialize static var when this function is invoked the first time. */
+ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
+ return;
+ }
+
+ if (previousLastDeviceEventTimeMilliseconds == lastDeviceEventTime.milliseconds)
+ {
+ /* no new user event, no need to change idle counter. */
+ return;
+ }
+ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
+
+ /*
+ * Some user event occured; now update idle counter with previous
+ * event time, so idle counter has the most up-to-date value with
+ * respect to previous user event (we need old and new counter
+ * value to compute if a transition occured). Recompute bracket
+ * values if this is system counter.
+ */
+
+ XSyncIntsToValue (&pIdleTimeCounter->value, previousIdle, 0);
+ if (IsSystemCounter(pIdleTimeCounter)) {
+ SyncComputeBracketValues(pIdleTimeCounter);
+ }
}
static void
@@ -2700,7 +2734,7 @@ IdleTimeWakeupHandler(pointer env, int r
if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
return;
- IdleTimeQueryValue(NULL, &idle);
+ IdleTimeQueryValue(IdleTimeCounter, &idle);
if ((pIdleTimeValueGreater &&
XSyncValueGreaterOrEqual(idle, *pIdleTimeValueGreater)) ||