[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force X.Org X11 SVN commit: r4143 - in trunk/xserver/xorg-server/debian: . patches



Author: dnusinow
Date: 2006-12-12 21:06:43 -0500 (Tue, 12 Dec 2006)
New Revision: 4143

Added:
   trunk/xserver/xorg-server/debian/patches/38_wait_for_something_force_timer_reset.diff
Modified:
   trunk/xserver/xorg-server/debian/changelog
   trunk/xserver/xorg-server/debian/patches/series
Log:
* Add 38_wait_for_something_force_timer_reset.diff which forces the server
  to reset timers when they've overrun in some cases rather than wait
  forever. Patch by Daniel Stone. Thanks Michel D?\195?\164nzer for pointing the
  changes out. Closes: #374026

Modified: trunk/xserver/xorg-server/debian/changelog
===================================================================
--- trunk/xserver/xorg-server/debian/changelog	2006-12-12 23:59:39 UTC (rev 4142)
+++ trunk/xserver/xorg-server/debian/changelog	2006-12-13 02:06:43 UTC (rev 4143)
@@ -7,8 +7,12 @@
   [ David Nusinow ]
   * Pull fix for the ignore_abi.diff patch. This one's a major brown bag on my
     part. Thanks Michel Dänzer.
+  * Add 38_wait_for_something_force_timer_reset.diff which forces the server
+    to reset timers when they've overrun in some cases rather than wait
+    forever. Patch by Daniel Stone. Thanks Michel Dänzer for pointing the
+    changes out. Closes: #374026
 
- -- David Nusinow <dnusinow@debian.org>  Tue, 12 Dec 2006 18:58:06 -0500
+ -- David Nusinow <dnusinow@debian.org>  Tue, 12 Dec 2006 20:36:33 -0500
 
 xorg-server (2:1.1.1-11) unstable; urgency=low
 

Added: trunk/xserver/xorg-server/debian/patches/38_wait_for_something_force_timer_reset.diff
===================================================================
--- trunk/xserver/xorg-server/debian/patches/38_wait_for_something_force_timer_reset.diff	                        (rev 0)
+++ trunk/xserver/xorg-server/debian/patches/38_wait_for_something_force_timer_reset.diff	2006-12-13 02:06:43 UTC (rev 4143)
@@ -0,0 +1,81 @@
+From upstream commits 8d3b465eb3d6c93cbbcebe8e5c9298caaaeb650b and
+bb7a39ac13731a80fc2d80487f9da760dd34c3ba
+Patch by Daniel Stone.
+
+Index: xorg-server/os/WaitFor.c
+===================================================================
+--- xorg-server.orig/os/WaitFor.c	2006-09-18 17:25:50.000000000 -0400
++++ xorg-server/os/WaitFor.c	2006-12-12 20:35:45.000000000 -0500
+@@ -128,11 +128,13 @@
+ struct _OsTimerRec {
+     OsTimerPtr		next;
+     CARD32		expires;
++    CARD32              delta;
+     OsTimerCallback	callback;
+     pointer		arg;
+ };
+ 
+ static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
++static void CheckAllTimers(CARD32 now);
+ static OsTimerPtr timers = NULL;
+ 
+ /*****************
+@@ -209,6 +211,12 @@
+         {
+             now = GetTimeInMillis();
+ 	    timeout = timers->expires - now;
++            if (timeout > 0 && timeout > timers->delta + 250) {
++                /* time has rewound.  reset the timers. */
++                CheckAllTimers(now);
++                timeout = timers->expires - now;
++            }
++
+             if (timeout < 0)
+                 timeout = 0;
+ 	    waittime.tv_sec = timeout / MILLI_PER_SECOND;
+@@ -447,6 +455,21 @@
+ }
+ #endif
+ 
++/* If time has rewound, re-run every affected timer.
++ * Timers might drop out of the list, so we have to restart every time. */
++static void
++CheckAllTimers(CARD32 now)
++{
++    OsTimerPtr timer;
++
++start:
++    for (timer = timers; timer; timer = timer->next) {
++        if (timer->expires - now > timer->delta + 250) {
++            TimerForce(timer);
++            goto start;
++        }
++    }
++}
+ 
+ static void
+ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
+@@ -488,8 +511,13 @@
+     }
+     if (!millis)
+ 	return timer;
+-    if (!(flags & TimerAbsolute))
++    if (flags & TimerAbsolute) {
++        timer->delta = millis - now;
++    }
++    else {
++        timer->delta = millis;
+ 	millis += now;
++    }
+     timer->expires = millis;
+     timer->callback = func;
+     timer->arg = arg;
+@@ -503,7 +531,7 @@
+     for (prev = &timers;
+ 	 *prev && (int) ((*prev)->expires - millis) <= 0;
+ 	 prev = &(*prev)->next)
+-	;
++        ;
+     timer->next = *prev;
+     *prev = timer;
+     return timer;

Modified: trunk/xserver/xorg-server/debian/patches/series
===================================================================
--- trunk/xserver/xorg-server/debian/patches/series	2006-12-12 23:59:39 UTC (rev 4142)
+++ trunk/xserver/xorg-server/debian/patches/series	2006-12-13 02:06:43 UTC (rev 4143)
@@ -33,3 +33,4 @@
 35_randr_byteswap.patch
 36_fix_ffs.patch
 37_Fix-__glXDRIbindTexImage-for-32-bpp-on-big-endian-platforms.diff
+38_wait_for_something_force_timer_reset.diff



Reply to: