[Xquartz-changes] xserver: Branch 'master' - 23 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Tue Dec 21 10:49:51 PST 2010


 Xext/sync.c                           |   30 +++
 Xext/xf86bigfont.c                    |    2 
 configure.ac                          |    6 
 dix/dixfonts.c                        |    2 
 dix/getevents.c                       |   60 ++++--
 hw/dmx/Makefile.am                    |    7 
 hw/dmx/doc/Makefile.am                |    2 
 hw/xfree86/common/Makefile.am         |    1 
 hw/xfree86/common/compiler.h          |   13 -
 hw/xfree86/common/scoasm.h            |  142 ----------------
 hw/xfree86/common/xf86.h              |    2 
 hw/xfree86/common/xf86Bus.c           |   35 ----
 hw/xfree86/common/xf86Configure.c     |   21 --
 hw/xfree86/common/xf86Cursor.c        |    6 
 hw/xfree86/common/xf86Events.c        |   13 -
 hw/xfree86/common/xf86Globals.c       |    1 
 hw/xfree86/common/xf86Init.c          |   25 --
 hw/xfree86/common/xf86Option.c        |    2 
 hw/xfree86/common/xf86PM.c            |   23 --
 hw/xfree86/common/xf86Priv.h          |    1 
 hw/xfree86/common/xf86Xinput.c        |   23 +-
 hw/xfree86/common/xf86str.h           |    7 
 hw/xfree86/ddc/ddc.c                  |   11 -
 hw/xfree86/doc/Makefile.am            |    4 
 hw/xfree86/int10/helper_exec.c        |    5 
 hw/xfree86/loader/loader.c            |   20 --
 hw/xfree86/loader/os.c                |    2 
 hw/xfree86/loader/sdksyms.sh          |    6 
 hw/xfree86/modes/xf86EdidModes.c      |    5 
 hw/xfree86/os-support/Makefile.am     |    2 
 hw/xfree86/os-support/sco/Makefile.am |    5 
 hw/xfree86/os-support/sco/VTsw_sco.c  |  127 --------------
 hw/xfree86/os-support/sco/sco_init.c  |  294 ----------------------------------
 hw/xfree86/os-support/sco/sco_iop.c   |   90 ----------
 hw/xfree86/os-support/sco/sco_video.c |  290 ---------------------------------
 hw/xfree86/os-support/xf86_OSlib.h    |   31 ---
 hw/xfree86/parser/Makefile.am         |    2 
 os/access.c                           |   12 -
 os/osinit.c                           |    5 
 os/xprintf.c                          |    2 
 randr/rrscreen.c                      |   12 +
 41 files changed, 148 insertions(+), 1201 deletions(-)

New commits:
commit 56d9c736f0c450bffd43300107689eb6dd1ea70b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 16 14:26:10 2010 -0500

    xfree86: Convert some xf86BlockSIGIO to OsBlockSignals
    
    The DDC1 and int10 code are blocking SIGIO to get some assurance that
    their usleep() calls take as long as they expect.  That's a good start
    but you really want to be blocking more than just SIGIO, SIGALRM too at
    minimum.
    
    At this point, except for SIGIO handler setup itself, BlockSIGIO really
    means "block input events".
    
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c
index 7c7dc9c..179f42c 100644
--- a/hw/xfree86/ddc/ddc.c
+++ b/hw/xfree86/ddc/ddc.c
@@ -235,15 +235,12 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed,
  * @return NULL if no monitor attached or failure to interpret the EDID.
  */
 xf86MonPtr
-xf86DoEDID_DDC1(
-    int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, 
-    unsigned int (*DDC1Read)(ScrnInfoPtr)
-)
+xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, 
+		unsigned int (*DDC1Read)(ScrnInfoPtr))
 {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     unsigned char *EDID_block = NULL;
     xf86MonPtr tmp = NULL;
-    int sigio;
     /* Default DDC and DDC1 to enabled. */
     Bool noddc = FALSE, noddc1 = FALSE;
     OptionInfoPtr options;
@@ -259,9 +256,9 @@ xf86DoEDID_DDC1(
     if (noddc || noddc1)
 	return NULL;
     
-    sigio = xf86BlockSIGIO();
+    OsBlockSignals();
     EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read);
-    xf86UnblockSIGIO(sigio);
+    OsReleaseSignals();
 
     if (EDID_block){
 	tmp = xf86InterpretEDID(scrnIndex,EDID_block);
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 55ab058..b9af473 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -75,13 +75,14 @@ setup_int(xf86Int10InfoPtr pInt)
     if (pInt->Flags & SET_BIOS_SCRATCH)
 	SetResetBIOSVars(pInt, TRUE);
 #endif
-    return xf86BlockSIGIO();
+    OsBlockSignals();
+    return 0;
 }
 
 void
 finish_int(xf86Int10InfoPtr pInt, int sig)
 {
-    xf86UnblockSIGIO(sig);
+    OsReleaseSignals();
     pInt->ax = (CARD32) X86_EAX;
     pInt->bx = (CARD32) X86_EBX;
     pInt->cx = (CARD32) X86_ECX;
commit ce13a1dbbfbeee3a3d51d0385817df50944cfdee
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 16 14:03:13 2010 -0500

    xfree86: Remove xf86EnterServerState
    
    Back when we had RAC this was a vaguely meaningful thing.  Since then
    it's been a glorified (and confusing) wrapper around xf86BlockSIGIO.
    
    Note that the APM and VT switch code are unusual relative to other code
    that cares about SIGIO state.  Most callers push a SIGIO disable to
    create a critical section for the duration of the caller's stack frame,
    but those two effectively disable SIGIO after their return and re-enable
    on their next entry.
    
    Reviewed-by: Tiago Vignatti <tigo.vignatti at nokia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index f7470f2..54332e3 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -135,7 +135,6 @@ extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
 extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
 			EntityProc enter, EntityProc leave, pointer);
 extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
-extern _X_EXPORT void xf86EnterServerState(xf86State state);
 extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
 
 extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 623b130..3b08968 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -497,32 +497,6 @@ xf86AccessLeave(void)
 }
 
 /*
- * xf86EnterServerState() -- set state the server is in.
- */
-
-typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState;
-
-void
-xf86EnterServerState(xf86State state)
-{
-    static int sigio_state;
-    static TriState sigio_blocked = TRI_UNSET;
-
-    /*
-     * This is a good place to block SIGIO during SETUP state. SIGIO should be
-     * blocked in SETUP state otherwise (u)sleep() might get interrupted
-     * early. We take care not to call xf86BlockSIGIO() twice.
-     */
-    if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) {
-        sigio_state = xf86BlockSIGIO();
-	sigio_blocked = TRI_TRUE;
-    } else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) {
-        xf86UnblockSIGIO(sigio_state);
-        sigio_blocked = TRI_FALSE;
-    }
-}
-
-/*
  * xf86PostProbe() -- Allocate all non conflicting resources
  * This function gets called by xf86Init().
  */
@@ -544,13 +518,6 @@ xf86PostProbe(void)
 	    xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
 }
 
-void
-xf86PostScreenInit(void)
-{
-    xf86VGAarbiterWrapFunctions();
-    xf86EnterServerState(OPERATING);
-}
-
 int
 xf86GetLastScrnFlag(int entityIndex)
 {
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 0d27fd5..929f047 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -202,7 +202,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
   ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
   ScreenPtr   pCursorScreen;
   Bool        Switched;
-  int         px, py;
+  int         px, py, was_blocked;
   DeviceIntPtr dev, it;
 
   if (!pScr->vtSema || !mode || !pScr->SwitchMode)
@@ -232,7 +232,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
   if (pScreen == pCursorScreen)
     miPointerGetPosition(dev, &px, &py);
 
-  xf86EnterServerState(SETUP);
+  was_blocked = xf86BlockSIGIO();
   Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0);
   if (Switched) {
     pScr->currentMode = mode;
@@ -269,7 +269,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
       pScr->frameY1 = pScr->virtualY - 1;
     }
   }
-  xf86EnterServerState(OPERATING);
+  xf86UnblockSIGIO(was_blocked);
 
   if (pScr->AdjustFrame)
     (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index fdd908a..84c0d18 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -414,7 +414,8 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
 static void
 xf86VTSwitch(void)
 {
-  int i, prevSIGIO;
+  int i;
+  static int prevSIGIO;
   InputInfoPtr pInfo;
   IHPtr ih;
 
@@ -456,7 +457,8 @@ xf86VTSwitch(void)
           DisableDevice(pInfo->dev, TRUE);
       }
     }
-    xf86EnterServerState(SETUP);
+
+    prevSIGIO = xf86BlockSIGIO();
     for (i = 0; i < xf86NumScreens; i++)
 	xf86Screens[i]->LeaveVT(i, 0);
 
@@ -468,14 +470,11 @@ xf86VTSwitch(void)
        */
 
       DebugF("xf86VTSwitch: Leave failed\n");
-      prevSIGIO = xf86BlockSIGIO();
       xf86AccessEnter();
-      xf86EnterServerState(SETUP);
       for (i = 0; i < xf86NumScreens; i++) {
 	if (!xf86Screens[i]->EnterVT(i, 0))
 	  FatalError("EnterVT failed for screen %d\n", i);
       }
-      xf86EnterServerState(OPERATING);
       if (!(dispatchException & DE_TERMINATE)) {
 	for (i = 0; i < xf86NumScreens; i++) {
 	  if (xf86Screens[i]->EnableDisableFBAccess)
@@ -513,11 +512,9 @@ xf86VTSwitch(void)
 	    xf86DisableIO();
     }
   } else {
-
     DebugF("xf86VTSwitch: Entering\n");
     if (!xf86VTSwitchTo()) return;
 
-    prevSIGIO = xf86BlockSIGIO();
 #ifdef XF86PM
     xf86OSPMClose = xf86OSPMOpen();
 #endif
@@ -525,13 +522,11 @@ xf86VTSwitch(void)
     if (xorgHWAccess)
 	xf86EnableIO();
     xf86AccessEnter();
-    xf86EnterServerState(SETUP);
     for (i = 0; i < xf86NumScreens; i++) {
       xf86Screens[i]->vtSema = TRUE;
       if (!xf86Screens[i]->EnterVT(i, 0))
 	  FatalError("EnterVT failed for screen %d\n", i);
     }
-    xf86EnterServerState(OPERATING);
     for (i = 0; i < xf86NumScreens; i++) {
       if (xf86Screens[i]->EnableDisableFBAccess)
 	(*xf86Screens[i]->EnableDisableFBAccess)(i, TRUE);
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index ca3f281..a1fda54 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -330,7 +330,7 @@ InstallSignalHandlers(void)
 void
 InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 {
-  int                    i, j, k, scr_index;
+  int                    i, j, k, scr_index, was_blocked = 0;
   char                   **modulelist;
   pointer                *optionlist;
   Pix24Flags		 screenpix24, pix24;
@@ -708,7 +708,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
       ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
 #endif
       xf86AccessEnter();
-      xf86EnterServerState(SETUP);
+      was_blocked = xf86BlockSIGIO();
     }
   }
 
@@ -779,7 +779,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 #endif
   }
 
-  xf86PostScreenInit();
+  xf86VGAarbiterWrapFunctions();
+  xf86UnblockSIGIO(was_blocked);
 
   xf86InitOrigins();
 
@@ -928,6 +929,8 @@ AbortDDX(void)
 {
   int i;
 
+  xf86BlockSIGIO();
+
   /*
    * try to restore the original video state
    */
@@ -936,8 +939,6 @@ AbortDDX(void)
       DPMSSet(serverClient, DPMSModeOn);
 #endif
   if (xf86Screens) {
-      if (xf86Screens[0]->vtSema)
-	  xf86EnterServerState(SETUP);
       for (i = 0; i < xf86NumScreens; i++)
 	  if (xf86Screens[i]->vtSema) {
 	      /*
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
index 6b1b138..16b6bdc 100644
--- a/hw/xfree86/common/xf86PM.c
+++ b/hw/xfree86/common/xf86PM.c
@@ -33,6 +33,7 @@
 #include "xf86.h"
 #include "xf86Priv.h"
 #include "xf86Xinput.h"
+#include "xf86_OSproc.h"
 
 int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num) = NULL;
 pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event) = NULL;
@@ -61,6 +62,8 @@ eventName(pmEvent event, char **str)
     }
 }
 
+static int sigio_blocked_for_suspend;
+
 static void
 suspend (pmEvent event, Bool undo)
 {
@@ -76,7 +79,7 @@ suspend (pmEvent event, Bool undo)
 	DisableDevice(pInfo->dev, TRUE);
 	pInfo = pInfo->next;
     }
-    xf86EnterServerState(SETUP);
+    sigio_blocked_for_suspend = xf86BlockSIGIO();
     for (i = 0; i < xf86NumScreens; i++) {
 	if (xf86Screens[i]->PMEvent)
 	    xf86Screens[i]->PMEvent(i,event,undo);
@@ -96,7 +99,6 @@ resume(pmEvent event, Bool undo)
     InputInfoPtr pInfo;
 
     xf86AccessEnter();
-    xf86EnterServerState(SETUP);
     for (i = 0; i < xf86NumScreens; i++) {
 	if (xf86Screens[i]->PMEvent)
 	    xf86Screens[i]->PMEvent(i,event,undo);
@@ -105,7 +107,7 @@ resume(pmEvent event, Bool undo)
 	    xf86Screens[i]->EnterVT(i, 0);
 	}
     }
-    xf86EnterServerState(OPERATING);
+    xf86UnblockSIGIO(sigio_blocked_for_suspend);
     for (i = 0; i < xf86NumScreens; i++) {
 	if (xf86Screens[i]->EnableDisableFBAccess)
 	    (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
@@ -121,12 +123,7 @@ resume(pmEvent event, Bool undo)
 static void
 DoApmEvent(pmEvent event, Bool undo)
 {
-    /* 
-     * we leave that as a global function for now. I don't know if 
-     * this might cause problems in the future. It is a global server 
-     * variable therefore it needs to be in a server info structure
-     */
-    int i, setup = 0;
+    int i, was_blocked;
     
     switch(event) {
 #if 0
@@ -156,14 +153,13 @@ DoApmEvent(pmEvent event, Bool undo)
 	}
 	break;
     default:
+	was_blocked = xf86BlockSIGIO();
 	for (i = 0; i < xf86NumScreens; i++) {
 	    if (xf86Screens[i]->PMEvent) {
-		if (!setup) xf86EnterServerState(SETUP);
-		setup = 1;
 		xf86Screens[i]->PMEvent(i,event,undo);
 	    }
 	}
-	if (setup) xf86EnterServerState(OPERATING);
+	xf86UnblockSIGIO(was_blocked);
 	break;
     }
 }
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 08c0fa9..7137a53 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -114,7 +114,6 @@ extern _X_EXPORT void xf86AccessLeave(void);
 extern _X_EXPORT void xf86PostProbe(void);
 extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex);
 extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev);
-extern _X_EXPORT void xf86PostScreenInit(void);
 
 /* xf86Config.c */
 
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index a65237a..0493dc5 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -581,13 +581,6 @@ typedef struct _entityInfo {
     DriverPtr driver;
 } EntityInfoRec, *EntityInfoPtr;
 
-/* server states */
-
-typedef enum {
-    SETUP,
-    OPERATING
-} xf86State;
-
 /* DGA */
 
 typedef struct {
commit a04e74cb480f98bc3dd4def2da6f6752640d9e38
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Dec 15 15:16:33 2010 -0500

    xfree86: Symmetrize xf86AccessEnter and xf86AccessLeave
    
    Enter was changing server operating state, Leave wasn't.  Which was
    wholly redundant, since all callers of Enter would immediately change
    the operating state to exactly what Enter had just done.
    
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 90c1914..623b130 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -484,8 +484,6 @@ xf86AccessEnter(void)
     for (i = 0; i < xf86NumEntities; i++)
         if (xf86Entities[i]->entityEnter)
 		xf86Entities[i]->entityEnter(i,xf86Entities[i]->private);
-
-    xf86EnterServerState(SETUP);
 }
 
 void
commit 7a9062f2f029b4f911ba56f291375fbf5a98ca73
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Dec 14 15:44:16 2010 -0500

    fonts: Fix typo in async ListFonts logic
    
    This was introduced in 3ab6cd31cbdf8095b2948034fce5fb645422d8da.  Mea
    culpa.  This logic is still incorrect [1], but at least it's less
    incorrect.
    
    [1] - https://bugzilla.redhat.com/658587
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index bd1ad30..d8f1529 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -667,7 +667,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
 		    ((pointer) c->client, fpe, &name, &namelen, &tmpname,
 		     &resolvedlen, c->current.private);
 		if (err == Suspended) {
-		    if (ClientIsAsleep(client))
+		    if (!ClientIsAsleep(client))
 			ClientSleep(client,
 				    (ClientSleepProcPtr)doListFontsAndAliases,
 				    c);
commit f28e48834e40c7901c2efc72f962c9724e74a531
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 16 13:13:54 2010 -0500

    Remove SCO support
    
    This has never been buildable in any modular server release.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index f7dde6e..da35287 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -50,7 +50,7 @@
 #ifdef SVR4
 #include <sys/sysmacros.h>
 #endif
-#if defined(__CYGWIN__) || defined(__SCO__)
+#if defined(__CYGWIN__) 
 #include <sys/param.h>
 #include <sys/sysmacros.h>
 #endif
diff --git a/configure.ac b/configure.ac
index a5967ad..1ceffe7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2224,7 +2224,6 @@ hw/xfree86/os-support/bus/Makefile
 hw/xfree86/os-support/hurd/Makefile
 hw/xfree86/os-support/misc/Makefile
 hw/xfree86/os-support/linux/Makefile
-hw/xfree86/os-support/sco/Makefile
 hw/xfree86/os-support/solaris/Makefile
 hw/xfree86/parser/Makefile
 hw/xfree86/ramdac/Makefile
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 4abf217..c031d4b 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -59,7 +59,6 @@ CLEANFILES = $(BUILT_SOURCES)
 EXTRA_DIST = \
 	compiler.h \
 	fourcc.h \
-	scoasm.h \
 	vidmodeproc.h \
 	xf86.h \
 	xf86Bus.h \
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 958f8d0..9e00d75 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1525,22 +1525,9 @@ inl(unsigned short port)
 #      define asm __asm
 #     endif
 #    endif
-#    ifndef SCO325
-#     if defined(__UNIXWARE__)
-#     /* avoid including <sys/types.h> for <sys/inline.h> on UnixWare */
-#      define ushort unsigned short
-#      define ushort_t unsigned short
-#      define ulong unsigned long
-#      define ulong_t unsigned long
-#      define uint_t unsigned int
-#      define uchar_t unsigned char
-#     endif /* __UNIXWARE__ */
 #     if !defined(__SUNPRO_C)
 #      include <sys/inline.h>
 #     endif
-#    else
-#     include "scoasm.h"
-#    endif
 #    if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \
 	defined(__USLC__)
 #     pragma asm partial_optimization outl
diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h
deleted file mode 100644
index 8f80e7b..0000000
--- a/hw/xfree86/common/scoasm.h
+++ /dev/null
@@ -1,142 +0,0 @@
-
-/*
- * Copyright (c) 1996 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * scoasm.h - used to define inline versions of certain functions which
- * do NOT appear in sys/inline.h.
- */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#if defined(__SCO__) && defined(__USLC__)
-#ifndef _SCOASM_HDR_INC
-#define _SCOASM_HDR_INC
-
-asm     void outl(port,val)
-{
-%reg	port,val;
-	movl	port, %edx
-	movl	val, %eax
-	outl	(%dx)
-%reg	port; mem	val;
-	movl	port, %edx
-	movl    val, %eax
-	outl	(%dx)
-%mem	port; reg	val;
-	movw	port, %dx
-	movl	val, %eax
-	outl	(%dx)
-%mem	port,val;
-	movw	port, %dx
-	movl    val, %eax
-	outl	(%dx)
-}
-
-asm	void outw(port,val)
-{
-%reg	port,val;
-	movl	port, %edx
-	movl	val, %eax
-	data16
-	outl	(%dx)
-%reg	port; mem	val;
-	movl	port, %edx
-	movw	val, %ax
-	data16
-	outl	(%dx)
-%mem	port; reg	val;
-	movw	port, %dx
-	movl	val, %eax
-	data16
-	outl	(%dx)
-%mem	port,val;
-	movw	port, %dx
-	movw	val, %ax
-	data16
-	outl	(%dx)
-}
-
-asm	void outb(port,val)
-{
-%reg	port,val;
-	movl	port, %edx
-	movl	val, %eax
-	outb	(%dx)
-%reg	port; mem	val;
-	movl	port, %edx
-	movb	val, %al
-	outb	(%dx)
-%mem	port; reg	val;
-	movw	port, %dx
-	movl	val, %eax
-	outb	(%dx)
-%mem	port,val;
-	movw	port, %dx
-	movb	val, %al
-	outb	(%dx)
-}
-
-asm     int inl(port)
-{
-%reg	port;
-	movl	port, %edx
-	inl	(%dx)
-%mem	port;
-	movw	port, %dx
-	inl	(%dx)
-}
-
-asm	int inw(port)
-{
-%reg	port;
-	subl    %eax, %eax
-	movl	port, %edx
-	data16
-	inl	(%dx)
-%mem	port;
-	subl    %eax, %eax
-	movw	port, %dx
-	data16
-	inl	(%dx)
-}
-
-asm	int inb(port)
-{
-%reg	port;
-	subl    %eax, %eax
-	movl	port, %edx
-	inb	(%dx)
-%mem	port;
-	subl    %eax, %eax
-	movw	port, %dx
-	inb	(%dx)
-}
-
-#endif /* _SCOASM_HDR_INC */
-#endif /* __SCO__ && __USLC__ */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index b89f701..883c48c 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -56,12 +56,7 @@ xf86MonPtr ConfiguredMonitor;
 Bool xf86DoConfigurePass1 = TRUE;
 static Bool foundMouse = FALSE;
 
-#if defined(__SCO__)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-#elif defined(__UNIXWARE__)
-static char *DFLT_MOUSE_PROTO = "OSMouse";
-static char *DFLT_MOUSE_DEV = "/dev/mouse";
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#if   defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
 static char *DFLT_MOUSE_PROTO = "auto";
 #elif defined(linux)
@@ -169,15 +164,11 @@ configureInputSection (void)
 	}
 #endif
 
-#ifndef __SCO__
 	fd = open(DFLT_MOUSE_DEV, 0);
 	if (fd != -1) {
 	    foundMouse = TRUE;
 	    close(fd);
 	}
-#else
-	foundMouse = TRUE;
-#endif
     }
 
     mouse = calloc(1, sizeof(XF86ConfInputRec));
@@ -186,11 +177,9 @@ configureInputSection (void)
     mouse->inp_option_lst = 
 		xf86addNewOption(mouse->inp_option_lst, strdup("Protocol"),
 				strdup(DFLT_MOUSE_PROTO));
-#ifndef __SCO__
     mouse->inp_option_lst = 
 		xf86addNewOption(mouse->inp_option_lst, strdup("Device"),
 				strdup(DFLT_MOUSE_DEV));
-#endif
     mouse->inp_option_lst = 
 		xf86addNewOption(mouse->inp_option_lst, strdup("ZAxisMapping"),
 				strdup("4 5 6 7"));
@@ -749,13 +738,6 @@ DoConfigure(void)
 
     ErrorF("\n");
 
-#ifdef __SCO__
-    ErrorF("\n"__XSERVERNAME__
-	   " is using the kernel event driver to access the mouse.\n"
-	    "If you wish to use the internal "__XSERVERNAME__
-	   " mouse drivers, please\n"
-	    "edit the file and correct the Device.\n");
-#else /* !__SCO__ */
     if (!foundMouse) {
 	ErrorF("\n"__XSERVERNAME__" is not able to detect your mouse.\n"
 		"Edit the file and correct the Device.\n");
@@ -766,7 +748,6 @@ DoConfigure(void)
 	       " tries to autodetect\n"
 		"the protocol.\n",DFLT_MOUSE_DEV);
     }
-#endif /* !__SCO__ */
 
     if (xf86NumScreens > 1) {
 	ErrorF("\n"__XSERVERNAME__
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 78f51e1..ca3f281 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -711,20 +711,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
       xf86EnterServerState(SETUP);
     }
   }
-#ifdef SCO325
-  else {
-    /*
-     * Under SCO we must ack that we got the console at startup,
-     * I think this is the safest way to assure it.
-     */
-    static int once = 1;
-    if (once) {
-      once = 0;
-      if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
-        xf86Msg(X_WARNING, "VT_ACKACQ failed");
-    }
-  }
-#endif /* SCO325 */
 
   for (i = 0; i < xf86NumScreens; i++)
       if (!xf86ColormapAllocatePrivates(xf86Screens[i]))
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 694c1c2..159b611 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -114,26 +114,6 @@ LoaderInit(void)
 		   GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
 		   GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
 
-#if defined(__UNIXWARE__) && !defined(__GNUC__)
-    /* For UnixWare we need to load the C Runtime libraries which are
-     * normally auto-linked by the compiler. Otherwise we are bound to
-     * see unresolved symbols when trying to use the type "long long".
-     * Obviously, this does not apply if the GNU C compiler is used.
-     */
-    {
-	int errmaj, errmin, wasLoaded; /* place holders */
-	char *xcrtpath = DEFAULT_MODULE_PATH "/libcrt.a";
-	char *uwcrtpath = "/usr/ccs/lib/libcrt.a";
-	char *path;
-	struct stat st;
-
-	if(stat(xcrtpath, &st) < 0)
-	    path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */
-	else
-	    path = xcrtpath; /* get the libcrt.a we compiled with */
-	LoaderOpen (path, &errmaj, &errmin, &wasLoaded, 0);
-    }
-#endif
 }
 
 /* Public Interface to the loader. */
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
index 5acce00..6b5ac7e 100644
--- a/hw/xfree86/loader/os.c
+++ b/hw/xfree86/loader/os.c
@@ -50,8 +50,6 @@
 #define OSNAME "openbsd"
 #elif defined(__GNU__)
 #define OSNAME "hurd"
-#elif defined(__SCO__)
-#define OSNAME "sco"
 #elif defined(SVR4) && defined(sun)
 #define OSNAME "solaris"
 #elif defined(SVR5)
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index b50f441..3af4328 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -1,5 +1,5 @@
 SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
-DIST_SUBDIRS = bsd bus misc linux solaris sco hurd
+DIST_SUBDIRS = bsd bus misc linux solaris hurd
 
 sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h
 
diff --git a/hw/xfree86/os-support/sco/Makefile.am b/hw/xfree86/os-support/sco/Makefile.am
deleted file mode 100644
index b5d40f7..0000000
--- a/hw/xfree86/os-support/sco/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-EXTRA_DIST = \
-	VTsw_sco.c \
-	sco_init.c \
-	sco_iop.c \
-	sco_video.c
diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c
deleted file mode 100644
index c9194ec..0000000
--- a/hw/xfree86/os-support/sco/VTsw_sco.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 1993 by David Wexelblat <dwex at goblin.org>
- * Copyright 1993 by David McCullough <davidm at stallion.oz.au>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of David Wexelblat not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  David Wexelblat makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-/* For the event driver prototypes */
-#include <sys/event.h>
-#include <mouse.h>
-
-/*
- * Handle the VT-switching interface for SCO
- */
-
-/*
- * This function is the signal handler for the VT-switching signal.  It
- * is only referenced inside the OS-support layer. NOTE: we do NOT need
- * to re-arm the signal here, since we used sigaction() to set the signal
- * disposition in sco_init.c. If we had used signal(), we would need to
- * re-arm the signal here. All we need to do now is record the fact that
- * we got the signal. XFree86 handles the rest.
- */
-void
-xf86VTRequest(int sig)
-{
-  xf86Info.vtRequestsPending = TRUE;
-  return;
-}
-
-Bool
-xf86VTSwitchPending(void)
-{
-  return xf86Info.vtRequestsPending ? TRUE : FALSE;
-}
-
-/*
- * When we switch away, we need to flush and suspend the event driver
- * before the VT_RELDISP. We also need to get the current LED status
- * and preserve it, so that we can restore it when we come back.
- */
-static int sco_ledstatus = -1;
-static unsigned int sco_ledstate = 0;
-
-Bool
-xf86VTSwitchAway(void)
-{
-  ev_flush();
-  ev_suspend();
-
-  sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate);
-
-  xf86Info.vtRequestsPending = FALSE;
-  if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) {
-    return FALSE;
-  } else {
-    return TRUE;
-  }
-}
-
-/*
- * When we come back to the X server, we need to resume the event driver,
- * and we need to restore the LED settings to what they were when we
- * switched away.
- */
-Bool
-xf86VTSwitchTo(void)
-{
-  ev_resume();
-
-  xf86Info.vtRequestsPending = FALSE;
-  if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
-    return FALSE;
-  } else {
-    if (sco_ledstatus >= 0) {
-      ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
-    }
-    sco_ledstatus = -1;
-
-    /*
-     * Convince the console driver this screen is in graphics mode,
-     * otherwise it assumes it can do more to the screen than it should.
-     */
-    if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
-        ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
-    }
-
-    return TRUE;
-  }
-}
-
-Bool
-xf86VTActivate(int vtno)
-{
-	if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) {
-		return FALSE;
-	}
-
-	return TRUE;
-}
diff --git a/hw/xfree86/os-support/sco/sco_init.c b/hw/xfree86/os-support/sco/sco_init.c
deleted file mode 100644
index 3322ed5..0000000
--- a/hw/xfree86/os-support/sco/sco_init.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright 2001-2005 by J. Kean Johnston <jkj at sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Re-written May 2001 to represent the current state of reality */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xmd.h>
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-
-static Bool KeepTty = FALSE;
-static int VTnum = -1;
-static char vtdevice[48];
-static int sco_console_mode = -1;
-
-extern Bool mpxLock;
-
-void
-xf86OpenConsole(void)
-{
-  int i, ioctl_ret;
-  struct vt_mode VT;
-  struct vid_info vidinf;
-  struct sigaction sigvtsw;
-  char *ttn;
-
-  if (serverGeneration == 1) {
-    /* check if we're run with euid==0 */
-    if (geteuid() != 0) {
-      FatalError("xf86OpenConsole: Server must be setuid root\n");
-    }
-
-    /* If we are run in the background we will get SIGTTOU. Ignore it. */
-    OsSignal (SIGTTOU, SIG_IGN);
-
-    /*
-     * Set up the virtual terminal (multiscreen in SCO parlance).
-     * For the actual console itself, screens are numbered from
-     * 1 to (usually) 16. However, it is possible to have a nested
-     * server, and it is also possible to be on a multi-console
-     * system such as MaxSpeed or SunRiver. Therefore, we should
-     * not make any assumptions about the TTY name we are on, and
-     * instead we rely on ttyname() to give us the real TTY name.
-     * Previously, we tried to determine the TTY name manually.
-     * This is wrong. The only time we need to futz with the TTY name
-     * is if we were given the name of a TTY to run on explicity on
-     * the command line.
-     */
-
-    if (VTnum == -1) {
-      /*
-       * No device was specified. We need to query the kernel to see which
-       * console device we are on (and in fact if we are on a console at all).
-       */
-      ttn = ttyname (1);
-
-      if (ttn == (char *)0) {
-	FatalError ("xf86OpenConsole: Could not determine TTY name: %s\n",
-	  strerror(errno));
-      }
-      strlcpy (vtdevice, ttn, sizeof(vtdevice));
-    } else if (VTnum >= 0) {
-      snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum);
-    }
-
-    /*
-     * Now we can dispose of stdin/stdout
-     */
-    fclose (stdin);
-    fclose (stdout);
-
-    if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NDELAY, 0)) < 0) {
-      FatalError("xf86OpenConsole: Cannot open %s: %s\n", vtdevice,
-	strerror(errno));
-    }
-
-    /*
-     * We make 100% sure we use the correct VT number. This can get ugly
-     * where there are multi-consoles in use, so we make sure we query
-     * the kernel for the correct VT number. It knows best, we don't.
-     */
-    vidinf.size = sizeof(vidinf);
-    if (ioctl (xf86Info.consoleFd, CONS_GETINFO, &vidinf) < 0) {
-      FatalError ("xf86OpenConsole: %s not a console device "
-	"or error querying device: %s\n", vtdevice, strerror (errno));
-    }
-    xf86Info.vtno = vidinf.m_num;
-    VTnum = vidinf.m_num + 1; /* 0-based */
-
-    ErrorF("(using VT%02d device %s)\n\n", VTnum, vtdevice);
-
-    /* We activate the console just in case its not the one we are on */
-    if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
-        ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno));
-    }
-
-    /* Disassociate from controling TTY */
-    if (!KeepTty) {
-      setpgrp();
-    }
-
-    /*
-     * Now we get the current mode that the console device is in. We will
-     * use this later when we close the console device to restore it to
-     * that same mode.
-     */
-    if ((sco_console_mode = ioctl(xf86Info.consoleFd, CONS_GET, 0L)) < 0) {
-      FatalError("xf86OpenConsole: CONS_GET failed on console (%s)\n",
-          strerror(errno));
-    }
-
-    if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) {
-      FatalError("xf86OpenConsole: VT_GETMODE failed (%s)\n", strerror(errno));
-    }
-
-    sigvtsw.sa_handler = xf86VTRequest;
-    sigfillset(&sigvtsw.sa_mask);
-    sigvtsw.sa_flags = 0;
-
-    /* NOTE: Using sigaction means we dont have to re-arm the signal */
-    sigaction(SIGUSR1, &sigvtsw, NULL);
-
-    VT.mode = VT_PROCESS;
-    VT.relsig = SIGUSR1;
-    VT.acqsig = SIGUSR1;
-    VT.frsig = SIGINT;          /* Not implemented */
-    VT.waitv = 0;
-
-    /*
-     * The SCO X server tries the following call 5 times. Lets do the same
-     * thing. It shouldn't really be required but sometimes things take a
-     * while to settle down when switching screens. *helpless shrug* I know
-     * its sucks but ...
-     */
-
-    ioctl_ret = 0;
-    for (i = 0; i < 5; i++) {
-      ioctl_ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
-      if (ioctl_ret >= 0)
-        break;
-      usleep(999999); /* Dont use nap() - it forces linking with -lx */
-    }
-
-    if (ioctl_ret < 0) {
-      FatalError("xf86OpenConsole: VT_SETMODE failed (%s)\n", strerror(errno));
-    }
-
-    /*
-     * Convince the console driver we are in graphics mode.
-     */
-    if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
-        ErrorF("Failed to set graphics mode (%s)\n", strerror(errno));
-    }
-  } else { /* serverGeneration != 1 */
-    if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) {
-      ErrorF("xf86OpenConsole: VT_ACTIVATE failed (%s)\n", strerror(errno));
-    }
-  }
-}
-
-/*
- * Restore the console to its previous state. This may cause flicker if
- * the screen was previous in a graphics mode, because we first set it
- * to text mode. This has the advantage of getting the console driver
- * to do a soft reset on the card, which really does help settle the
- * video card down again after coming out of Xfree86.
- */
-void
-xf86CloseConsole(void)
-{
-  struct vt_mode VT;
-  struct sigaction sigvtsw;
-
-  /* Set text mode (possibly briefly) */
-  ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT0);
-
-  /* Restore the original mode */
-  if (sco_console_mode != -1) {
-      ioctl(xf86Info.consoleFd, MODESWITCH | sco_console_mode, 0L);
-  }
-
-  ioctl(xf86Info.consoleFd, VT_RELDISP, 1);     /* Release the display */
-
-  sigvtsw.sa_handler = SIG_DFL;
-  sigfillset(&sigvtsw.sa_mask);
-  sigvtsw.sa_flags = 0;
-
-  sigaction(SIGUSR1, &sigvtsw, NULL);
-
-  VT.mode = VT_AUTO;
-  VT.waitv = 0;
-  VT.relsig = SIGUSR1;
-  VT.acqsig = SIGUSR1;
-  VT.frsig  = SIGINT;
-  ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* Revert to auto handling */
-
-  close(xf86Info.consoleFd); /* We're done with the device */
-}
-
-int
-xf86ProcessArgument(int argc, char *argv[], int i)
-{
-  /*
-   * Keep server from detaching from controlling tty.  This is useful
-   * when debugging (so the server can receive keyboard signals).
-   */
-  if (!strcmp(argv[i], "-keeptty")) {
-    KeepTty = TRUE;
-    return 1;
-  }
-
-  /*
-   * By default, the X server wants to bind itself to CPU 0. This makes
-   * sure that the server has full access to the I/O ports at IOPL 3.
-   * Some SMP systems have trouble with I/O on CPU's other than 0. If,
-   * however, you have a system that is well behaved, you can specify
-   * this argument and let the scheduler decide which CPU the server
-   * should run on.
-   */
-  if (!strcmp(argv[i], "-nompxlock")) {
-    mpxLock = FALSE;
-    return 1;
-  }
-
-  /*
-   * Specify the VT number to run on (NOT the device).
-   */
-  if ((argv[i][0] == 'v') && (argv[i][1] == 't')) {
-    if (sscanf(argv[i], "vt%2d", &VTnum) == 0) {
-      UseMsg();
-      VTnum = -1;
-      return 0;
-    }
-    if (VTnum <= 0) {
-      UseMsg();
-      VTnum = -1;
-      return 0;
-    }
-    return 1;
-  }
-
-  /*
-   * Use a device the user specifies.
-   */
-  if (!strcmp(argv[i], "-crt")) {
-    if (++i > argc) {
-      UseMsg();
-      VTnum = -1;
-      return 0;
-    } else {
-      VTnum = -2;
-      strlcpy (vtdevice, argv[i], sizeof(vtdevice));
-      return 2;
-    }
-  }
-  return 0;
-}
-
-void
-xf86UseMsg(void)
-{
-	ErrorF("vtXX                   use the specified VT number\n");
-	ErrorF("-crt DEVICE            use the specified VT device\n");
-        ErrorF("-nompxlock             dont bind X server to CPU 0\n");
-	ErrorF("-keeptty               ");
-	ErrorF("don't detach controlling tty (for debugging only)\n");
-}
diff --git a/hw/xfree86/os-support/sco/sco_iop.c b/hw/xfree86/os-support/sco/sco_iop.c
deleted file mode 100644
index 3da4fcf..0000000
--- a/hw/xfree86/os-support/sco/sco_iop.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2001 by J. Kean Johnston <jkj at caldera.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-
-#include "compiler.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-#include "xf86_OSlib.h"
-
-
-/***************************************************************************/
-/* I/O Permissions section                                                 */
-/***************************************************************************/
-
-/*
- * There is a right way and a wrong way of doing this. Unfortunately, we
- * are forced to do it the wrong way. The right way is to be told the range
- * or ranges of I/O ports the driver(s) need access to, in order to use the
- * CONS_IOPERM ioctl() to grant access only to those ports we care about.
- * This way we can guarantee some small level of stability because a driver
- * does not have access to all ports (which would mean it could play with
- * the PIT and thus affect scheduling times, or a whole slew of other
- * nasty things). However, because XFree86 currently only enables or disables
- * ALL port access, we need to run at IOPL 3, which basically means the
- * X Server runs at the same level as the kernel. You can image why this is
- * unsafe. Oh, and this is not a problem unique to OSR5, other OSes are
- * affected by this as well.
- *
- * So, for the time being, we change our IOPL until such time as the XFree86
- * architecture is changed to allow for tighter control of I/O ports. If and
- * when it is, then the CONS_ADDIOP/DELIOP ioctl() should be used to enable 
- * or disable access to the desired ports.
- */
-
-extern long sysi86 (int cmd, ...);
-
-static Bool IOEnabled = FALSE;
-
-Bool
-xf86EnableIO(void)
-{
-	if (IOEnabled)
-		return TRUE;
-
-	if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) {
-		xf86Msg(X_WARNING,"Failed to set IOPL for extended I/O\n");
-		return FALSE;
-	}
-	
-	IOEnabled = TRUE;
-	return TRUE;
-}
-
-void
-xf86DisableIO(void)
-{
-	if (!IOEnabled)
-		return;
-
-	sysi86(SI86V86, V86SC_IOPL, 0);
-	IOEnabled = FALSE;
-}
diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c
deleted file mode 100644
index f63b71d..0000000
--- a/hw/xfree86/os-support/sco/sco_video.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright 2001 by J. Kean Johnston <jkj at sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Re-written May 2001 to represent the current state of reality */
-
-/*
- * This file contains the completely re-written SCO OpenServer video
- * routines for XFree86 4.x. Much of this is based on the SCO X server
- * code (which is an X11R5 server) and will probably only work on
- * OpenServer versions 5.0.5, 5.0.6 and later. Please send me (jkj at sco.com)
- * email if you have any questions.
- *
- * Ideally, you should use OSR5.0.6A or later, with the updated console
- * driver for 5.0.6A (its the default driver in 5.0.7 and later).
- * However, if you are running on an older system, this code will detect
- * that and adjust accordingly.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "input.h"
-#include "scrnintstr.h"
-
-#define _NEED_SYSI86
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-#include "xf86_OSlib.h"
-
-#include <sys/ci/ciioctl.h>
-#define MPXNAME "/dev/atp1"
-#define BASECPU 1
-
-Bool mpxLock = TRUE;
-
-#define USE_VASMETHOD	1
-
-/***************************************************************************/
-/* Video Memory Mapping section                                            */
-/***************************************************************************/
-
-static int sco_mcdone = 0, sco_ismc = 0;
-
-/***************************************************************************/
-/*
- * To map the video memory, we first need to see if we are on a multi-console
- * system. If we are, we need to try to use an existing video class in the
- * kernel. We do this by retrieving the list of currently defined classes
- * (via the new CONS_GETCLASS ioctl()) to see if we have a class that will
- * match the range of memory we desire. If we can't find one, we have an
- * error and we abort.
- *
- * If we are not using a multi-console, we can simply use mmap() to map in
- * the frame buffer, using the classs-access method as a fall-back only if
- * the mmap() fails (it shouldn't). We always set the appropriate pointers
- * in the config structure to point ot the right function to map and unmap
- * the video memory. An alternative to using mmap() is to use the new
- * CONS_ADDVAS call, which will use vasmalloc() and vasbind() in the kernel
- * to map the physical address to a virtual one, which it then returns.
- * I am not 100% sure if this is faster or not, but it may prove easier to
- * debug things. Just to be on the safe side, I have included both methods
- * here, and the mmap() method can be used by setting USE_VASMETHOD to 0
- * above.
- */
-
-#if !defined(CONS_ADDVAS)
-# undef USE_VASMETHOD
-# define USE_VASMETHOD 0
-#endif
-
-static int
-scoIsMultiConsole (void)
-{
-	int x;
-
-	if (sco_mcdone)
-		return sco_ismc;
-	x = access ("/usr/lib/vidconf/.multiconsole", F_OK);
-	if (x == 0)
-		sco_ismc = 1;
-	sco_mcdone = 1;
-	return sco_ismc;
-}
-
-/*
- * This maps memory using mmap()
- */
-static pointer
-mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-  int fd;
-  unsigned long realBase, alignOff;
-  pointer base;
-
-  fd = open (DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
-  if (fd < 0) {
-    FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM,
-       	strerror(errno));
-    return 0; /* NOTREACHED */
-  }
-
-  realBase = Base & ~(getpagesize() - 1);
-  alignOff = Base - realBase;
-
-  DebugF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
-
-  base = mmap((caddr_t)0, Size + alignOff,
-	      (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE),
-  	      MAP_SHARED, fd, (off_t)realBase);
-  close(fd);
-  if (base == MAP_FAILED) {
-    FatalError("xf86MapVidMem: Could not mmap framebuffer (0x%08x,0x%x) (%s)\n",
-       	Base, Size, strerror(errno));
-    return 0; /* NOTREACHED */
-  }
-
-    DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
-    return (pointer)((char *)base + alignOff);
-}
-
-#if (USE_VASMETHOD)
-/*
- * This maps memory using the virtual address space (VAS) console calls.
- */
-static pointer
-mapVidMemVAS(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-  struct vidvasmem vas;
-  pointer base;
-
-  vas.base = (long)Base;
-  vas.size = (long)Size;
-
-  base = (pointer)ioctl (xf86Info.consoleFd, CONS_ADDVAS, &vas);
-  if (base == (pointer)-1) {
-    return mapVidMemMMAP(ScreenNum, Base, Size, flags);
-  }
-  return base;
-}
-#endif /* USE_VASMETHOD */
-
-struct vidclass vidclasslist[] = {
-	{ "VBE", "", 0xf0000000, 0x2000000, 0 },
-	{ "P9000", "", 0xc0000000, 0x400000, 0 },
-	{ "TULIP", "", 0x80000000, 0x400000, 0 },
-	{ "VIPER", "", 0xa0000000, 0x400000, 0 },
-	{ "S3T", "", 0xa0000000, 0x200000, 0 },
-	{ "S3DT", "", 0x4000000, 0x400000, 0 },
-	{ "MGA", "", 0x2200000, 0x4000, 0 },
-	{ "CLVGA", "", 0xa0000, 0x20000, 0 },
-	{ "OLIVE", "", 0xd8000000, 0x400000, 0 },
-	{ "S3C", "", 0xa0000, 0x10000, 0 },
-	{ "MGAVLB", "", 0xac000, 0x34000, 0 },
-	{ "ATI8514", "", 0xFF000, 0x1000, 0 },
-	{ "GXREGS", "", 0xb0000, 0x10000, 0 },
-	{ "GX", "", 0xa0000, 0x10000, 0 },
-	{ "CT64300", "", 0xa0000000, 0x400000, 0 },
-	{ "SVGA", "", 0xa0000, 0x20000, 0 },
-	{ "S3V", "", 0xa0000000, 0x400000, 0 },
-	{ "8514A", "", 0xFF000, 0x1000, 0 },
-	{ "VGA", "", 0xa0000, 0x10000, 0 },
-	{ 0 }
-};
-
-static pointer
-mapVidMemVC(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
-  struct vidclass *vcp;
-  char *class = NULL;
-  pointer base;
-
-  for (vcp = vidclasslist; vcp->name; vcp++) {
-    if ((vcp->base == Base) && (vcp->size == Size)) {
-      class = vcp->name;
-      break;
-    }
-  }
-
-  if (class == NULL) {
-    /*
-     * As a fall-back, we will try and use the mmap() approach. This may
-     * prove to be the wrong thing to do, but time and testing will tell.
-     */
-    ErrorF("xf86MapVidMem: No class map defined for (0x%08x,0x%08x)\n", Base, Size);
-#if USE_VASMETHOD
-    return mapVidMemVAS(ScreenNum, Base, Size, flags);
-#else /* !USE_VASMETHOD */
-    return mapVidMemMMAP(ScreenNum, Base, Size, flags);
-#endif
-  }
-
-  /*
-   * We found a suitable class. Try and use it.
-   */
-  base = (pointer)ioctl(xf86Info.consoleFd, MAP_CLASS, class);
-  if ((int)base == -1) {
-    FatalError("xf86MapVidMem: Failed to map video memory class `%s'\n", class);
-    return 0; /* NOTREACHED */
-  }
-
-  return base;
-}
-
-/*
- * Unmapping the video memory is easy. We always call munmap(), as it is
- * safe to do so even if we haven't actually mapped in any pages via mmap().
- * In the case where we used the video class, we don't need to do anything
- * as the kernel will clean up the TSS when we exit, and will undo the
- * vasbind() that was done when the class was originally mapped. If we used
- * vasmap, we simply undo the map. Again, it is benign to call vasunmap
- * even if we got the frame buffer via some other mechanism (like mmap).
- */
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-#if USE_VASMETHOD
-  struct vidvasmem vas;
-  int x;
-
-  vas.base = (long)Base;
-  vas.size = (long)Size;
-
-  x = ioctl (xf86Info.consoleFd, CONS_DELVAS, &vas);
-  if (x == 0)
-    return;
-#endif /* USE_VASMETHOD */
-
-  munmap(Base, Size);
-}
-
-/*
- * Set things up to point to our local functions. When the kernel gets
- * MTRR support, we will need to add the required functions for that
- * here too. MTRR support will most likely appear in 5.0.8 or 5.1.0.
- *
- * We also want to lock the X server process to the base CPU in an MPX
- * system, since we will be going to IOPL 3. Most engine drivers can cope
- * with I/O access on any CPU but there are a few (AST Manhattan I believe)
- * that can't, so the server needs to be locked to CPU0.
- */
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
-  int mpx_fd;
-
-  if (scoIsMultiConsole ()) {
-    pVidMem->mapMem = mapVidMemVC;
-  } else {
-#if USE_VASMETHOD
-    pVidMem->mapMem = mapVidMemVAS;
-#else
-    pVidMem->mapMem = mapVidMemMMAP;
-#endif
-  }
-
-  pVidMem->unmapMem = unmapVidMem;
-  pVidMem->linearSupported = TRUE;
-  pVidMem->initialised = TRUE;
-
-  if (mpxLock && (mpx_fd = open (MPXNAME, O_RDONLY)) > 0) {
-    if (ioctl (mpx_fd, ACPU_XLOCK, BASECPU) < 0)
-      ErrorF ("xf86OSInitVidMem: Can not bind to CPU 0 (%s)\n",
-          strerror(errno));
-    close (mpx_fd);
-  }
-}
-
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index c53fc0d..3b646da 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -85,22 +85,11 @@
 /**************************************************************************/
 #if (defined(SYSV) || defined(SVR4)) && \
     (defined(sun) || defined(__i386__))
-# ifdef SCO325
-#  ifndef _SVID3
-#   define _SVID3
-#  endif
-#  ifndef _NO_STATIC
-#   define _NO_STATIC
-#  endif
-# endif
 # include <sys/ioctl.h>
 # include <signal.h>
 # include <termio.h>
 # include <sys/stat.h>
 # include <sys/types.h>
-# if defined(__SCO__) 
-# include <sys/param.h>
-# endif
 
 
 # include <errno.h>
@@ -140,15 +129,7 @@
 # if !defined(sun)
 #  include <sys/emap.h>
 # endif
-# if defined(SCO325)
-#  include <sys/vtkd.h>
-#  include <sys/console.h>
-#  include <sys/scankbd.h>
-#  include <sys/vid.h>
-#  define LED_CAP CLKED
-#  define LED_NUM NLKED
-#  define LED_SCR SLKED
-# elif defined(HAS_USL_VTS)
+# if   defined(HAS_USL_VTS)
 #  if !defined(sun)
 #   include <sys/at_ansi.h>
 #  endif
@@ -177,20 +158,12 @@
 #  define VT_ACKACQ 2
 # endif /* !VT_ACKACQ */
 
-# if defined(__SCO__)
-#  include <sys/sysmacros.h>
-#  define POSIX_TTY
-# endif /* __SCO__ */
 
-# if defined(SVR4) || defined(SCO325)
+# if defined(SVR4) 
 #  include <sys/mman.h>
 #  if !(defined(sun) && defined (SVR4))
 #    define DEV_MEM "/dev/pmem"
 #  endif
-#  ifdef SCO325
-#   undef DEV_MEM
-#   define DEV_MEM "/dev/mem"
-#  endif
 #  define CLEARDTR_SUPPORT
 #  define POSIX_TTY
 # endif /* SVR4 */
diff --git a/os/access.c b/os/access.c
index a532db6..d43fdf8 100644
--- a/os/access.c
+++ b/os/access.c
@@ -102,9 +102,9 @@ SOFTWARE.
 #include <sys/ioctl.h>
 #include <ctype.h>
 
-#if defined(TCPCONN) || defined(STREAMSCONN) || defined(__SCO__)
+#if defined(TCPCONN) || defined(STREAMSCONN) 
 #include <netinet/in.h>
-#endif /* TCPCONN || STREAMSCONN || __SCO__ */
+#endif /* TCPCONN || STREAMSCONN */
 
 #ifdef HAS_GETPEERUCRED
 # include <ucred.h>
@@ -176,10 +176,6 @@ SOFTWARE.
 #endif
 #endif 
 
-#ifdef __SCO__
-/* The system defined value is wrong. MAXPATHLEN is set in sco5.cf. */
-#undef PATH_MAX
-#endif
 
 #define X_INCLUDE_NETDB_H
 #include <X11/Xos_r.h>
@@ -297,7 +293,7 @@ AccessUsingXdmcp (void)
 }
 
 
-#if  defined(SVR4) && !defined(SCO325) && !defined(sun)  && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
+#if  defined(SVR4) && !defined(sun)  && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
 
 /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
 
@@ -327,7 +323,7 @@ ifioctl (int fd, int cmd, char *arg)
 #endif
     return ret;
 }
-#else /* Case sun, SCO325 and others  */
+#else
 #define ifioctl ioctl
 #endif
 
diff --git a/os/osinit.c b/os/osinit.c
index c83c32c..018e404 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -74,9 +74,6 @@ SOFTWARE.
 #endif
 #endif
 
-#if defined(__SCO__)
-#include <sys/wait.h>
-#endif
 
 #if !defined(SYSV) && !defined(WIN32) 
 #include <sys/resource.h>
@@ -209,7 +206,7 @@ OsInit(void)
 	dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal);
 #endif
 
-#if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__)
+#if !defined(__CYGWIN__) 
 	fclose(stdin);
 	fclose(stdout);
 #endif
commit 040d54fb88f3970e19d0fbf911d6447f592496bd
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Dec 15 14:59:13 2010 -0500

    xfree86: Remove unused xf86inSuspend
    
    What is this, I don't even.
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index b29ec51..f7470f2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -69,7 +69,6 @@ extern _X_EXPORT Bool fbSlotClaimed;
 extern _X_EXPORT Bool sbusSlotClaimed;
 #endif
 extern _X_EXPORT confDRIRec xf86ConfigDRI;
-extern _X_EXPORT Bool xf86inSuspend;
 extern _X_EXPORT Bool xf86DRI2Enabled(void);
 
 extern _X_EXPORT Bool VTSwitchEnabled;	/* kbd driver */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 6177f05..16d5557 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -194,5 +194,4 @@ Bool xf86VidModeDisabled = FALSE;
 Bool xf86VidModeAllowNonLocal = FALSE;
 #endif
 RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
-Bool xf86inSuspend = FALSE;
 Bool xorgHWAccess = FALSE;
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
index 7af89b5..6b1b138 100644
--- a/hw/xfree86/common/xf86PM.c
+++ b/hw/xfree86/common/xf86PM.c
@@ -67,8 +67,6 @@ suspend (pmEvent event, Bool undo)
     int i;
     InputInfoPtr pInfo;
 
-   xf86inSuspend = TRUE;
-    
     for (i = 0; i < xf86NumScreens; i++) {
 	if (xf86Screens[i]->EnableDisableFBAccess)
 	    (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
@@ -118,7 +116,6 @@ resume(pmEvent event, Bool undo)
 	EnableDevice(pInfo->dev, TRUE);
 	pInfo = pInfo->next;
     }
-    xf86inSuspend = FALSE;
 }
 
 static void
commit e7dc253452a1ba64718a08fdc070405b494f53cd
Merge: d110791... d5b0d58...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Dec 20 00:48:45 2010 -0800

    Merge remote branch 'alanc/master'

commit d1107918d4626268803b54033a07405122278e7f
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Fri Dec 17 16:09:35 2010 +0200

    randr: check for virtual size limits before set crtc
    
    Return a error if the screen is configured to an invalid size.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 292163f..0efc62e 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -939,6 +939,18 @@ ProcRRSetScreenConfig (ClientPtr client)
 	width = mode->mode.height;
 	height = mode->mode.width;
     }
+
+    if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
+	client->errorValue = width;
+	free(pData);
+	return BadValue;
+    }
+    if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) {
+	client->errorValue = height;
+	free(pData);
+	return BadValue;
+    }
+
     if (width != pScreen->width || height != pScreen->height)
     {
 	int	c;
commit 4b88c7be8de4149fe3d166bf115775f9e81a1373
Author: Jörn Horstmann <launchpad at planetxml.de>
Date:   Mon Dec 6 11:24:02 2010 +1100

    Add EDID quirk for HP Compaq nc8430.
    
    Like some other LPL panels, this one reports the vertical size in cm rather
    than mm.
    Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009>
    
    X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414>
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 3d51b1d..d9ece7a 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -145,6 +145,11 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 0x2a00)
 	return TRUE;
 
+    /* Bug #28414: HP Compaq NC8430 LP154W01-TLA8 */
+    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 5750)
+	return TRUE;
+
     /* Bug #21750: Samsung Syncmaster 2333HD */
     if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
 	DDC->vendor.prod_id == 1157)
commit a2e67a6412386782cb8b644b86a5744591397d45
Author: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Mon Dec 6 11:24:01 2010 +1100

    IDLETIME: Fix edge-case in IdleTimeBlockHandler
    
    Ensure that if we're called exactly on the threshold of a
    NegativeTransition trigger that we reshedule to pick up
    an idle time over the threshold.
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/sync.c b/Xext/sync.c
index 7ea8a44..d495116 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -2793,6 +2793,14 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
 		break;
 	    }
 	}
+	/* 
+	 * We've been called exactly on the idle time, but we have a
+	 * NegativeTransition trigger which requires a transition from an
+	 * idle time greater than this.  Schedule a wakeup for the next
+	 * millisecond so we won't miss a transition.
+	 */
+	if (XSyncValueEqual (idle, *pIdleTimeValueLess))
+	    AdjustWaitForDelay(wt, 1);
     }
     else if (pIdleTimeValueGreater)
     {
commit b55bf248581dc66321b24b29f199f6dc8d02db1b
Author: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Mon Dec 6 11:24:00 2010 +1100

    Xext: Fix edge case with {Positive, Negative}Transition triggers.
    
    The {Positive,Negative}Transition triggers only fire when the counter
    goes from strictly {below,above} the threshold.  If
    SyncComputeBracketValues gets called exactly at this threshold we may update
    the bracket values so that the counter is not updated past the threshold.
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/sync.c b/Xext/sync.c
index ab8f20d..7ea8a44 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1059,6 +1059,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
 	    {
 		psci->bracket_less = pTrigger->test_value;
 		pnewltval = &psci->bracket_less;
+	    } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
+		       XSyncValueLessThan(pTrigger->test_value,
+					  psci->bracket_greater))
+	    {
+	        /*
+		 * The value is exactly equal to our threshold.  We want one
+		 * more event in the positive direction to ensure we pick up
+		 * when the value *exceeds* this threshold.
+		 */
+	        psci->bracket_greater = pTrigger->test_value;
+		pnewgtval = &psci->bracket_greater;
 	    }
 	}
         else if (pTrigger->test_type == XSyncPositiveTransition &&
@@ -1069,6 +1080,17 @@ SyncComputeBracketValues(SyncCounter *pCounter)
 	    {
 		psci->bracket_greater = pTrigger->test_value;
 		pnewgtval = &psci->bracket_greater;
+	    } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
+		       XSyncValueGreaterThan(pTrigger->test_value,
+					     psci->bracket_less))
+	    {
+	        /*
+		 * The value is exactly equal to our threshold.  We want one
+		 * more event in the negative direction to ensure we pick up
+		 * when the value is less than this threshold.
+		 */
+	        psci->bracket_less = pTrigger->test_value;
+		pnewltval = &psci->bracket_less;
 	    }
 	}
     } /* end for each trigger */
commit d5b0d58573ffb90ea70273cd013102168fd2a18a
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Dec 16 22:29:37 2010 -0800

    Bug 32436 - hw/xfree86/parser/Makefile.am TOP_SRCDIR should be top_srcdir
    
    https://bugs.freedesktop.org/show_bug.cgi?id=32436
    Fix typo introduced in 2416255f7e3fd9190a9 that breaks builds when
    configured --enable-install-libxf86config
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Tested-by: Simon Thum <simon.thum at gmx.de>

diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
index a5adc01..fb5d49e 100644
--- a/hw/xfree86/parser/Makefile.am
+++ b/hw/xfree86/parser/Makefile.am
@@ -31,7 +31,7 @@ libxf86config_internal_la_SOURCES = \
 	$(INTERNAL_SOURCES)
 
 libxf86config_a_SOURCES = \
-	$(TOP_SRCDIR)/os/xprintf.c \
+	$(top_srcdir)/os/xprintf.c \
 	$(INTERNAL_SOURCES)
 libxf86config_a_CFLAGS = $(AM_CFLAGS)
 
commit 058b889fde47b4c32534f11ed651bf1749d1dbb2
Author: David Barksdale <david.barksdale at adcedosolutions.com>
Date:   Mon Dec 13 18:35:20 2010 -0800

    Bug 21827: faulty sdksyms.c generated by the awk script in sdksyms.sh
    
    https://bugs.freedesktop.org/show_bug.cgi?id=21827
    
    Tested-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: David Barksdale <david.barksdale at adcedosolutions.com>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 356d490..f60b8ed 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -359,7 +359,7 @@ BEGIN {
 	    # skip modifiers, if any
 	    $n ~ /^\*?(unsigned|const|volatile|struct)$/ ||
 	    # skip pointer
-	    $n ~ /\*$/)
+	    $n ~ /^[a-zA-Z0-9_]*\*$/)
 	    n++;
 
 	# type specifier may not be set, as in
@@ -367,6 +367,10 @@ BEGIN {
 	if ($n !~ /[^a-zA-Z0-9_]/)
 	    n++;
 
+	# go back if we are at the parameter list already
+	if ($n ~ /^[(]([^*].*)?$/)
+	    n--;
+
 	# match
 	#    extern _X_EXPORT type (* name[])(...)
 	if ($n ~ /^[^a-zA-Z0-9_]+$/)
commit 1324b0ca9f8a7fdaf03b374c75eb3c9df407c2f1
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Dec 10 00:08:24 2010 +0000

    Typo in xserver Xvasprintf()
    
    I needed this patch in the wrapper around vsnprintf() in os/xprintf.c
    (MinGW for Windows build) to correct various crashes.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/os/xprintf.c b/os/xprintf.c
index 0a8bd06..254b737 100644
--- a/os/xprintf.c
+++ b/os/xprintf.c
@@ -108,7 +108,7 @@ Xvasprintf(char **ret, const char * _X_RESTRICT_KYWD format, va_list va)
         return -1;
 
     vsnprintf(*ret, size + 1, format, va);
-    ret[size] = 0;
+    (*ret)[size] = 0;
     return size;
 #endif
 }
commit f1542f1d716723cba7c323849086585635121893
Merge: 9716d31... 8a8fdd7...
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Dec 14 15:04:12 2010 -0800

    Merge remote branch 'whot/for-keith'

commit 9716d3124799c6db0d1c782aa72c72f972d5a158
Merge: 03ea0b7... f641e4b...
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Dec 14 15:01:36 2010 -0800

    Merge remote branch 'jeremyhu/master'

commit 03ea0b7726487b96df73936518da73d023e51334
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Tue Dec 7 16:31:55 2010 -0500

    docs: replace BUILLDOCS with existing ENABLE_DEVEL_DOCS
    
    Use the util-macros AM Conditionals to control generation of developers
    documents. This is used throughout xorg modules.
    
    The doxygen generated docs are now also managed by --enable-devel-docs.
    
    Remove --enable-builddocs as this was last use for BUILDDOCS
    
    	*** From the RELEASE NOTES ***
    
     New configure options for documentation in modules
     --------------------------------------------------
     As many more modules now contain documentation to be converted from DocBook XML to text,
     HTML, PostScript, and/or PDF formats, new standard options have been added to the configure
     macros to control the build of these in the modules.
     --with-xmlto=yes|no
                         Enables or disables use of the xmlto [https://fedorahosted.org/
                         xmlto/] command to translate DocBook XML to other formats.
                         All DocBook XML conversions require use of this command.
     --with-fop=yes|no
                         Enables or disables use of the Apache fop [http://
                         xmlgraphics.apache.org/fop/] command to translate DocBook
                         XML to PostScript and PDF formats.
     --enable-docs=yes|no
                         Enables or disables the build and installation of all
                         documentation except traditional man pages or those covered
                         by the --enable-devel-docs and --enable-specs options.
     --enable-devel-docs=yes|no
                         Enables or disables the build and installation of documentation
                         for developers of the X.Org software modules.
     --enable-specs=yes|no
                         Enables or disables the build and installation of the formal
                         specification documents for protocols and APIs.
    
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 38158f9..a5967ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -581,9 +581,6 @@ AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11
 				[ XQUARTZ_SPARKLE="${enableval}" ],
 				[ XQUARTZ_SPARKLE="no" ])
 AC_SUBST([XQUARTZ_SPARKLE])
-AC_ARG_ENABLE(builddocs,      AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
-                                [BUILDDOCS=$enableval],
-                                [BUILDDOCS=no])
 AC_ARG_ENABLE(install-libxf86config,
 				AS_HELP_STRING([--enable-install-libxf86config],
 				[Install libxf86config (default: disabled)]),
@@ -709,8 +706,6 @@ if test "x$INT10" = xyes; then
 	AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
 fi
 
-dnl Handle building documentation
-AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes)
 XORG_ENABLE_DOCS
 XORG_ENABLE_DEVEL_DOCS
 XORG_WITH_XMLTO(0.0.20)
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 3c8fa13..2a87c39 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -1,5 +1,5 @@
 
-SUBDIRS = input config examples
+SUBDIRS = input config examples doc
 bin_PROGRAMS = Xdmx
 
 if XINERAMA
@@ -14,10 +14,6 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
 GLX_DEFS = @GL_CFLAGS@
 endif
 
-if BUILDDOCS
-SUBDIRS += doc
-endif
-
 AM_CFLAGS = \
       -DHAVE_DMX_CONFIG_H \
       $(DIX_CFLAGS) \
diff --git a/hw/dmx/doc/Makefile.am b/hw/dmx/doc/Makefile.am
index 6dea366..4bbc8bf 100644
--- a/hw/dmx/doc/Makefile.am
+++ b/hw/dmx/doc/Makefile.am
@@ -24,7 +24,6 @@ doc_sources = dmx.xml scaled.xml
 # Developer's documentation is not installed
 if ENABLE_DEVEL_DOCS
 include $(top_srcdir)/doc/xml/xmlrules-noinst.in
-endif
 
 if HAVE_DOXYGEN
 
@@ -40,6 +39,7 @@ html/annotated.html: $(DOXYGEN_SRC)
 maintainer-clean-local:
 	rm -rf html/
 endif
+endif ENABLE_DEVEL_DOCS
 
 EXTRA_DIST = \
 	$(XML_FILES) \
diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am
index 33ff18a..8021736 100644
--- a/hw/xfree86/doc/Makefile.am
+++ b/hw/xfree86/doc/Makefile.am
@@ -1,8 +1,4 @@
-if BUILDDOCS
 SUBDIRS = devel man sgml
-else
-SUBDIRS = man
-endif
 
 EXTRA_DIST = \
 	README.modes
commit c78c71c3a872665e426a0a4b82f17007bd8c12cd
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Tue Dec 7 16:31:54 2010 -0500

    hw/dmx/doc: DIST_SUBDIRS not required when using AM_CONDITIONAL
    
    The makefile can be simplyfied as Automake handle this automatically.
    All directories in SUBDIRS are visited for dist purposes.
    
    www.gnu.org/software/automake/manual/automake.html#SUBDIRS-vs-DIST_005fSUBDIRS
    
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 5c16dc3..3c8fa13 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -1,4 +1,3 @@
-DIST_SUBDIRS = input config glxProxy examples doc
 
 SUBDIRS = input config examples
 bin_PROGRAMS = Xdmx
commit 8a8fdd762ad89c350854943311ec4aadc50245fa
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 13 11:28:30 2010 +1000

    xfree86: always report the input options before initialising the device.
    
    After collecting the driver's default options, report the list of options
    set for the device before calling PreInit(). This helps with debugging those
    cases where options are not merged correctly.
    
    xf86OptionListReport reports with verbosity 5, higher than the default
    verbosity so this won't generate logspam in the default case.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Simon Thum <simon.thum at gmx.de>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 4ee8336..b9006ab 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -684,6 +684,7 @@ xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo)
     pInfo->next = NULL;
 
     xf86CollectInputOptions(pInfo, (const char**)drv->default_options);
+    xf86OptionListReport(pInfo->options);
     xf86ProcessCommonOptions(pInfo, pInfo->options);
 }
 
commit 9db9e964f6ca553dcbd3b7b037745d9581eaa065
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Dec 10 13:23:13 2010 +1000

    xfree86: swap the order to-be-merged lists in xf86CollectInputOptions.
    
    Current order causes the user-configured option list to be overwritten with
    the default list supplied by the driver. Swap around so we overwrite the
    driver's default values instead.
    
    This only affected options supplied by the driver such as XkbLayout in the
    case of evdev.
    
    Reported-by: Sebastian Glita <glseba at yahoo.com>
    Reported-by: Simon Thum <simon.thum at gmx.de>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Tested-by: Sebastian Glita <glseba at yahoo.com>

diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index d49aa31..16c27e5 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -130,7 +130,7 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts)
     if (defaultOpts) {
 	XF86OptionPtr tmp =xf86optionListCreate(defaultOpts, -1, 0);
 	if (pInfo->options)
-	    pInfo->options = xf86optionListMerge(pInfo->options, tmp);
+	    pInfo->options = xf86optionListMerge(tmp, pInfo->options);
 	else
 	    pInfo->options = tmp;
     }
commit 0d440a1c6e219cd39dbddd2b7e813c6431aac6ea
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Dec 8 14:52:19 2010 +1000

    dix: allow for button-only input devices (#21457)
    
    Add a few checks for the existence of a valuator class on the device to
    avoid null-pointer dereferences for button events from devices without a
    valuator class.
    
    X.Org Bug 21457 <http://bugs.freedesktop.org/show_bug.cgi?id=21457>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/dix/getevents.c b/dix/getevents.c
index 9feb216..794df42 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -767,7 +767,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
     /* if attached, clip both x and y to the defined limits (usually
      * co-ord space limit). If it is attached, we need x/y to go over the
      * limits to be able to change screens. */
-    if(dev->u.master) {
+    if(dev->u.master && dev->valuator) {
         if (valuator_get_mode(dev, 0) == Absolute)
             clipAxis(dev, 0, x);
         if (valuator_get_mode(dev, 1) == Absolute)
@@ -830,7 +830,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
     int old_screenx, old_screeny;
 
     /* scale x&y to screen */
-    if (dev->valuator->numAxes > 0) {
+    if (dev->valuator && dev->valuator->numAxes > 0) {
         *screenx = rescaleValuatorAxis(*x, x_frac, screenx_frac,
                 dev->valuator->axes + 0, NULL, scr->width);
     } else {
@@ -838,7 +838,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
         *screenx_frac = dev->last.remainder[0];
     }
 
-    if (dev->valuator->numAxes > 1) {
+    if (dev->valuator && dev->valuator->numAxes > 1) {
         *screeny = rescaleValuatorAxis(*y, y_frac, screeny_frac,
                 dev->valuator->axes + 1, NULL, scr->height);
     } else {
@@ -872,18 +872,21 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
         dev->u.master->last.remainder[1] = *screeny_frac;
     }
 
-    /* Crossed screen? Scale back to device coordiantes */
-    if(*screenx != old_screenx)
+    if (dev->valuator)
     {
-        scr = miPointerGetScreen(dev);
-        *x = rescaleValuatorAxis(*screenx, *screenx_frac, &x_frac, NULL,
-                                dev->valuator->axes + 0, scr->width);
-    }
-    if(*screeny != old_screeny)
-    {
-        scr = miPointerGetScreen(dev);
-        *y = rescaleValuatorAxis(*screeny, *screeny_frac, &y_frac, NULL,
-                                 dev->valuator->axes + 1, scr->height);
+        /* Crossed screen? Scale back to device coordiantes */
+        if(*screenx != old_screenx)
+        {
+            scr = miPointerGetScreen(dev);
+            *x = rescaleValuatorAxis(*screenx, *screenx_frac, &x_frac, NULL,
+                                    dev->valuator->axes + 0, scr->width);
+        }
+        if(*screeny != old_screeny)
+        {
+            scr = miPointerGetScreen(dev);
+            *y = rescaleValuatorAxis(*screeny, *screeny_frac, &y_frac, NULL,
+                                     dev->valuator->axes + 1, scr->height);
+        }
     }
 
     /* dropy x/y (device coordinates) back into valuators for next event */
@@ -904,6 +907,9 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
 static void
 updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms)
 {
+    if (!dev->valuator)
+        return;
+
     updateMotionHistory(dev, ms, mask, dev->last.valuators);
     if (dev->u.master)
     {
@@ -1104,7 +1110,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     if (!pDev->enabled)
         return 0;
 
-    if (!scr || !pDev->valuator)
+    if (!scr)
         return 0;
 
     switch (type)
commit 9cf055892dd413932e54b43cc2dfea70bafd525f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Dec 8 14:43:51 2010 +1000

    xfree86: don't set movement flags for non-valuator events.
    
    If a device doesn't send valuators, don't try to move its position.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index c2cf438..4ee8336 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1015,10 +1015,13 @@ xf86PostMotionEventM(DeviceIntPtr	device,
     int dx = 0, dy = 0;
 #endif
 
-    if (is_absolute)
-        flags = POINTER_ABSOLUTE;
-    else
-        flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    if (valuator_mask_num_valuators(mask) > 0)
+    {
+        if (is_absolute)
+            flags = POINTER_ABSOLUTE;
+        else
+            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    }
 
 #if XFreeXDGA
     /* The evdev driver may not always send all axes across. */
@@ -1160,10 +1163,13 @@ xf86PostButtonEventM(DeviceIntPtr	device,
     int index;
 #endif
 
-    if (is_absolute)
-        flags = POINTER_ABSOLUTE;
-    else
-        flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    if (valuator_mask_num_valuators(mask) > 0)
+    {
+        if (is_absolute)
+            flags = POINTER_ABSOLUTE;
+        else
+            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    }
 
 #if XFreeXDGA
     if (miPointerGetScreen(device)) {
commit aba8133c9c5a50753c388d76407868ac69f4134b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Dec 8 14:02:17 2010 +1000

    dix: clear up an overly convoluted if statement.
    
    No functional changes, just improves readability. This statement had things
    added to/removed from it for a few server releases while the input event
    queue was revamped. What made sense once is now mainly confusing.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 25889de..9feb216 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1104,17 +1104,25 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     if (!pDev->enabled)
         return 0;
 
-    ms = GetTimeInMillis(); /* before pointer update to help precision */
-
-    if (!scr || !pDev->valuator ||
-        (type != MotionNotify && type != ButtonPress && type != ButtonRelease) ||
-        (type != MotionNotify && !pDev->button) ||
-        ((type == ButtonPress || type == ButtonRelease) && !buttons))
+    if (!scr || !pDev->valuator)
         return 0;
 
-    if (type == MotionNotify &&
-        (!mask_in || valuator_mask_num_valuators(mask_in) <= 0))
-        return 0;
+    switch (type)
+    {
+        case MotionNotify:
+            if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0)
+                return 0;
+            break;
+        case ButtonPress:
+        case ButtonRelease:
+            if (!pDev->button || !buttons)
+                return 0;
+            break;
+        default:
+            return 0;
+    }
+
+    ms = GetTimeInMillis(); /* before pointer update to help precision */
 
     events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
 


More information about the Xquartz-changes mailing list