xserver: Branch 'master'

Peter Hutterer whot at kemper.freedesktop.org
Sun Jul 13 20:22:03 PDT 2008


 hw/xfree86/common/xf86Helper.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 11ee0ae9390a608a232ff94abcc0cbcf9ed7b70a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 14 10:20:11 2008 +0930

    xfree86: append, not prepent, new input devices to xf86InputDevs.
    
    If devices are prepended to the list, their wake-up order on resume is not the
    same as the original initialisation order. Hot-plugged devices, originally
    inited last, are re-enabled before the xorg.conf devices and in some cases may
    steal the device files. Result: we have different devices before and after
    suspend/resume.
    
    RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386>

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index d58ce93..41181b0 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -308,12 +308,11 @@ xf86AllocateScrnInfoPrivateIndex(void)
     return idx;
 }
 
-/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
-
+/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
 _X_EXPORT InputInfoPtr
 xf86AllocateInput(InputDriverPtr drv, int flags)
 {
-    InputInfoPtr new;
+    InputInfoPtr new, *prev = NULL;
 
     if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
 	return NULL;
@@ -321,8 +320,13 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
     new->drv = drv;
     drv->refCount++;
     new->module = DuplicateModule(drv->module, NULL);
-    new->next = xf86InputDevs;
-    xf86InputDevs = new;
+
+    for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
+        ;
+
+    *prev = new;
+    new->next = NULL;
+
     return new;
 }
 


More information about the xorg-commit mailing list