xserver: Branch 'mpx' - 48 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Mar 20 09:18:03 EET 2007


 GL/glx/glxcmdsswap.c                                            |    4 
 GL/glx/glxdri.c                                                 |    1 
 Xext/shm.c                                                      |   23 
 Xi/exevents.c                                                   |   89 -
 Xi/extinit.c                                                    |   15 
 afb/afbpixmap.c                                                 |    4 
 autogen.sh                                                      |    2 
 cfb/cfbpixmap.c                                                 |    4 
 configure.ac                                                    |    2 
 dix/atom.c                                                      |    8 
 dix/colormap.c                                                  |   56 
 dix/cursor.c                                                    |    8 
 dix/devices.c                                                   |  100 +
 dix/dispatch.c                                                  |  245 ++--
 dix/dixfonts.c                                                  |    6 
 dix/dixutils.c                                                  |   10 
 dix/events.c                                                    |  224 ++-
 dix/extension.c                                                 |   24 
 dix/gc.c                                                        |   68 -
 dix/glyphcurs.c                                                 |    8 
 dix/grabs.c                                                     |    8 
 dix/main.c                                                      |    6 
 dix/pixmap.c                                                    |    4 
 dix/privates.c                                                  |    8 
 dix/property.c                                                  |    6 
 dix/resource.c                                                  |   68 -
 dix/swaprep.c                                                   |   90 -
 dix/swapreq.c                                                   |  276 ++--
 dix/window.c                                                    |  210 +--
 fb/fbpixmap.c                                                   |    4 
 hw/darwin/Makefile.am                                           |   52 
 hw/darwin/README.apple                                          |    8 
 hw/darwin/apple/X11.xcodeproj/project.pbxproj                   |   33 
 hw/darwin/apple/X11Application.m                                |   57 
 hw/darwin/apple/bundle-main.c                                   |    7 
 hw/darwin/darwin.h                                              |    4 
 hw/darwin/darwinEvents.c                                        |  291 ++--
 hw/dmx/dmxpixmap.c                                              |    4 
 hw/dmx/dmxscrinit.c                                             |    6 
 hw/kdrive/ati/ati_cursor.c                                      |   20 
 hw/kdrive/ephyr/ephyrinit.c                                     |    8 
 hw/kdrive/i810/i810_cursor.c                                    |   11 
 hw/kdrive/src/kinput.c                                          |    6 
 hw/xfree86/Makefile.am                                          |    1 
 hw/xfree86/common/xf86Xinput.c                                  |   11 
 hw/xfree86/common/xf86fbman.c                                   |    2 
 hw/xfree86/doc/README.modes                                     |  474 +++++++
 hw/xfree86/dri/dri.c                                            |    6 
 hw/xfree86/i2c/uda1380_module.c                                 |    2 
 hw/xfree86/loader/Makefile.am                                   |    3 
 hw/xfree86/loader/dixsym.c                                      |    2 
 hw/xfree86/loader/loadmod.c                                     |    3 
 hw/xfree86/loader/xf86sym.c                                     |    5 
 hw/xfree86/modes/Makefile.am                                    |    4 
 hw/xfree86/modes/xf86Crtc.c                                     |  273 ++++
 hw/xfree86/modes/xf86Crtc.h                                     |  187 ++-
 hw/xfree86/modes/xf86Cursors.c                                  |  608 ++++++++++
 hw/xfree86/modes/xf86RandR12.c                                  |   24 
 hw/xfree86/modes/xf86Rename.h                                   |    4 
 hw/xfree86/modes/xf86Rotate.c                                   |  128 +-
 hw/xfree86/ramdac/Makefile.am                                   |    6 
 hw/xfree86/ramdac/xf86Cursor.h                                  |    3 
 hw/xfree86/x86emu/prim_ops.c                                    |    4 
 hw/xfree86/xf4bpp/ppcPixmap.c                                   |    4 
 hw/xnest/Pixmap.c                                               |    6 
 hw/xnest/Screen.c                                               |    4 
 hw/xnest/XNPixmap.h                                             |    7 
 hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am |   10 
 hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am   |   10 
 hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am     |    7 
 hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am      |    2 
 include/dix.h                                                   |    3 
 include/extinit.h                                               |    4 
 include/input.h                                                 |    1 
 include/pixmapstr.h                                             |    2 
 include/screenint.h                                             |    4 
 include/scrnintstr.h                                            |    2 
 mfb/mfbpixmap.c                                                 |    4 
 mi/miarc.c                                                      |  102 -
 mi/mibitblt.c                                                   |   12 
 mi/mibstore.c                                                   |   62 -
 mi/micmap.c                                                     |   18 
 mi/miexpose.c                                                   |   32 
 mi/mifillarc.c                                                  |   56 
 mi/mifillrct.c                                                  |   20 
 mi/mifpolycon.c                                                 |    8 
 mi/miglblt.c                                                    |   20 
 mi/miline.h                                                     |    2 
 mi/mioverlay.c                                                  |   10 
 mi/mipoly.c                                                     |    8 
 mi/mipolycon.c                                                  |    8 
 mi/mipolygen.c                                                  |   12 
 mi/mipolypnt.c                                                  |    2 
 mi/mipolyutil.c                                                 |   42 
 mi/mipushpxl.c                                                  |   10 
 mi/miregion.c                                                   |  304 ++---
 mi/miscrinit.c                                                  |    4 
 mi/mispans.c                                                    |   56 
 mi/misprite.c                                                   |   10 
 mi/mivaltree.c                                                  |   30 
 mi/miwideline.c                                                 |  216 +--
 mi/miwindow.c                                                   |   48 
 mi/mizerarc.c                                                   |   28 
 randr/rrcrtc.c                                                  |    2 
 randr/rrdispatch.c                                              |    7 
 randr/rroutput.c                                                |    2 
 randr/rrpointer.c                                               |    2 
 107 files changed, 3222 insertions(+), 1819 deletions(-)

New commits:
diff-tree 0acf993e2878d0866fd4e2db8252c1ea6841e494 (from 015d728bcde5b16a72a976579755421e3023626b)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Mar 19 16:11:01 2007 +1030

    dix:    Move sprite initalization/pairing from ActivateDevice to
            EnableDevice.
            zero out spriteTrace, otherwise GetCurrentRootWindow() may return
            invalid data.
    
            Evdev adds previously hotplugged devices on its own when rescanning,
            and ActivateDevice does not get called for those devices. Sprites need
            to be initialized or paired before the device gets started, so the
            safest place to do so is EnableDevice (which actually does get called
            by the evdev driver).

diff --git a/dix/devices.c b/dix/devices.c
index 927d16e..579203f 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -173,6 +173,11 @@ EnableDevice(DeviceIntPtr dev)
     dev->enabled = TRUE;
     *prev = dev->next;
 
+    if (IsPointerDevice(dev) && dev->isMPDev)
+        InitializeSprite(dev, GetCurrentRootWindow());
+    else
+        PairDevices(NULL, inputInfo.pointer, dev);
+
     for (prev = &inputInfo.devices; *prev; prev = &(*prev)->next)
         ;
     *prev = dev;
@@ -221,11 +226,6 @@ ActivateDevice(DeviceIntPtr dev)
     SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask,
                           (xEvent *) &ev, 1);
 
-    if (IsPointerDevice(dev) && dev->isMPDev)
-        InitializeSprite(dev, GetCurrentRootWindow());
-    else
-        PairDevices(NULL, inputInfo.pointer, dev);
-
     return ret;
 }
 
@@ -448,7 +448,6 @@ InitAndStartDevices()
             PairDevices(NULL, GuessFreePointerDevice(), dev);
     }
 
-
     return Success;
 }
 
diff --git a/dix/events.c b/dix/events.c
index dc9c4e5..c9b5a4f 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4290,6 +4290,11 @@ InitEvents()
     {
 	spriteTraceSize = 32;
 	spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr));
+        /* FIXME: spriteTrace[0] needs to be NULL, otherwise
+         * GetCurrentRootWindow() in EnableDevice() may return a invalid
+         * value. (whot)
+         */
+        memset(spriteTrace, 0, 32 * sizeof(WindowPtr));
 	if (!spriteTrace)
 	    FatalError("failed to allocate spriteTrace");
     }
diff-tree 015d728bcde5b16a72a976579755421e3023626b (from parents)
Merge: 65b0eb60b0b9e6405aa2e3d4c712ec4d2f0da070 b167583fe234a536aa6187e17f21da85be4f0b7f
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Mar 19 09:42:56 2007 +1030

    Merge branch 'master' into mpx
    
    Conflicts:
    
    	dix/devices.c
    	dix/events.c
    	mi/misprite.c

diff --cc dix/devices.c
index 0c1553e,8eb54f7..927d16e
@@@ -541,19 -493,11 +541,22 @@@
      while (dev->xkb_interest)
  	XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
  #endif
 +    
 +    if (DevHasCursor(dev))
 +        xfree((pointer)dev->pSprite);
 +
 +    /* a client may have the device set as client pointer */
 +    for (j = 0; j < currentMaxClients; j++)
 +    {
 +        if (clients[j]->clientPtr == dev)
 +            PickPointer(clients[j]);
 +    }
  
+     if (dev->devPrivates)
+ 	xfree(dev->devPrivates);
+ 
 -    xfree(dev->sync.event);
 +    xfree(dev->coreGrab.sync.event);
 +    xfree(dev->deviceGrab.sync.event);
      xfree(dev);
  }
  
@@@ -1888,9 -1822,9 +1891,9 @@@
  }
  
  void
- MaybeStopHint(register DeviceIntPtr dev, ClientPtr client)
+ MaybeStopHint(DeviceIntPtr dev, ClientPtr client)
  {
 -    GrabPtr grab = dev->grab;
 +    GrabPtr grab = dev->coreGrab.grab;
  
      if ((grab && SameClient(grab, client) &&
  	 ((grab->eventMask & PointerMotionHintMask) ||
diff --cc dix/events.c
index ca12d22,c0b62b8..dc9c4e5
@@@ -805,15 -761,12 +805,15 @@@
  
  static void
  CheckVirtualMotion(
-     register DeviceIntPtr pDev,
-     register QdEventPtr qe,
-     register WindowPtr pWin)
++    DeviceIntPtr pDev,
+     QdEventPtr qe,
+     WindowPtr pWin)
  {
 +    SpritePtr pSprite = pDev->pSprite;
 +
  #ifdef PANORAMIX
      if(!noPanoramiXExtension) {
 -	XineramaCheckVirtualMotion(qe, pWin);
 +	XineramaCheckVirtualMotion(pDev, qe, pWin);
  	return;
      }
  #endif
@@@ -934,12 -883,10 +934,12 @@@
  }
  
  static void
 -PostNewCursor(void)
 +PostNewCursor(DeviceIntPtr pDev)
  {
-     register    WindowPtr win;
-     register    GrabPtr grab = pDev->coreGrab.grab;
+     WindowPtr win;
 -    GrabPtr grab = inputInfo.pointer->grab;
++    GrabPtr grab = pDev->coreGrab.grab;
 +    SpritePtr   pSprite = pDev->pSprite;
 +    CursorPtr   pCursor;
  
      if (syncEvents.playingEvents)
  	return;
@@@ -1046,10 -984,9 +1046,10 @@@
  void
  EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
  {
-     register QdEventPtr tail = *syncEvents.pendtail;
-     register QdEventPtr qe;
+     QdEventPtr tail = *syncEvents.pendtail;
+     QdEventPtr qe;
      xEvent		*qxE;
 +    SpritePtr pSprite = device->pSprite;
  
      NoticeTime(xE);
  
@@@ -1122,9 -1059,8 +1122,9 @@@
  static void
  PlayReleasedEvents(void)
  {
-     register QdEventPtr *prev, qe;
-     register DeviceIntPtr dev;
+     QdEventPtr *prev, qe;
+     DeviceIntPtr dev;
 +    DeviceIntPtr pDev;
  
      prev = &syncEvents.pending;
      while ( (qe = *prev) )
@@@ -1169,9 -1104,9 +1169,9 @@@
  }
  
  static void
- FreezeThaw(register DeviceIntPtr dev, Bool frozen)
+ FreezeThaw(DeviceIntPtr dev, Bool frozen)
  {
 -    dev->sync.frozen = frozen;
 +    dev->coreGrab.sync.frozen = frozen;
      if (frozen)
  	dev->public.processInputProc = dev->public.enqueueInputProc;
      else
@@@ -1181,17 -1116,16 +1181,17 @@@
  void
  ComputeFreezes()
  {
-     register DeviceIntPtr replayDev = syncEvents.replayDev;
-     register int i;
+     DeviceIntPtr replayDev = syncEvents.replayDev;
+     int i;
      WindowPtr w;
-     register xEvent *xE;
+     xEvent *xE;
      int count;
      GrabPtr grab;
-     register DeviceIntPtr dev;
+     DeviceIntPtr dev;
  
      for (dev = inputInfo.devices; dev; dev = dev->next)
 -	FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN));
 +	FreezeThaw(dev, dev->coreGrab.sync.other || 
 +                (dev->coreGrab.sync.state >= FROZEN));
      if (syncEvents.playingEvents || (!replayDev && !syncEvents.pending))
  	return;
      syncEvents.playingEvents = TRUE;
@@@ -1283,20 -1198,20 +1283,20 @@@
  #endif
  
  void
- CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
+ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
  {
-     register GrabPtr grab = thisDev->coreGrab.grab;
-     register DeviceIntPtr dev;
 -    GrabPtr grab = thisDev->grab;
++    GrabPtr grab = thisDev->coreGrab.grab;
+     DeviceIntPtr dev;
  
      if (thisMode == GrabModeSync)
 -	thisDev->sync.state = FROZEN_NO_EVENT;
 +	thisDev->coreGrab.sync.state = FROZEN_NO_EVENT;
      else
      {	/* free both if same client owns both */
 -	thisDev->sync.state = THAWED;
 -	if (thisDev->sync.other &&
 -	    (CLIENT_BITS(thisDev->sync.other->resource) ==
 +	thisDev->coreGrab.sync.state = THAWED;
 +	if (thisDev->coreGrab.sync.other &&
 +	    (CLIENT_BITS(thisDev->coreGrab.sync.other->resource) ==
  	     CLIENT_BITS(grab->resource)))
 -	    thisDev->sync.other = NullGrab;
 +	    thisDev->coreGrab.sync.other = NullGrab;
      }
      for (dev = inputInfo.devices; dev; dev = dev->next)
      {
@@@ -1317,12 -1232,11 +1317,12 @@@
  }
  
  void
- ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, 
+ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, 
                      TimeStamp time, Bool autoGrab)
  {
 -    WindowPtr oldWin = (mouse->grab) ? mouse->grab->window
 -				     : sprite.win;
 +    WindowPtr oldWin = (mouse->coreGrab.grab) ? 
 +                        mouse->coreGrab.grab->window
 +                        : mouse->pSprite->win;
  
      if (grab->confineTo)
      {
@@@ -1347,25 -1260,24 +1347,25 @@@
  }
  
  void
- DeactivatePointerGrab(register DeviceIntPtr mouse)
+ DeactivatePointerGrab(DeviceIntPtr mouse)
  {
-     register GrabPtr grab = mouse->coreGrab.grab;
-     register DeviceIntPtr dev;
 -    GrabPtr grab = mouse->grab;
++    GrabPtr grab = mouse->coreGrab.grab;
+     DeviceIntPtr dev;
  
      mouse->valuator->motionHintWindow = NullWindow;
 -    mouse->grab = NullGrab;
 -    mouse->sync.state = NOT_GRABBED;
 -    mouse->fromPassiveGrab = FALSE;
 +    mouse->coreGrab.grab = NullGrab;
 +    mouse->coreGrab.sync.state = NOT_GRABBED;
 +    mouse->coreGrab.fromPassiveGrab = FALSE;
      for (dev = inputInfo.devices; dev; dev = dev->next)
      {
 -	if (dev->sync.other == grab)
 -	    dev->sync.other = NullGrab;
 +	if (dev->coreGrab.sync.other == grab)
 +	    dev->coreGrab.sync.other = NullGrab;
      }
 -    DoEnterLeaveEvents(grab->window, sprite.win, NotifyUngrab);
 +    DoEnterLeaveEvents(mouse, grab->window, 
 +                       mouse->pSprite->win, NotifyUngrab);
      if (grab->confineTo)
 -	ConfineCursorToWindow(ROOT, FALSE, FALSE);
 -    PostNewCursor();
 +	ConfineCursorToWindow(mouse, ROOT, FALSE, FALSE);
 +    PostNewCursor(mouse);
      if (grab->cursor)
  	FreeCursor(grab->cursor, (Cursor)0);
      ComputeFreezes();
@@@ -1398,12 -1310,12 +1398,12 @@@
  }
  
  void
- DeactivateKeyboardGrab(register DeviceIntPtr keybd)
+ DeactivateKeyboardGrab(DeviceIntPtr keybd)
  {
-     register GrabPtr grab = keybd->coreGrab.grab;
-     register DeviceIntPtr dev;
-     register WindowPtr focusWin = keybd->focus ? keybd->focus->win
 -    GrabPtr grab = keybd->grab;
++    GrabPtr grab = keybd->coreGrab.grab;
+     DeviceIntPtr dev;
+     WindowPtr focusWin = keybd->focus ? keybd->focus->win
 -					       : sprite.win;
 +					       : keybd->pSprite->win;
  
      if (focusWin == FollowKeyboardWin)
  	focusWin = inputInfo.keyboard->focus->win;
@@@ -1434,11 -1338,9 +1434,11 @@@
  {
      Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced;
      TimeStamp grabTime;
-     register DeviceIntPtr dev;
+     DeviceIntPtr dev;
 +    GrabInfoPtr devgrabinfo, 
 +                grabinfo = (core) ? &thisDev->coreGrab : &thisDev->deviceGrab;
  
 -    thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client);
 +    thisGrabbed = grabinfo->grab && SameClient(grabinfo->grab, client);
      thisSynced = FALSE;
      otherGrabbed = FALSE;
      othersFrozen = TRUE;
@@@ -1551,11 -1442,11 +1551,11 @@@
  }
  
  int
- ProcAllowEvents(register ClientPtr client)
+ ProcAllowEvents(ClientPtr client)
  {
      TimeStamp		time;
 -    DeviceIntPtr	mouse = inputInfo.pointer;
 -    DeviceIntPtr	keybd = inputInfo.keyboard;
 +    DeviceIntPtr	mouse = PickPointer(client);
 +    DeviceIntPtr	keybd = PickKeyboard(client);
      REQUEST(xAllowEventsReq);
  
      REQUEST_SIZE_MATCH(xAllowEventsReq);
@@@ -1704,8 -1589,8 +1704,8 @@@
  }
  
  int
- DeliverEventsToWindow(DeviceIntPtr pDev, register WindowPtr pWin, xEvent
 -DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count, 
 -                      Mask filter, GrabPtr grab, int mskidx)
++DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
 +        *pEvents, int count, Mask filter, GrabPtr grab, int mskidx)
  {
      int deliveries = 0, nondeliveries = 0;
      int attempt;
@@@ -2255,90 -2092,46 +2255,90 @@@
  #endif
  
  void
- DefineInitialRootWindow(register WindowPtr win)
+ DefineInitialRootWindow(WindowPtr win)
  {
 -    ScreenPtr pScreen = win->drawable.pScreen;
 +    DeviceIntPtr pDev = inputInfo.devices;
  
 -    sprite.hotPhys.pScreen = pScreen;
 -    sprite.hotPhys.x = pScreen->width / 2;
 -    sprite.hotPhys.y = pScreen->height / 2;
 -    sprite.hot = sprite.hotPhys;
 -    sprite.hotLimits.x2 = pScreen->width;
 -    sprite.hotLimits.y2 = pScreen->height;
  #ifdef XEVIE
 -    xeviewin =
 +    xeviewin = win;
  #endif
 -    sprite.win = win;
 -    sprite.current = wCursor (win);
 -    sprite.current->refcnt++;
 -    spriteTraceGood = 1;
      ROOT = win;
 -    (*pScreen->CursorLimits) (
 -	pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits);
 -    sprite.confined = FALSE;
 -    (*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits);
 -    (*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
 -    (*pScreen->DisplayCursor) (pScreen, sprite.current);
  
 +    InitializeSprite(inputInfo.pointer, win);
 +
 +    while (pDev)
 +    {
 +        if (DevHasCursor(pDev))
 +            InitializeSprite(pDev, win);
 +        pDev = pDev->next;
 +    }
 +}
 +
 +void 
 +InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
 +{
 +    SpritePtr pSprite;
 +    ScreenPtr pScreen; 
 +
 +    if (!pDev->pSprite)
 +    {
 +        pDev->pSprite = (SpritePtr)xcalloc(1, sizeof(SpriteRec));
 +        if (!pDev->pSprite)
 +            FatalError("InitializeSprite: failed to allocate sprite struct");
 +    }
 +
 +    pSprite = pDev->pSprite;
 +    pDev->spriteOwner = TRUE;
 +
 +    pScreen = (pWin) ? pWin->drawable.pScreen : (ScreenPtr)NULL;
 +    pSprite->hot.pScreen = pScreen;
 +    pSprite->hotPhys.pScreen = pScreen;
 +    if (pScreen)
 +    {
 +        pSprite->hotPhys.x = pScreen->width / 2;
 +        pSprite->hotPhys.y = pScreen->height / 2;
 +        pSprite->hotLimits.x2 = pScreen->width;
 +        pSprite->hotLimits.y2 = pScreen->height;
 +    }
 +
 +    pSprite->hot = pSprite->hotPhys;
 +    pSprite->win = pWin;
 +
 +    if (pWin)
 +    {
 +        pSprite->current = wCursor(pWin);
 +        pSprite->current->refcnt++;
 +    } else
 +        pSprite->current = NullCursor;
 +
 +    if (pScreen)
 +    {
 +        (*pScreen->CursorLimits) ( pDev, pScreen, pSprite->current,
 +                                   &pSprite->hotLimits, &pSprite->physLimits);
 +        pSprite->confined = FALSE;
 +
 +        (*pScreen->ConstrainCursor) (pDev, pScreen,
 +                                     &pSprite->physLimits);
 +        (*pScreen->SetCursorPosition) (pDev, pScreen, pSprite->hot.x,
 +                                       pSprite->hot.y,
 +                                       FALSE); 
 +        (*pScreen->DisplayCursor) (pDev, pScreen, pSprite->current);
 +    }
  #ifdef PANORAMIX
      if(!noPanoramiXExtension) {
 -	sprite.hotLimits.x1 = -panoramiXdataPtr[0].x;
 -	sprite.hotLimits.y1 = -panoramiXdataPtr[0].y;
 -	sprite.hotLimits.x2 = PanoramiXPixWidth  - panoramiXdataPtr[0].x;
 -	sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
 -	sprite.physLimits = sprite.hotLimits;
 -	sprite.confineWin = NullWindow;
 +        pSprite->hotLimits.x1 = -panoramiXdataPtr[0].x;
 +        pSprite->hotLimits.y1 = -panoramiXdataPtr[0].y;
 +        pSprite->hotLimits.x2 = PanoramiXPixWidth  - panoramiXdataPtr[0].x;
 +        pSprite->hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
 +        pSprite->physLimits = pSprite->hotLimits;
 +        pSprite->confineWin = NullWindow;
  #ifdef SHAPE
 -        sprite.hotShape = NullRegion;
 +        pSprite->hotShape = NullRegion;
  #endif
 -	sprite.screen = pScreen;
 -	/* gotta UNINIT these someplace */
 -	REGION_NULL(pScreen, &sprite.Reg1);
 -	REGION_NULL(pScreen, &sprite.Reg2);
 +        pSprite->screen = pScreen;
 +        /* gotta UNINIT these someplace */
 +        REGION_NULL(pScreen, &pSprite->Reg1);
 +        REGION_NULL(pScreen, &pSprite->Reg2);
      }
  #endif
  }
@@@ -2632,14 -2411,13 +2632,14 @@@
  static Bool
  CheckPassiveGrabsOnWindow(
      WindowPtr pWin,
-     register DeviceIntPtr device,
-     register xEvent *xE,
+     DeviceIntPtr device,
+     xEvent *xE,
      int count)
  {
-     register GrabPtr grab = wPassiveGrabs(pWin);
+     GrabPtr grab = wPassiveGrabs(pWin);
      GrabRec tempGrab;
 +    GrabInfoPtr grabinfo;
-     register xEvent *dxE;
+     xEvent *dxE;
  
      if (!grab)
  	return FALSE;
@@@ -2809,22 -2585,13 +2809,22 @@@
  }
  
  void
- DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, 
+ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, 
                      Bool deactivateGrab, int count)
  {
-     register GrabPtr grab;
 -    GrabPtr grab = thisDev->grab;
++    GrabPtr grab;
 +    GrabInfoPtr grabinfo;
      int deliveries = 0;
-     register DeviceIntPtr dev;
-     register xEvent *dxE;
+     DeviceIntPtr dev;
+     xEvent *dxE;
 +    SpritePtr pSprite = thisDev->pSprite;
 +
 +    if (xE->u.u.type & EXTENSION_EVENT_BASE)
 +        grabinfo = &thisDev->deviceGrab;
 +    else
 +        grabinfo = &thisDev->coreGrab;
 +
 +    grab = grabinfo->grab;
  
      if (grab->ownerEvents)
      {
@@@ -2912,15 -2674,13 +2912,14 @@@
  #endif
  {
      int             key, bit;
-     register BYTE   *kptr;
-     register int    i;
-     register CARD8  modifiers;
-     register CARD16 mask;
-     register GrabPtr         grab;
+     BYTE   *kptr;
+     int    i;
+     CARD8  modifiers;
+     CARD16 mask;
 -    GrabPtr         grab = keybd->grab;
++    GrabPtr         grab;
 +    GrabInfoPtr     grabinfo;
      Bool            deactivateGrab = FALSE;
-     register KeyClassPtr keyc = keybd->key;
- 
+     KeyClassPtr keyc = keybd->key;
  #ifdef XEVIE
      static Window           rootWin = 0;
  
@@@ -3110,16 -2863,14 +3109,16 @@@
  
  void
  #ifdef XKB
- CoreProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count)
+ CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
  #else
- ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count)
+ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
  #endif
  {
 -    GrabPtr	grab = mouse->grab;
 +    GrabPtr	        grab = mouse->coreGrab.grab;
      Bool                deactivateGrab = FALSE;
-     register ButtonClassPtr butc = mouse->button;
 -    ButtonClassPtr butc = mouse->button;
++    ButtonClassPtr      butc = mouse->button;
 +    SpritePtr           pSprite = mouse->pSprite;
 +
  #ifdef XKB
      XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo;
  #endif
@@@ -3163,12 -2914,12 +3162,12 @@@
      }
      if (xE->u.u.type != MotionNotify)
      {
- 	register int  key;
- 	register BYTE *kptr;
+ 	int  key;
+ 	BYTE *kptr;
  	int           bit;
  
 -	XE_KBPTR.rootX = sprite.hot.x;
 -	XE_KBPTR.rootY = sprite.hot.y;
 +	XE_KBPTR.rootX = pSprite->hot.x;
 +	XE_KBPTR.rootY = pSprite->hot.y;
  
  	key = xE->u.u.detail;
  	kptr = &butc->down[key >> 3];
@@@ -3437,21 -3187,16 +3436,21 @@@
      int type,
      int mode,
      int detail,
-     register WindowPtr pWin,
+     WindowPtr pWin,
      Window child)
  {
 -    xEvent		event;
 -    DeviceIntPtr keybd = inputInfo.keyboard;
 +    xEvent              event;
-     register DeviceIntPtr keybd = inputInfo.keyboard;
++    DeviceIntPtr        keybd = inputInfo.keyboard;
      WindowPtr		focus;
-     register DeviceIntPtr mouse = pDev;
 -    DeviceIntPtr mouse = inputInfo.pointer;
 -    GrabPtr	grab = mouse->grab;
++    DeviceIntPtr        mouse = pDev;
 +    GrabPtr	        grab = mouse->coreGrab.grab;
 +    GrabPtr	        devgrab = mouse->deviceGrab.grab;
      Mask		mask;
  
 +    deviceEnterNotify   *devEnterLeave;
 +    int                 mskidx;
 +    OtherInputMasks     *inputMasks;
 +
      if ((pWin == mouse->valuator->motionHintWindow) &&
  	(detail != NotifyInferior))
  	mouse->valuator->motionHintWindow = NullWindow;
@@@ -3553,18 -3271,14 +3552,18 @@@
  
      if (ancestor == parent)
  	return;
 -    EnterNotifies(ancestor, parent, mode, detail);
 -    EnterLeaveEvent(EnterNotify, mode, detail, parent, child->drawable.id);
 -}
 +    EnterNotifies(pDev, ancestor, parent, mode, detail);
 +    EnterLeaveEvent(pDev, EnterNotify, mode, detail, parent,
 +                    child->drawable.id); }
  
  static void
 -LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
 +LeaveNotifies(DeviceIntPtr pDev, 
 +              WindowPtr child, 
 +              WindowPtr ancestor, 
 +              int mode, 
 +              int detail)
  {
-     register WindowPtr  pWin;
+     WindowPtr  pWin;
  
      if (ancestor == child)
  	return;
@@@ -4044,8 -3744,8 +4043,8 @@@
  int
  ProcChangeActivePointerGrab(ClientPtr client)
  {
 -    DeviceIntPtr device = inputInfo.pointer;
 -    GrabPtr grab = device->grab;
 +    DeviceIntPtr device = PickPointer(client);
-     register GrabPtr grab = device->coreGrab.grab;
++    GrabPtr      grab = device->coreGrab.grab;
      CursorPtr newCursor, oldCursor;
      REQUEST(xChangeActivePointerGrabReq);
      TimeStamp time;
diff --cc hw/xfree86/dri/dri.c
index a4413c7,7bd07c0..05df54a
@@@ -70,8 -70,9 +70,10 @@@
  #include "mi.h"
  #include "mipointer.h"
  #include "xf86_OSproc.h"
 +#include "inputstr.h"
  
+ #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
+ 
  #if !defined(PANORAMIX)
  extern Bool noPanoramiXExtension;
  #endif
diff --cc hw/xfree86/modes/xf86Cursors.c
index 0000000,009cccf..1564182
mode 000000,100644..100644
@@@ -1,0 -1,607 +1,608 @@@
+ /*
+  * Copyright © 2007 Keith Packard
+  *
+  * 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 the copyright holders not be used in advertising or
+  * publicity pertaining to distribution of the software without specific,
+  * written prior permission.  The copyright holders make no representations
+  * about the suitability of this software for any purpose.  It is provided "as
+  * is" without express or implied warranty.
+  *
+  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+  * EVENT SHALL THE COPYRIGHT HOLDERS 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>
+ #else
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+ #endif
+ 
+ #include <stddef.h>
+ #include <string.h>
+ #include <stdio.h>
+ 
+ #include "xf86.h"
+ #include "xf86DDC.h"
+ #include "xf86Crtc.h"
+ #include "xf86Modes.h"
+ #include "xf86RandR12.h"
+ #include "X11/extensions/render.h"
+ #define DPMS_SERVER
+ #include "X11/extensions/dpms.h"
+ #include "X11/Xatom.h"
+ #ifdef RENDER
+ #include "picturestr.h"
+ #endif
+ #include "cursorstr.h"
++#include "inputstr.h"
+ 
+ /*
+  * Given a screen coordinate, rotate back to a cursor source coordinate
+  */
+ static void
+ xf86_crtc_rotate_coord (Rotation    rotation,
+ 			int	    width,
+ 			int	    height,
+ 			int	    x_dst,
+ 			int	    y_dst,
+ 			int	    *x_src,
+ 			int	    *y_src)
+ {
+     if (rotation & RR_Reflect_X)
+ 	x_dst = width - x_dst - 1;
+     if (rotation & RR_Reflect_Y)
+ 	y_dst = height - y_dst - 1;
+     
+     switch (rotation & 0xf) {
+     case RR_Rotate_0:
+ 	*x_src = x_dst;
+ 	*y_src = y_dst;
+ 	break;
+     case RR_Rotate_90:
+ 	*x_src = height - y_dst - 1;
+ 	*y_src = x_dst;
+ 	break;
+     case RR_Rotate_180:
+ 	*x_src = width - x_dst - 1;
+ 	*y_src = height - y_dst - 1;
+ 	break;
+     case RR_Rotate_270:
+ 	*x_src = y_dst;
+ 	*y_src = width - x_dst - 1;
+ 	break;
+     }
+ }
+ 
+ /*
+  * Convert an x coordinate to a position within the cursor bitmap
+  */
+ static int
+ cursor_bitpos (int flags, int x, Bool mask)
+ {
+     if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK)
+ 	mask = !mask;
+     if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED)
+ 	x = (x & ~3) | (3 - (x & 3));
+     if (flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST)
+ 	x = (x & ~7) | (7 - (x & 7));
+     if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1)
+ 	x = (x << 1) + mask;
+     else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8)
+ 	x = ((x & ~7) << 1) | (mask << 3) | (x & 7);
+     else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16)
+ 	x = ((x & ~15) << 1) | (mask << 4) | (x & 15);
+     else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32)
+ 	x = ((x & ~31) << 1) | (mask << 5) | (x & 31);
+     else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64)
+ 	x = ((x & ~63) << 1) | (mask << 6) | (x & 63);
+     return x;
+ }
+ 
+ /*
+  * Fetch one bit from a cursor bitmap
+  */
+ static CARD8
+ get_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+ {
+     x = cursor_bitpos (flags, x, mask);
+     image += y * stride;
+     return (image[(x >> 3)] >> (x & 7)) & 1;
+ }
+ 
+ /*
+  * Set one bit in a cursor bitmap
+  */
+ static void
+ set_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+ {
+     x = cursor_bitpos (flags, x, mask);
+     image += y * stride;
+     image[(x >> 3)] |= 1 << (x & 7);
+ }
+     
+ /*
+  * Load a two color cursor into a driver that supports only ARGB cursors
+  */
+ static void
+ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src)
+ {
+     ScrnInfoPtr		scrn = crtc->scrn;
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+     CARD32		*cursor_image = (CARD32 *) xf86_config->cursor_image;
+     int			x, y;
+     int			xin, yin;
+     int			stride = cursor_info->MaxWidth >> 2;
+     int			flags = cursor_info->Flags;
+     CARD32		bits;
+ 
+ #ifdef ARGB_CURSOR
+     crtc->cursor_argb = FALSE;
+ #endif
+ 
+     for (y = 0; y < cursor_info->MaxHeight; y++)
+ 	for (x = 0; x < cursor_info->MaxWidth; x++) 
+ 	{
+ 	    xf86_crtc_rotate_coord (crtc->rotation,
+ 				    cursor_info->MaxWidth,
+ 				    cursor_info->MaxHeight,
+ 				    x, y, &xin, &yin);
+ 	    if (get_bit (src, stride, flags, xin, yin, TRUE) ==
+ 		((flags & HARDWARE_CURSOR_INVERT_MASK) == 0))
+ 	    {
+ 		if (get_bit (src, stride, flags, xin, yin, FALSE))
+ 		    bits = xf86_config->cursor_fg;
+ 		else
+ 		    bits = xf86_config->cursor_bg;
+ 	    }
+ 	    else
+ 		bits = 0;
+ 	    cursor_image[y * cursor_info->MaxWidth + x] = bits;
+ 	}
+     crtc->funcs->load_cursor_argb (crtc, cursor_image);
+ }
+ 
+ /*
+  * Set the colors for a two-color cursor (ignore for ARGB cursors)
+  */
+ static void
+ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
+ {
+     ScreenPtr		screen = scrn->pScreen;
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     CursorPtr		cursor = xf86_config->cursor;
+     int			c;
+     CARD8		*bits = cursor ? cursor->devPriv[screen->myNum] : NULL;
+ 
+     /* Save ARGB versions of these colors */
+     xf86_config->cursor_fg = (CARD32) fg | 0xff000000;
+     xf86_config->cursor_bg = (CARD32) bg | 0xff000000;
+     
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled && !crtc->cursor_argb)
+ 	{
+ 	    if (crtc->funcs->load_cursor_image)
+ 		crtc->funcs->set_cursor_colors (crtc, bg, fg);
+ 	    else if (bits)
+ 		xf86_crtc_convert_cursor_to_argb (crtc, bits);
+ 	}
+     }
+ }
+ 
+ static void
+ xf86_crtc_hide_cursor (xf86CrtcPtr crtc)
+ {
+     if (crtc->cursor_shown)
+     {
+ 	crtc->funcs->hide_cursor (crtc);
+ 	crtc->cursor_shown = FALSE;
+     }
+ }
+ 
+ void
+ xf86_hide_cursors (ScrnInfoPtr scrn)
+ {
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     int			c;
+ 
+     xf86_config->cursor_on = FALSE;
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled)
+ 	    xf86_crtc_hide_cursor (crtc);
+     }
+ }
+     
+ static void
+ xf86_crtc_show_cursor (xf86CrtcPtr crtc)
+ {
+     if (!crtc->cursor_shown && crtc->cursor_in_range)
+     {
+ 	crtc->funcs->show_cursor (crtc);
+ 	crtc->cursor_shown = TRUE;
+     }
+ }
+ 
+ void
+ xf86_show_cursors (ScrnInfoPtr scrn)
+ {
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     int			c;
+ 
+     xf86_config->cursor_on = TRUE;
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled)
+ 	    xf86_crtc_show_cursor (crtc);
+     }
+ }
+     
+ static void
+ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
+ {
+     ScrnInfoPtr		scrn = crtc->scrn;
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+     DisplayModePtr	mode = &crtc->mode;
+     int			x_temp;
+     int			y_temp;
+     Bool		in_range;
+ 
+     /* 
+      * Move to crtc coordinate space
+      */
+     x -= crtc->x;
+     y -= crtc->y;
+     
+     /*
+      * Rotate
+      */
+     switch ((crtc->rotation) & 0xf) {
+     case RR_Rotate_0:
+ 	break;
+     case RR_Rotate_90:
+ 	x_temp = y;
+ 	y_temp = mode->VDisplay - cursor_info->MaxWidth - x;
+ 	x = x_temp;
+ 	y = y_temp;
+ 	break;
+     case RR_Rotate_180:
+ 	x_temp = mode->HDisplay - cursor_info->MaxWidth - x;
+ 	y_temp = mode->VDisplay - cursor_info->MaxHeight - y;
+ 	x = x_temp;
+ 	y = y_temp;
+ 	break;
+     case RR_Rotate_270:
+ 	x_temp = mode->HDisplay - cursor_info->MaxHeight -  y;
+ 	y_temp = x;
+ 	x = x_temp;
+ 	y = y_temp;
+ 	break;
+     }
+     
+     /*
+      * Reflect
+      */
+     if (crtc->rotation & RR_Reflect_X)
+ 	x = mode->HDisplay - cursor_info->MaxWidth - x;
+     if (crtc->rotation & RR_Reflect_Y)
+ 	y = mode->VDisplay - cursor_info->MaxHeight - y;
+ 
+     /*
+      * Disable the cursor when it is outside the viewport
+      */
+     in_range = TRUE;
+     if (x >= mode->HDisplay || y >= mode->VDisplay ||
+ 	x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) 
+     {
+ 	in_range = FALSE;
+ 	x = 0;
+ 	y = 0;
+     }
+ 
+     crtc->cursor_in_range = in_range;
+     
+     if (in_range)
+     {
+ 	crtc->funcs->set_cursor_position (crtc, x, y);
+ 	xf86_crtc_show_cursor (crtc);
+     }
+     else
+ 	xf86_crtc_hide_cursor (crtc);
+ }
+ 
+ static void
+ xf86_set_cursor_position (ScrnInfoPtr scrn, int x, int y)
+ {
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     int			c;
+ 
+     /* undo what xf86HWCurs did to the coordinates */
+     x += scrn->frameX0;
+     y += scrn->frameY0;
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled)
+ 	    xf86_crtc_set_cursor_position (crtc, x, y);
+     }
+ }
+     
+ /*
+  * Load a two-color cursor into a crtc, performing rotation as needed
+  */
+ static void
+ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
+ {
+     ScrnInfoPtr		scrn = crtc->scrn;
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+     CARD8		*cursor_image;
+ 
+ #ifdef ARGB_CURSOR
+     crtc->cursor_argb = FALSE;
+ #endif
+ 
+     if (crtc->rotation == RR_Rotate_0)
+ 	cursor_image = src;
+     else
+     {
+         int x, y;
+     	int xin, yin;
+ 	int stride = cursor_info->MaxWidth >> 2;
+ 	int flags = cursor_info->Flags;
+ 	
+ 	cursor_image = xf86_config->cursor_image;
+ 	memset(cursor_image, 0, cursor_info->MaxWidth * stride);
+ 	
+         for (y = 0; y < cursor_info->MaxHeight; y++)
+ 	    for (x = 0; x < cursor_info->MaxWidth; x++) 
+ 	    {
+ 		xf86_crtc_rotate_coord (crtc->rotation,
+ 					cursor_info->MaxWidth,
+ 					cursor_info->MaxHeight,
+ 					x, y, &xin, &yin);
+ 		if (get_bit(src, stride, flags, xin, yin, FALSE))
+ 		    set_bit(cursor_image, stride, flags, x, y, FALSE);
+ 		if (get_bit(src, stride, flags, xin, yin, TRUE))
+ 		    set_bit(cursor_image, stride, flags, x, y, TRUE);
+ 	    }
+     }
+     crtc->funcs->load_cursor_image (crtc, cursor_image);
+ }
+     
+ /*
+  * Load a cursor image into all active CRTCs
+  */
+ static void
+ xf86_load_cursor_image (ScrnInfoPtr scrn, unsigned char *src)
+ {
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     int			c;
+ 
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled)
+ 	{
+ 	    if (crtc->funcs->load_cursor_image)
+ 		xf86_crtc_load_cursor_image (crtc, src);
+ 	    else if (crtc->funcs->load_cursor_argb)
+ 		xf86_crtc_convert_cursor_to_argb (crtc, src);
+ 	}
+     }
+ }
+ 
+ static Bool
+ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
+ {
+     ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+ 
+     xf86_config->cursor = cursor;
+     
+     if (cursor->bits->width > cursor_info->MaxWidth ||
+ 	cursor->bits->height> cursor_info->MaxHeight)
+ 	return FALSE;
+ 
+     return TRUE;
+ }
+ 
+ static Bool
+ xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
+ {
+     ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+     
+     xf86_config->cursor = cursor;
+     
+     /* Make sure ARGB support is available */
+     if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
+ 	return FALSE;
+     
+     if (cursor->bits->width > cursor_info->MaxWidth ||
+ 	cursor->bits->height> cursor_info->MaxHeight)
+ 	return FALSE;
+ 
+     return TRUE;
+ }
+ 
+ static void
+ xf86_crtc_load_cursor_argb (xf86CrtcPtr crtc, CursorPtr cursor)
+ {
+     ScrnInfoPtr		scrn = crtc->scrn;
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+     CARD32		*cursor_image = (CARD32 *) xf86_config->cursor_image;
+     CARD32		*cursor_source = (CARD32 *) cursor->bits->argb;
+     int			x, y;
+     int			xin, yin;
+     CARD32		bits;
+     int			source_width = cursor->bits->width;
+     int			source_height = cursor->bits->height;
+     int			image_width = cursor_info->MaxWidth;
+     int			image_height = cursor_info->MaxHeight;
+     
+     for (y = 0; y < image_height; y++)
+ 	for (x = 0; x < image_width; x++)
+ 	{
+ 	    xf86_crtc_rotate_coord (crtc->rotation, image_width, image_height,
+ 				    x, y, &xin, &yin);
+ 	    if (xin < source_width && yin < source_height)
+ 		bits = cursor_source[yin * source_width + xin];
+ 	    else
+ 		bits = 0;
+ 	    cursor_image[y * image_width + x] = bits;
+ 	}
+     
+     crtc->funcs->load_cursor_argb (crtc, cursor_image);
+ }
+ 
+ static void
+ xf86_load_cursor_argb (ScrnInfoPtr scrn, CursorPtr cursor)
+ {
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     int			c;
+ 
+     for (c = 0; c < xf86_config->num_crtc; c++)
+     {
+ 	xf86CrtcPtr crtc = xf86_config->crtc[c];
+ 
+ 	if (crtc->enabled)
+ 	    xf86_crtc_load_cursor_argb (crtc, cursor);
+     }
+ }
+ 
+ Bool
+ xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags)
+ {
+     ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     xf86CursorInfoPtr	cursor_info;
+ 
+     cursor_info = xf86CreateCursorInfoRec();
+     if (!cursor_info)
+ 	return FALSE;
+ 
+     xf86_config->cursor_image = xalloc (max_width * max_height * 4);
+ 
+     if (!xf86_config->cursor_image)
+     {
+ 	xf86DestroyCursorInfoRec (cursor_info);
+ 	return FALSE;
+     }
+ 	
+     xf86_config->cursor_info = cursor_info;
+ 
+     cursor_info->MaxWidth = max_width;
+     cursor_info->MaxHeight = max_height;
+     cursor_info->Flags = flags;
+ 
+     cursor_info->SetCursorColors = xf86_set_cursor_colors;
+     cursor_info->SetCursorPosition = xf86_set_cursor_position;
+     cursor_info->LoadCursorImage = xf86_load_cursor_image;
+     cursor_info->HideCursor = xf86_hide_cursors;
+     cursor_info->ShowCursor = xf86_show_cursors;
+     cursor_info->UseHWCursor = xf86_use_hw_cursor;
+ #ifdef ARGB_CURSOR
+     if (flags & HARDWARE_CURSOR_ARGB)
+     {
+ 	cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
+ 	cursor_info->LoadCursorARGB = xf86_load_cursor_argb;
+     }
+ #endif
+     
+     xf86_config->cursor = NULL;
+     xf86_hide_cursors (scrn);
+     
+     return xf86InitCursor (screen, cursor_info);
+ }
+ 
+ /**
+  * Called when anything on the screen is reconfigured.
+  *
+  * Reloads cursor images as needed, then adjusts cursor positions
+  */
+ 
+ void
+ xf86_reload_cursors (ScreenPtr screen)
+ {
+     ScrnInfoPtr		scrn;
+     xf86CrtcConfigPtr   xf86_config;
+     xf86CursorInfoPtr   cursor_info;
+     CursorPtr		cursor;
+     int			x, y;
+     
+     /* initial mode setting will not have set a screen yet */
+     if (!screen)
+ 	return;
+     scrn = xf86Screens[screen->myNum];
+     xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ 
+     /* make sure the cursor code has been initialized */
+     cursor_info = xf86_config->cursor_info;
+     if (!cursor_info)
+ 	return;
+     
+     cursor = xf86_config->cursor;
 -    GetSpritePosition (&x, &y);
++    GetSpritePosition (inputInfo.pointer, &x, &y);
+     if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+ 	(*cursor_info->HideCursor)(scrn);
+ 
+     if (cursor)
+     {
+ #ifdef ARGB_CURSOR
+ 	if (cursor->bits->argb && cursor_info->LoadCursorARGB)
+ 	    (*cursor_info->LoadCursorARGB) (scrn, cursor);
+ 	else
+ #endif
+ 	    (*cursor_info->LoadCursorImage)(cursor_info->pScrn,
+ 					    cursor->devPriv[screen->myNum]);
+ 
+ 	(*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y);
+ 	(*cursor_info->ShowCursor)(cursor_info->pScrn);
+     }
+ }
+ 
+ /**
+  * Clean up CRTC-based cursor code
+  */
+ void
+ xf86_cursors_fini (ScreenPtr screen)
+ {
+     ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+     
+     if (xf86_config->cursor_info)
+     {
+ 	xf86DestroyCursorInfoRec (xf86_config->cursor_info);
+ 	xf86_config->cursor_info = NULL;
+     }
+     if (xf86_config->cursor_image)
+     {
+ 	xfree (xf86_config->cursor_image);
+ 	xf86_config->cursor_image = NULL;
+     }
+ }
diff --cc mi/misprite.c
index 8639c56,c0560a4..bb67f48
@@@ -392,37 -318,29 +392,37 @@@
  
      pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
  
 -    if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
 +    for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
      {
 -	DDXPointPtr    	pts;
 -	int    		*widths;
 -	int    		nPts;
 -	int    		xorg,
 -			yorg;
 -
 -	xorg = pDrawable->x;
 -	yorg = pDrawable->y;
 -
 -	for (pts = ppt, widths = pwidth, nPts = nspans;
 -	     nPts--;
 -	     pts++, widths++)
 - 	{
 -	    if (SPN_OVERLAP(&pScreenPriv->saved,pts->y+yorg,
 -			     pts->x+xorg,*widths))
 -	    {
 -		SPRITE_DEBUG (("GetSpans remove\n"));
 -		miSpriteRemoveCursor (pScreen);
 -		break;
 -	    }
 -	}
 +        if (DevHasCursor(pDev))
 +        {
 +            pCursorInfo = &pScreenPriv->pDevCursors[pDev->id];
 +
 +            if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp)
 +            {
-                 register DDXPointPtr    pts;
-                 register int    	*widths;
-                 register int    	nPts;
-                 register int    	xorg,
-                          yorg;
++                DDXPointPtr    pts;
++                int    	       *widths;
++                int    	       nPts;
++                int    	       xorg,
++                               yorg;
 +
 +                xorg = pDrawable->x;
 +                yorg = pDrawable->y;
 +
 +                for (pts = ppt, widths = pwidth, nPts = nspans;
 +                        nPts--;
 +                        pts++, widths++)
 +                {
 +                    if (SPN_OVERLAP(&pCursorInfo->saved,pts->y+yorg,
 +                                pts->x+xorg,*widths))
 +                    {
 +                        SPRITE_DEBUG (("GetSpans remove\n"));
 +                        miSpriteRemoveCursor (pDev, pScreen);
 +                        break;
 +                    }
 +                }
 +            }
 +        }
      }
  
      (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
diff-tree b167583fe234a536aa6187e17f21da85be4f0b7f (from 3bffb281260476d2f74f0bf451d85d2f7cacd6c4)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Nov 15 17:50:02 2006 +1030

    o fix minor error in comment for GetPointerEvents()

diff --git a/dix/getevents.c b/dix/getevents.c
index 935112d..77d1e21 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -470,7 +470,7 @@ GetKeyboardValuatorEvents(xEvent *events
 
 
 /**
- * Generate a series of xEvents (returned in xE) representing pointer
+ * Generate a series of xEvents (returned in events) representing pointer
  * motion, or button presses.  Xi and XKB-aware.
  *
  * events is not NULL-terminated; the return value is the number of events.
diff-tree 65b0eb60b0b9e6405aa2e3d4c712ec4d2f0da070 (from 456f429ad655ab4d80e30c58291d801966a613b2)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Mar 16 15:52:24 2007 +1030

    Xi:     move IsPointerDevice into dix.
    dix:    IsPointerDevice and IsKeyboardDevice, use same ways to identify type
            of device as XI does for the XListInputDevices reply.
            Autopair each non-pointer device with VCP when activating, pair with
            real device after activation.
            Don't return non-keyboard devices when calling GetPairedKeyboard or
            PickKeyboard, otherwise we segfault for 'evdev brain'.

diff --git a/Xi/extinit.c b/Xi/extinit.c
index ff6e4ac..672d333 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -985,21 +985,6 @@ AssignTypeAndName(DeviceIntPtr dev, Atom
 
 /***********************************************************************
  *
- * Returns true if a device may require a pointer (is a mouse).
- * FIXME: Other devices should be able to get a pointer too...
- *
- */
-_X_EXPORT Bool
-IsPointerDevice(DeviceIntPtr dev)
-{
-    if (dev_type[1].type == dev->type)
-        return TRUE;
-  
-    return FALSE;
-}
-
-/***********************************************************************
- *
  * Make device type atoms.
  *
  */
diff --git a/dix/devices.c b/dix/devices.c
index 42eebf1..0c1553e 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -221,6 +221,11 @@ ActivateDevice(DeviceIntPtr dev)
     SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask,
                           (xEvent *) &ev, 1);
 
+    if (IsPointerDevice(dev) && dev->isMPDev)
+        InitializeSprite(dev, GetCurrentRootWindow());
+    else
+        PairDevices(NULL, inputInfo.pointer, dev);
+
     return ret;
 }
 
@@ -403,7 +408,6 @@ InitCoreDevices()
         inputInfo.pointer = dev;
         inputInfo.pointer->next = NULL;
 
-
         /* the core keyboard is initialised by now. set the keyboard's sprite
          * to the core pointer's sprite. */
         PairDevices(pairingClient, inputInfo.pointer, inputInfo.keyboard);
@@ -1995,6 +1999,9 @@ ProcQueryKeymap(ClientPtr client)
 int 
 PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
 {
+    if (!ptr)
+        return BadDevice;
+
     if (!pairingClient)
         RegisterPairingClient(client);
     else if (pairingClient != client)
@@ -2032,6 +2039,8 @@ GetPairedPointer(DeviceIntPtr kbd)
 
 /* Find the keyboard device that is paired with the given pointer. If none is
  * found, return NULL.
+ * We also check if the paired device is a keyboard. If not (e.g. evdev brain)
+ * we don't return it. This probably needs to be fixed.
  */
 _X_EXPORT DeviceIntPtr
 GetPairedKeyboard(DeviceIntPtr ptr)
@@ -2040,7 +2049,9 @@ GetPairedKeyboard(DeviceIntPtr ptr)
 
     while(dev)
     {
-        if (ptr != dev && ptr->pSprite == dev->pSprite)
+        if (ptr != dev && 
+            IsKeyboardDevice(dev) &&
+            ptr->pSprite == dev->pSprite)
             return dev;
         dev = dev->next;
     }
diff --git a/dix/events.c b/dix/events.c
index fbbae1d..ca12d22 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -250,6 +250,27 @@ DevHasCursor(DeviceIntPtr pDev) 
     return (pDev != inputInfo.pointer && pDev->spriteOwner);
 }
 
+/*
+ * Return true if a device is a pointer, check is the same as used by XI to
+ * fill the 'use' field.
+ */
+_X_EXPORT Bool
+IsPointerDevice(DeviceIntPtr dev)
+{
+    return ((dev->valuator && dev->button) || dev == inputInfo.pointer);
+}
+
+/*
+ * Return true if a device is a keyboard, check is the same as used by XI to
+ * fill the 'use' field.
+ */
+_X_EXPORT Bool
+IsKeyboardDevice(DeviceIntPtr dev)
+{
+    return ((dev->key && dev->kbdfeed) || dev == inputInfo.keyboard);
+}
+
+
 #ifdef XEVIE
 _X_EXPORT WindowPtr xeviewin;
 _X_EXPORT HotSpot xeviehot;
@@ -4914,9 +4935,16 @@ _X_EXPORT DeviceIntPtr
 PickKeyboard(ClientPtr client)
 {
     DeviceIntPtr ptr = PickPointer(client);
-    DeviceIntPtr kbd;
+    DeviceIntPtr kbd = inputInfo.devices;
 
-    kbd = GetPairedKeyboard(ptr);
+    while(kbd)
+    {
+        if (ptr != kbd && 
+            IsKeyboardDevice(kbd) && 
+            ptr->pSprite == kbd->pSprite)
+            return kbd;
+        kbd = kbd->next;
+    }
 
     return (kbd) ? kbd : inputInfo.keyboard;
 }
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index c6d6b36..db39980 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -186,14 +186,6 @@ xf86ActivateDevice(LocalDevicePtr local)
         }
 #endif
 
-        /* Only create a new sprite if it's a non-shared pointer */
-        if (IsPointerDevice(dev) && dev->isMPDev)
-            InitializeSprite(dev, GetCurrentRootWindow());
-        else {
-            /* pair with a free device */
-            PairDevices(NULL, GuessFreePointerDevice(), dev);
-        }
-
         RegisterOtherDevice(dev);
 
         if (serverGeneration == 1) 
@@ -426,6 +418,9 @@ NewInputDeviceRequest (InputOption *opti
     if (dev->inited && dev->startup)
         EnableDevice(dev);
 
+    if (!IsPointerDevice(dev))
+        PairDevices(NULL, GuessFreePointerDevice(), dev);
+
     /* send enter/leave event, update sprite window */
     CheckMotion(NULL, dev);
 
diff --git a/include/dix.h b/include/dix.h
index 57cdce3..44862ad 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -757,4 +757,7 @@ extern int ffs(int i);
 
 extern Bool DevHasCursor(DeviceIntPtr pDev);
 
+extern Bool IsPointerDevice( DeviceIntPtr dev);
+extern Bool IsKeyboardDevice(DeviceIntPtr dev);
+
 #endif /* DIX_H */
diff --git a/include/extinit.h b/include/extinit.h
index d7aa541..ead59be 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -149,10 +149,6 @@ AssignTypeAndName (
 	char *                 /* name */
 	);
 
-Bool IsPointerDevice(
-        DeviceIntPtr            /* dev */
-        );
-
 void
 MakeDeviceTypeAtoms (
 	void
diff-tree 3bffb281260476d2f74f0bf451d85d2f7cacd6c4 (from 9562b6abe1da566cf73a08c4f4c4339fb67fbc71)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Thu Mar 15 16:16:16 2007 -0700

    Don't wedge when rotating more than one CRTC.
    
    Rotation block handler was re-registering the rotation damage structure,
    creating an infinite loop in the damage code. Track registration of the
    damage structure to avoid this.
    (cherry picked from commit b14f003b0ed1252766c9e3b1c086ea2809521047)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index df8a8aa..b751592 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -529,7 +529,8 @@ typedef struct _xf86CrtcConfig {
     int			maxWidth, maxHeight;
     
     /* For crtc-based rotation */
-    DamagePtr   rotationDamage;
+    DamagePtr		rotation_damage;
+    Bool		rotation_damage_registered;
 
     /* DGA */
     unsigned int	dga_flags;
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 6826b62..e82b69e 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -251,9 +251,13 @@ xf86RotatePrepare (ScreenPtr pScreen)
 							     crtc->rotatedData,
 							     crtc->mode.HDisplay,
 							     crtc->mode.VDisplay);
-	    /* Hook damage to screen pixmap */
-	    DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
-			    xf86_config->rotationDamage);
+	    if (!xf86_config->rotation_damage_registered)
+	    {
+		/* Hook damage to screen pixmap */
+		DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+				xf86_config->rotation_damage);
+		xf86_config->rotation_damage_registered = TRUE;
+	    }
 	    
 	    xf86CrtcDamageShadow (crtc);
 	}
@@ -265,7 +269,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
 {
     ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    DamagePtr		damage = xf86_config->rotationDamage;
+    DamagePtr		damage = xf86_config->rotation_damage;
     RegionPtr		region;
 
     if (!damage)
@@ -334,13 +338,14 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	    crtc->rotatedData = NULL;
 	}
 
-	if (xf86_config->rotationDamage)
+	if (xf86_config->rotation_damage)
 	{
 	    /* Free damage structure */
 	    DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
-			      xf86_config->rotationDamage);
-	    DamageDestroy (xf86_config->rotationDamage);
-	    xf86_config->rotationDamage = NULL;
+			      xf86_config->rotation_damage);
+	    xf86_config->rotation_damage_registered = FALSE;
+	    DamageDestroy (xf86_config->rotation_damage);
+	    xf86_config->rotation_damage = NULL;
 	    /* Free block/wakeup handler */
 	    RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
 					  xf86RotateWakeupHandler,
@@ -382,13 +387,13 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	    xf86CrtcDamageShadow (crtc);
 	}
 	
-	if (!xf86_config->rotationDamage)
+	if (!xf86_config->rotation_damage)
 	{
 	    /* Create damage structure */
-	    xf86_config->rotationDamage = DamageCreate (NULL, NULL,
+	    xf86_config->rotation_damage = DamageCreate (NULL, NULL,
 						DamageReportNone,
 						TRUE, pScreen, pScreen);
-	    if (!xf86_config->rotationDamage)
+	    if (!xf86_config->rotation_damage)
 		goto bail2;
 	    
 	    /* Assign block/wakeup handler */
@@ -402,8 +407,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	if (0)
 	{
 bail3:
-	    DamageDestroy (xf86_config->rotationDamage);
-	    xf86_config->rotationDamage = NULL;
+	    DamageDestroy (xf86_config->rotation_damage);
+	    xf86_config->rotation_damage = NULL;
 	    
 bail2:
 	    if (shadow || shadowData)
diff-tree 9562b6abe1da566cf73a08c4f4c4339fb67fbc71 (from 3b71b0f89f1db837da91650baa0ef4bb7ef2e98f)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Thu Mar 15 10:50:45 2007 -0700

    Allow xf86_reload_cursors during server init.
    
    xf86_reload_cursors is supposed to be called from the crtc mode setting
    commit hook; as that happens during server initialization, check for this
    case.
    (cherry picked from commit 5b77bf2d020b1ee56c1c5f2db089a8f7f64a76a6)

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 095df48..009cccf 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -548,12 +548,24 @@ xf86_cursors_init (ScreenPtr screen, int
 void
 xf86_reload_cursors (ScreenPtr screen)
 {
-    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
-    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
-    CursorPtr		cursor = xf86_config->cursor;
+    ScrnInfoPtr		scrn;
+    xf86CrtcConfigPtr   xf86_config;
+    xf86CursorInfoPtr   cursor_info;
+    CursorPtr		cursor;
     int			x, y;
     
+    /* initial mode setting will not have set a screen yet */
+    if (!screen)
+	return;
+    scrn = xf86Screens[screen->myNum];
+    xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+
+    /* make sure the cursor code has been initialized */
+    cursor_info = xf86_config->cursor_info;
+    if (!cursor_info)
+	return;
+    
+    cursor = xf86_config->cursor;
     GetSpritePosition (&x, &y);
     if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
 	(*cursor_info->HideCursor)(scrn);
diff-tree 3b71b0f89f1db837da91650baa0ef4bb7ef2e98f (from 2fe74ef339c3a4902ae8214f5a0454662895422c)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Mar 15 13:21:00 2007 -0700

    Set the RandR version returned, rather than just passing the proto's version.

diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index 7f98965..5525427 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -22,6 +22,9 @@
 
 #include "randrstr.h"
 
+#define SERVER_RANDR_MAJOR	1
+#define SERVER_RANDR_MINOR	2
+
 Bool
 RRClientKnowsRates (ClientPtr	pClient)
 {
@@ -49,8 +52,8 @@ ProcRRQueryVersion (ClientPtr client)
      * Report the current version; the current
      * spec says they're all compatible after 1.0
      */
-    rep.majorVersion = RANDR_MAJOR;
-    rep.minorVersion = RANDR_MINOR;
+    rep.majorVersion = SERVER_RANDR_MAJOR;
+    rep.minorVersion = SERVER_RANDR_MINOR;
     if (client->swapped) {
     	swaps(&rep.sequenceNumber, n);
     	swapl(&rep.length, n);
diff-tree 2fe74ef339c3a4902ae8214f5a0454662895422c (from ae75019ccf1edac9e8be31b6a96293624f672ccb)
Author: Matthias Hopf <mhopf at suse.de>
Date:   Thu Mar 15 16:56:01 2007 +0100

    Fix calculations in x86 emulator for the long long case (Andreas Schwab).

diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
index 461e09e..b9e7257 100644
--- a/hw/xfree86/x86emu/prim_ops.c
+++ b/hw/xfree86/x86emu/prim_ops.c
@@ -2082,7 +2082,7 @@ Implements the IMUL instruction and side
 void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
 {
 #ifdef	__HAS_LONG_LONG__
-	s64 res = (s32)d * (s32)s;
+	s64 res = (s64)(s32)d * (s32)s;
 
 	*res_lo = (u32)res;
 	*res_hi = (u32)(res >> 32);
@@ -2174,7 +2174,7 @@ Implements the MUL instruction and side 
 void mul_long(u32 s)
 {
 #ifdef	__HAS_LONG_LONG__
-	u64 res = (u32)M.x86.R_EAX * (u32)s;
+	u64 res = (u64)M.x86.R_EAX * s;
 
 	M.x86.R_EAX = (u32)res;
 	M.x86.R_EDX = (u32)(res >> 32);
diff-tree 456f429ad655ab4d80e30c58291d801966a613b2 (from c5b07fb717289f61b54d7b093421bcb92124b839)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Mar 15 21:48:19 2007 +1030

    dix:    fix: don't return when device is same as argument.
            fix: set access default rule to 0 on init.

diff --git a/dix/devices.c b/dix/devices.c
index 6c17786..42eebf1 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2040,7 +2040,7 @@ GetPairedKeyboard(DeviceIntPtr ptr)
 
     while(dev)
     {
-        if (ptr->pSprite == dev->pSprite)
+        if (ptr != dev && ptr->pSprite == dev->pSprite)
             return dev;
         dev = dev->next;
     }
diff --git a/dix/window.c b/dix/window.c
index 6c35583..38bd74f 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3721,6 +3721,7 @@ MakeWindowOptional (register WindowPtr p
     optional->access.ndeny = 0;
     optional->access.perm = NULL;
     optional->access.deny = NULL;
+    optional->access.defaultRule = 0;
     parentOptional = FindWindowWithOptional(pWin)->optional;
     optional->visual = parentOptional->visual;
     if (!pWin->cursorIsNone)
diff-tree ae75019ccf1edac9e8be31b6a96293624f672ccb (from 4bf1b280f7cb676ec2b172f26dd2ad9bac2eb2ca)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Wed Mar 14 23:59:29 2007 -0700

    Create driver-independent CRTC-based cursor layer.
    
    This moves most of the cursor management code out of the intel driver and
    into the general server code. Of course, the hope is that this code will be
    useful for other driver writers as well.
    
    Check out xf86Crtc.h for the usage information, making sure you add the
    needed hooks to the crtc funcs structure for your driver.
    (cherry picked from commit 4d81c99a4660a0bf9014f789de55edabd185bd14)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index b669063..50aa673 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -56,6 +56,7 @@ XORG_LIBS = \
             parser/libxf86config.a \
 	    dixmods/libdixmods.la \
 	    modes/libxf86modes.a \
+	    ramdac/libramdac.a \
 	    ddc/libddc.a \
 	    i2c/libi2c.a \
             @XORG_LIBS@
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index ceb66a2..ef9ab9a 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -2,7 +2,8 @@ noinst_LIBRARIES = libloader.a
 
 INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(srcdir)/../dixmods/extmod \
 	   -I$(srcdir)/../vbe -I$(top_srcdir)/miext/cw -I$(srcdir)/../int10 \
-	   -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes
+	   -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
+	   -I$(srcdir)/../ramdac
 
 #AM_LDFLAGS = -r
 AM_CFLAGS = -DIN_LOADER $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index e489212..c220d8a 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -841,6 +841,7 @@ DuplicateModule(ModuleDescPtr mod, Modul
 static const char *compiled_in_modules[] = {
     "ddc",
     "i2c",
+    "ramdac",
     NULL
 };
 
@@ -861,7 +862,7 @@ doLoadModule(const char *module, const c
     PatternPtr patterns = NULL;
     int noncanonical = 0;
     char *m = NULL;
-    char **cim;
+    const char **cim;
 
     xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
 
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 6337265..bc7c814 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1220,6 +1220,11 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86RandR12SetConfig)
     SYMFUNC(xf86RandR12SetRotations)
 #endif
+    SYMFUNC(xf86_cursors_init)
+    SYMFUNC(xf86_reload_cursors)
+    SYMFUNC(xf86_show_cursors)
+    SYMFUNC(xf86_hide_cursors)
+    SYMFUNC(xf86_cursors_fini)
 
     SYMFUNC(xf86DoEDID_DDC1)
     SYMFUNC(xf86DoEDID_DDC2)
diff --git a/hw/xfree86/modes/Makefile.am b/hw/xfree86/modes/Makefile.am
index e0b6136..1f82068 100644
--- a/hw/xfree86/modes/Makefile.am
+++ b/hw/xfree86/modes/Makefile.am
@@ -3,6 +3,7 @@ noinst_LIBRARIES = libxf86modes.a
 libxf86modes_a_SOURCES = \
 	xf86Crtc.c \
 	xf86Crtc.h \
+	xf86Cursors.c \
 	xf86cvt.c \
 	xf86DiDGA.c \
 	xf86EdidModes.c \
@@ -16,7 +17,8 @@ libxf86modes_a_SOURCES = \
 INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
 	   -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \
            -I$(srcdir)/../scanpci -I$(srcdir)/../vbe -I$(srcdir)/../int10 \
-	   -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod
+	   -I$(srcdir)/../vgahw -I$(srcdir)/../ramdac \
+	   -I$(srcdir)/../dixmods/extmod
 
 sdk_HEADERS = \
 	xf86Crtc.h \
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 6152ae4..df8a8aa 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -28,6 +28,7 @@
 #include "xf86Rename.h"
 #endif
 #include "xf86Modes.h"
+#include "xf86Cursor.h"
 #include "damage.h"
 
 /* Compat definitions for older X Servers. */
@@ -37,6 +38,9 @@
 #ifndef M_T_DRIVER
 #define M_T_DRIVER	0x40
 #endif
+#ifndef HARDWARE_CURSOR_ARGB
+#define HARDWARE_CURSOR_ARGB				0x00004000
+#endif
 
 typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
 typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
@@ -155,6 +159,42 @@ typedef struct _xf86CrtcFuncs {
     (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data);
 
     /**
+     * Set cursor colors
+     */
+    void
+    (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg);
+
+    /**
+     * Set cursor position
+     */
+    void
+    (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y);
+
+    /**
+     * Show cursor
+     */
+    void
+    (*show_cursor) (xf86CrtcPtr crtc);
+
+    /**
+     * Hide cursor
+     */
+    void
+    (*hide_cursor) (xf86CrtcPtr crtc);
+
+    /**
+     * Load monochrome image
+     */
+    void
+    (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image);
+
+    /**
+     * Load ARGB image
+     */
+     void
+     (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image);
+     
+    /**
      * Clean up driver-specific bits of the crtc
      */
     void
@@ -174,12 +214,6 @@ struct _xf86Crtc {
      */
     Bool	    enabled;
     
-    /** Track whether cursor is within CRTC range  */
-    Bool	    cursorInRange;
-    
-    /** Track state of cursor associated with this CRTC */
-    Bool	    cursorShown;
-    
     /**
      * Active mode
      *
@@ -232,6 +266,19 @@ struct _xf86Crtc {
 #else
     void	    *randr_crtc;
 #endif
+
+    /**
+     * Current cursor is ARGB
+     */
+    Bool	    cursor_argb;
+    /**
+     * Track whether cursor is within CRTC range 
+     */
+    Bool	    cursor_in_range;
+    /**
+     * Track state of cursor associated with this CRTC
+     */
+    Bool	    cursor_shown;
 };
 
 typedef struct _xf86OutputFuncs {
@@ -495,6 +542,13 @@ typedef struct _xf86CrtcConfig {
     const xf86CrtcConfigFuncsRec *funcs;
 
     CreateScreenResourcesProcPtr    CreateScreenResources;
+
+    /* Cursor information */
+    xf86CursorInfoPtr	cursor_info;
+    CursorPtr		cursor;
+    CARD8		*cursor_image;
+    Bool		cursor_on;
+    CARD32		cursor_fg, cursor_bg;
 } xf86CrtcConfigRec, *xf86CrtcConfigPtr;
 
 extern int xf86CrtcConfigPrivateIndex;
@@ -637,4 +691,41 @@ xf86ConnectorGetName(xf86ConnectorType c
 Bool
 xf86SetDesiredModes (ScrnInfoPtr pScrn);
 
+/**
+ * Initialize the CRTC-based cursor code. CRTC function vectors must
+ * contain relevant cursor setting functions.
+ *
+ * Driver should call this from ScreenInit function
+ */
+Bool
+xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags);
+
+/**
+ * Called when anything on the screen is reconfigured.
+ *
+ * Reloads cursor images as needed, then adjusts cursor positions.
+ * 
+ * Driver should call this from crtc commit function.
+ */
+void
+xf86_reload_cursors (ScreenPtr screen);
+
+/**
+ * Called from EnterVT to turn the cursors back on
+ */
+void
+xf86_show_cursors (ScrnInfoPtr scrn);
+
+/**
+ * Called by the driver to turn cursors off
+ */
+void
+xf86_hide_cursors (ScrnInfoPtr scrn);
+
+/**
+ * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time.
+ */
+void
+xf86_cursors_fini (ScreenPtr screen);
+    
 #endif /* _XF86CRTC_H_ */
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
new file mode 100644
index 0000000..095df48
--- /dev/null
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -0,0 +1,595 @@
+/*
+ * Copyright © 2007 Keith Packard
+ *
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS 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>
+#else
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "xf86.h"
+#include "xf86DDC.h"
+#include "xf86Crtc.h"
+#include "xf86Modes.h"
+#include "xf86RandR12.h"
+#include "X11/extensions/render.h"
+#define DPMS_SERVER
+#include "X11/extensions/dpms.h"
+#include "X11/Xatom.h"
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+#include "cursorstr.h"
+
+/*
+ * Given a screen coordinate, rotate back to a cursor source coordinate
+ */
+static void
+xf86_crtc_rotate_coord (Rotation    rotation,
+			int	    width,
+			int	    height,
+			int	    x_dst,
+			int	    y_dst,
+			int	    *x_src,
+			int	    *y_src)
+{
+    if (rotation & RR_Reflect_X)
+	x_dst = width - x_dst - 1;
+    if (rotation & RR_Reflect_Y)
+	y_dst = height - y_dst - 1;
+    
+    switch (rotation & 0xf) {
+    case RR_Rotate_0:
+	*x_src = x_dst;
+	*y_src = y_dst;
+	break;
+    case RR_Rotate_90:
+	*x_src = height - y_dst - 1;
+	*y_src = x_dst;
+	break;
+    case RR_Rotate_180:
+	*x_src = width - x_dst - 1;
+	*y_src = height - y_dst - 1;
+	break;
+    case RR_Rotate_270:
+	*x_src = y_dst;
+	*y_src = width - x_dst - 1;
+	break;
+    }
+}
+
+/*
+ * Convert an x coordinate to a position within the cursor bitmap
+ */
+static int
+cursor_bitpos (int flags, int x, Bool mask)
+{
+    if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK)
+	mask = !mask;
+    if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED)
+	x = (x & ~3) | (3 - (x & 3));
+    if (flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST)
+	x = (x & ~7) | (7 - (x & 7));
+    if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1)
+	x = (x << 1) + mask;
+    else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8)
+	x = ((x & ~7) << 1) | (mask << 3) | (x & 7);
+    else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16)
+	x = ((x & ~15) << 1) | (mask << 4) | (x & 15);
+    else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32)
+	x = ((x & ~31) << 1) | (mask << 5) | (x & 31);
+    else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64)
+	x = ((x & ~63) << 1) | (mask << 6) | (x & 63);
+    return x;
+}
+
+/*
+ * Fetch one bit from a cursor bitmap
+ */
+static CARD8
+get_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+{
+    x = cursor_bitpos (flags, x, mask);
+    image += y * stride;
+    return (image[(x >> 3)] >> (x & 7)) & 1;
+}
+
+/*
+ * Set one bit in a cursor bitmap
+ */
+static void
+set_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+{
+    x = cursor_bitpos (flags, x, mask);
+    image += y * stride;
+    image[(x >> 3)] |= 1 << (x & 7);
+}
+    
+/*
+ * Load a two color cursor into a driver that supports only ARGB cursors
+ */
+static void
+xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src)
+{
+    ScrnInfoPtr		scrn = crtc->scrn;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    CARD32		*cursor_image = (CARD32 *) xf86_config->cursor_image;
+    int			x, y;
+    int			xin, yin;
+    int			stride = cursor_info->MaxWidth >> 2;
+    int			flags = cursor_info->Flags;
+    CARD32		bits;
+
+#ifdef ARGB_CURSOR
+    crtc->cursor_argb = FALSE;
+#endif
+
+    for (y = 0; y < cursor_info->MaxHeight; y++)
+	for (x = 0; x < cursor_info->MaxWidth; x++) 
+	{
+	    xf86_crtc_rotate_coord (crtc->rotation,
+				    cursor_info->MaxWidth,
+				    cursor_info->MaxHeight,
+				    x, y, &xin, &yin);
+	    if (get_bit (src, stride, flags, xin, yin, TRUE) ==
+		((flags & HARDWARE_CURSOR_INVERT_MASK) == 0))
+	    {
+		if (get_bit (src, stride, flags, xin, yin, FALSE))
+		    bits = xf86_config->cursor_fg;
+		else
+		    bits = xf86_config->cursor_bg;
+	    }
+	    else
+		bits = 0;
+	    cursor_image[y * cursor_info->MaxWidth + x] = bits;
+	}
+    crtc->funcs->load_cursor_argb (crtc, cursor_image);
+}
+
+/*
+ * Set the colors for a two-color cursor (ignore for ARGB cursors)
+ */
+static void
+xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
+{
+    ScreenPtr		screen = scrn->pScreen;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    CursorPtr		cursor = xf86_config->cursor;
+    int			c;
+    CARD8		*bits = cursor ? cursor->devPriv[screen->myNum] : NULL;
+
+    /* Save ARGB versions of these colors */
+    xf86_config->cursor_fg = (CARD32) fg | 0xff000000;
+    xf86_config->cursor_bg = (CARD32) bg | 0xff000000;
+    
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled && !crtc->cursor_argb)
+	{
+	    if (crtc->funcs->load_cursor_image)
+		crtc->funcs->set_cursor_colors (crtc, bg, fg);
+	    else if (bits)
+		xf86_crtc_convert_cursor_to_argb (crtc, bits);
+	}
+    }
+}
+
+static void
+xf86_crtc_hide_cursor (xf86CrtcPtr crtc)
+{
+    if (crtc->cursor_shown)
+    {
+	crtc->funcs->hide_cursor (crtc);
+	crtc->cursor_shown = FALSE;
+    }
+}
+
+void
+xf86_hide_cursors (ScrnInfoPtr scrn)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    xf86_config->cursor_on = FALSE;
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled)
+	    xf86_crtc_hide_cursor (crtc);
+    }
+}
+    
+static void
+xf86_crtc_show_cursor (xf86CrtcPtr crtc)
+{
+    if (!crtc->cursor_shown && crtc->cursor_in_range)
+    {
+	crtc->funcs->show_cursor (crtc);
+	crtc->cursor_shown = TRUE;
+    }
+}
+
+void
+xf86_show_cursors (ScrnInfoPtr scrn)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    xf86_config->cursor_on = TRUE;
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled)
+	    xf86_crtc_show_cursor (crtc);
+    }
+}
+    
+static void
+xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
+{
+    ScrnInfoPtr		scrn = crtc->scrn;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    DisplayModePtr	mode = &crtc->mode;
+    int			x_temp;
+    int			y_temp;
+    Bool		in_range;
+
+    /* 
+     * Move to crtc coordinate space
+     */
+    x -= crtc->x;
+    y -= crtc->y;
+    
+    /*
+     * Rotate
+     */
+    switch ((crtc->rotation) & 0xf) {
+    case RR_Rotate_0:
+	break;
+    case RR_Rotate_90:
+	x_temp = y;
+	y_temp = mode->VDisplay - cursor_info->MaxWidth - x;
+	x = x_temp;
+	y = y_temp;
+	break;
+    case RR_Rotate_180:
+	x_temp = mode->HDisplay - cursor_info->MaxWidth - x;
+	y_temp = mode->VDisplay - cursor_info->MaxHeight - y;
+	x = x_temp;
+	y = y_temp;
+	break;
+    case RR_Rotate_270:
+	x_temp = mode->HDisplay - cursor_info->MaxHeight -  y;
+	y_temp = x;
+	x = x_temp;
+	y = y_temp;
+	break;
+    }
+    
+    /*
+     * Reflect
+     */
+    if (crtc->rotation & RR_Reflect_X)
+	x = mode->HDisplay - cursor_info->MaxWidth - x;
+    if (crtc->rotation & RR_Reflect_Y)
+	y = mode->VDisplay - cursor_info->MaxHeight - y;
+
+    /*
+     * Disable the cursor when it is outside the viewport
+     */
+    in_range = TRUE;
+    if (x >= mode->HDisplay || y >= mode->VDisplay ||
+	x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) 
+    {
+	in_range = FALSE;
+	x = 0;
+	y = 0;
+    }
+
+    crtc->cursor_in_range = in_range;
+    
+    if (in_range)
+    {
+	crtc->funcs->set_cursor_position (crtc, x, y);
+	xf86_crtc_show_cursor (crtc);
+    }
+    else
+	xf86_crtc_hide_cursor (crtc);
+}
+
+static void
+xf86_set_cursor_position (ScrnInfoPtr scrn, int x, int y)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    /* undo what xf86HWCurs did to the coordinates */
+    x += scrn->frameX0;
+    y += scrn->frameY0;
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled)
+	    xf86_crtc_set_cursor_position (crtc, x, y);
+    }
+}
+    
+/*
+ * Load a two-color cursor into a crtc, performing rotation as needed
+ */
+static void
+xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
+{
+    ScrnInfoPtr		scrn = crtc->scrn;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    CARD8		*cursor_image;
+
+#ifdef ARGB_CURSOR
+    crtc->cursor_argb = FALSE;
+#endif
+
+    if (crtc->rotation == RR_Rotate_0)
+	cursor_image = src;
+    else
+    {
+        int x, y;
+    	int xin, yin;
+	int stride = cursor_info->MaxWidth >> 2;
+	int flags = cursor_info->Flags;
+	
+	cursor_image = xf86_config->cursor_image;
+	memset(cursor_image, 0, cursor_info->MaxWidth * stride);
+	
+        for (y = 0; y < cursor_info->MaxHeight; y++)
+	    for (x = 0; x < cursor_info->MaxWidth; x++) 
+	    {
+		xf86_crtc_rotate_coord (crtc->rotation,
+					cursor_info->MaxWidth,
+					cursor_info->MaxHeight,
+					x, y, &xin, &yin);
+		if (get_bit(src, stride, flags, xin, yin, FALSE))
+		    set_bit(cursor_image, stride, flags, x, y, FALSE);
+		if (get_bit(src, stride, flags, xin, yin, TRUE))
+		    set_bit(cursor_image, stride, flags, x, y, TRUE);
+	    }
+    }
+    crtc->funcs->load_cursor_image (crtc, cursor_image);
+}
+    
+/*
+ * Load a cursor image into all active CRTCs
+ */
+static void
+xf86_load_cursor_image (ScrnInfoPtr scrn, unsigned char *src)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled)
+	{
+	    if (crtc->funcs->load_cursor_image)
+		xf86_crtc_load_cursor_image (crtc, src);
+	    else if (crtc->funcs->load_cursor_argb)
+		xf86_crtc_convert_cursor_to_argb (crtc, src);
+	}
+    }
+}
+
+static Bool
+xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+
+    xf86_config->cursor = cursor;
+    
+    if (cursor->bits->width > cursor_info->MaxWidth ||
+	cursor->bits->height> cursor_info->MaxHeight)
+	return FALSE;
+
+    return TRUE;
+}
+
+static Bool
+xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    
+    xf86_config->cursor = cursor;
+    
+    /* Make sure ARGB support is available */
+    if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
+	return FALSE;
+    
+    if (cursor->bits->width > cursor_info->MaxWidth ||
+	cursor->bits->height> cursor_info->MaxHeight)
+	return FALSE;
+
+    return TRUE;
+}
+
+static void
+xf86_crtc_load_cursor_argb (xf86CrtcPtr crtc, CursorPtr cursor)
+{
+    ScrnInfoPtr		scrn = crtc->scrn;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    CARD32		*cursor_image = (CARD32 *) xf86_config->cursor_image;
+    CARD32		*cursor_source = (CARD32 *) cursor->bits->argb;
+    int			x, y;
+    int			xin, yin;
+    CARD32		bits;
+    int			source_width = cursor->bits->width;
+    int			source_height = cursor->bits->height;
+    int			image_width = cursor_info->MaxWidth;
+    int			image_height = cursor_info->MaxHeight;
+    
+    for (y = 0; y < image_height; y++)
+	for (x = 0; x < image_width; x++)
+	{
+	    xf86_crtc_rotate_coord (crtc->rotation, image_width, image_height,
+				    x, y, &xin, &yin);
+	    if (xin < source_width && yin < source_height)
+		bits = cursor_source[yin * source_width + xin];
+	    else
+		bits = 0;
+	    cursor_image[y * image_width + x] = bits;
+	}
+    
+    crtc->funcs->load_cursor_argb (crtc, cursor_image);
+}
+
+static void
+xf86_load_cursor_argb (ScrnInfoPtr scrn, CursorPtr cursor)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    for (c = 0; c < xf86_config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+	if (crtc->enabled)
+	    xf86_crtc_load_cursor_argb (crtc, cursor);
+    }
+}
+
+Bool
+xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info;
+
+    cursor_info = xf86CreateCursorInfoRec();
+    if (!cursor_info)
+	return FALSE;
+
+    xf86_config->cursor_image = xalloc (max_width * max_height * 4);
+
+    if (!xf86_config->cursor_image)
+    {
+	xf86DestroyCursorInfoRec (cursor_info);
+	return FALSE;
+    }
+	
+    xf86_config->cursor_info = cursor_info;
+
+    cursor_info->MaxWidth = max_width;
+    cursor_info->MaxHeight = max_height;
+    cursor_info->Flags = flags;
+
+    cursor_info->SetCursorColors = xf86_set_cursor_colors;
+    cursor_info->SetCursorPosition = xf86_set_cursor_position;
+    cursor_info->LoadCursorImage = xf86_load_cursor_image;
+    cursor_info->HideCursor = xf86_hide_cursors;
+    cursor_info->ShowCursor = xf86_show_cursors;
+    cursor_info->UseHWCursor = xf86_use_hw_cursor;
+#ifdef ARGB_CURSOR
+    if (flags & HARDWARE_CURSOR_ARGB)
+    {
+	cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb;
+	cursor_info->LoadCursorARGB = xf86_load_cursor_argb;
+    }
+#endif
+    
+    xf86_config->cursor = NULL;
+    xf86_hide_cursors (scrn);
+    
+    return xf86InitCursor (screen, cursor_info);
+}
+
+/**
+ * Called when anything on the screen is reconfigured.
+ *
+ * Reloads cursor images as needed, then adjusts cursor positions
+ */
+
+void
+xf86_reload_cursors (ScreenPtr screen)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
+    CursorPtr		cursor = xf86_config->cursor;
+    int			x, y;
+    
+    GetSpritePosition (&x, &y);
+    if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+	(*cursor_info->HideCursor)(scrn);
+
+    if (cursor)
+    {
+#ifdef ARGB_CURSOR
+	if (cursor->bits->argb && cursor_info->LoadCursorARGB)
+	    (*cursor_info->LoadCursorARGB) (scrn, cursor);
+	else
+#endif
+	    (*cursor_info->LoadCursorImage)(cursor_info->pScrn,
+					    cursor->devPriv[screen->myNum]);
+
+	(*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y);
+	(*cursor_info->ShowCursor)(cursor_info->pScrn);
+    }
+}
+
+/**
+ * Clean up CRTC-based cursor code
+ */
+void
+xf86_cursors_fini (ScreenPtr screen)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+    
+    if (xf86_config->cursor_info)
+    {
+	xf86DestroyCursorInfoRec (xf86_config->cursor_info);
+	xf86_config->cursor_info = NULL;
+    }
+    if (xf86_config->cursor_image)
+    {
+	xfree (xf86_config->cursor_image);
+	xf86_config->cursor_image = NULL;
+    }
+}
diff --git a/hw/xfree86/ramdac/Makefile.am b/hw/xfree86/ramdac/Makefile.am
index 8d94445..2b84cb4 100644
--- a/hw/xfree86/ramdac/Makefile.am
+++ b/hw/xfree86/ramdac/Makefile.am
@@ -1,8 +1,6 @@
-module_LTLIBRARIES = libramdac.la
+noinst_LIBRARIES = libramdac.a
 
-libramdac_la_LDFLAGS = -avoid-version
-
-libramdac_la_SOURCES = xf86RamDacMod.c xf86RamDac.c xf86RamDacCmap.c \
+libramdac_a_SOURCES = xf86RamDac.c xf86RamDacCmap.c \
                       xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c \
 		      xf86BitOrder.c
 
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
index 08cca6b..469f48f 100644
--- a/hw/xfree86/ramdac/xf86Cursor.h
+++ b/hw/xfree86/ramdac/xf86Cursor.h
@@ -44,5 +44,8 @@ void xf86ForceHWCursor (ScreenPtr pScree
 #define HARDWARE_CURSOR_NIBBLE_SWAPPED			0x00000800
 #define HARDWARE_CURSOR_SHOW_TRANSPARENT		0x00001000
 #define HARDWARE_CURSOR_UPDATE_UNHIDDEN			0x00002000
+#ifdef ARGB_CURSOR
+#define HARDWARE_CURSOR_ARGB				0x00004000
+#endif
 
 #endif /* _XF86CURSOR_H */
diff-tree c5b07fb717289f61b54d7b093421bcb92124b839 (from c3eb248cf93a3afd9168acfb88254606beddd7a8)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Mar 14 17:42:30 2007 +1030

    kdrive: update kdrive to new mi API with additional device argument. Includes
            an update of ati_cursor.c and i810_cursor.c

diff --git a/autogen.sh b/autogen.sh
index 1176abd..66acd28 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,4 +9,4 @@ cd $srcdir
 autoreconf -v --install || exit 1
 cd $ORIGDIR || exit $?
 
-$srcdir/configure --enable-maintainer-mode --disable-dmx "$@"
+$srcdir/configure --enable-maintainer-mode --disable-dmx --enable-kdrive "$@"
diff --git a/hw/kdrive/ati/ati_cursor.c b/hw/kdrive/ati/ati_cursor.c
index e8c7117..082062d 100644
--- a/hw/kdrive/ati/ati_cursor.c
+++ b/hw/kdrive/ati/ati_cursor.c
@@ -28,9 +28,10 @@
 #include "ati_reg.h"
 #include "cursorstr.h"
 #include "ati_draw.h"
+#include "inputstr.h"
 
 static void
-ATIMoveCursor(ScreenPtr pScreen, int x, int y)
+ATIMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
 	KdScreenPriv(pScreen);
 	ATICardInfo(pScreenPriv);
@@ -360,7 +361,7 @@ ATIUnloadCursor(ScreenPtr pScreen)
 }
 
 static Bool
-ATIRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+ATIRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
 	KdScreenPriv(pScreen);
 	ATICardInfo(pScreenPriv);
@@ -375,26 +376,26 @@ ATIRealizeCursor(ScreenPtr pScreen, Curs
 	{
 		int x, y;
 
-		miPointerPosition(&x, &y);
+		miPointerGetPosition(pDev, &x, &y);
 		if (atic->is_radeon)
 			RadeonLoadCursor (pScreen);
 		else
 			ClassicLoadCursor(pScreen);
 		/* Move to new position */
-		ATIMoveCursor(pScreen, x, y);
+		ATIMoveCursor(pDev, pScreen, x, y);
 	}
 
 	return TRUE;
 }
 
 static Bool
-ATIUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+ATIUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
 	return TRUE;
 }
 
 static void
-ATISetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+ATISetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 {
 	KdScreenPriv(pScreen);
 	ATICardInfo(pScreenPriv);
@@ -413,7 +414,7 @@ ATISetCursor(ScreenPtr pScreen, CursorPt
 		else
 			ClassicLoadCursor(pScreen);
 		/* Move to new position */
-		ATIMoveCursor(pScreen, x, y);
+		ATIMoveCursor(pDev, pScreen, x, y);
 	}
 	else
 		ATIUnloadCursor(pScreen);
@@ -465,6 +466,7 @@ ATICursorSave(ScreenPtr pScreen, KdOffsc
 void
 ATICursorEnable(ScreenPtr pScreen)
 {
+	DeviceIntPtr pDev = inputInfo.pointer;
 	KdScreenPriv(pScreen);
 	ATICardInfo(pScreenPriv);
 	ATIScreenInfo(pScreenPriv);
@@ -489,13 +491,13 @@ ATICursorEnable(ScreenPtr pScreen)
 	if (pCurPriv->pCursor) {
 		int x, y;
 
-		miPointerPosition(&x, &y);
+		miPointerGetPosition(pDev, &x, &y);
 		if (atic->is_radeon)
 			RadeonLoadCursor(pScreen);
 		else
 			ClassicLoadCursor(pScreen);
 		/* Move to new position */
-		ATIMoveCursor(pScreen, x, y);
+		ATIMoveCursor(pDev, pScreen, x, y);
 	}
 	else
 		ATIUnloadCursor(pScreen);
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index a77b87e..8310f65 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -151,25 +151,25 @@ OsVendorInit (void)
 /* 'Fake' cursor stuff, could be improved */
 
 static Bool
-ephyrRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+ephyrRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
   return TRUE;
 }
 
 static Bool
-ephyrUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+ephyrUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
   return TRUE;
 }
 
 static void
-ephyrSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+ephyrSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 {
   ;
 }
 
 static void
-ephyrMoveCursor(ScreenPtr pScreen, int x, int y)
+ephyrMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
   ;
 }
diff --git a/hw/kdrive/i810/i810_cursor.c b/hw/kdrive/i810/i810_cursor.c
index cf4f717..d361bf0 100644
--- a/hw/kdrive/i810/i810_cursor.c
+++ b/hw/kdrive/i810/i810_cursor.c
@@ -78,6 +78,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #include "kxv.h"
 #include "i810.h"
 #include "cursorstr.h"
+#include "inputstr.h"
 
 #define SetupCursor(s)	    KdScreenPriv(pScreen); \
 			    i810CardInfo(pScreenPriv); \
@@ -129,7 +130,7 @@ _i810MoveCursor(ScreenPtr pScreen, int x
 static void i810LoadCursor(ScreenPtr pScreen, int x, int y);
 
 static void
-i810MoveCursor (ScreenPtr pScreen, int x, int y)
+i810MoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
     KdScreenPriv(pScreen);
     i810ScreenInfo(pScreenPriv);
@@ -281,7 +282,7 @@ i810UnloadCursor(ScreenPtr pScreen)
 
 
 static Bool
-i810RealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
+i810RealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
     KdScreenPriv(pScreen);
     i810ScreenInfo(pScreenPriv);
@@ -297,7 +298,7 @@ i810RealizeCursor (ScreenPtr pScreen, Cu
 	{
 	    int	    x, y;
 	    
-	    miPointerPosition (&x, &y);
+	    miPointerGetPosition (pDev, &x, &y);
 	    i810LoadCursor (pScreen, x, y);
 	}
     }
@@ -305,13 +306,13 @@ i810RealizeCursor (ScreenPtr pScreen, Cu
 }
 
 static Bool
-i810UnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
+i810UnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
     return TRUE;
 }
 
 static void
-i810SetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+i810SetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 {
     KdScreenPriv(pScreen);
     i810ScreenInfo(pScreenPriv);
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 3bf6bad..23fede2 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2219,11 +2219,11 @@ KdCrossScreen(ScreenPtr pScreen, Bool en
 int KdCurScreen;	/* current event screen */
 
 static void
-KdWarpCursor (ScreenPtr pScreen, int x, int y)
+KdWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
     KdBlockSigio ();
     KdCurScreen = pScreen->myNum;
-    miPointerWarpCursor (pScreen, x, y);
+    miPointerWarpCursor(pDev, pScreen, x, y);
     KdUnblockSigio ();
 }
 
@@ -2238,7 +2238,7 @@ void
 ProcessInputEvents ()
 {
     mieqProcessInputEvents();
-    miPointerUpdate();
+    miPointerUpdateSprite(inputInfo.pointer);
     if (kdSwitchPending)
 	KdProcessSwitch ();
     KdCheckLock ();
diff-tree c3eb248cf93a3afd9168acfb88254606beddd7a8 (from ce9409acebd994cf1809050f2cc8e1db66130f12)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Mar 14 13:21:33 2007 +1030

    dix:    fix: don't skip first item in list when seeking for a device cursor.

diff --git a/dix/window.c b/dix/window.c
index 3d79728..6c35583 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3930,6 +3930,7 @@ CursorPtr WindowGetDeviceCursor(WindowPt
 /* Searches for a DevCursorNode for the given window and device. If one is
  * found, return True and set pNode and pPrev to the node and to the node
  * before the node respectively. Otherwise return False.
+ * If the device is the first in list, pPrev is set to NULL.
  */
 static Bool 
 WindowSeekDeviceCursor(WindowPtr pWin, 
@@ -3943,6 +3944,14 @@ WindowSeekDeviceCursor(WindowPtr pWin, 
         return FALSE;
 
     pList = pWin->optional->deviceCursors;
+
+    if (pList && pList->dev == pDev)
+    {
+        *pNode = pList;
+        *pPrev = NULL;
+        return TRUE;
+    }
+
     while(pList)
     {
         if (pList->next)
diff-tree ce9409acebd994cf1809050f2cc8e1db66130f12 (from 577464af4362e5a32cf7165b5128655dd86c6200)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Tue Mar 13 19:16:56 2007 +1030

    dix:    Get the state from the paired device and the real device to fill the
            state field in the event, rather than using the virtual devices.
            ProcessPointerEvent: name argument "device" instead of "other".
            Add GetPairedKeyboard().

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 6cedafb..bc26189 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -113,29 +113,46 @@ RegisterOtherDevice(DeviceIntPtr device)
 }
 
  /*ARGSUSED*/ void
-ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
+ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
 {
     BYTE *kptr;
     int i;
     CARD16 modifiers;
     CARD16 mask;
-    GrabPtr grab = other->deviceGrab.grab;
+    GrabPtr grab = device->deviceGrab.grab;
     Bool deactivateDeviceGrab = FALSE;
     int key = 0, bit = 0, rootX, rootY;
-    ButtonClassPtr b = other->button;
-    KeyClassPtr k = other->key;
-    ValuatorClassPtr v = other->valuator;
+    ButtonClassPtr b = device->button;
+    KeyClassPtr k = device->key;
+    ValuatorClassPtr v = device->valuator;
     deviceValuator *xV = (deviceValuator *) xE;
 
-
     if (xE->u.u.type != DeviceValuator) {
-	GetSpritePosition(other, &rootX, &rootY);
+        DeviceIntPtr mouse = NULL, kbd = NULL;
+	GetSpritePosition(device, &rootX, &rootY);
 	xE->u.keyButtonPointer.rootX = rootX;
 	xE->u.keyButtonPointer.rootY = rootY;
 	key = xE->u.u.detail;
 	NoticeEventTime(xE);
-	xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state |
-	    inputInfo.pointer->button->state; /* FIXME: change for MPX */
+
+        /* If 'device' is a pointer device, we need to get the paired keyboard
+         * for the state. If there is none, the kbd bits of state are 0.
+         * If 'device' is a keyboard device, get the paired pointer and use the
+         * pointer's state for the button bits.
+         */
+        if (IsPointerDevice(device))
+        {
+            kbd = GetPairedKeyboard(device);
+            mouse = device;
+        }
+        else
+        {
+            mouse = GetPairedPointer(device);
+            kbd = device;
+        }
+        xE->u.keyButtonPointer.state = (kbd) ? (kbd->key->state) : 0;
+        xE->u.keyButtonPointer.state |= (mouse) ? (mouse->button->state) : 0;
+
 	bit = 1 << (key & 7);
     }
     if (DeviceEventCallback) {
@@ -155,7 +172,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 		    || (xV->num_valuators
 			&& (first + xV->num_valuators > v->numAxes))))
 		FatalError("Bad valuators reported for device %s\n",
-			   other->name);
+			   device->name);
 	    xV->device_state = 0;
 	    if (k)
 		xV->device_state |= k->state;
@@ -192,15 +209,15 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 	if (*kptr & bit) {	/* allow ddx to generate multiple downs */
 	    if (!modifiers) {
 		xE->u.u.type = DeviceKeyRelease;
-		ProcessOtherEvent(xE, other, count);
+		ProcessOtherEvent(xE, device, count);
 		xE->u.u.type = DeviceKeyPress;
 		/* release can have side effects, don't fall through */
-		ProcessOtherEvent(xE, other, count);
+		ProcessOtherEvent(xE, device, count);
 	    }
 	    return;
 	}
-	if (other->valuator)
-	    other->valuator->motionHintWindow = NullWindow;
+	if (device->valuator)
+	    device->valuator->motionHintWindow = NullWindow;
 	*kptr |= bit;
 	k->prev_state = k->state;
 	for (i = 0, mask = 1; modifiers; i++, mask <<= 1) {
@@ -211,8 +228,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 		modifiers &= ~mask;
 	    }
 	}
-	if (!grab && CheckDeviceGrabs(other, xE, 0, count)) {
-	    other->deviceGrab.activatingKey = key;
+	if (!grab && CheckDeviceGrabs(device, xE, 0, count)) {
+	    device->deviceGrab.activatingKey = key;
 	    return;
 	}
     } else if (xE->u.u.type == DeviceKeyRelease) {
@@ -223,8 +240,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 	if (!(*kptr & bit))	/* guard against duplicates */
 	    return;
 	modifiers = k->modifierMap[key];
-	if (other->valuator)
-	    other->valuator->motionHintWindow = NullWindow;
+	if (device->valuator)
+	    device->valuator->motionHintWindow = NullWindow;
 	*kptr &= ~bit;
 	k->prev_state = k->state;
 	for (i = 0, mask = 1; modifiers; i++, mask <<= 1) {
@@ -238,9 +255,9 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 	    }
 	}
 
-	if (other->deviceGrab.fromPassiveGrab && 
-            !other->deviceGrab.grab->coreGrab &&
-            (key == other->deviceGrab.activatingKey))
+	if (device->deviceGrab.fromPassiveGrab && 
+            !device->deviceGrab.grab->coreGrab &&
+            (key == device->deviceGrab.activatingKey))
 	    deactivateDeviceGrab = TRUE;
     } else if (xE->u.u.type == DeviceButtonPress) {
         if (!b)
@@ -248,8 +265,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 
 	kptr = &b->down[key >> 3];
 	*kptr |= bit;
-	if (other->valuator)
-	    other->valuator->motionHintWindow = NullWindow;
+	if (device->valuator)
+	    device->valuator->motionHintWindow = NullWindow;
 	b->buttonsDown++;
 	b->motionMask = DeviceButtonMotionMask;
 	xE->u.u.detail = b->map[key];
@@ -259,7 +276,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 	    b->state |= (Button1Mask >> 1) << xE->u.u.detail;
 	SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
         if (!grab)
-            if (CheckDeviceGrabs(other, xE, 0, count))
+            if (CheckDeviceGrabs(device, xE, 0, count))
                 return;
 
     } else if (xE->u.u.type == DeviceButtonRelease) {
@@ -268,8 +285,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 
 	kptr = &b->down[key >> 3];
 	*kptr &= ~bit;
-	if (other->valuator)
-	    other->valuator->motionHintWindow = NullWindow;
+	if (device->valuator)
+	    device->valuator->motionHintWindow = NullWindow;
 	if (!--b->buttonsDown)
 	    b->motionMask = 0;
 	xE->u.u.detail = b->map[key];
@@ -279,24 +296,24 @@ ProcessOtherEvent(xEventPtr xE, DeviceIn
 	    b->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
 	SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
         if (!b->state 
-            && other->deviceGrab.fromPassiveGrab
-            && !other->deviceGrab.grab->coreGrab)
+            && device->deviceGrab.fromPassiveGrab
+            && !device->deviceGrab.grab->coreGrab)
             deactivateDeviceGrab = TRUE;
     } else if (xE->u.u.type == ProximityIn)
-	other->valuator->mode &= ~OutOfProximity;
+	device->valuator->mode &= ~OutOfProximity;
     else if (xE->u.u.type == ProximityOut)
-	other->valuator->mode |= OutOfProximity;
+	device->valuator->mode |= OutOfProximity;
 
     if (grab)
-	DeliverGrabbedEvent(xE, other, deactivateDeviceGrab, count);
-    else if (other->focus)
-	DeliverFocusedEvent(other, xE, GetSpriteWindow(other), count);
+	DeliverGrabbedEvent(xE, device, deactivateDeviceGrab, count);
+    else if (device->focus)
+	DeliverFocusedEvent(device, xE, GetSpriteWindow(device), count);
     else
-	DeliverDeviceEvents(GetSpriteWindow(other), xE, NullGrab, NullWindow,
-			    other, count);
+	DeliverDeviceEvents(GetSpriteWindow(device), xE, NullGrab, NullWindow,
+			    device, count);
 
     if (deactivateDeviceGrab == TRUE)
-	(*other->deviceGrab.DeactivateGrab) (other);
+	(*device->deviceGrab.DeactivateGrab) (device);
 }
 
 _X_EXPORT int
diff --git a/dix/devices.c b/dix/devices.c
index 05a03b5..6c17786 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2030,6 +2030,23 @@ GetPairedPointer(DeviceIntPtr kbd)
     return inputInfo.pointer;
 }
 
+/* Find the keyboard device that is paired with the given pointer. If none is
+ * found, return NULL.
+ */
+_X_EXPORT DeviceIntPtr
+GetPairedKeyboard(DeviceIntPtr ptr)
+{
+    DeviceIntPtr dev = inputInfo.devices;
+
+    while(dev)
+    {
+        if (ptr->pSprite == dev->pSprite)
+            return dev;
+        dev = dev->next;
+    }
+    return dev;
+}
+
 /*
  * Register a client to be able to pair devices. 
  */
diff --git a/dix/events.c b/dix/events.c
index b4b929f..fbbae1d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4913,18 +4913,12 @@ PickPointer(ClientPtr client)
 _X_EXPORT DeviceIntPtr
 PickKeyboard(ClientPtr client)
 {
-    DeviceIntPtr ptr;
-    DeviceIntPtr dev = inputInfo.devices;
-    ptr = PickPointer(client);
+    DeviceIntPtr ptr = PickPointer(client);
+    DeviceIntPtr kbd;
 
-    while(dev)
-    {
-        if (ptr->pSprite == dev->pSprite)
-            return dev;
-        dev = dev->next;
-    }
+    kbd = GetPairedKeyboard(ptr);
 
-    return inputInfo.keyboard;
+    return (kbd) ? kbd : inputInfo.keyboard;
 }
 
 /* A client that has one or more core grabs does not get core events from
diff --git a/include/input.h b/include/input.h
index 2d72f83..765d71d 100644
--- a/include/input.h
+++ b/include/input.h
@@ -451,6 +451,7 @@ extern int PairDevices(ClientPtr client,
                        DeviceIntPtr keyboard);
 
 extern DeviceIntPtr GetPairedPointer(DeviceIntPtr kbd);
+extern DeviceIntPtr GetPairedKeyboard(DeviceIntPtr ptr);
 
 extern Bool RegisterPairingClient(ClientPtr client);
 extern Bool UnregisterPairingClient(ClientPtr client);
diff-tree 4bf1b280f7cb676ec2b172f26dd2ad9bac2eb2ca (from c366b82bd50066019cf82b3464445d5bc27d6f9f)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Fri Mar 9 14:18:14 2007 +0000

    Set pScreen on context

diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index e035704..5e683a8 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -495,6 +495,7 @@ __glXDRIscreenCreateContext(__GLXscreen 
     context->base.loseCurrent       = __glXDRIcontextLoseCurrent;
     context->base.copy              = __glXDRIcontextCopy;
     context->base.forceCurrent      = __glXDRIcontextForceCurrent;
+    context->base.pScreen           = screen->base.pScreen;
 
     context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
 
diff-tree c366b82bd50066019cf82b3464445d5bc27d6f9f (from 405483496538f1c82cbd7fe1e76c5d94e1a90525)
Author: Jay Estabrook <Jay.Estabrook at hp.com>
Date:   Fri Mar 9 12:26:55 2007 +0000

    Ensure domain is stripped from the bus ID.

diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index c183e2a..7bd07c0 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -71,6 +71,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #include "mipointer.h"
 #include "xf86_OSproc.h"
 
+#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
+
 #if !defined(PANORAMIX)
 extern Bool noPanoramiXExtension;
 #endif
@@ -2202,8 +2204,8 @@ DRICreatePCIBusID(pciVideoPtr PciInfo)
 
     tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func);
     domain = xf86GetPciDomain(tag);
-    snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus,
-	PciInfo->device, PciInfo->func);
+    snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain,
+	PCI_BUS_NO_DOMAIN(PciInfo->bus), PciInfo->device, PciInfo->func);
     return busID;
 }
 
diff-tree 405483496538f1c82cbd7fe1e76c5d94e1a90525 (from 63169ce52d354b4345dcfc46b89f0ea88379718f)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Mar 9 14:16:23 2007 +1030

    mi: remove 'register' keywords.

diff --git a/mi/miarc.c b/mi/miarc.c
index 2b3a0cb..8b6d8c0 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -246,7 +246,7 @@ typedef struct _miPolyArc {
 static CARD32 gcvals[6];
 
 static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
-static void newFinalSpan(int y, register int xmin, register int xmax);
+static void newFinalSpan(int y, int xmin, int xmax);
 static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right,
 		    miArcFacePtr left);
 static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc *tarc, int lw,
@@ -284,7 +284,7 @@ miArcSegment(
 {
     int l = pGC->lineWidth;
     int a0, a1, startAngle, endAngle;
-    miArcFacePtr	temp;
+    miArcFacePtr temp;
 
     if (!l)
 	l = 1;
@@ -432,8 +432,8 @@ static RESTYPE cacheType;
 /*ARGSUSED*/
 int
 miFreeArcCache (data, id)
-    pointer	    data;
-    XID		    id;
+    pointer data;
+    XID	    id;
 {
     int k;
     arcCacheRec *cent;
@@ -461,11 +461,11 @@ miComputeCircleSpans(
     xArc *parc,
     miArcSpanData *spdata)
 {
-    register miArcSpan *span;
+    miArcSpan *span;
     int doinner;
-    register int x, y, e;
+    int x, y, e;
     int xk, yk, xm, ym, dx, dy;
-    register int slw, inslw;
+    int slw, inslw;
     int inx = 0, iny, ine = 0;
     int inxk = 0, inyk = 0, inxm = 0, inym = 0;
 
@@ -529,7 +529,7 @@ miComputeEllipseSpans(
     xArc *parc,
     miArcSpanData *spdata)
 {
-    register miArcSpan *span;
+    miArcSpan *span;
     double w, h, r, xorg;
     double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
     double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;
@@ -859,13 +859,13 @@ tailX(
 
 static miArcSpanData *
 miComputeWideEllipse(
-    int		   lw,
-    register xArc *parc,
-    Bool	  *mustFree)
-{
-    register miArcSpanData *spdata;
-    register arcCacheRec *cent, *lruent;
-    register int k;
+    int  lw,
+    xArc *parc,
+    Bool *mustFree)
+{
+    miArcSpanData *spdata;
+    arcCacheRec *cent, *lruent;
+    int k;
     arcCacheRec fakeent;
 
     if (!lw)
@@ -943,14 +943,14 @@ miFillWideEllipse(
     xArc	*parc)
 {
     DDXPointPtr points;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
     int *widths;
-    register int *wids;
+    int *wids;
     miArcSpanData *spdata;
     Bool mustFree;
-    register miArcSpan *span;
-    register int xorg, yorgu, yorgl;
-    register int n;
+    miArcSpan *span;
+    int xorg, yorgu, yorgl;
+    int n;
 
     yorgu = parc->height + pGC->lineWidth;
     n = (sizeof(int) * 2) * yorgu;
@@ -1077,20 +1077,20 @@ miPolyArc(pDraw, pGC, narcs, parcs)
     int		narcs;
     xArc	*parcs;
 {
-    register int		i;
-    xArc			*parc;
-    int				xMin, xMax, yMin, yMax;
-    int				pixmapWidth = 0, pixmapHeight = 0;
-    int				xOrg = 0, yOrg = 0;
-    int				width;
-    Bool			fTricky;
-    DrawablePtr			pDrawTo;
-    CARD32			fg, bg;
-    GCPtr			pGCTo;
-    miPolyArcPtr		polyArcs;
-    int				cap[2], join[2];
-    int				iphase;
-    int				halfWidth;
+    int		i;
+    xArc	*parc;
+    int		xMin, xMax, yMin, yMax;
+    int		pixmapWidth = 0, pixmapHeight = 0;
+    int		xOrg = 0, yOrg = 0;
+    int		width;
+    Bool	fTricky;
+    DrawablePtr	pDrawTo;
+    CARD32	fg, bg;
+    GCPtr	pGCTo;
+    miPolyArcPtr polyArcs;
+    int		cap[2], join[2];
+    int		iphase;
+    int		halfWidth;
 
     width = pGC->lineWidth;
     if(width == 0 && pGC->lineStyle == LineSolid)
@@ -3139,9 +3139,9 @@ static struct finalSpanChunk	*chunks;
 struct finalSpan *
 realAllocSpan ()
 {
-	register struct finalSpanChunk	*newChunk;
-	register struct finalSpan	*span;
-	register int			i;
+	struct finalSpanChunk	*newChunk;
+	struct finalSpan	*span;
+	int			i;
 
 	newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk));
 	if (!newChunk)
@@ -3179,14 +3179,14 @@ fillSpans (
     DrawablePtr	pDrawable,
     GCPtr	pGC)
 {
-	register struct finalSpan	*span;
-	register DDXPointPtr		xSpan;
-	register int			*xWidth;
-	register int			i;
-	register struct finalSpan	**f;
-	register int			spany;
-	DDXPointPtr			xSpans;
-	int				*xWidths;
+	struct finalSpan	*span;
+	DDXPointPtr		xSpan;
+	int			*xWidth;
+	int			i;
+	struct finalSpan	**f;
+	int			spany;
+	DDXPointPtr		xSpans;
+	int			*xWidths;
 
 	if (nspans == 0)
 		return;
@@ -3280,13 +3280,13 @@ realFindSpan (int y)
 static void
 newFinalSpan (
     int		y,
-    register int	xmin,
-    register int	xmax)
+    int	xmin,
+    int	xmax)
 {
-	register struct finalSpan	*x;
-	register struct finalSpan	**f;
-	struct finalSpan		*oldx;
-	struct finalSpan		*prev;
+	struct finalSpan	*x;
+	struct finalSpan	**f;
+	struct finalSpan	*oldx;
+	struct finalSpan	*prev;
 
 	f = findSpan (y);
 	if (!f)
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index bf0e29a..e4b1407 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -76,12 +76,12 @@ extern int ffs(int);
 _X_EXPORT RegionPtr
 miCopyArea(pSrcDrawable, pDstDrawable,
 	    pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut)
-    register DrawablePtr 	pSrcDrawable;
-    register DrawablePtr 	pDstDrawable;
-    GCPtr 			pGC;
-    int 			xIn, yIn;
-    int 			widthSrc, heightSrc;
-    int 			xOut, yOut;
+    DrawablePtr 	pSrcDrawable;
+    DrawablePtr 	pDstDrawable;
+    GCPtr 		pGC;
+    int 		xIn, yIn;
+    int 		widthSrc, heightSrc;
+    int 		xOut, yOut;
 {
     DDXPointPtr		ppt, pptFirst;
     unsigned int	*pwidthFirst, *pwidth, *pbits;
diff --git a/mi/mibstore.c b/mi/mibstore.c
index 6653c23..70839ce 100644
--- a/mi/mibstore.c
+++ b/mi/mibstore.c
@@ -152,11 +152,11 @@ static void	    miBSClearBackingRegion(W
 
 #define copyData(src,dst,n,morecopy) \
 { \
-    register short *srcCopy = (short *)(src); \
-    register short *dstCopy = (short *)(dst); \
-    register int i; \
-    register int bsx = pBackingStore->x; \
-    register int bsy = pBackingStore->y; \
+    short *srcCopy = (short *)(src); \
+    short *dstCopy = (short *)(dst); \
+    int i; \
+    int bsx = pBackingStore->x; \
+    int bsy = pBackingStore->y; \
     for (i = n; --i >= 0; ) \
     { \
 	*dstCopy++ = *srcCopy++ - bsx; \
@@ -1010,7 +1010,7 @@ miBSSetSpans(pDrawable, pGC, psrc, ppt, 
     DrawablePtr		pDrawable;
     GCPtr		pGC;
     char		*psrc;
-    register DDXPointPtr ppt;
+    DDXPointPtr 	ppt;
     int			*pwidth;
     int			nspans;
     int			fSorted;
@@ -1150,8 +1150,8 @@ miBSDoCopy(
     }	    	  	*boxes;	    /* Array of box/drawable pairs covering
 				     * source box. */
     int  	  	*sequence;  /* Sequence of boxes to move */
-    register int  	i, j, k, l, y;
-    register BoxPtr	pBox;
+    int  		i, j, k, l, y;
+    BoxPtr		pBox;
     int	    	  	dx, dy, nrects;
     Bool    	  	graphicsExposures;
     CopyPlaneProcPtr  	pixCopyProc;
@@ -1591,7 +1591,7 @@ static RegionPtr
 miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane)
     DrawablePtr	  pSrc;
     DrawablePtr	  pDst;
-    register GC   *pGC;
+    GC  	 *pGC;
     int     	  srcx,
 		  srcy;
     int     	  w,
@@ -1901,9 +1901,9 @@ miBSPolyArc(pDrawable, pGC, narcs, parcs
 static void
 miBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts)
     DrawablePtr		pDrawable;
-    register GCPtr	pGC;
+    GCPtr		pGC;
     int			shape, mode;
-    register int	count;
+    int			count;
     DDXPointPtr		pPts;
 {
     DDXPointPtr	pPtsCopy;
@@ -2546,8 +2546,8 @@ static void
 miBSAllocate(pWin)
     WindowPtr 	  pWin;
 {
-    register miBSWindowPtr  pBackingStore;
-    register ScreenPtr 	    pScreen;
+    miBSWindowPtr  	pBackingStore;
+    ScreenPtr 	   	pScreen;
 	
     if (pWin->drawable.pScreen->backingStoreSupport == NotUseful)
 	return;
@@ -2648,7 +2648,7 @@ miBSFree(pWin)
     WindowPtr pWin;
 {
     miBSWindowPtr 	pBackingStore;
-    register ScreenPtr	pScreen;
+    ScreenPtr		pScreen;
 
     pScreen = pWin->drawable.pScreen;
 
@@ -2792,9 +2792,9 @@ miResizeBackingStore(
  */
 static void
 miBSSaveDoomedAreas(pWin, pObscured, dx, dy)
-    register WindowPtr pWin;
-    RegionPtr 	       pObscured;
-    int		       dx, dy;
+    WindowPtr		pWin;
+    RegionPtr		pObscured;
+    int			dx, dy;
 {
     miBSWindowPtr 	pBackingStore;
     ScreenPtr	  	pScreen;
@@ -2899,14 +2899,14 @@ miBSSaveDoomedAreas(pWin, pObscured, dx,
  */
 static RegionPtr
 miBSRestoreAreas(pWin, prgnExposed)
-    register WindowPtr pWin;
+    WindowPtr pWin;
     RegionPtr prgnExposed;
 {
     PixmapPtr pBackingPixmap;
     miBSWindowPtr pBackingStore;
     RegionPtr prgnSaved;
     RegionPtr prgnRestored;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     RegionPtr exposures = prgnExposed;
 
     pScreen = pWin->drawable.pScreen;
@@ -3097,15 +3097,15 @@ miBSTranslateBackingStore(pWin, windx, w
     int     	  oldx;		/* old window position */
     int     	  oldy;
 {
-    register miBSWindowPtr 	pBackingStore;
-    register RegionPtr 	    	pSavedRegion;
-    register RegionPtr 	    	newSaved, doomed;
-    register ScreenPtr		pScreen;
-    BoxRec			extents;
-    int     	  scrdx;	/* bit translation distance on screen */
-    int     	  scrdy;
-    int		  dx;		/* distance window moved  on screen */
-    int		  dy;
+    miBSWindowPtr 	pBackingStore;
+    RegionPtr 	    	pSavedRegion;
+    RegionPtr 	    	newSaved, doomed;
+    ScreenPtr		pScreen;
+    BoxRec		extents;
+    int 		scrdx;	/* bit translation distance on screen */
+    int     	  	scrdy;
+    int			dx;		/* distance window moved  on screen */
+    int			dy;
 
     pScreen = pWin->drawable.pScreen;
     pBackingStore = (miBSWindowPtr)(pWin->backStorage);
@@ -3815,9 +3815,9 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExp
     miBSWindowPtr	pBackingStore;
     CopyPlaneProcPtr 	copyProc;
     GCPtr		pScratchGC;
-    register BoxPtr	pBox;
-    register int  	i;
-    register int  	dx, dy;
+    BoxPtr		pBox;
+    int  		i;
+    int  		dx, dy;
     BITS32		gcMask;
 
     if (!REGION_NOTEMPTY(pGC->pScreen, prgnExposed))
diff --git a/mi/micmap.c b/mi/micmap.c
index 987affe..977c587 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -125,8 +125,8 @@ miResolveColor(unsigned short *pred, uns
 _X_EXPORT Bool
 miInitializeColormap(ColormapPtr pmap)
 {
-    register unsigned i;
-    register VisualPtr pVisual;
+    unsigned i;
+    VisualPtr pVisual;
     unsigned lim, maxent, shift;
 
     pVisual = pmap->pVisual;
@@ -211,13 +211,13 @@ _X_EXPORT int
 miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs,
 			xColorItem *outdefs)
 {
-    register int    red, green, blue;
-    int		    maxred, maxgreen, maxblue;
-    int		    stepred, stepgreen, stepblue;
-    VisualPtr	    pVisual;
-    register int    pixel;
-    register int    nresult;
-    register int    i;
+    int	        red, green, blue;
+    int	        maxred, maxgreen, maxblue;
+    int	        stepred, stepgreen, stepblue;
+    VisualPtr   pVisual;
+    int         pixel;
+    int         nresult;
+    int         i;
 
     pVisual = pmap->pVisual;
 
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 1ca5fc9..df04bd2 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -130,15 +130,15 @@ exposing is done by the backing store's 
 _X_EXPORT RegionPtr
 miHandleExposures(pSrcDrawable, pDstDrawable,
 		  pGC, srcx, srcy, width, height, dstx, dsty, plane)
-    register DrawablePtr	pSrcDrawable;
-    register DrawablePtr	pDstDrawable;
+    DrawablePtr			pSrcDrawable;
+    DrawablePtr			pDstDrawable;
     GCPtr 			pGC;
     int 			srcx, srcy;
     int 			width, height;
     int 			dstx, dsty;
     unsigned long		plane;
 {
-    register ScreenPtr pscr;
+    ScreenPtr pscr;
     RegionPtr prgnSrcClip;	/* drawable-relative source clip */
     RegionRec rgnSrcRec;
     RegionPtr prgnDstClip;	/* drawable-relative dest clip */
@@ -387,9 +387,9 @@ miSendGraphicsExpose (client, pRgn, draw
     if (pRgn && !REGION_NIL(pRgn))
     {
         xEvent *pEvent;
-	register xEvent *pe;
-	register BoxPtr pBox;
-	register int i;
+	xEvent *pe;
+	BoxPtr pBox;
+	int i;
 	int numRects;
 
 	numRects = REGION_NUM_RECTS(pRgn);
@@ -431,12 +431,12 @@ void
 miSendExposures(pWin, pRgn, dx, dy)
     WindowPtr pWin;
     RegionPtr pRgn;
-    register int dx, dy;
+    int dx, dy;
 {
-    register BoxPtr pBox;
+    BoxPtr pBox;
     int numRects;
-    register xEvent *pEvent, *pe;
-    register int i;
+    xEvent *pEvent, *pe;
+    int i;
 
     pBox = REGION_RECTS(pRgn);
     numRects = REGION_NUM_RECTS(pRgn);
@@ -493,7 +493,7 @@ miSendExposures(pWin, pRgn, dx, dy)
 _X_EXPORT void 
 miWindowExposures(pWin, prgn, other_exposed)
     WindowPtr pWin;
-    register RegionPtr prgn, other_exposed;
+    RegionPtr prgn, other_exposed;
 {
     RegionPtr   exposures = prgn;
     if (pWin->backStorage && prgn)
@@ -629,7 +629,7 @@ tossGC (
 
 _X_EXPORT void
 miPaintWindow(pWin, prgn, what)
-register WindowPtr pWin;
+WindowPtr pWin;
 RegionPtr prgn;
 int what;
 {
@@ -657,10 +657,10 @@ int what;
     BoxRec box;
     WindowPtr	pBgWin;
     GCPtr pGC;
-    register int i;
-    register BoxPtr pbox;
-    register ScreenPtr pScreen = pWin->drawable.pScreen;
-    register xRectangle *prect;
+    int i;
+    BoxPtr pbox;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    xRectangle *prect;
     int numRects;
 
     gcmask = 0;
diff --git a/mi/mifillarc.c b/mi/mifillarc.c
index 6606316..46c0738 100644
--- a/mi/mifillarc.c
+++ b/mi/mifillarc.c
@@ -54,8 +54,8 @@ Author:  Bob Scheifler, MIT X Consortium
 
 _X_EXPORT void
 miFillArcSetup(arc, info)
-    register xArc *arc;
-    register miFillArcRec *info;
+    xArc *arc;
+    miFillArcRec *info;
 {
     info->y = arc->height >> 1;
     info->dy = arc->height & 1;
@@ -109,8 +109,8 @@ miFillArcSetup(arc, info)
 
 void
 miFillArcDSetup(arc, info)
-    register xArc *arc;
-    register miFillArcDRec *info;
+    xArc *arc;
+    miFillArcDRec *info;
 {
     /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
     /* even: xorg = yorg = 0   odd:  xorg = .5, yorg = -.5 */
@@ -141,13 +141,13 @@ miFillArcDSetup(arc, info)
 
 static void
 miGetArcEdge(
-	     register xArc *arc,
-	     register miSliceEdgePtr edge,
+	     xArc *arc,
+	     miSliceEdgePtr edge,
 	     int k,
 	     Bool top, 
 	     Bool left )
 {
-    register int xady, y;
+    int xady, y;
 
     y = arc->height >> 1;
     if (!(arc->width & 1))
@@ -271,13 +271,13 @@ miEllipseAngleToSlope (angle, width, hei
 
 static void
 miGetPieEdge(
-	     register xArc *arc,
-	     register int angle,
-	     register miSliceEdgePtr edge,
+	     xArc *arc,
+	     int angle,
+	     miSliceEdgePtr edge,
 	     Bool top, 
 	     Bool left )
 {
-    register int k;
+    int k;
     int	dx, dy;
 
     miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, 0, 0);
@@ -316,11 +316,11 @@ miGetPieEdge(
 
 _X_EXPORT void
 miFillArcSliceSetup(arc, slice, pGC)
-    register xArc *arc;
-    register miArcSliceRec *slice;
+    xArc *arc;
+    miArcSliceRec *slice;
     GCPtr pGC;
 {
-    register int angle1, angle2;
+    int angle1, angle2;
 
     angle1 = arc->angle1;
     if (arc->angle2 < 0)
@@ -550,14 +550,14 @@ miFillEllipseI(
 	       GCPtr pGC,
 	       xArc *arc )
 {
-    register int x, y, e;
+    int x, y, e;
     int yk, xk, ym, xm, dx, dy, xorg, yorg;
     int slw;
     miFillArcRec info;
     DDXPointPtr points;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
     int *widths;
-    register int *wids;
+    int *wids;
 
     points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height);
     if (!points)
@@ -593,14 +593,14 @@ miFillEllipseD(
 	       GCPtr pGC,
 	       xArc *arc )
 {
-    register int x, y;
+    int x, y;
     int xorg, yorg, dx, dy, slw;
     double e, yk, xk, ym, xm;
     miFillArcDRec info;
     DDXPointPtr points;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
     int *widths;
-    register int *wids;
+    int *wids;
 
     points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height);
     if (!points)
@@ -659,14 +659,14 @@ miFillArcSliceI(
 		xArc *arc )
 {
     int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
-    register int x, y, e;
+    int x, y, e;
     miFillArcRec info;
     miArcSliceRec slice;
     int ya, xl, xr, xc;
     DDXPointPtr points;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
     int *widths;
-    register int *wids;
+    int *wids;
 
     miFillArcSetup(arc, &info);
     miFillArcSliceSetup(arc, &slice, pGC);
@@ -721,16 +721,16 @@ miFillArcSliceD(
 		GCPtr pGC,
 		xArc *arc )
 {
-    register int x, y;
+    int x, y;
     int dx, dy, xorg, yorg, slw;
     double e, yk, xk, ym, xm;
     miFillArcDRec info;
     miArcSliceRec slice;
     int ya, xl, xr, xc;
     DDXPointPtr points;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
     int *widths;
-    register int *wids;
+    int *wids;
 
     miFillArcDSetup(arc, &info);
     miFillArcSliceSetup(arc, &slice, pGC);
@@ -790,8 +790,8 @@ miPolyFillArc(pDraw, pGC, narcs, parcs)
     int		narcs;
     xArc	*parcs;
 {
-    register int i;
-    register xArc *arc;
+    int i;
+    xArc *arc;
 
     for(i = narcs, arc = parcs; --i >= 0; arc++)
     {
diff --git a/mi/mifillrct.c b/mi/mifillrct.c
index 78e89d6..ca7e864 100644
--- a/mi/mifillrct.c
+++ b/mi/mifillrct.c
@@ -74,16 +74,16 @@ miPolyFillRect(pDrawable, pGC, nrectFill
     xRectangle	*prectInit;  	/* Pointer to first rectangle to fill */
 {
     int i;
-    register int	height;
-    register int	width;
-    register xRectangle *prect; 
-    int			xorg;
-    register int	yorg;
-    int			maxheight;
-    DDXPointPtr		pptFirst;
-    register DDXPointPtr ppt;
-    int			*pwFirst;
-    register int 	*pw;
+    int	height;
+    int	width;
+    xRectangle *prect; 
+    int	xorg;
+    int	yorg;
+    int	maxheight;
+    DDXPointPtr	pptFirst;
+    DDXPointPtr ppt;
+    int	*pwFirst;
+    int *pw;
 
     if (pGC->miTranslate)
     {
diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c
index 57229f6..7bc1bb2 100644
--- a/mi/mifpolycon.c
+++ b/mi/mifpolycon.c
@@ -55,7 +55,7 @@ SOFTWARE.
 #include "pixmapstr.h"
 #include "mifpoly.h"
 
-static int GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans,
+static int GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans,
 			   int *by, int *ty);
 
 #ifdef ICEILTEMPDECL
@@ -101,7 +101,7 @@ miFillSppPoly(dst, pgc, count, ptsIn, xT
     			*width,
     			*FirstWidth,    /* output buffer */
     	 		*Marked;	/* set if this vertex has been used */
-    register int	left, right,	/* indices to first endpoints */
+    int			left, right,	/* indices to first endpoints */
     			nextleft,
                  	nextright;	/* indices to second endpoints */
     DDXPointPtr 	ptsOut,
@@ -251,13 +251,13 @@ miFillSppPoly(dst, pgc, count, ptsIn, xT
 static
 int
 GetFPolyYBounds(
-    register SppPointPtr	pts,
+    SppPointPtr			pts,
     int 			n,
     double			yFtrans,
     int 			*by,
     int				*ty)
 {
-    register SppPointPtr	ptMin;
+    SppPointPtr			ptMin;
     double 			ymin, ymax;
     SppPointPtr			ptsStart = pts;
 
diff --git a/mi/miglblt.c b/mi/miglblt.c
index db299a8..4db3eb6 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -92,18 +92,18 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, ngl
 {
     int width, height;
     PixmapPtr pPixmap;
-    int nbyLine;			/* bytes per line of padded pixmap */
+    int nbyLine;		/* bytes per line of padded pixmap */
     FontPtr pfont;
     GCPtr pGCtmp;
-    register int i;
-    register int j;
-    unsigned char *pbits;		/* buffer for PutImage */
-    register unsigned char *pb;		/* temp pointer into buffer */
-    register CharInfoPtr pci;		/* currect char info */
-    register unsigned char *pglyph;	/* pointer bits in glyph */
-    int gWidth, gHeight;		/* width and height of glyph */
-    register int nbyGlyphWidth;		/* bytes per scanline of glyph */
-    int nbyPadGlyph;			/* server padded line of glyph */
+    int i;
+    int j;
+    unsigned char *pbits;	/* buffer for PutImage */
+    unsigned char *pb;		/* temp pointer into buffer */
+    CharInfoPtr pci;		/* currect char info */
+    unsigned char *pglyph;	/* pointer bits in glyph */
+    int gWidth, gHeight;	/* width and height of glyph */
+    int nbyGlyphWidth;		/* bytes per scanline of glyph */
+    int nbyPadGlyph;		/* server padded line of glyph */
 
     XID gcvals[3];
 
diff --git a/mi/miline.h b/mi/miline.h
index 7028485..b97b8cf 100644
--- a/mi/miline.h
+++ b/mi/miline.h
@@ -109,7 +109,7 @@ extern void miSetZeroLineBias(
 }
   
 #define SWAPINT(i, j) \
-{  register int _t = i;  i = j;  j = _t; }
+{  int _t = i;  i = j;  j = _t; }
 
 #define SWAPPT(i, j) \
 {  DDXPointRec _t; _t = i;  i = j; j = _t; }
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index c02ea2d..5724a6f 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -1019,7 +1019,7 @@ miOverlayMoveWindow(
 static void 
 miOverlayWindowExposures(
     WindowPtr pWin,
-    register RegionPtr prgn,
+    RegionPtr prgn,
     RegionPtr other_exposed
 ){
     RegionPtr   exposures = prgn;
@@ -1106,7 +1106,7 @@ miOverlayRecomputeExposures (
     WindowPtr	pWin,
     pointer	value 
 ){
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     miOverlayTwoRegions	*pValid = (miOverlayTwoRegions*)value;
     miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
 
@@ -1161,10 +1161,10 @@ miOverlayResizeWindow(
     DDXPointRec oldpt;
     RegionPtr oldRegion = NULL, oldRegion2 = NULL;
     WindowPtr pFirstChange;
-    register WindowPtr pChild;
+    WindowPtr pChild;
     RegionPtr	gravitate[StaticGravity + 1];
     RegionPtr	gravitate2[StaticGravity + 1];
-    register unsigned g;
+    unsigned 	g;
     int		nx, ny;		/* destination x,y */
     int		newx, newy;	/* new inner window position */
     RegionPtr	pRegion = NULL;
@@ -1669,7 +1669,7 @@ miOverlayChangeBorderWidth(
     unsigned int width
 ){
     int oldwidth;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     Bool WasViewable = (Bool)(pWin->viewable);
     Bool HadBorder;
 #ifdef DO_SAVE_UNDERS
diff --git a/mi/mipoly.c b/mi/mipoly.c
index b514b5e..ea0406f 100644
--- a/mi/mipoly.c
+++ b/mi/mipoly.c
@@ -70,14 +70,14 @@ SOFTWARE.
 _X_EXPORT void
 miFillPolygon(dst, pgc, shape, mode, count, pPts)
     DrawablePtr		dst;
-    register GCPtr	pgc;
+    GCPtr		pgc;
     int			shape, mode;
-    register int	count;
+    int			count;
     DDXPointPtr		pPts;
 {
     int			i;
-    register int	xorg, yorg;
-    register DDXPointPtr ppt;
+    int			xorg, yorg;
+    DDXPointPtr 	ppt;
 
     if (count == 0)
 	return;
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
index b5ab893..e2d666e 100644
--- a/mi/mipolycon.c
+++ b/mi/mipolycon.c
@@ -78,9 +78,9 @@ miFillConvexPoly(dst, pgc, count, ptsIn)
     int		count;                /* number of points        */
     DDXPointPtr ptsIn;                /* the points              */
 {
-    register int xl = 0, xr = 0; /* x vals of left and right edges */
-    register int dl = 0, dr = 0; /* decision variables             */
-    register int ml = 0, m1l = 0;/* left edge slope and slope+1    */
+    int xl = 0, xr = 0; /* x vals of left and right edges */
+    int dl = 0, dr = 0; /* decision variables             */
+    int ml = 0, m1l = 0;/* left edge slope and slope+1    */
     int mr = 0, m1r = 0;         /* right edge slope and slope+1   */
     int incr1l = 0, incr2l = 0;  /* left edge error increments     */
     int incr1r = 0, incr2r = 0;  /* right edge error increments    */
@@ -221,7 +221,7 @@ miFillConvexPoly(dst, pgc, count, ptsIn)
 static int
 getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty)
 {
-    register DDXPointPtr ptMin;
+    DDXPointPtr ptMin;
     int ymin, ymax;
     DDXPointPtr ptsStart = pts;
 
diff --git a/mi/mipolygen.c b/mi/mipolygen.c
index 34da21f..0d2ecc4 100644
--- a/mi/mipolygen.c
+++ b/mi/mipolygen.c
@@ -72,12 +72,12 @@ miFillGeneralPoly(dst, pgc, count, ptsIn
     int		count;              /* number of points        */
     DDXPointPtr ptsIn;              /* the points              */
 {
-    register EdgeTableEntry *pAET;  /* the Active Edge Table   */
-    register int y;                 /* the current scanline    */
-    register int nPts = 0;          /* number of pts in buffer */
-    register EdgeTableEntry *pWETE; /* Winding Edge Table      */
-    register ScanLineList *pSLL;    /* Current ScanLineList    */
-    register DDXPointPtr ptsOut;      /* ptr to output buffers   */
+    EdgeTableEntry *pAET;  /* the Active Edge Table   */
+    int y;                 /* the current scanline    */
+    int nPts = 0;          /* number of pts in buffer */
+    EdgeTableEntry *pWETE; /* Winding Edge Table      */
+    ScanLineList *pSLL;    /* Current ScanLineList    */
+    DDXPointPtr ptsOut;      /* ptr to output buffers   */
     int *width;
     DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */
     int FirstWidth[NUMPTSTOBUFFER];
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 245bda3..afe3f72 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -70,7 +70,7 @@ miPolyPoint(pDrawable, pGC, mode, npt, p
     XID			fsOld, fsNew;
     int			*pwidthInit, *pwidth;
     int			i;
-    register xPoint 	*ppt;
+    xPoint 		*ppt;
 
     /* make pointlist origin relative */
     if (mode == CoordModePrevious)
diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c
index 5443ba5..fe72e55 100644
--- a/mi/mipolyutil.c
+++ b/mi/mipolyutil.c
@@ -81,8 +81,8 @@ miInsertEdgeInET(ET, ETE, scanline, SLLB
     ScanLineListBlock **SLLBlock;
     int *iSLLBlock;
 {
-    register EdgeTableEntry *start, *prev;
-    register ScanLineList *pSLL, *pPrevSLL;
+    EdgeTableEntry *start, *prev;
+    ScanLineList *pSLL, *pPrevSLL;
     ScanLineListBlock *tmpSLLBlock;
 
     /*
@@ -166,15 +166,15 @@ miInsertEdgeInET(ET, ETE, scanline, SLLB
 
 Bool
 miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
-    register int count;
-    register DDXPointPtr pts;
+    int count;
+    DDXPointPtr pts;
     EdgeTable *ET;
     EdgeTableEntry *AET;
-    register EdgeTableEntry *pETEs;
+    EdgeTableEntry *pETEs;
     ScanLineListBlock   *pSLLBlock;
 {
-    register DDXPointPtr top, bottom;
-    register DDXPointPtr PrevPt, CurrPt;
+    DDXPointPtr top, bottom;
+    DDXPointPtr PrevPt, CurrPt;
     int iSLLBlock = 0;
 
     int dy;
@@ -262,10 +262,10 @@ miCreateETandAET(count, pts, ET, AET, pE
 
 void
 miloadAET(AET, ETEs)
-    register EdgeTableEntry *AET, *ETEs;
+    EdgeTableEntry *AET, *ETEs;
 {
-    register EdgeTableEntry *pPrevAET;
-    register EdgeTableEntry *tmp;
+    EdgeTableEntry *pPrevAET;
+    EdgeTableEntry *tmp;
 
     pPrevAET = AET;
     AET = AET->next;
@@ -310,11 +310,11 @@ miloadAET(AET, ETEs)
  */
 void
 micomputeWAET(AET)
-    register EdgeTableEntry *AET;
+    EdgeTableEntry *AET;
 {
-    register EdgeTableEntry *pWETE;
-    register int inside = 1;
-    register int isInside = 0;
+    EdgeTableEntry *pWETE;
+    int inside = 1;
+    int isInside = 0;
 
     AET->nextWETE = (EdgeTableEntry *)NULL;
     pWETE = AET;
@@ -349,12 +349,12 @@ micomputeWAET(AET)
 
 int
 miInsertionSort(AET)
-    register EdgeTableEntry *AET;
+    EdgeTableEntry *AET;
 {
-    register EdgeTableEntry *pETEchase;
-    register EdgeTableEntry *pETEinsert;
-    register EdgeTableEntry *pETEchaseBackTMP;
-    register int changed = 0;
+    EdgeTableEntry *pETEchase;
+    EdgeTableEntry *pETEinsert;
+    EdgeTableEntry *pETEchaseBackTMP;
+    int changed = 0;
 
     AET = AET->next;
     while (AET) 
@@ -386,9 +386,9 @@ miInsertionSort(AET)
  */
 void
 miFreeStorage(pSLLBlock)
-    register ScanLineListBlock   *pSLLBlock;
+    ScanLineListBlock   *pSLLBlock;
 {
-    register ScanLineListBlock   *tmpSLLBlock;
+    ScanLineListBlock   *tmpSLLBlock;
 
     while (pSLLBlock) 
     {
diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c
index 6526aa0..3695f30 100644
--- a/mi/mipushpxl.c
+++ b/mi/mipushpxl.c
@@ -85,11 +85,11 @@ miPushPixels(pGC, pBitMap, pDrawable, dx
     int		dx, dy, xOrg, yOrg;
 {
     int		h, dxDivPPW, ibEnd;
-    MiBits *pwLineStart;
-    register MiBits	*pw, *pwEnd;
-    register MiBits msk;
-    register int ib, w;
-    register int ipt;		/* index into above arrays */
+    MiBits 	*pwLineStart;
+    MiBits	*pw, *pwEnd;
+    MiBits 	msk;
+    int 	ib, w;
+    int 	ipt;		/* index into above arrays */
     Bool 	fInBox;
     DDXPointRec	pt[NPT], ptThisLine;
     int		width[NPT];
diff --git a/mi/miregion.c b/mi/miregion.c
index 0db46dc..5422099 100644
--- a/mi/miregion.c
+++ b/mi/miregion.c
@@ -228,7 +228,7 @@ miPrintRegion(rgn)
     RegionPtr rgn;
 {
     int num, size;
-    register int i;
+    int i;
     BoxPtr rects;
 
     num = REGION_NUM_RECTS(rgn);
@@ -275,7 +275,7 @@ Bool
 miValidRegion(reg)
     RegionPtr reg;
 {
-    register int i, numRects;
+    int i, numRects;
 
     if ((reg->extents.x1 > reg->extents.x2) ||
 	(reg->extents.y1 > reg->extents.y2))
@@ -289,7 +289,7 @@ miValidRegion(reg)
 	return (!reg->data);
     else
     {
-	register BoxPtr pboxP, pboxN;
+	BoxPtr pboxP, pboxN;
 	BoxRec box;
 
 	pboxP = REGION_RECTS(reg);
@@ -331,7 +331,7 @@ miRegionCreate(rect, size)
     BoxPtr rect;
     int size;
 {
-    register RegionPtr pReg;
+    RegionPtr pReg;
    
     pReg = (RegionPtr)xalloc(sizeof(RegionRec));
     if (!pReg)
@@ -414,7 +414,7 @@ miRegionBreak (pReg)
 
 _X_EXPORT Bool
 miRectAlloc(
-    register RegionPtr pRgn,
+    RegionPtr pRgn,
     int n)
 {
     RegDataPtr	data;
@@ -455,8 +455,8 @@ miRectAlloc(
 
 _X_EXPORT Bool
 miRegionCopy(dst, src)
-    register RegionPtr dst;
-    register RegionPtr src;
+    RegionPtr dst;
+    RegionPtr src;
 {
     good(dst);
     good(src);
@@ -508,14 +508,14 @@ miRegionCopy(dst, src)
  */
 INLINE static int
 miCoalesce (
-    register RegionPtr	pReg,	    	/* Region to coalesce		     */
+    RegionPtr	pReg,	    	/* Region to coalesce		     */
     int	    	  	prevStart,  	/* Index of start of previous band   */
     int	    	  	curStart)   	/* Index of start of current band    */
 {
-    register BoxPtr	pPrevBox;   	/* Current box in previous band	     */
-    register BoxPtr	pCurBox;    	/* Current box in current band       */
-    register int  	numRects;	/* Number rectangles in both bands   */
-    register int	y2;		/* Bottom of current band	     */
+    BoxPtr	pPrevBox;   	/* Current box in previous band	     */
+    BoxPtr	pCurBox;    	/* Current box in current band       */
+    int  	numRects;	/* Number rectangles in both bands   */
+    int		y2;		/* Bottom of current band	     */
     /*
      * Figure out how many rectangles are in the band.
      */
@@ -592,14 +592,14 @@ miCoalesce (
 
 INLINE static Bool
 miAppendNonO (
-    register RegionPtr	pReg,
-    register BoxPtr	r,
-    BoxPtr  	  	rEnd,
-    register int  	y1,
-    register int  	y2)
+    RegionPtr	pReg,
+    BoxPtr	r,
+    BoxPtr  	rEnd,
+    int  	y1,
+    int  	y2)
 {
-    register BoxPtr	pNextRect;
-    register int	newRects;
+    BoxPtr	pNextRect;
+    int		newRects;
 
     newRects = rEnd - r;
 
@@ -691,25 +691,25 @@ miRegionOp(
 					    /* in region 2 ? */
     Bool	    *pOverlap)
 {
-    register BoxPtr r1;			    /* Pointer into first region     */
-    register BoxPtr r2;			    /* Pointer into 2d region	     */
-    BoxPtr	    r1End;		    /* End of 1st region	     */
-    BoxPtr	    r2End;		    /* End of 2d region		     */
-    short	    ybot;		    /* Bottom of intersection	     */
-    short	    ytop;		    /* Top of intersection	     */
-    RegDataPtr	    oldData;		    /* Old data for newReg	     */
-    int		    prevBand;		    /* Index of start of
-					     * previous band in newReg       */
-    int		    curBand;		    /* Index of start of current
-					     * band in newReg		     */
-    register BoxPtr r1BandEnd;		    /* End of current band in r1     */
-    register BoxPtr r2BandEnd;		    /* End of current band in r2     */
-    short	    top;		    /* Top of non-overlapping band   */
-    short	    bot;		    /* Bottom of non-overlapping band*/
-    register int    r1y1;		    /* Temps for r1->y1 and r2->y1   */
-    register int    r2y1;
-    int		    newSize;
-    int		    numRects;
+    BoxPtr 	r1;		    /* Pointer into first region     */
+    BoxPtr 	r2;		    /* Pointer into 2d region	     */
+    BoxPtr	r1End;		    /* End of 1st region	     */
+    BoxPtr	r2End;		    /* End of 2d region		     */
+    short	ybot;		    /* Bottom of intersection	     */
+    short	ytop;		    /* Top of intersection	     */
+    RegDataPtr	oldData;	    /* Old data for newReg	     */
+    int		prevBand;	    /* Index of start of
+				     * previous band in newReg       */
+    int		curBand;	    /* Index of start of current
+				     * band in newReg		     */
+    BoxPtr  	r1BandEnd;	    /* End of current band in r1     */
+    BoxPtr  	r2BandEnd;	    /* End of current band in r2     */
+    short   	top;		    /* Top of non-overlapping band   */
+    short   	bot;	    	    /* Bottom of non-overlapping band*/
+    int     	r1y1;	    	    /* Temps for r1->y1 and r2->y1   */
+    int     	r2y1;
+    int	    	newSize;
+    int	    	numRects;
 
     /*
      * Break any region computed from a broken region
@@ -915,9 +915,9 @@ miRegionOp(
  */
 void
 miSetExtents (pReg)
-    register RegionPtr pReg;
+    RegionPtr pReg;
 {
-    register BoxPtr pBox, pBoxEnd;
+    BoxPtr pBox, pBoxEnd;
 
     if (!pReg->data)
 	return;
@@ -974,18 +974,18 @@ miSetExtents (pReg)
 /*ARGSUSED*/
 static Bool
 miIntersectO (
-    register RegionPtr	pReg,
-    register BoxPtr	r1,
+    RegionPtr	pReg,
+    BoxPtr	r1,
     BoxPtr  	  	r1End,
-    register BoxPtr	r2,
+    BoxPtr	r2,
     BoxPtr  	  	r2End,
     short    	  	y1,
     short    	  	y2,
     Bool		*pOverlap)
 {
-    register int  	x1;
-    register int  	x2;
-    register BoxPtr	pNextRect;
+    int  	x1;
+    int  	x2;
+    BoxPtr	pNextRect;
 
     pNextRect = REGION_TOP(pReg);
 
@@ -1022,9 +1022,9 @@ miIntersectO (
 
 _X_EXPORT Bool
 miIntersect(newReg, reg1, reg2)
-    register RegionPtr 	newReg;     /* destination Region */
-    register RegionPtr 	reg1;
-    register RegionPtr	reg2;       /* source regions     */
+    RegionPtr 	newReg;     /* destination Region */
+    RegionPtr 	reg1;
+    RegionPtr	reg2;       /* source regions     */
 {
     good(reg1);
     good(reg2);
@@ -1117,18 +1117,18 @@ miIntersect(newReg, reg1, reg2)
  */
 static Bool
 miUnionO (
-    register RegionPtr	pReg,
-    register BoxPtr	r1,
-	     BoxPtr  	r1End,
-    register BoxPtr	r2,
-	     BoxPtr  	r2End,
-	     short	y1,
-	     short	y2,
-	     Bool	*pOverlap)
-{
-    register BoxPtr     pNextRect;
-    register int        x1;     /* left and right side of current union */
-    register int        x2;
+    RegionPtr	pReg,
+    BoxPtr	r1,
+    BoxPtr  	r1End,
+    BoxPtr	r2,
+    BoxPtr  	r2End,
+    short	y1,
+    short	y2,
+    Bool	*pOverlap)
+{
+    BoxPtr     pNextRect;
+    int        x1;     /* left and right side of current union */
+    int        x2;
 
     assert (y1 < y2);
     assert(r1 != r1End && r2 != r2End);
@@ -1178,8 +1178,8 @@ miUnionO (
 _X_EXPORT Bool 
 miUnion(newReg, reg1, reg2)
     RegionPtr		newReg;                  /* destination Region */
-    register RegionPtr 	reg1;
-    register RegionPtr	reg2;             /* source regions     */
+    RegionPtr 	reg1;
+    RegionPtr	reg2;             /* source regions     */
 {
     Bool overlap; /* result ignored */
 
@@ -1276,8 +1276,8 @@ miUnion(newReg, reg1, reg2)
  */
 _X_EXPORT Bool
 miRegionAppend(dstrgn, rgn)
-    register RegionPtr dstrgn;
-    register RegionPtr rgn;
+    RegionPtr dstrgn;
+    RegionPtr rgn;
 {
     int numRects, dnumRects, size;
     BoxPtr new, old;
@@ -1307,7 +1307,7 @@ miRegionAppend(dstrgn, rgn)
 	dstrgn->extents = rgn->extents;
     else if (dstrgn->extents.x2 > dstrgn->extents.x1)
     {
-	register BoxPtr first, last;
+	BoxPtr first, last;
 
 	first = old;
 	last = REGION_BOXPTR(dstrgn) + (dnumRects - 1);
@@ -1371,13 +1371,13 @@ miRegionAppend(dstrgn, rgn)
 
 static void
 QuickSortRects(
-    register BoxRec     rects[],
-    register int        numRects)
+    BoxRec     rects[],
+    int        numRects)
 {
-    register int	y1;
-    register int	x1;
-    register int        i, j;
-    register BoxPtr     r;
+    int	y1;
+    int	x1;
+    int        i, j;
+    BoxPtr     r;
 
     /* Always called with numRects > 1 */
 
@@ -1472,17 +1472,17 @@ miRegionValidate(badreg, pOverlap)
 	int	    curBand;
     } RegionInfo;
 
-	     int	numRects;   /* Original numRects for badreg	    */
-	     RegionInfo *ri;	    /* Array of current regions		    */
-    	     int	numRI;      /* Number of entries used in ri	    */
-	     int	sizeRI;	    /* Number of entries available in ri    */
-	     int	i;	    /* Index into rects			    */
-    register int	j;	    /* Index into ri			    */
-    register RegionInfo *rit;       /* &ri[j]				    */
-    register RegionPtr  reg;        /* ri[j].reg			    */
-    register BoxPtr	box;	    /* Current box in rects		    */
-    register BoxPtr	riBox;      /* Last box in ri[j].reg		    */
-    register RegionPtr  hreg;       /* ri[j_half].reg			    */
+    int	numRects;   /* Original numRects for badreg	    */
+    RegionInfo *ri;	    /* Array of current regions		    */
+    int	numRI;      /* Number of entries used in ri	    */
+    int	sizeRI;	    /* Number of entries available in ri    */
+    int	i;	    /* Index into rects			    */
+    int	j;	    /* Index into ri			    */
+    RegionInfo *rit;       /* &ri[j]				    */
+    RegionPtr  reg;        /* ri[j].reg			    */
+    BoxPtr	box;	    /* Current box in rects		    */
+    BoxPtr	riBox;      /* Last box in ri[j].reg		    */
+    RegionPtr  hreg;       /* ri[j_half].reg			    */
     Bool		ret = TRUE;
 
     *pOverlap = FALSE;
@@ -1654,13 +1654,13 @@ bail:
 _X_EXPORT RegionPtr
 miRectsToRegion(nrects, prect, ctype)
     int			nrects;
-    register xRectangle	*prect;
+    xRectangle		*prect;
     int			ctype;
 {
-    register RegionPtr	pRgn;
-    register RegDataPtr	pData;
-    register BoxPtr	pBox;
-    register int        i;
+    RegionPtr		pRgn;
+    RegDataPtr		pData;
+    BoxPtr		pBox;
+    int        		i;
     int			x1, y1, x2, y2;
 
     pRgn = miRegionCreate(NullBox, 0);
@@ -1754,17 +1754,17 @@ miRectsToRegion(nrects, prect, ctype)
 /*ARGSUSED*/
 static Bool
 miSubtractO (
-    register RegionPtr	pReg,
-    register BoxPtr	r1,
-    BoxPtr  	  	r1End,
-    register BoxPtr	r2,
-    BoxPtr  	  	r2End,
-    register short  	y1,
-             short  	y2,
-    Bool		*pOverlap)
+    RegionPtr	pReg,
+    BoxPtr	r1,
+    BoxPtr  	r1End,
+    BoxPtr	r2,
+    BoxPtr  	r2End,
+    short  	y1,
+    short  	y2,
+    Bool	*pOverlap)
 {
-    register BoxPtr	pNextRect;
-    register int  	x1;
+    BoxPtr	pNextRect;
+    int  	x1;
 
     x1 = r1->x1;
     
@@ -1878,9 +1878,9 @@ miSubtractO (
  */
 _X_EXPORT Bool
 miSubtract(regD, regM, regS)
-    register RegionPtr	regD;               
-    register RegionPtr 	regM;
-    register RegionPtr	regS;          
+    RegionPtr	regD;               
+    RegionPtr 	regM;
+    RegionPtr	regS;          
 {
     Bool overlap; /* result ignored */
 
@@ -2003,15 +2003,15 @@ miInverse(newReg, reg1, invRect)
 
 _X_EXPORT int
 miRectIn(region, prect)
-    register RegionPtr  region;
-    register BoxPtr     prect;
+    RegionPtr  region;
+    BoxPtr     prect;
 {
-    register int	x;
-    register int	y;
-    register BoxPtr     pbox;
-    register BoxPtr     pboxEnd;
-    int			partIn, partOut;
-    int			numRects;
+    int		x;
+    int		y;
+    BoxPtr	pbox;
+    BoxPtr	pboxEnd;
+    int		partIn, partOut;
+    int		numRects;
 
     good(region);
     numRects = REGION_NUM_RECTS(region);
@@ -2099,13 +2099,13 @@ miRectIn(region, prect)
 
 _X_EXPORT void
 miTranslateRegion(pReg, x, y)
-    register RegionPtr pReg;
-    register int x;
-    register int y;
+    RegionPtr pReg;
+    int x;
+    int y;
 {
     int x1, x2, y1, y2;
-    register int nbox;
-    register BoxPtr pbox;
+    int nbox;
+    BoxPtr pbox;
 
     good(pReg);
     pReg->extents.x1 = x1 = pReg->extents.x1 + x;
@@ -2144,7 +2144,7 @@ miTranslateRegion(pReg, x, y)
 	pReg->extents.y2 = MAXSHORT;
     if (pReg->data && (nbox = pReg->data->numRects))
     {
-	register BoxPtr pboxout;
+	BoxPtr pboxout;
 
 	for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++)
 	{
@@ -2184,8 +2184,8 @@ miTranslateRegion(pReg, x, y)
 
 Bool
 miRegionDataCopy(
-    register RegionPtr dst,
-    register RegionPtr src)
+    RegionPtr dst,
+    RegionPtr src)
 {
     good(dst);
     good(src);
@@ -2226,11 +2226,11 @@ miRegionReset(pReg, pBox)
 
 _X_EXPORT Bool
 miPointInRegion(pReg, x, y, box)
-    register RegionPtr pReg;
-    register int x, y;
+    RegionPtr pReg;
+    int x, y;
     BoxPtr box;     /* "return" value */
 {
-    register BoxPtr pbox, pboxEnd;
+    BoxPtr pbox, pboxEnd;
     int numRects;
 
     good(pReg);
@@ -2294,8 +2294,8 @@ miRegionExtents(pReg)
 
 #define ExchangeSpans(a, b)				    \
 {							    \
-    DDXPointRec     tpt;				    \
-    register int    tw;					    \
+    DDXPointRec	tpt;				    	    \
+    int    	tw;					    \
 							    \
     tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt;    \
     tw = widths[a]; widths[a] = widths[b]; widths[b] = tw;  \
@@ -2307,13 +2307,13 @@ miRegionExtents(pReg)
 */
 
 static void QuickSortSpans(
-    register DDXPointRec    spans[],
-    register int	    widths[],
-    register int	    numSpans)
-{
-    register int	    y;
-    register int	    i, j, m;
-    register DDXPointPtr    r;
+    DDXPointRec spans[],
+    int	    	widths[],
+    int	    	numSpans)
+{
+    int	    y;
+    int	    i, j, m;
+    DDXPointPtr    r;
 
     /* Always called with numSpans > 1 */
     /* Sorts only by y, doesn't bother to sort by x */
@@ -2323,7 +2323,7 @@ static void QuickSortSpans(
 	if (numSpans < 9)
 	{
 	    /* Do insertion sort */
-	    register int yprev;
+	    int yprev;
 
 	    yprev = spans[0].y;
 	    i = 1;
@@ -2412,18 +2412,18 @@ static void QuickSortSpans(
 
 _X_EXPORT int
 miClipSpans(
-    RegionPtr		    prgnDst,
-    register DDXPointPtr    ppt,
-    register int	    *pwidth,
-    int			    nspans,
-    register DDXPointPtr    pptNew,
-    int			    *pwidthNew,
-    int			    fSorted)
-{
-    register DDXPointPtr pptLast;
-    int			*pwidthNewStart;	/* the vengeance of Xerox! */
-    register int	y, x1, x2;
-    register int	numRects;
+    RegionPtr	prgnDst,
+    DDXPointPtr ppt,
+    int	    	*pwidth,
+    int		nspans,
+    DDXPointPtr	pptNew,
+    int		*pwidthNew,
+    int		fSorted)
+{
+    DDXPointPtr pptLast;
+    int	*pwidthNewStart;	/* the vengeance of Xerox! */
+    int	y, x1, x2;
+    int	numRects;
 
     good(prgnDst);
     pptLast = ppt + nspans;
@@ -2435,7 +2435,7 @@ miClipSpans(
 	/* It doesn't pay much to make use of fSorted in this case, 
 	   so we lump everything together. */
 
-	register    int clipx1, clipx2, clipy1, clipy2;
+	int clipx1, clipx2, clipy1, clipy2;
 
 	clipx1 = prgnDst->extents.x1;
 	clipy1 = prgnDst->extents.y1;
@@ -2467,10 +2467,10 @@ miClipSpans(
     else if ((numRects = prgnDst->data->numRects))
     {
 	/* Have to clip against many boxes */
-	BoxPtr		pboxBandStart, pboxBandEnd;
-	register BoxPtr pbox;
-	register BoxPtr pboxLast;
-	register int	clipy1, clipy2;
+	BoxPtr pboxBandStart, pboxBandEnd;
+	BoxPtr pbox;
+	BoxPtr pboxLast;
+	int clipy1, clipy2;
 
 	/* In this case, taking advantage of sorted spans gains more than
 	   the sorting costs. */
@@ -2493,7 +2493,7 @@ miClipSpans(
 		x2 = x1 + *pwidth;
 		do
 		{ /* For each box in band */
-		    register int    newx1, newx2;
+		    int newx1, newx2;
 
 		    newx1 = x1;
 		    newx2 = x2;
@@ -2531,10 +2531,10 @@ _X_EXPORT int
 miFindMaxBand(prgn)
     RegionPtr prgn;
 {
-    register int nbox;
-    register BoxPtr pbox;
-    register int nThisBand;
-    register int nMaxBand = 0;
+    int nbox;
+    BoxPtr pbox;
+    int nThisBand;
+    int nMaxBand = 0;
     short yThisBand;
 
     good(prgn);
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index ac1b823..7922cb6 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -185,7 +185,7 @@ miCreateScreenResources(pScreen)
 
 Bool
 miScreenDevPrivateInit(pScreen, width, pbits)
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     int width;
     pointer pbits;
 {
@@ -207,7 +207,7 @@ miScreenDevPrivateInit(pScreen, width, p
 _X_EXPORT Bool
 miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
 	     rootDepth, numDepths, depths, rootVisual, numVisuals, visuals)
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     pointer pbits;		/* pointer to screen bits */
     int xsize, ysize;		/* in pixels */
     int dpix, dpiy;		/* dots per inch */
diff --git a/mi/mispans.c b/mi/mispans.c
index 4c8b6d6..61d72e4 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -188,8 +188,8 @@ void miAppendSpans(spanGroup, otherGroup
     SpanGroup	*otherGroup;
     Spans       *spans;
 {
-    register    int ymin, ymax;
-    register    int spansCount;
+    int ymin, ymax;
+    int spansCount;
 
     spansCount = spans->count;
     if (spansCount > 0) {
@@ -226,21 +226,21 @@ void miFreeSpanGroup(spanGroup)
 }
 
 static void QuickSortSpansX(
-    register DDXPointRec    points[],
-    register int	    widths[],
-    register int	    numSpans )
+    DDXPointRec points[],
+    int		widths[],
+    int		numSpans )
 {
-    register int	    x;
-    register int	    i, j, m;
-    register DDXPointPtr    r;
+    int	    		x;
+    int	    		i, j, m;
+    DDXPointPtr 	r;
 
 /* Always called with numSpans > 1 */
 /* Sorts only by x, as all y should be the same */
 
 #define ExchangeSpans(a, b)				    \
 {							    \
-    DDXPointRec     tpt;				    \
-    register int    tw;					    \
+    DDXPointRec 	tpt;				    \
+    int    		tw;				    \
 							    \
     tpt = points[a]; points[a] = points[b]; points[b] = tpt;    \
     tw = widths[a]; widths[a] = widths[b]; widths[b] = tw;  \
@@ -249,7 +249,7 @@ static void QuickSortSpansX(
     do {
 	if (numSpans < 9) {
 	    /* Do insertion sort */
-	    register int xprev;
+	    int xprev;
 
 	    xprev = points[0].x;
 	    i = 1;
@@ -313,14 +313,14 @@ static void QuickSortSpansX(
 
 
 static int UniquifySpansX(
-    Spans		    *spans,
-    register DDXPointRec    *newPoints,
-    register int	    *newWidths )
+    Spans	    	*spans,
+    DDXPointRec    	*newPoints,
+    int	    		*newWidths )
 {
-    register int newx1, newx2, oldpt, i, y;
-    register DDXPointRec    *oldPoints;
-    register int	    *oldWidths;
-    int			    *startNewWidths;
+    int 		newx1, newx2, oldpt, i, y;
+    DDXPointRec		*oldPoints;
+    int	    		*oldWidths;
+    int			*startNewWidths;
 
 /* Always called with numSpans > 1 */
 /* Uniquify the spans, and stash them into newPoints and newWidths.  Return the
@@ -384,16 +384,16 @@ void miFillUniqueSpanGroup(pDraw, pGC, s
     GCPtr	pGC;
     SpanGroup   *spanGroup;
 {
-    register int    i;
-    register Spans  *spans;
-    register Spans  *yspans;
-    register int    *ysizes;
-    register int    ymin, ylength;
+    int    		i;
+    Spans  		*spans;
+    Spans  		*yspans;
+    int    		*ysizes;
+    int    		ymin, ylength;
 
     /* Outgoing spans for one big call to FillSpans */
-    register DDXPointPtr    points;
-    register int	    *widths;
-    register int	    count;
+    DDXPointPtr    	points;
+    int	    		*widths;
+    int	    		count;
 
     if (spanGroup->count == 0) return;
 
@@ -545,8 +545,8 @@ void miFillSpanGroup(pDraw, pGC, spanGro
     GCPtr	pGC;
     SpanGroup   *spanGroup;
 {
-    register int    i;
-    register Spans  *spans;
+    int    i;
+    Spans  *spans;
 
     for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
 	(*pGC->ops->FillSpans)
diff --git a/mi/misprite.c b/mi/misprite.c
index 286c755..c0560a4 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -320,11 +320,11 @@ miSpriteGetSpans (pDrawable, wMax, ppt, 
 
     if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp)
     {
-	register DDXPointPtr    pts;
-	register int    	*widths;
-	register int    	nPts;
-	register int    	xorg,
-				yorg;
+	DDXPointPtr    	pts;
+	int    		*widths;
+	int    		nPts;
+	int    		xorg,
+			yorg;
 
 	xorg = pDrawable->x;
 	yorg = pDrawable->y;
diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index 0e5ed61..92ea0a8 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -112,13 +112,13 @@ miShapedWindowIn (pScreen, universe, bou
     ScreenPtr	pScreen;
     RegionPtr	universe, bounding;
     BoxPtr	rect;
-    register int x, y;
+    int 	x, y;
 {
-    BoxRec  box;
-    register BoxPtr  boundBox;
-    int	    nbox;
-    Bool    someIn, someOut;
-    register int t, x1, y1, x2, y2;
+    BoxRec  	box;
+    BoxPtr	boundBox;
+    int		nbox;
+    Bool	someIn, someOut;
+    int 	t, x1, y1, x2, y2;
 
     nbox = REGION_NUM_RECTS (bounding);
     boundBox = REGION_RECTS (bounding);
@@ -202,16 +202,16 @@ miRegisterRedirectBorderClipProc (SetRed
  */
 static void
 miComputeClips (
-    register WindowPtr	pParent,
-    register ScreenPtr	pScreen,
-    register RegionPtr	universe,
+    WindowPtr	pParent,
+    ScreenPtr	pScreen,
+    RegionPtr	universe,
     VTKind		kind,
     RegionPtr		exposed ) /* for intermediate calculations */
 {
     int			dx,
 			dy;
     RegionRec		childUniverse;
-    register WindowPtr	pChild;
+    WindowPtr		pChild;
     int     	  	oldVis, newVis;
     BoxRec		borderSize;
     RegionRec		childUnion;
@@ -535,10 +535,10 @@ miComputeClips (
 
 static void
 miTreeObscured(
-    register WindowPtr pParent )
+    WindowPtr pParent )
 {
-    register WindowPtr pChild;
-    register int    oldVis;
+    WindowPtr 	pChild;
+    int    	oldVis;
 
     pChild = pParent;
     while (1)
@@ -609,8 +609,8 @@ miValidateTree (pParent, pChild, kind)
     RegionRec		childUnion; /* the space covered by borderSize for
 				     * all marked children */
     RegionRec		exposed;    /* For intermediate calculations */
-    register ScreenPtr	pScreen;
-    register WindowPtr	pWin;
+    ScreenPtr		pScreen;
+    WindowPtr		pWin;
     Bool		overlap;
     int			viewvals;
     Bool		forward;
diff --git a/mi/miwideline.c b/mi/miwideline.c
index d57c2ea..7f99aca 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -56,10 +56,10 @@ from The Open Group.
 ICEILTEMPDECL
 #endif
 
-static void miLineArc(DrawablePtr pDraw, register GCPtr pGC,
+static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
 		      unsigned long pixel, SpanDataPtr spanData,
-		      register LineFacePtr leftFace,
-		      register LineFacePtr rightFace,
+		      LineFacePtr leftFace,
+		      LineFacePtr rightFace,
 		      double xorg, double yorg, Bool isInt);
 
 
@@ -79,12 +79,12 @@ miFillPolyHelper (pDrawable, pGC, pixel,
     PolyEdgePtr	left, right;
     int		left_count, right_count;
 {
-    register int left_x = 0, left_e = 0;
+    int left_x = 0, left_e = 0;
     int	left_stepx = 0;
     int	left_signdx = 0;
     int	left_dy = 0, left_dx = 0;
 
-    register int right_x = 0, right_e = 0;
+    int right_x = 0, right_e = 0;
     int	right_stepx = 0;
     int	right_signdx = 0;
     int	right_dy = 0, right_dx = 0;
@@ -92,10 +92,10 @@ miFillPolyHelper (pDrawable, pGC, pixel,
     int	height = 0;
     int	left_height = 0, right_height = 0;
 
-    register DDXPointPtr ppt;
+    DDXPointPtr ppt;
     DDXPointPtr pptInit = NULL;
-    register int *pwidth;
-    int *pwidthInit = NULL;
+    int 	*pwidth;
+    int 	*pwidthInit = NULL;
     XID		oldPixel;
     int		xorg;
     Spans	spanRec;
@@ -203,8 +203,8 @@ miFillRectPolyHelper (
     int		w,
     int		h)
 {
-    register DDXPointPtr ppt;
-    register int *pwidth;
+    DDXPointPtr ppt;
+    int 	*pwidth;
     XID		oldPixel;
     Spans	spanRec;
     xRectangle  rect;
@@ -265,10 +265,10 @@ _X_EXPORT /* static */ int
 miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge)
     double	x0, y0;
     double	k;  /* x0 * dy - y0 * dx */
-    register int dx, dy;
+    int 	dx, dy;
     int		xi, yi;
     int		left;
-    register PolyEdgePtr edge;
+    PolyEdgePtr edge;
 {
     int	    x, y, e;
     int	    xady;
@@ -322,23 +322,23 @@ miPolyBuildEdge (x0, y0, k, dx, dy, xi, 
 
 _X_EXPORT /* static */ int
 miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, h)
-    register PolyVertexPtr vertices;
-    register PolySlopePtr  slopes;
-    int		    count;
-    int		    xi, yi;
-    PolyEdgePtr	    left, right;
-    int		    *pnleft, *pnright;
-    int		    *h;
+    PolyVertexPtr 	vertices;
+    PolySlopePtr	slopes;
+    int			count;
+    int		   	xi, yi;
+    PolyEdgePtr	    	left, right;
+    int		    	*pnleft, *pnright;
+    int		    	*h;
 {
-    int	    top, bottom;
-    double  miny, maxy;
-    register int i;
-    int	    j;
-    int	    clockwise;
-    int	    slopeoff;
-    register int s;
-    register int nright, nleft;
-    int	    y, lasty = 0, bottomy, topy = 0;
+    int 	top, bottom;
+    double 	miny, maxy;
+    int 	i;
+    int		j;
+    int		clockwise;
+    int		slopeoff;
+    int 	s;
+    int 	nright, nleft;
+    int	   	y, lasty = 0, bottomy, topy = 0;
 
     /* find the top of the polygon */
     maxy = miny = vertices[0].y;
@@ -467,12 +467,12 @@ miLineOnePoint (
 
 static void
 miLineJoin (
-    DrawablePtr	    pDrawable,
-    GCPtr	    pGC,
-    unsigned long   pixel,
-    SpanDataPtr	    spanData,
-    register LineFacePtr pLeft,
-    register LineFacePtr pRight)
+    DrawablePtr 	pDrawable,
+    GCPtr		pGC,
+    unsigned long	pixel,
+    SpanDataPtr		spanData,
+    LineFacePtr		pLeft,
+    LineFacePtr 	pRight)
 {
     double	    mx = 0, my = 0;
     double	    denom = 0.0;
@@ -624,9 +624,9 @@ miLineArcI (
     DDXPointPtr	    points,
     int		    *widths)
 {
-    register DDXPointPtr tpts, bpts;
-    register int *twids, *bwids;
-    register int x, y, e, ex, slw;
+    DDXPointPtr tpts, bpts;
+    int *twids, *bwids;
+    int x, y, e, ex, slw;
 
     tpts = points;
     twids = widths;
@@ -717,8 +717,8 @@ miLineArcD (
     int		    edgey2,
     Bool	    edgeleft2)
 {
-    register DDXPointPtr pts;
-    register int *wids;
+    DDXPointPtr pts;
+    int *wids;
     double radius, x0, y0, el, er, yk, xlk, xrk, k;
     int xbase, ybase, y, boty, xl, xr, xcl, xcr;
     int ymin, ymax;
@@ -875,8 +875,8 @@ miLineArcD (
 
 int
 miRoundJoinFace (face, edge, leftEdge)
-    register LineFacePtr face;
-    register PolyEdgePtr edge;
+    LineFacePtr face;
+    PolyEdgePtr edge;
     Bool	*leftEdge;
 {
     int	    y;
@@ -924,7 +924,7 @@ miRoundJoinFace (face, edge, leftEdge)
 
 _X_EXPORT void
 miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2)
-    register LineFacePtr pLeft, pRight;
+    LineFacePtr pLeft, pRight;
     PolyEdgePtr	edge1, edge2;
     int		*y1, *y2;
     Bool	*left1, *left2;
@@ -949,14 +949,14 @@ miRoundJoinClip (pLeft, pRight, edge1, e
 
 _X_EXPORT int
 miRoundCapClip (face, isInt, edge, leftEdge)
-    register LineFacePtr face;
+    LineFacePtr face;
     Bool	isInt;
-    register PolyEdgePtr edge;
+    PolyEdgePtr edge;
     Bool	*leftEdge;
 {
-    int	    y;
-    register int dx, dy;
-    double  xa, ya, k;
+    int		y;
+    int 	dx, dy;
+    double	xa, ya, k;
     Bool	left;
 
     dx = -face->dy;
@@ -999,15 +999,15 @@ miRoundCapClip (face, isInt, edge, leftE
 
 static void
 miLineArc (
-    DrawablePtr	    pDraw,
-    register GCPtr  pGC,
-    unsigned long   pixel,
-    SpanDataPtr	    spanData,
-    register LineFacePtr leftFace,
-    register LineFacePtr rightFace,
-    double	    xorg,
-    double          yorg,
-    Bool	    isInt)
+    DrawablePtr		pDraw,
+    GCPtr  		pGC,
+    unsigned long	pixel,
+    SpanDataPtr		spanData,
+    LineFacePtr		leftFace,
+    LineFacePtr 	rightFace,
+    double	    	xorg,
+    double          	yorg,
+    Bool	    	isInt)
 {
     DDXPointPtr points;
     int *widths;
@@ -1116,14 +1116,14 @@ miLineArc (
 
 void
 miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt)
-    DrawablePtr	    pDrawable;
-    register GCPtr  pGC;
-    unsigned long   pixel;
-    SpanDataPtr	    spanData;
-    register LineFacePtr face;
-    Bool	    isLeft;
-    double	    xorg, yorg;
-    Bool	    isInt;
+    DrawablePtr		pDrawable;
+    GCPtr  		pGC;
+    unsigned long	pixel;
+    SpanDataPtr		spanData;
+    LineFacePtr 	face;
+    Bool	    	isLeft;
+    double	    	xorg, yorg;
+    Bool	    	isInt;
 {
     int	xorgi = 0, yorgi = 0;
     int	lw;
@@ -1286,18 +1286,18 @@ miLineProjectingCap (pDrawable, pGC, pix
 
 static void
 miWideSegment (
-    DrawablePtr	    pDrawable,
-    GCPtr	    pGC,
-    unsigned long   pixel,
-    SpanDataPtr	    spanData,
-    register int    x1,
-    register int    y1,
-    register int    x2,
-    register int    y2,
-    Bool	    projectLeft,
-    Bool	    projectRight,
-    register LineFacePtr leftFace,
-    register LineFacePtr rightFace)
+    DrawablePtr		pDrawable,
+    GCPtr		pGC,
+    unsigned long	pixel,
+    SpanDataPtr		spanData,
+    int    		x1,
+    int    		y1,
+    int    		x2,
+    int    		y2,
+    Bool		projectLeft,
+    Bool		projectRight,
+    LineFacePtr 	leftFace,
+    LineFacePtr 	rightFace)
 {
     double	l, L, r;
     double	xa, ya;
@@ -1508,7 +1508,7 @@ miWideSegment (
 
 SpanDataPtr
 miSetupSpanData (pGC, spanData, npt)
-    register GCPtr pGC;
+    GCPtr pGC;
     SpanDataPtr	spanData;
     int		npt;
 {
@@ -1552,21 +1552,21 @@ miCleanupSpanData (pDrawable, pGC, spanD
 _X_EXPORT void
 miWideLine (pDrawable, pGC, mode, npt, pPts)
     DrawablePtr	pDrawable;
-    register GCPtr pGC;
+    GCPtr 	pGC;
     int		mode;
-    register int npt;
-    register DDXPointPtr pPts;
+    int 	npt;
+    DDXPointPtr pPts;
 {
-    int		    x1, y1, x2, y2;
-    SpanDataRec	    spanDataRec;
-    SpanDataPtr	    spanData;
-    unsigned long   pixel;
-    Bool	    projectLeft, projectRight;
-    LineFaceRec	    leftFace, rightFace, prevRightFace;
-    LineFaceRec	    firstFace;
-    register int    first;
-    Bool	    somethingDrawn = FALSE;
-    Bool	    selfJoin;
+    int		x1, y1, x2, y2;
+    SpanDataRec	spanDataRec;
+    SpanDataPtr	spanData;
+    long   	pixel;
+    Bool	projectLeft, projectRight;
+    LineFaceRec	leftFace, rightFace, prevRightFace;
+    LineFaceRec	firstFace;
+    int		first;
+    Bool	somethingDrawn = FALSE;
+    Bool	selfJoin;
 
     spanData = miSetupSpanData (pGC, &spanDataRec, npt);
     pixel = pGC->fgPixel;
@@ -1693,7 +1693,7 @@ miWideLine (pDrawable, pGC, mode, npt, p
 static void
 miWideDashSegment (
     DrawablePtr	    pDrawable,
-    register GCPtr  pGC,
+    GCPtr  	    pGC,
     SpanDataPtr	    spanData,
     int		    *pDashOffset,
     int		    *pDashIndex,
@@ -2050,25 +2050,25 @@ miWideDashSegment (
 _X_EXPORT void
 miWideDash (pDrawable, pGC, mode, npt, pPts)
     DrawablePtr	pDrawable;
-    register GCPtr pGC;
+    GCPtr 	pGC;
     int		mode;
-    register int npt;
-    register DDXPointPtr pPts;
+    int 	npt;
+    DDXPointPtr pPts;
 {
-    int		    x1, y1, x2, y2;
-    unsigned long   pixel;
-    Bool	    projectLeft, projectRight;
-    LineFaceRec	    leftFace, rightFace, prevRightFace;
-    LineFaceRec	    firstFace;
-    int		    first;
-    int		    dashIndex, dashOffset;
-    register int    prevDashIndex;
-    SpanDataRec	    spanDataRec;
-    SpanDataPtr	    spanData;
-    Bool	    somethingDrawn = FALSE;
-    Bool	    selfJoin;
-    Bool	    endIsFg = FALSE, startIsFg = FALSE;
-    Bool            firstIsFg = FALSE, prevIsFg = FALSE;
+    int			x1, y1, x2, y2;
+    unsigned long	pixel;
+    Bool		projectLeft, projectRight;
+    LineFaceRec		leftFace, rightFace, prevRightFace;
+    LineFaceRec		firstFace;
+    int			first;
+    int			dashIndex, dashOffset;
+    int			prevDashIndex;
+    SpanDataRec		spanDataRec;
+    SpanDataPtr		spanData;
+    Bool		somethingDrawn = FALSE;
+    Bool		selfJoin;
+    Bool		endIsFg = FALSE, startIsFg = FALSE;
+    Bool		firstIsFg = FALSE, prevIsFg = FALSE;
 
 #if 0
     /* XXX backward compatibility */
diff --git a/mi/miwindow.c b/mi/miwindow.c
index cd6bb8d..6ca2e1e 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -160,12 +160,12 @@ miClearToBackground(pWin, x, y, w, h, ge
  */
 static Bool
 miCheckSubSaveUnder(
-    register WindowPtr	pParent,	/* Parent to check */
+    WindowPtr		pParent,	/* Parent to check */
     WindowPtr		pFirst,		/* first reconfigured window */
     RegionPtr		pRegion)	/* Initial area obscured by saveUnder */
 {
-    register WindowPtr	pChild;		/* Current child */
-    register ScreenPtr	pScreen;	/* Screen to use */
+    WindowPtr		pChild;		/* Current child */
+    ScreenPtr		pScreen;	/* Screen to use */
     RegionRec		SubRegion;	/* Area of children obscured */
     Bool		res = FALSE;	/* result */
     Bool		subInited=FALSE;/* SubRegion initialized */
@@ -268,12 +268,12 @@ miCheckSubSaveUnder(
  */
 Bool
 miChangeSaveUnder(pWin, first)
-    register WindowPtr	pWin;
+    WindowPtr		pWin;
     WindowPtr		first;		/* First window to check.
 					 * Used when pWin was restacked */
 {
     RegionRec	rgn;	/* Area obscured by saveUnder windows */
-    register ScreenPtr pScreen;
+    ScreenPtr 	pScreen;
     Bool	res;
 
     if (!deltaSaveUndersViewable && !numSaveUndersViewable)
@@ -309,7 +309,7 @@ miPostChangeSaveUnder(pWin, pFirst)
     WindowPtr		pWin;
     WindowPtr		pFirst;
 {
-    register WindowPtr pParent, pChild;
+    WindowPtr pParent, pChild;
     ChangeWindowAttributesProcPtr ChangeWindowAttributes;
 
     if (!(pParent = pWin->parent))
@@ -342,9 +342,9 @@ miPostChangeSaveUnder(pWin, pFirst)
 
 void
 miMarkWindow(pWin)
-    register WindowPtr pWin;
+    WindowPtr pWin;
 {
-    register ValidatePtr val;
+    ValidatePtr val;
 
     if (pWin->valdata)
 	return;
@@ -362,8 +362,8 @@ miMarkOverlappedWindows(pWin, pFirst, pp
     WindowPtr pFirst;
     WindowPtr *ppLayerWin;
 {
-    register BoxPtr box;
-    register WindowPtr pChild, pLast;
+    BoxPtr box;
+    WindowPtr pChild, pLast;
     Bool anyMarked = FALSE;
     MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow;
     ScreenPtr pScreen;
@@ -449,8 +449,8 @@ _X_EXPORT void
 miHandleValidateExposures(pWin)
     WindowPtr pWin;
 {
-    register WindowPtr pChild;
-    register ValidatePtr val;
+    WindowPtr pChild;
+    ValidatePtr val;
     ScreenPtr pScreen;
     WindowExposuresProcPtr WindowExposures;
 
@@ -487,7 +487,7 @@ miHandleValidateExposures(pWin)
 
 void
 miMoveWindow(pWin, x, y, pNextSib, kind)
-    register WindowPtr pWin;
+    WindowPtr pWin;
     int x,y;
     WindowPtr pNextSib;
     VTKind kind;
@@ -498,7 +498,7 @@ miMoveWindow(pWin, x, y, pNextSib, kind)
     RegionPtr oldRegion = NULL;
     DDXPointRec oldpt;
     Bool anyMarked = FALSE;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     WindowPtr windowToValidate;
 #ifdef DO_SAVE_UNDERS
     Bool dosave = FALSE;
@@ -576,10 +576,10 @@ miMoveWindow(pWin, x, y, pNextSib, kind)
 
 static int
 miRecomputeExposures (
-    register WindowPtr	pWin,
+    WindowPtr	pWin,
     pointer		value) /* must conform to VisitWindowProcPtr */
 {
-    register ScreenPtr	pScreen;
+    ScreenPtr	pScreen;
     RegionPtr	pValid = (RegionPtr)value;
 
     if (pWin->valdata)
@@ -604,7 +604,7 @@ miRecomputeExposures (
 
 void
 miSlideAndSizeWindow(pWin, x, y, w, h, pSib)
-    register WindowPtr pWin;
+    WindowPtr pWin;
     int x,y;
     unsigned int w, h;
     WindowPtr pSib;
@@ -620,11 +620,11 @@ miSlideAndSizeWindow(pWin, x, y, w, h, p
     DDXPointRec oldpt;
     RegionPtr oldRegion = NULL;
     Bool anyMarked = FALSE;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     WindowPtr pFirstChange;
-    register WindowPtr pChild;
+    WindowPtr pChild;
     RegionPtr	gravitate[StaticGravity + 1];
-    register unsigned g;
+    unsigned g;
     int		nx, ny;		/* destination x,y */
     int		newx, newy;	/* new inner window position */
     RegionPtr	pRegion = NULL;
@@ -981,10 +981,10 @@ miGetLayerWindow(pWin)
 
 _X_EXPORT void
 miSetShape(pWin)
-    register WindowPtr	pWin;
+    WindowPtr	pWin;
 {
     Bool	WasViewable = (Bool)(pWin->viewable);
-    register ScreenPtr pScreen = pWin->drawable.pScreen;
+    ScreenPtr 	pScreen = pWin->drawable.pScreen;
     Bool	anyMarked = FALSE;
     RegionPtr	pOldClip = NULL, bsExposed;
 #ifdef DO_SAVE_UNDERS
@@ -1081,12 +1081,12 @@ miSetShape(pWin)
 
 _X_EXPORT void
 miChangeBorderWidth(pWin, width)
-    register WindowPtr pWin;
+    WindowPtr pWin;
     unsigned int width;
 {
     int oldwidth;
     Bool anyMarked = FALSE;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     Bool WasViewable = (Bool)(pWin->viewable);
     Bool HadBorder;
 #ifdef DO_SAVE_UNDERS
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 33e1acc..f1adc9e 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -97,8 +97,8 @@ static miZeroArcPtRec oob = {65536, 6553
 
 _X_EXPORT Bool
 miZeroArcSetup(arc, info, ok360)
-    register xArc *arc;
-    register miZeroArcRec *info;
+    xArc *arc;
+    miZeroArcRec *info;
     Bool ok360;
 {
     int l;
@@ -404,11 +404,11 @@ miZeroArcSetup(arc, info, ok360)
 DDXPointPtr
 miZeroArcPts(arc, pts)
     xArc *arc;
-    register DDXPointPtr pts;
+    DDXPointPtr pts;
 {
     miZeroArcRec info;
-    register int x, y, a, b, d, mask;
-    register int k1, k3, dx, dy;
+    int x, y, a, b, d, mask;
+    int k1, k3, dx, dy;
     Bool do360;
 
     do360 = miZeroArcSetup(arc, &info, TRUE);
@@ -509,14 +509,14 @@ miZeroArcDashPts(
     GCPtr pGC,
     xArc *arc,
     DashInfo *dinfo,
-    register DDXPointPtr points,
+    DDXPointPtr points,
     int maxPts,
-    register DDXPointPtr *evenPts, 
-    register DDXPointPtr *oddPts )
+    DDXPointPtr *evenPts, 
+    DDXPointPtr *oddPts )
 {
     miZeroArcRec info;
-    register int x, y, a, b, d, mask;
-    register int k1, k3, dx, dy;
+    int x, y, a, b, d, mask;
+    int k1, k3, dx, dy;
     int dashRemaining;
     DDXPointPtr arcPts[4];
     DDXPointPtr startPts[5], endPts[5];
@@ -715,11 +715,11 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs)
     xArc	*parcs;
 {
     int maxPts = 0;
-    register int n, maxw = 0;
-    register xArc *arc;
-    register int i;
+    int n, maxw = 0;
+    xArc *arc;
+    int i;
     DDXPointPtr points, pts, oddPts;
-    register DDXPointPtr pt;
+    DDXPointPtr pt;
     int numPts;
     Bool dospans;
     int *widths = NULL;
diff-tree 63169ce52d354b4345dcfc46b89f0ea88379718f (from 40ae4f246d8818410490236ab183204a84765629)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Thu Mar 8 17:50:19 2007 +1030

    dix: remove 'register' keyword for all variables.

diff --git a/dix/atom.c b/dix/atom.c
index d9d74f1..bd3223c 100644
--- a/dix/atom.c
+++ b/dix/atom.c
@@ -77,10 +77,10 @@ void FreeAtom(NodePtr patom);
 _X_EXPORT Atom 
 MakeAtom(char *string, unsigned len, Bool makeit)
 {
-    register    NodePtr * np;
+    NodePtr * np;
     unsigned i;
-    int     comp;
-    register unsigned int   fp = 0;
+    int comp;
+    unsigned int fp = 0;
 
     np = &atomRoot;
     for (i = 0; i < (len+1)/2; i++)
@@ -107,7 +107,7 @@ MakeAtom(char *string, unsigned len, Boo
     }
     if (makeit)
     {
-	register NodePtr nd;
+	NodePtr nd;
 
 	nd = (NodePtr) xalloc(sizeof(NodeRec));
 	if (!nd)
diff --git a/dix/colormap.c b/dix/colormap.c
index a74cb39..73b6669 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -95,8 +95,8 @@ static int BlueComp(
 );
 
 static void FreePixels(
-    register ColormapPtr /*pmap*/,
-    register int /*client*/
+    ColormapPtr /*pmap*/,
+    int /*client*/
 );
 
 static void CopyFree(
@@ -259,9 +259,9 @@ CreateColormap (Colormap mid, ScreenPtr 
     int		class, size;
     unsigned long sizebytes;
     ColormapPtr	pmap;
-    register	EntryPtr	pent;
+    EntryPtr	pent;
     int		i;
-    register	Pixel	*ppix, **pptr;
+    Pixel	*ppix, **pptr;
 
     class = pVisual->class;
     if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID))
@@ -428,8 +428,8 @@ CreateColormap (Colormap mid, ScreenPtr 
 int
 FreeColormap (pointer value, XID mid)
 {
-    int		i;
-    register EntryPtr pent;
+    int	i;
+    EntryPtr pent;
     ColormapPtr	pmap = (ColormapPtr)value;
 
     if(CLIENT_ID(mid) != SERVER_ID)
@@ -744,9 +744,9 @@ static void
 UpdateColors (ColormapPtr pmap)
 {
     xColorItem		*defs;
-    register xColorItem *pdef;
-    register EntryPtr 	pent;
-    register VisualPtr	pVisual;
+    xColorItem *pdef;
+    EntryPtr 	pent;
+    VisualPtr	pVisual;
     int			i, n, size;
 
     pVisual = pmap->pVisual;
@@ -993,14 +993,14 @@ AllocColor (ColormapPtr pmap, 
  */
 
 _X_EXPORT void
-FakeAllocColor (register ColormapPtr pmap, register xColorItem *item)
+FakeAllocColor (ColormapPtr pmap, xColorItem *item)
 {
-    Pixel	pixR, pixG, pixB;
-    Pixel	temp;
-    int		entries;
-    xrgb	rgb;
-    int		class;
-    register VisualPtr	pVisual;
+    Pixel pixR, pixG, pixB;
+    Pixel temp;
+    int	entries;
+    xrgb rgb;
+    int	class;
+    VisualPtr pVisual;
 
     pVisual = pmap->pVisual;
     rgb.red = item->red;
@@ -1059,9 +1059,9 @@ FakeAllocColor (register ColormapPtr pma
 
 /* free a pixel value obtained from FakeAllocColor */
 _X_EXPORT void
-FakeFreeColor(register ColormapPtr pmap, Pixel pixel)
+FakeFreeColor(ColormapPtr pmap, Pixel pixel)
 {
-    register VisualPtr pVisual;
+    VisualPtr pVisual;
     Pixel pixR, pixG, pixB;
 
     switch (pmap->class) {
@@ -1507,11 +1507,11 @@ QueryColors (ColormapPtr pmap, int count
 }
 
 static void
-FreePixels(register ColormapPtr pmap, register int client)
+FreePixels(ColormapPtr pmap, int client)
 {
-    register Pixel		*ppix, *ppixStart;
-    register int 		n;
-    int				class;
+    Pixel *ppix, *ppixStart;
+    int n;
+    int	class;
 
     class = pmap->class;
     ppixStart = pmap->clientPixelsRed[client];
@@ -1646,8 +1646,8 @@ AllocColorPlanes (int client, ColormapPt
 {
     int		ok;
     Pixel	mask, *ppixFirst;
-    register Pixel shift;
-    register int i;
+    Pixel shift;
+    int i;
     int		class;
     int		oldcount;
     colorResource *pcr = (colorResource *)NULL;
@@ -2409,10 +2409,10 @@ FreeCo (ColormapPtr pmap, int client, in
 _X_EXPORT int
 StoreColors (ColormapPtr pmap, int count, xColorItem *defs)
 {
-    register Pixel 	pix;
-    register xColorItem *pdef;
-    register EntryPtr 	pent, pentT, pentLast;
-    register VisualPtr	pVisual;
+    Pixel 	pix;
+    xColorItem *pdef;
+    EntryPtr 	pent, pentT, pentLast;
+    VisualPtr	pVisual;
     SHAREDCOLOR		*pred, *pgreen, *pblue;
     int			n, ChgRed, ChgGreen, ChgBlue, idef;
     int			class, errVal = Success;
diff --git a/dix/cursor.c b/dix/cursor.c
index 7071d83..5ab562e 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -86,7 +86,7 @@ FreeCursorBits(CursorBitsPtr bits)
 #endif
     if (bits->refcnt == 0)
     {
-	register GlyphSharePtr *prev, this;
+	GlyphSharePtr *prev, this;
 
 	for (prev = &sharedGlyphs;
 	     (this = *prev) && (this->bits != bits);
@@ -135,7 +135,7 @@ FreeCursor(pointer value, XID cid)
 static void
 CheckForEmptyMask(CursorBitsPtr bits)
 {
-    register unsigned char *msk = bits->mask;
+    unsigned char *msk = bits->mask;
     int n = BitmapBytePad(bits->width) * bits->height;
 
     bits->emptyMask = FALSE;
@@ -305,8 +305,8 @@ AllocGlyphCursor(Font source, unsigned s
 	}
 	if (!maskfont)
 	{
-	    register long n;
-	    register unsigned char *mskptr;
+	    long n;
+	    unsigned char *mskptr;
 
 	    n = BitmapBytePad(cm.width)*(long)cm.height;
 	    mskptr = mskbits = (unsigned char *)xalloc(n);
diff --git a/dix/devices.c b/dix/devices.c
index d5acb2d..8eb54f7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -84,7 +84,7 @@ int CoreDevicePrivatesIndex = 0, CoreDev
 DeviceIntPtr
 AddInputDevice(DeviceProc deviceProc, Bool autoStart)
 {
-    register DeviceIntPtr dev, *prev; /* not a typo */
+    DeviceIntPtr dev, *prev; /* not a typo */
 
     if (inputInfo.numDevices >= MAX_DEVICES)
 	return (DeviceIntPtr)NULL;
@@ -140,9 +140,9 @@ AddInputDevice(DeviceProc deviceProc, Bo
 }
 
 Bool
-EnableDevice(register DeviceIntPtr dev)
+EnableDevice(DeviceIntPtr dev)
 {
-    register DeviceIntPtr *prev;
+    DeviceIntPtr *prev;
     int ret;
 
     for (prev = &inputInfo.off_devices;
@@ -166,9 +166,9 @@ EnableDevice(register DeviceIntPtr dev)
 }
 
 Bool
-DisableDevice(register DeviceIntPtr dev)
+DisableDevice(DeviceIntPtr dev)
 {
-    register DeviceIntPtr *prev;
+    DeviceIntPtr *prev;
 
     for (prev = &inputInfo.devices;
 	 *prev && (*prev != dev);
@@ -315,7 +315,7 @@ CorePointerProc(DeviceIntPtr pDev, int w
 void
 InitCoreDevices()
 {
-    register DeviceIntPtr dev;
+    DeviceIntPtr dev;
 
     if (CoreDevicePrivatesGeneration != serverGeneration) {
         CoreDevicePrivatesIndex = AllocateDevicePrivateIndex();
@@ -374,7 +374,7 @@ InitCoreDevices()
 int
 InitAndStartDevices()
 {
-    register DeviceIntPtr dev, next;
+    DeviceIntPtr dev, next;
 
     for (dev = inputInfo.off_devices; dev; dev = dev->next) {
         DebugF("(dix) initialising device %d\n", dev->id);
@@ -406,7 +406,7 @@ InitAndStartDevices()
 }
 
 static void
-CloseDevice(register DeviceIntPtr dev)
+CloseDevice(DeviceIntPtr dev)
 {
     KbdFeedbackPtr k, knext;
     PtrFeedbackPtr p, pnext;
@@ -504,7 +504,7 @@ CloseDevice(register DeviceIntPtr dev)
 void
 CloseDownDevices()
 {
-    register DeviceIntPtr dev, next;
+    DeviceIntPtr dev, next;
 
     for (dev = inputInfo.devices; dev; dev = next)
     {
@@ -634,7 +634,7 @@ QueryMinMaxKeyCodes(KeyCode *minCode, Ke
 }
 
 Bool
-SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src)
+SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src)
 {
     int i, j;
     int rowDif = src->minKeyCode - dst->minKeyCode;
@@ -683,7 +683,7 @@ SetKeySymsMap(register KeySymsPtr dst, r
 }
 
 static Bool
-InitModMap(register KeyClassPtr keyc)
+InitModMap(KeyClassPtr keyc)
 {
     int i, j;
     CARD8 keysPerModifier[8];
@@ -728,7 +728,7 @@ _X_EXPORT Bool
 InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers[])
 {
     int i;
-    register KeyClassPtr keyc;
+    KeyClassPtr keyc;
     
     keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec));
     if (!keyc)
@@ -763,10 +763,10 @@ InitKeyClassDeviceStruct(DeviceIntPtr de
 }
 
 _X_EXPORT Bool
-InitButtonClassDeviceStruct(register DeviceIntPtr dev, int numButtons, 
+InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, 
                             CARD8 *map)
 {
-    register ButtonClassPtr butc;
+    ButtonClassPtr butc;
     int i;
 
     butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec));
@@ -792,7 +792,7 @@ InitValuatorClassDeviceStruct(DeviceIntP
                               int numMotionEvents, int mode)
 {
     int i;
-    register ValuatorClassPtr valc;
+    ValuatorClassPtr valc;
 
     if (!dev)
         return FALSE;
@@ -834,7 +834,7 @@ InitValuatorClassDeviceStruct(DeviceIntP
 _X_EXPORT Bool
 InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
 {
-    register AbsoluteClassPtr abs;
+    AbsoluteClassPtr abs;
 
     abs = (AbsoluteClassPtr)xalloc(sizeof(AbsoluteClassRec));
     if (!abs)
@@ -864,7 +864,7 @@ InitAbsoluteClassDeviceStruct(DeviceIntP
 _X_EXPORT Bool
 InitFocusClassDeviceStruct(DeviceIntPtr dev)
 {
-    register FocusClassPtr focc;
+    FocusClassPtr focc;
 
     focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec));
     if (!focc)
@@ -883,7 +883,7 @@ _X_EXPORT Bool
 InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, 
                                  KbdCtrlProcPtr controlProc)
 {
-    register KbdFeedbackPtr feedc;
+    KbdFeedbackPtr feedc;
 
     feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec));
     if (!feedc)
@@ -910,7 +910,7 @@ InitKbdFeedbackClassDeviceStruct(DeviceI
 _X_EXPORT Bool
 InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc)
 {
-    register PtrFeedbackPtr feedc;
+    PtrFeedbackPtr feedc;
 
     feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec));
     if (!feedc)
@@ -948,7 +948,7 @@ InitStringFeedbackClassDeviceStruct (
       int max_symbols, int num_symbols_supported, KeySym *symbols)
 {
     int i;
-    register StringFeedbackPtr feedc;
+    StringFeedbackPtr feedc;
 
     feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec));
     if (!feedc)
@@ -986,7 +986,7 @@ _X_EXPORT Bool
 InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc, 
                                    BellCtrlProcPtr controlProc)
 {
-    register BellFeedbackPtr feedc;
+    BellFeedbackPtr feedc;
 
     feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec));
     if (!feedc)
@@ -1005,7 +1005,7 @@ InitBellFeedbackClassDeviceStruct (Devic
 _X_EXPORT Bool
 InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc)
 {
-    register LedFeedbackPtr feedc;
+    LedFeedbackPtr feedc;
 
     feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec));
     if (!feedc)
@@ -1026,7 +1026,7 @@ InitLedFeedbackClassDeviceStruct (Device
 _X_EXPORT Bool
 InitIntegerFeedbackClassDeviceStruct (DeviceIntPtr dev, IntegerCtrlProcPtr controlProc)
 {
-    register IntegerFeedbackPtr feedc;
+    IntegerFeedbackPtr feedc;
 
     feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec));
     if (!feedc)
@@ -1112,9 +1112,9 @@ SendMappingNotify(unsigned request, unsi
  * sort it to do the checking. How often is it called? Just being lazy?
  */
 Bool
-BadDeviceMap(register BYTE *buff, int length, unsigned low, unsigned high, XID *errval)
+BadDeviceMap(BYTE *buff, int length, unsigned low, unsigned high, XID *errval)
 {
-    register int     i, j;
+    int i, j;
 
     for (i = 0; i < length; i++)
 	if (buff[i])		       /* only check non-zero elements */
@@ -1136,12 +1136,12 @@ BadDeviceMap(register BYTE *buff, int le
 
 Bool
 AllModifierKeysAreUp(dev, map1, per1, map2, per2)
-    register DeviceIntPtr dev;
-    register CARD8 *map1, *map2;
+    DeviceIntPtr dev;
+    CARD8 *map1, *map2;
     int per1, per2;
 {
-    register int i, j, k;
-    register CARD8 *down = dev->key->down;
+    int i, j, k;
+    CARD8 *down = dev->key->down;
 
     for (i = 8; --i >= 0; map2 += per2)
     {
@@ -1258,7 +1258,7 @@ int
 ProcGetModifierMapping(ClientPtr client)
 {
     xGetModifierMappingReply rep;
-    register KeyClassPtr keyc = inputInfo.keyboard->key;
+    KeyClassPtr keyc = inputInfo.keyboard->key;
 
     REQUEST_SIZE_MATCH(xReq);
     rep.type = X_Reply;
@@ -1459,7 +1459,7 @@ NoteLedState(DeviceIntPtr keybd, int led
 _X_EXPORT int
 Ones(unsigned long mask)             /* HACKMEM 169 */
 {
-    register unsigned long y;
+    unsigned long y;
 
     y = (mask >> 1) &033333333333;
     y = mask - y - ((y >>1) & 033333333333);
@@ -1676,7 +1676,7 @@ int
 ProcGetKeyboardControl (ClientPtr client)
 {
     int i;
-    register KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl;
+    KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl;
     xGetKeyboardControlReply rep;
 
     REQUEST_SIZE_MATCH(xReq);
@@ -1698,7 +1698,7 @@ ProcGetKeyboardControl (ClientPtr client
 int
 ProcBell(ClientPtr client)
 {
-    register DeviceIntPtr keybd = inputInfo.keyboard;
+    DeviceIntPtr keybd = inputInfo.keyboard;
     int base = keybd->kbdfeed->ctrl.bell;
     int newpercent;
     REQUEST(xBellReq);
@@ -1807,7 +1807,7 @@ ProcChangePointerControl(ClientPtr clien
 int
 ProcGetPointerControl(ClientPtr client)
 {
-    register PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl;
+    PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl;
     xGetPointerControlReply rep;
 
     REQUEST_SIZE_MATCH(xReq);
@@ -1822,7 +1822,7 @@ ProcGetPointerControl(ClientPtr client)
 }
 
 void
-MaybeStopHint(register DeviceIntPtr dev, ClientPtr client)
+MaybeStopHint(DeviceIntPtr dev, ClientPtr client)
 {
     GrabPtr grab = dev->grab;
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index d44687e..b258aa6 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -262,7 +262,7 @@ void 
 FlushClientCaches(XID id)
 {
     int i;
-    register ClientPtr client;
+    ClientPtr client;
 
     client = clients[CLIENT_ID(id)];
     if (client == NullClient)
@@ -394,11 +394,11 @@ SmartScheduleClient (int *clientReady, i
 void
 Dispatch(void)
 {
-    register int        *clientReady;     /* array of request ready clients */
-    register int	result;
-    register ClientPtr	client;
-    register int	nready;
-    register HWEventQueuePtr* icheck = checkForInput;
+    int        *clientReady;     /* array of request ready clients */
+    int	result;
+    ClientPtr	client;
+    int	nready;
+    HWEventQueuePtr* icheck = checkForInput;
 #ifdef SMART_SCHEDULE
     long			start_tick;
 #endif
@@ -594,11 +594,11 @@ ProcCreateWindow(ClientPtr client)
 }
 
 int
-ProcChangeWindowAttributes(register ClientPtr client)
+ProcChangeWindowAttributes(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xChangeWindowAttributesReq);
-    register int result;
+    int result;
     int len, rc;
 
     REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
@@ -619,7 +619,7 @@ ProcChangeWindowAttributes(register Clie
 }
 
 int
-ProcGetWindowAttributes(register ClientPtr client)
+ProcGetWindowAttributes(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -636,7 +636,7 @@ ProcGetWindowAttributes(register ClientP
 }
 
 int
-ProcDestroyWindow(register ClientPtr client)
+ProcDestroyWindow(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -652,7 +652,7 @@ ProcDestroyWindow(register ClientPtr cli
 }
 
 int
-ProcDestroySubwindows(register ClientPtr client)
+ProcDestroySubwindows(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -667,11 +667,11 @@ ProcDestroySubwindows(register ClientPtr
 }
 
 int
-ProcChangeSaveSet(register ClientPtr client)
+ProcChangeSaveSet(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xChangeSaveSetReq);
-    register int result, rc;
+    int result, rc;
 		  
     REQUEST_SIZE_MATCH(xChangeSaveSetReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
@@ -695,11 +695,11 @@ ProcChangeSaveSet(register ClientPtr cli
 }
 
 int
-ProcReparentWindow(register ClientPtr client)
+ProcReparentWindow(ClientPtr client)
 {
     WindowPtr pWin, pParent;
     REQUEST(xReparentWindowReq);
-    register int result, rc;
+    int result, rc;
 
     REQUEST_SIZE_MATCH(xReparentWindowReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
@@ -728,7 +728,7 @@ ProcReparentWindow(register ClientPtr cl
 }
 
 int
-ProcMapWindow(register ClientPtr client)
+ProcMapWindow(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -744,7 +744,7 @@ ProcMapWindow(register ClientPtr client)
 }
 
 int
-ProcMapSubwindows(register ClientPtr client)
+ProcMapSubwindows(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -760,7 +760,7 @@ ProcMapSubwindows(register ClientPtr cli
 }
 
 int
-ProcUnmapWindow(register ClientPtr client)
+ProcUnmapWindow(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -776,7 +776,7 @@ ProcUnmapWindow(register ClientPtr clien
 }
 
 int
-ProcUnmapSubwindows(register ClientPtr client)
+ProcUnmapSubwindows(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xResourceReq);
@@ -791,11 +791,11 @@ ProcUnmapSubwindows(register ClientPtr c
 }
 
 int
-ProcConfigureWindow(register ClientPtr client)
+ProcConfigureWindow(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xConfigureWindowReq);
-    register int result;
+    int result;
     int len, rc;
 
     REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
@@ -814,7 +814,7 @@ ProcConfigureWindow(register ClientPtr c
 }
 
 int
-ProcCirculateWindow(register ClientPtr client)
+ProcCirculateWindow(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xCirculateWindowReq);
@@ -835,7 +835,7 @@ ProcCirculateWindow(register ClientPtr c
 }
 
 int
-GetGeometry(register ClientPtr client, xGetGeometryReply *rep)
+GetGeometry(ClientPtr client, xGetGeometryReply *rep)
 {
     DrawablePtr pDraw;
     int rc;
@@ -865,7 +865,7 @@ GetGeometry(register ClientPtr client, x
     if ((pDraw->type == UNDRAWABLE_WINDOW) ||
         ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id)))
     {
-        register WindowPtr pWin = (WindowPtr)pDraw;
+        WindowPtr pWin = (WindowPtr)pDraw;
 	rep->x = pWin->origin.x - wBorderWidth (pWin);
 	rep->y = pWin->origin.y - wBorderWidth (pWin);
 	rep->borderWidth = pWin->borderWidth;
@@ -880,7 +880,7 @@ GetGeometry(register ClientPtr client, x
 
 
 int
-ProcGetGeometry(register ClientPtr client)
+ProcGetGeometry(ClientPtr client)
 {
     xGetGeometryReply rep;
     int status;
@@ -894,7 +894,7 @@ ProcGetGeometry(register ClientPtr clien
 
 
 int
-ProcQueryTree(register ClientPtr client)
+ProcQueryTree(ClientPtr client)
 {
     xQueryTreeReply reply;
     int rc, numChildren = 0;
@@ -942,7 +942,7 @@ ProcQueryTree(register ClientPtr client)
 }
 
 int
-ProcInternAtom(register ClientPtr client)
+ProcInternAtom(ClientPtr client)
 {
     Atom atom;
     char *tchar;
@@ -971,7 +971,7 @@ ProcInternAtom(register ClientPtr client
 }
 
 int
-ProcGetAtomName(register ClientPtr client)
+ProcGetAtomName(ClientPtr client)
 {
     char *str;
     xGetAtomNameReply reply;
@@ -1002,7 +1002,7 @@ extern int k5_bad();
 #endif
 
 int
-ProcSetSelectionOwner(register ClientPtr client)
+ProcSetSelectionOwner(ClientPtr client)
 {
     WindowPtr pWin;
     TimeStamp time;
@@ -1097,7 +1097,7 @@ ProcSetSelectionOwner(register ClientPtr
 }
 
 int
-ProcGetSelectionOwner(register ClientPtr client)
+ProcGetSelectionOwner(ClientPtr client)
 {
     REQUEST(xResourceReq);
 
@@ -1128,7 +1128,7 @@ ProcGetSelectionOwner(register ClientPtr
 }
 
 int
-ProcConvertSelection(register ClientPtr client)
+ProcConvertSelection(ClientPtr client)
 {
     Bool paramsOkay;
     xEvent event;
@@ -1188,7 +1188,7 @@ ProcConvertSelection(register ClientPtr 
 }
 
 int
-ProcGrabServer(register ClientPtr client)
+ProcGrabServer(ClientPtr client)
 {
     REQUEST_SIZE_MATCH(xReq);
     if (grabState != GrabNone && client != grabClient)
@@ -1242,7 +1242,7 @@ UngrabServer(ClientPtr client)
 }
 
 int
-ProcUngrabServer(register ClientPtr client)
+ProcUngrabServer(ClientPtr client)
 {
     REQUEST_SIZE_MATCH(xReq);
     UngrabServer(client);
@@ -1250,7 +1250,7 @@ ProcUngrabServer(register ClientPtr clie
 }
 
 int
-ProcTranslateCoords(register ClientPtr client)
+ProcTranslateCoords(ClientPtr client)
 {
     REQUEST(xTranslateCoordsReq);
 
@@ -1327,7 +1327,7 @@ ProcTranslateCoords(register ClientPtr c
 }
 
 int
-ProcOpenFont(register ClientPtr client)
+ProcOpenFont(ClientPtr client)
 {
     int	err;
     REQUEST(xOpenFontReq);
@@ -1346,7 +1346,7 @@ ProcOpenFont(register ClientPtr client)
 }
 
 int
-ProcCloseFont(register ClientPtr client)
+ProcCloseFont(ClientPtr client)
 {
     FontPtr pFont;
     REQUEST(xResourceReq);
@@ -1367,11 +1367,11 @@ ProcCloseFont(register ClientPtr client)
 }
 
 int
-ProcQueryFont(register ClientPtr client)
+ProcQueryFont(ClientPtr client)
 {
     xQueryFontReply	*reply;
     FontPtr pFont;
-    register GC *pGC;
+    GC *pGC;
     REQUEST(xResourceReq);
 
     REQUEST_SIZE_MATCH(xResourceReq);
@@ -1425,7 +1425,7 @@ ProcQueryFont(register ClientPtr client)
 }
 
 int
-ProcQueryTextExtents(register ClientPtr client)
+ProcQueryTextExtents(ClientPtr client)
 {
     REQUEST(xQueryTextExtentsReq);
     xQueryTextExtentsReply reply;
@@ -1475,7 +1475,7 @@ ProcQueryTextExtents(register ClientPtr 
 }
 
 int
-ProcListFonts(register ClientPtr client)
+ProcListFonts(ClientPtr client)
 {
     REQUEST(xListFontsReq);
 
@@ -1486,7 +1486,7 @@ ProcListFonts(register ClientPtr client)
 }
 
 int
-ProcListFontsWithInfo(register ClientPtr client)
+ProcListFontsWithInfo(ClientPtr client)
 {
     REQUEST(xListFontsWithInfoReq);
 
@@ -1508,13 +1508,13 @@ dixDestroyPixmap(pointer value, XID pid)
 }
 
 int
-ProcCreatePixmap(register ClientPtr client)
+ProcCreatePixmap(ClientPtr client)
 {
     PixmapPtr pMap;
     DrawablePtr pDraw;
     REQUEST(xCreatePixmapReq);
     DepthPtr pDepth;
-    register int i, rc;
+    int i, rc;
 
     REQUEST_SIZE_MATCH(xCreatePixmapReq);
     client->errorValue = stuff->pid;
@@ -1571,7 +1571,7 @@ CreatePmap:
 }
 
 int
-ProcFreePixmap(register ClientPtr client)
+ProcFreePixmap(ClientPtr client)
 {
     PixmapPtr pMap;
 
@@ -1593,7 +1593,7 @@ ProcFreePixmap(register ClientPtr client
 }
 
 int
-ProcCreateGC(register ClientPtr client)
+ProcCreateGC(ClientPtr client)
 {
     int error, rc;
     GC *pGC;
@@ -1621,7 +1621,7 @@ ProcCreateGC(register ClientPtr client)
 }
 
 int
-ProcChangeGC(register ClientPtr client)
+ProcChangeGC(ClientPtr client)
 {
     GC *pGC;
     int result;
@@ -1648,7 +1648,7 @@ ProcChangeGC(register ClientPtr client)
 }
 
 int
-ProcCopyGC(register ClientPtr client)
+ProcCopyGC(ClientPtr client)
 {
     GC *dstGC;
     GC *pGC;
@@ -1675,7 +1675,7 @@ ProcCopyGC(register ClientPtr client)
 }
 
 int
-ProcSetDashes(register ClientPtr client)
+ProcSetDashes(ClientPtr client)
 {
     GC *pGC;
     int result;
@@ -1704,7 +1704,7 @@ ProcSetDashes(register ClientPtr client)
 }
 
 int
-ProcSetClipRectangles(register ClientPtr client)
+ProcSetClipRectangles(ClientPtr client)
 {
     int	nr, result;
     GC *pGC;
@@ -1734,7 +1734,7 @@ ProcSetClipRectangles(register ClientPtr
 }
 
 int
-ProcFreeGC(register ClientPtr client)
+ProcFreeGC(ClientPtr client)
 {
     GC *pGC;
     int rc;
@@ -1750,7 +1750,7 @@ ProcFreeGC(register ClientPtr client)
 }
 
 int
-ProcClearToBackground(register ClientPtr client)
+ProcClearToBackground(ClientPtr client)
 {
     REQUEST(xClearAreaReq);
     WindowPtr pWin;
@@ -1777,7 +1777,7 @@ ProcClearToBackground(register ClientPtr
 }
 
 int
-ProcCopyArea(register ClientPtr client)
+ProcCopyArea(ClientPtr client)
 {
     DrawablePtr pDst;
     DrawablePtr pSrc;
@@ -1821,7 +1821,7 @@ ProcCopyArea(register ClientPtr client)
 }
 
 int
-ProcCopyPlane(register ClientPtr client)
+ProcCopyPlane(ClientPtr client)
 {
     DrawablePtr psrcDraw, pdstDraw;
     GC *pGC;
@@ -1872,7 +1872,7 @@ ProcCopyPlane(register ClientPtr client)
 }
 
 int
-ProcPolyPoint(register ClientPtr client)
+ProcPolyPoint(ClientPtr client)
 {
     int npoint;
     GC *pGC;
@@ -1895,7 +1895,7 @@ ProcPolyPoint(register ClientPtr client)
 }
 
 int
-ProcPolyLine(register ClientPtr client)
+ProcPolyLine(ClientPtr client)
 {
     int npoint;
     GC *pGC;
@@ -1918,7 +1918,7 @@ ProcPolyLine(register ClientPtr client)
 }
 
 int
-ProcPolySegment(register ClientPtr client)
+ProcPolySegment(ClientPtr client)
 {
     int nsegs;
     GC *pGC;
@@ -1937,7 +1937,7 @@ ProcPolySegment(register ClientPtr clien
 }
 
 int
-ProcPolyRectangle (register ClientPtr client)
+ProcPolyRectangle (ClientPtr client)
 {
     int nrects;
     GC *pGC;
@@ -1957,7 +1957,7 @@ ProcPolyRectangle (register ClientPtr cl
 }
 
 int
-ProcPolyArc(register ClientPtr client)
+ProcPolyArc(ClientPtr client)
 {
     int		narcs;
     GC *pGC;
@@ -1976,7 +1976,7 @@ ProcPolyArc(register ClientPtr client)
 }
 
 int
-ProcFillPoly(register ClientPtr client)
+ProcFillPoly(ClientPtr client)
 {
     int          things;
     GC *pGC;
@@ -2007,7 +2007,7 @@ ProcFillPoly(register ClientPtr client)
 }
 
 int
-ProcPolyFillRectangle(register ClientPtr client)
+ProcPolyFillRectangle(ClientPtr client)
 {
     int             things;
     GC *pGC;
@@ -2028,7 +2028,7 @@ ProcPolyFillRectangle(register ClientPtr
 }
 
 int
-ProcPolyFillArc(register ClientPtr client)
+ProcPolyFillArc(ClientPtr client)
 {
     int		narcs;
     GC *pGC;
@@ -2101,7 +2101,7 @@ ReformatImage (char *base, int nbytes, i
  * boundary, even if the scanlines are padded to our satisfaction.
  */
 int
-ProcPutImage(register ClientPtr client)
+ProcPutImage(ClientPtr client)
 {
     GC *pGC;
     DrawablePtr pDraw;
@@ -2159,13 +2159,13 @@ ProcPutImage(register ClientPtr client)
 
 
 int
-DoGetImage(register ClientPtr client, int format, Drawable drawable, 
+DoGetImage(ClientPtr client, int format, Drawable drawable, 
            int x, int y, int width, int height, 
            Mask planemask, xGetImageReply **im_return)
 {
     DrawablePtr		pDraw;
     int			nlines, linesPerBuf, rc;
-    register int	linesDone;
+    int	linesDone;
     long		widthBytesLine, length;
     Mask		plane = 0;
     char		*pBuf;
@@ -2379,7 +2379,7 @@ DoGetImage(register ClientPtr client, in
 }
 
 int
-ProcGetImage(register ClientPtr client)
+ProcGetImage(ClientPtr client)
 {
     REQUEST(xGetImageReq);
 
@@ -2392,7 +2392,7 @@ ProcGetImage(register ClientPtr client)
 }
 
 int
-ProcPolyText(register ClientPtr client)
+ProcPolyText(ClientPtr client)
 {
     int	err;
     REQUEST(xPolyTextReq);
@@ -2421,7 +2421,7 @@ ProcPolyText(register ClientPtr client)
 }
 
 int
-ProcImageText8(register ClientPtr client)
+ProcImageText8(ClientPtr client)
 {
     int	err;
     DrawablePtr pDraw;
@@ -2451,7 +2451,7 @@ ProcImageText8(register ClientPtr client
 }
 
 int
-ProcImageText16(register ClientPtr client)
+ProcImageText16(ClientPtr client)
 {
     int	err;
     DrawablePtr pDraw;
@@ -2482,7 +2482,7 @@ ProcImageText16(register ClientPtr clien
 
 
 int
-ProcCreateColormap(register ClientPtr client)
+ProcCreateColormap(ClientPtr client)
 {
     VisualPtr	pVisual;
     ColormapPtr	pmap;
@@ -2524,7 +2524,7 @@ ProcCreateColormap(register ClientPtr cl
 }
 
 int
-ProcFreeColormap(register ClientPtr client)
+ProcFreeColormap(ClientPtr client)
 {
     ColormapPtr pmap;
     REQUEST(xResourceReq);
@@ -2548,7 +2548,7 @@ ProcFreeColormap(register ClientPtr clie
 
 
 int
-ProcCopyColormapAndFree(register ClientPtr client)
+ProcCopyColormapAndFree(ClientPtr client)
 {
     Colormap	mid;
     ColormapPtr	pSrcMap;
@@ -2575,7 +2575,7 @@ ProcCopyColormapAndFree(register ClientP
 }
 
 int
-ProcInstallColormap(register ClientPtr client)
+ProcInstallColormap(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xResourceReq);
@@ -2596,7 +2596,7 @@ ProcInstallColormap(register ClientPtr c
 }
 
 int
-ProcUninstallColormap(register ClientPtr client)
+ProcUninstallColormap(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xResourceReq);
@@ -2618,7 +2618,7 @@ ProcUninstallColormap(register ClientPtr
 }
 
 int
-ProcListInstalledColormaps(register ClientPtr client)
+ProcListInstalledColormaps(ClientPtr client)
 {
     xListInstalledColormapsReply *preply; 
     int nummaps, rc;
@@ -2651,7 +2651,7 @@ ProcListInstalledColormaps(register Clie
 }
 
 int
-ProcAllocColor (register ClientPtr client)
+ProcAllocColor (ClientPtr client)
 {
     ColormapPtr pmap;
     int	retval;
@@ -2693,7 +2693,7 @@ ProcAllocColor (register ClientPtr clien
 }
 
 int
-ProcAllocNamedColor (register ClientPtr client)
+ProcAllocNamedColor (ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xAllocNamedColorReq);
@@ -2745,7 +2745,7 @@ ProcAllocNamedColor (register ClientPtr 
 }
 
 int
-ProcAllocColorCells (register ClientPtr client)
+ProcAllocColorCells (ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xAllocColorCellsReq);
@@ -2811,7 +2811,7 @@ ProcAllocColorCells (register ClientPtr 
 }
 
 int
-ProcAllocColorPlanes(register ClientPtr client)
+ProcAllocColorPlanes(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xAllocColorPlanesReq);
@@ -2875,7 +2875,7 @@ ProcAllocColorPlanes(register ClientPtr 
 }
 
 int
-ProcFreeColors(register ClientPtr client)
+ProcFreeColors(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xFreeColorsReq);
@@ -2944,7 +2944,7 @@ ProcStoreColors (ClientPtr client)
 }
 
 int
-ProcStoreNamedColor (register ClientPtr client)
+ProcStoreNamedColor (ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xStoreNamedColorReq);
@@ -2978,7 +2978,7 @@ ProcStoreNamedColor (register ClientPtr 
 }
 
 int
-ProcQueryColors(register ClientPtr client)
+ProcQueryColors(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xQueryColorsReq);
@@ -3029,7 +3029,7 @@ ProcQueryColors(register ClientPtr clien
 } 
 
 int
-ProcLookupColor(register ClientPtr client)
+ProcLookupColor(ClientPtr client)
 {
     ColormapPtr pcmp;
     REQUEST(xLookupColorReq);
@@ -3067,17 +3067,16 @@ ProcLookupColor(register ClientPtr clien
 }
 
 int
-ProcCreateCursor (register ClientPtr client)
+ProcCreateCursor (ClientPtr client)
 {
-    CursorPtr	pCursor;
-
-    register PixmapPtr 	src;
-    register PixmapPtr 	msk;
+    CursorPtr		pCursor;
+    PixmapPtr 		src;
+    PixmapPtr 		msk;
     unsigned char *	srcbits;
     unsigned char *	mskbits;
     unsigned short	width, height;
     long		n;
-    CursorMetricRec cm;
+    CursorMetricRec 	cm;
 
 
     REQUEST(xCreateCursorReq);
@@ -3132,7 +3131,7 @@ ProcCreateCursor (register ClientPtr cli
 					 XYPixmap, 1, (pointer)srcbits);
     if ( msk == (PixmapPtr)NULL)
     {
-	register unsigned char *bits = mskbits;
+	unsigned char *bits = mskbits;
 	while (--n >= 0)
 	    *bits++ = ~0;
     }
@@ -3157,7 +3156,7 @@ ProcCreateCursor (register ClientPtr cli
 }
 
 int
-ProcCreateGlyphCursor (register ClientPtr client)
+ProcCreateGlyphCursor (ClientPtr client)
 {
     CursorPtr pCursor;
     int res;
@@ -3181,7 +3180,7 @@ ProcCreateGlyphCursor (register ClientPt
 
 
 int
-ProcFreeCursor (register ClientPtr client)
+ProcFreeCursor (ClientPtr client)
 {
     CursorPtr pCursor;
     REQUEST(xResourceReq);
@@ -3202,7 +3201,7 @@ ProcFreeCursor (register ClientPtr clien
 }
 
 int
-ProcQueryBestSize (register ClientPtr client)
+ProcQueryBestSize (ClientPtr client)
 {
     xQueryBestSizeReply	reply;
     DrawablePtr pDraw;
@@ -3239,7 +3238,7 @@ ProcQueryBestSize (register ClientPtr cl
 
 
 int
-ProcSetScreenSaver (register ClientPtr client)
+ProcSetScreenSaver (ClientPtr client)
 {
     int blankingOption, exposureOption;
     REQUEST(xSetScreenSaverReq);
@@ -3295,7 +3294,7 @@ ProcSetScreenSaver (register ClientPtr c
 }
 
 int
-ProcGetScreenSaver(register ClientPtr client)
+ProcGetScreenSaver(ClientPtr client)
 {
     xGetScreenSaverReply rep;
 
@@ -3312,7 +3311,7 @@ ProcGetScreenSaver(register ClientPtr cl
 }
 
 int
-ProcChangeHosts(register ClientPtr client)
+ProcChangeHosts(ClientPtr client)
 {
     REQUEST(xChangeHostsReq);
     int result;
@@ -3336,7 +3335,7 @@ ProcChangeHosts(register ClientPtr clien
 }
 
 int
-ProcListHosts(register ClientPtr client)
+ProcListHosts(ClientPtr client)
 {
     xListHostsReply reply;
     int	len, nHosts, result;
@@ -3367,7 +3366,7 @@ ProcListHosts(register ClientPtr client)
 }
 
 int
-ProcChangeAccessControl(register ClientPtr client)
+ProcChangeAccessControl(ClientPtr client)
 {
     int result;
     REQUEST(xSetAccessControlReq);
@@ -3385,7 +3384,7 @@ ProcChangeAccessControl(register ClientP
 }
 
 int
-ProcKillClient(register ClientPtr client)
+ProcKillClient(ClientPtr client)
 {
     REQUEST(xResourceReq);
     ClientPtr killclient;
@@ -3417,7 +3416,7 @@ ProcKillClient(register ClientPtr client
 }
 
 int
-ProcSetFontPath(register ClientPtr client)
+ProcSetFontPath(ClientPtr client)
 {
     unsigned char *ptr;
     unsigned long nbytes, total;
@@ -3452,7 +3451,7 @@ ProcSetFontPath(register ClientPtr clien
 }
 
 int
-ProcGetFontPath(register ClientPtr client)
+ProcGetFontPath(ClientPtr client)
 {
     xGetFontPathReply reply;
     int stringLens, numpaths;
@@ -3474,7 +3473,7 @@ ProcGetFontPath(register ClientPtr clien
 }
 
 int
-ProcChangeCloseDownMode(register ClientPtr client)
+ProcChangeCloseDownMode(ClientPtr client)
 {
     REQUEST(xSetCloseDownModeReq);
 
@@ -3493,7 +3492,7 @@ ProcChangeCloseDownMode(register ClientP
     }
 }
 
-int ProcForceScreenSaver(register ClientPtr client)
+int ProcForceScreenSaver(ClientPtr client)
 {    
     REQUEST(xForceScreenSaverReq);
 
@@ -3509,7 +3508,7 @@ int ProcForceScreenSaver(register Client
     return client->noClientException;
 }
 
-int ProcNoOperation(register ClientPtr client)
+int ProcNoOperation(ClientPtr client)
 {
     REQUEST_AT_LEAST_SIZE(xReq);
     
@@ -3552,7 +3551,7 @@ InitProcVectors(void)
 char dispatchExceptionAtReset = DE_RESET;
 
 void
-CloseDownClient(register ClientPtr client)
+CloseDownClient(ClientPtr client)
 {
     Bool really_close_down = client->clientGone ||
 			     client->closeDownMode == DestroyAll;
@@ -3662,8 +3661,8 @@ KillAllClients()
 void
 CloseDownRetainedResources()
 {
-    register int i;
-    register ClientPtr client;
+    int i;
+    ClientPtr client;
 
     for (i=1; i<currentMaxClients; i++)
     {
@@ -3733,11 +3732,11 @@ void InitClient(ClientPtr client, int i,
 int
 InitClientPrivates(ClientPtr client)
 {
-    register char *ptr;
+    char *ptr;
     DevUnion *ppriv;
-    register unsigned *sizes;
-    register unsigned size;
-    register int i;
+    unsigned *sizes;
+    unsigned size;
+    int i;
 
     if (totalClientSize == sizeof(ClientRec))
 	ppriv = (DevUnion *)NULL;
@@ -3787,8 +3786,8 @@ InitClientPrivates(ClientPtr client)
 
 ClientPtr NextAvailableClient(pointer ospriv)
 {
-    register int i;
-    register ClientPtr client;
+    int i;
+    ClientPtr client;
     xReq data;
 
     i = nextFreeClientID;
@@ -3829,10 +3828,10 @@ ClientPtr NextAvailableClient(pointer os
 }
 
 int
-ProcInitialConnection(register ClientPtr client)
+ProcInitialConnection(ClientPtr client)
 {
     REQUEST(xReq);
-    register xConnClientPrefix *prefix;
+    xConnClientPrefix *prefix;
     int whichbyte = 1;
 
     prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
@@ -3856,10 +3855,10 @@ ProcInitialConnection(register ClientPtr
 }
 
 int
-SendConnSetup(register ClientPtr client, char *reason)
+SendConnSetup(ClientPtr client, char *reason)
 {
-    register xWindowRoot *root;
-    register int i;
+    xWindowRoot *root;
+    int i;
     int numScreens;
     char* lConnectionInfo;
     xConnSetupPrefix* lconnSetupPrefix;
@@ -3914,8 +3913,8 @@ SendConnSetup(register ClientPtr client,
 
     for (i=0; i<numScreens; i++) 
     {
-	register unsigned int j;
-	register xDepth *pDepth;
+	unsigned int j;
+	xDepth *pDepth;
 
         root->currentInputMask = WindowTable[i]->eventMask |
 			         wOtherEventMasks (WindowTable[i]);
@@ -3956,10 +3955,10 @@ SendConnSetup(register ClientPtr client,
 }
 
 int
-ProcEstablishConnection(register ClientPtr client)
+ProcEstablishConnection(ClientPtr client)
 {
     char *reason, *auth_proto, *auth_string;
-    register xConnClientPrefix *prefix;
+    xConnClientPrefix *prefix;
     REQUEST(xReq);
 
     prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
@@ -4008,7 +4007,7 @@ SendErrorToClient(ClientPtr client, unsi
 void
 DeleteWindowFromAnySelections(WindowPtr pWin)
 {
-    register int i;
+    int i;
 
     for (i = 0; i< NumCurrentSelections; i++)
         if (CurrentSelections[i].pWin == pWin)
@@ -4030,7 +4029,7 @@ DeleteWindowFromAnySelections(WindowPtr 
 static void
 DeleteClientFromAnySelections(ClientPtr client)
 {
-    register int i;
+    int i;
 
     for (i = 0; i< NumCurrentSelections; i++)
         if (CurrentSelections[i].client == client)
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 5f087a3..62ad575 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1145,9 +1145,9 @@ static XID clearGC[] = { CT_NONE };
 #define clearGCmask (GCClipMask)
 
 int
-doPolyText(ClientPtr client, register PTclosurePtr c)
+doPolyText(ClientPtr client, PTclosurePtr c)
 {
-    register FontPtr pFont = c->pGC->font, oldpFont;
+    FontPtr pFont = c->pGC->font, oldpFont;
     Font	fid, oldfid;
     int err = Success, lgerr;	/* err is in X error, not font error, space */
     enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
@@ -1447,7 +1447,7 @@ PolyText(ClientPtr client, DrawablePtr p
 #undef FontShiftSize
 
 int
-doImageText(ClientPtr client, register ITclosurePtr c)
+doImageText(ClientPtr client, ITclosurePtr c)
 {
     int err = Success, lgerr;	/* err is in X error, not font error, space */
     FontPathElementPtr fpe;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index e530360..c0728da 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -168,7 +168,7 @@ ISOLatin1ToLower (unsigned char source)
 _X_EXPORT void
 CopyISOLatin1Lowered(unsigned char *dest, unsigned char *source, int length)
 {
-    register int i;
+    int i;
 
     for (i = 0; i < length; i++, source++, dest++)
 	*dest = ISOLatin1ToLower (*source);
@@ -392,8 +392,8 @@ AlterSaveSetForClient(ClientPtr client, 
 void
 DeleteWindowFromAnySaveSet(WindowPtr pWin)
 {
-    register int i;
-    register ClientPtr client;
+    int i;
+    ClientPtr client;
     
     for (i = 0; i< currentMaxClients; i++)
     {    
@@ -434,7 +434,7 @@ static Bool		handlerDeleted;
 void
 BlockHandler(pointer pTimeout, pointer pReadmask)
 {
-    register int i, j;
+    int i, j;
     
     ++inHandler;
     for (i = 0; i < screenInfo.numScreens; i++)
@@ -468,7 +468,7 @@ BlockHandler(pointer pTimeout, pointer p
 void
 WakeupHandler(int result, pointer pReadmask)
 {
-    register int i, j;
+    int i, j;
 
     ++inHandler;
     for (i = numHandlers - 1; i >= 0; i--)
diff --git a/dix/events.c b/dix/events.c
index 0053f42..c0b62b8 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -761,8 +761,8 @@ CheckPhysLimits(
 
 static void
 CheckVirtualMotion(
-    register QdEventPtr qe,
-    register WindowPtr pWin)
+    QdEventPtr qe,
+    WindowPtr pWin)
 {
 #ifdef PANORAMIX
     if(!noPanoramiXExtension) {
@@ -875,7 +875,7 @@ ChangeToCursor(CursorPtr cursor)
 
 /* returns true if b is a descendent of a */
 Bool
-IsParent(register WindowPtr a, register WindowPtr b)
+IsParent(WindowPtr a, WindowPtr b)
 {
     for (b = b->parent; b; b = b->parent)
 	if (b == a) return TRUE;
@@ -885,8 +885,8 @@ IsParent(register WindowPtr a, register 
 static void
 PostNewCursor(void)
 {
-    register    WindowPtr win;
-    register    GrabPtr grab = inputInfo.pointer->grab;
+    WindowPtr win;
+    GrabPtr grab = inputInfo.pointer->grab;
 
     if (syncEvents.playingEvents)
 	return;
@@ -952,7 +952,7 @@ XineramaGetCursorScreen()
 #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */
 
 static void
-MonthChangedOrBadTime(register xEvent *xE)
+MonthChangedOrBadTime(xEvent *xE)
 {
     /* If the ddx/OS is careless about not processing timestamped events from
      * different sources in sorted order, then it's possible for time to go
@@ -971,7 +971,7 @@ MonthChangedOrBadTime(register xEvent *x
     lastDeviceEventTime = currentTime; }
 
 void
-NoticeEventTime(register xEvent *xE)
+NoticeEventTime(xEvent *xE)
 {
     if (!syncEvents.playingEvents)
 	NoticeTime(xE);
@@ -984,8 +984,8 @@ NoticeEventTime(register xEvent *xE)
 void
 EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
 {
-    register QdEventPtr tail = *syncEvents.pendtail;
-    register QdEventPtr qe;
+    QdEventPtr tail = *syncEvents.pendtail;
+    QdEventPtr qe;
     xEvent		*qxE;
 
     NoticeTime(xE);
@@ -1059,8 +1059,8 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr de
 static void
 PlayReleasedEvents(void)
 {
-    register QdEventPtr *prev, qe;
-    register DeviceIntPtr dev;
+    QdEventPtr *prev, qe;
+    DeviceIntPtr dev;
 
     prev = &syncEvents.pending;
     while ( (qe = *prev) )
@@ -1104,7 +1104,7 @@ PlayReleasedEvents(void)
 }
 
 static void
-FreezeThaw(register DeviceIntPtr dev, Bool frozen)
+FreezeThaw(DeviceIntPtr dev, Bool frozen)
 {
     dev->sync.frozen = frozen;
     if (frozen)
@@ -1116,13 +1116,13 @@ FreezeThaw(register DeviceIntPtr dev, Bo
 void
 ComputeFreezes()
 {
-    register DeviceIntPtr replayDev = syncEvents.replayDev;
-    register int i;
+    DeviceIntPtr replayDev = syncEvents.replayDev;
+    int i;
     WindowPtr w;
-    register xEvent *xE;
+    xEvent *xE;
     int count;
     GrabPtr grab;
-    register DeviceIntPtr dev;
+    DeviceIntPtr dev;
 
     for (dev = inputInfo.devices; dev; dev = dev->next)
 	FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN));
@@ -1198,10 +1198,10 @@ ScreenRestructured (ScreenPtr pScreen)
 #endif
 
 void
-CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
+CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
 {
-    register GrabPtr grab = thisDev->grab;
-    register DeviceIntPtr dev;
+    GrabPtr grab = thisDev->grab;
+    DeviceIntPtr dev;
 
     if (thisMode == GrabModeSync)
 	thisDev->sync.state = FROZEN_NO_EVENT;
@@ -1232,7 +1232,7 @@ CheckGrabForSyncs(register DeviceIntPtr 
 }
 
 void
-ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, 
+ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, 
                     TimeStamp time, Bool autoGrab)
 {
     WindowPtr oldWin = (mouse->grab) ? mouse->grab->window
@@ -1260,10 +1260,10 @@ ActivatePointerGrab(register DeviceIntPt
 }
 
 void
-DeactivatePointerGrab(register DeviceIntPtr mouse)
+DeactivatePointerGrab(DeviceIntPtr mouse)
 {
-    register GrabPtr grab = mouse->grab;
-    register DeviceIntPtr dev;
+    GrabPtr grab = mouse->grab;
+    DeviceIntPtr dev;
 
     mouse->valuator->motionHintWindow = NullWindow;
     mouse->grab = NullGrab;
@@ -1284,7 +1284,7 @@ DeactivatePointerGrab(register DeviceInt
 }
 
 void
-ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive)
+ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive)
 {
     WindowPtr oldWin;
 
@@ -1310,11 +1310,11 @@ ActivateKeyboardGrab(register DeviceIntP
 }
 
 void
-DeactivateKeyboardGrab(register DeviceIntPtr keybd)
+DeactivateKeyboardGrab(DeviceIntPtr keybd)
 {
-    register GrabPtr grab = keybd->grab;
-    register DeviceIntPtr dev;
-    register WindowPtr focusWin = keybd->focus ? keybd->focus->win
+    GrabPtr grab = keybd->grab;
+    DeviceIntPtr dev;
+    WindowPtr focusWin = keybd->focus ? keybd->focus->win
 					       : sprite.win;
 
     if (focusWin == FollowKeyboardWin)
@@ -1338,7 +1338,7 @@ AllowSome(ClientPtr client, TimeStamp ti
 {
     Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced;
     TimeStamp grabTime;
-    register DeviceIntPtr dev;
+    DeviceIntPtr dev;
 
     thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client);
     thisSynced = FALSE;
@@ -1442,7 +1442,7 @@ AllowSome(ClientPtr client, TimeStamp ti
 }
 
 int
-ProcAllowEvents(register ClientPtr client)
+ProcAllowEvents(ClientPtr client)
 {
     TimeStamp		time;
     DeviceIntPtr	mouse = inputInfo.pointer;
@@ -1487,7 +1487,7 @@ ProcAllowEvents(register ClientPtr clien
 void
 ReleaseActiveGrabs(ClientPtr client)
 {
-    register DeviceIntPtr dev;
+    DeviceIntPtr dev;
     Bool    done;
 
     /* XXX CloseDownClient should remove passive grabs before
@@ -1589,12 +1589,12 @@ TryClientEvents (ClientPtr client, xEven
 }
 
 int
-DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, 
+DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count, 
                       Mask filter, GrabPtr grab, int mskidx)
 {
     int deliveries = 0, nondeliveries = 0;
     int attempt;
-    register InputClients *other;
+    InputClients *other;
     ClientPtr client = NullClient;
     Mask deliveryMask = 0; /* If a grab occurs due to a button press, then
 		              this mask is the mask of the grab. */
@@ -1708,10 +1708,10 @@ XineramaTryClientEventsResult(
 #endif
 
 int
-MaybeDeliverEventsToClient(register WindowPtr pWin, xEvent *pEvents, 
+MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, 
                            int count, Mask filter, ClientPtr dontClient)
 {
-    register OtherClients *other;
+    OtherClients *other;
 
 
     if (pWin->eventMask & filter)
@@ -1799,8 +1799,8 @@ FixUpEventFromWindow(
 }
 
 int
-DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, 
-                    register WindowPtr stopAt, DeviceIntPtr dev, int count)
+DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab, 
+                    WindowPtr stopAt, DeviceIntPtr dev, int count)
 {
     Window child = None;
     int type = xE->u.u.type;
@@ -1809,7 +1809,7 @@ DeliverDeviceEvents(register WindowPtr p
 
     if (type & EXTENSION_EVENT_BASE)
     {
-	register OtherInputMasks *inputMasks;
+	OtherInputMasks *inputMasks;
 	int mskidx = dev->id;
 
 	inputMasks = wOtherInputMasks(pWin);
@@ -1863,8 +1863,8 @@ DeliverDeviceEvents(register WindowPtr p
 
 /* not useful for events that propagate up the tree or extension events */
 _X_EXPORT int
-DeliverEvents(register WindowPtr pWin, register xEvent *xE, int count, 
-              register WindowPtr otherParent)
+DeliverEvents(WindowPtr pWin, xEvent *xE, int count, 
+              WindowPtr otherParent)
 {
     Mask filter;
     int     deliveries;
@@ -1929,7 +1929,7 @@ PointInBorderSize(WindowPtr pWin, int x,
 static WindowPtr 
 XYToWindow(int x, int y)
 {
-    register WindowPtr  pWin;
+    WindowPtr  pWin;
     BoxRec		box;
 
     spriteTraceGood = 1;	/* root window still there */
@@ -2092,9 +2092,9 @@ void ReinitializeRootWindow(WindowPtr wi
 #endif
 
 void
-DefineInitialRootWindow(register WindowPtr win)
+DefineInitialRootWindow(WindowPtr win)
 {
-    register ScreenPtr pScreen = win->drawable.pScreen;
+    ScreenPtr pScreen = win->drawable.pScreen;
 
     sprite.hotPhys.pScreen = pScreen;
     sprite.hotPhys.x = pScreen->width / 2;
@@ -2411,13 +2411,13 @@ BorderSizeNotEmpty(WindowPtr pWin)
 static Bool
 CheckPassiveGrabsOnWindow(
     WindowPtr pWin,
-    register DeviceIntPtr device,
-    register xEvent *xE,
+    DeviceIntPtr device,
+    xEvent *xE,
     int count)
 {
-    register GrabPtr grab = wPassiveGrabs(pWin);
+    GrabPtr grab = wPassiveGrabs(pWin);
     GrabRec tempGrab;
-    register xEvent *dxE;
+    xEvent *dxE;
 
     if (!grab)
 	return FALSE;
@@ -2513,12 +2513,12 @@ tried. PRH
 */
 
 Bool
-CheckDeviceGrabs(register DeviceIntPtr device, register xEvent *xE, 
+CheckDeviceGrabs(DeviceIntPtr device, xEvent *xE, 
                  int checkFirst, int count)
 {
-    register int i;
-    register WindowPtr pWin = NULL;
-    register FocusClassPtr focus = device->focus;
+    int i;
+    WindowPtr pWin = NULL;
+    FocusClassPtr focus = device->focus;
 
     if (((xE->u.u.type == ButtonPress)
 #if defined(XINPUT) && defined(XKB)
@@ -2585,13 +2585,13 @@ DeliverFocusedEvent(DeviceIntPtr keybd, 
 }
 
 void
-DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, 
+DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, 
                     Bool deactivateGrab, int count)
 {
-    register GrabPtr grab = thisDev->grab;
+    GrabPtr grab = thisDev->grab;
     int deliveries = 0;
-    register DeviceIntPtr dev;
-    register xEvent *dxE;
+    DeviceIntPtr dev;
+    xEvent *dxE;
 
     if (grab->ownerEvents)
     {
@@ -2668,19 +2668,19 @@ DeliverGrabbedEvent(register xEvent *xE,
 
 void
 #ifdef XKB
-CoreProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count)
+CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
 #else
-ProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count)
+ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
 #endif
 {
     int             key, bit;
-    register BYTE   *kptr;
-    register int    i;
-    register CARD8  modifiers;
-    register CARD16 mask;
+    BYTE   *kptr;
+    int    i;
+    CARD8  modifiers;
+    CARD16 mask;
     GrabPtr         grab = keybd->grab;
     Bool            deactivateGrab = FALSE;
-    register KeyClassPtr keyc = keybd->key;
+    KeyClassPtr keyc = keybd->key;
 #ifdef XEVIE
     static Window           rootWin = 0;
 
@@ -2832,11 +2832,11 @@ drawable.id:0;
    CoreProcessKeyEvent to be called, as in for example Mouse Keys.
 */
 void
-FixKeyState (register xEvent *xE, register DeviceIntPtr keybd)
+FixKeyState (xEvent *xE, DeviceIntPtr keybd)
 {
     int             key, bit;
-    register BYTE   *kptr;
-    register KeyClassPtr keyc = keybd->key;
+    BYTE   *kptr;
+    KeyClassPtr keyc = keybd->key;
 
     key = xE->u.u.detail;
     kptr = &keyc->down[key >> 3];
@@ -2863,14 +2863,14 @@ FixKeyState (register xEvent *xE, regist
 
 void
 #ifdef XKB
-CoreProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count)
+CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
 #else
-ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count)
+ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
 #endif
 {
-    register GrabPtr	grab = mouse->grab;
+    GrabPtr	grab = mouse->grab;
     Bool                deactivateGrab = FALSE;
-    register ButtonClassPtr butc = mouse->button;
+    ButtonClassPtr butc = mouse->button;
 #ifdef XKB
     XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo;
 #endif
@@ -2914,8 +2914,8 @@ ProcessPointerEvent (register xEvent *xE
     }
     if (xE->u.u.type != MotionNotify)
     {
-	register int  key;
-	register BYTE *kptr;
+	int  key;
+	BYTE *kptr;
 	int           bit;
 
 	XE_KBPTR.rootX = sprite.hot.x;
@@ -2976,10 +2976,10 @@ ProcessPointerEvent (register xEvent *xE
 
 void
 RecalculateDeliverableEvents(pWin)
-    register WindowPtr pWin;
+    WindowPtr pWin;
 {
-    register OtherClients *others;
-    register WindowPtr pChild;
+    OtherClients *others;
+    WindowPtr pChild;
 
     pChild = pWin;
     while (1)
@@ -3018,8 +3018,8 @@ RecalculateDeliverableEvents(pWin)
 int
 OtherClientGone(pointer value, XID id)
 {
-    register OtherClientsPtr other, prev;
-    register WindowPtr pWin = (WindowPtr)value;
+    OtherClientsPtr other, prev;
+    WindowPtr pWin = (WindowPtr)value;
 
     prev = 0;
     for (other = wOtherClients(pWin); other; other = other->next)
@@ -3045,7 +3045,7 @@ OtherClientGone(pointer value, XID id)
 }
 
 int
-EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask mask)
+EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask)
 {
     Mask check;
     OtherClients * others;
@@ -3117,10 +3117,10 @@ maskSet: 
 }
 
 int
-EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client, 
+EventSuppressForWindow(WindowPtr pWin, ClientPtr client, 
                        Mask mask, Bool *checkOptional)
 {
-    register int i, free;
+    int i, free;
 
     if (mask & ~PropagateMask)
     {
@@ -3174,8 +3174,8 @@ EventSuppressForWindow(register WindowPt
 
 static WindowPtr 
 CommonAncestor(
-    register WindowPtr a,
-    register WindowPtr b)
+    WindowPtr a,
+    WindowPtr b)
 {
     for (b = b->parent; b; b = b->parent)
 	if (IsParent(b, a)) return b;
@@ -3187,14 +3187,14 @@ EnterLeaveEvent(
     int type,
     int mode,
     int detail,
-    register WindowPtr pWin,
+    WindowPtr pWin,
     Window child)
 {
     xEvent		event;
-    register DeviceIntPtr keybd = inputInfo.keyboard;
+    DeviceIntPtr keybd = inputInfo.keyboard;
     WindowPtr		focus;
-    register DeviceIntPtr mouse = inputInfo.pointer;
-    register GrabPtr	grab = mouse->grab;
+    DeviceIntPtr mouse = inputInfo.pointer;
+    GrabPtr	grab = mouse->grab;
     Mask		mask;
 
     if ((pWin == mouse->valuator->motionHintWindow) &&
@@ -3278,7 +3278,7 @@ EnterNotifies(WindowPtr ancestor, Window
 static void
 LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail)
 {
-    register WindowPtr  pWin;
+    WindowPtr  pWin;
 
     if (ancestor == child)
 	return;
@@ -3318,7 +3318,7 @@ DoEnterLeaveEvents(WindowPtr fromWin, Wi
 }
 
 static void
-FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin)
+FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin)
 {
     xEvent event;
 
@@ -3388,7 +3388,7 @@ FocusOutEvents(
     int mode, int detail,
     Bool doAncestor)
 {
-    register WindowPtr  pWin;
+    WindowPtr  pWin;
 
     for (pWin = child; pWin != ancestor; pWin = pWin->parent)
 	FocusEvent(dev, FocusOut, mode, detail, pWin);
@@ -3531,7 +3531,7 @@ SetInputFocus(
     Time ctime,
     Bool followOK)
 {
-    register FocusClassPtr focus;
+    FocusClassPtr focus;
     WindowPtr focusWin;
     int mode, rc;
     TimeStamp time;
@@ -3579,7 +3579,7 @@ SetInputFocus(
     else
     {
         int depth = 0;
-	register WindowPtr pWin;
+	WindowPtr pWin;
 
         for (pWin = focusWin; pWin; pWin = pWin->parent) depth++;
         if (depth > focus->traceSize)
@@ -3745,7 +3745,7 @@ int
 ProcChangeActivePointerGrab(ClientPtr client)
 {
     DeviceIntPtr device = inputInfo.pointer;
-    register GrabPtr grab = device->grab;
+    GrabPtr grab = device->grab;
     CursorPtr newCursor, oldCursor;
     REQUEST(xChangeActivePointerGrabReq);
     TimeStamp time;
@@ -3807,12 +3807,12 @@ ProcUngrabPointer(ClientPtr client)
 }
 
 int
-GrabDevice(register ClientPtr client, register DeviceIntPtr dev, 
+GrabDevice(ClientPtr client, DeviceIntPtr dev, 
            unsigned this_mode, unsigned other_mode, Window grabWindow, 
            unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status)
 {
     WindowPtr pWin;
-    register GrabPtr grab;
+    GrabPtr grab;
     TimeStamp time;
     int rc;
 
@@ -4433,7 +4433,7 @@ CheckCursorConfinement(WindowPtr pWin)
 Mask
 EventMaskForClient(WindowPtr pWin, ClientPtr client)
 {
-    register OtherClientsPtr	other;
+    OtherClientsPtr	other;
 
     if (wClient (pWin) == client)
 	return pWin->eventMask;
diff --git a/dix/extension.c b/dix/extension.c
index 29cae86..dc1a76f 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -81,11 +81,11 @@ extern unsigned totalExtensionSize;
 static void
 InitExtensionPrivates(ExtensionEntry *ext)
 {
-    register char *ptr;
+    char *ptr;
     DevUnion *ppriv;
-    register unsigned *sizes;
-    register unsigned size;
-    register int i;
+    unsigned *sizes;
+    unsigned size;
+    int i;
 
     if (totalExtensionSize == sizeof(ExtensionEntry))
 	ppriv = (DevUnion *)NULL;
@@ -115,7 +115,7 @@ AddExtension(char *name, int NumEvents, 
 	     unsigned short (*MinorOpcodeProc)(ClientPtr c3))
 {
     int i;
-    register ExtensionEntry *ext, **newexts;
+    ExtensionEntry *ext, **newexts;
 
     if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc)
         return((ExtensionEntry *) NULL);
@@ -282,7 +282,7 @@ MinorOpcodeOfRequest(ClientPtr client)
 void
 CloseDownExtensions()
 {
-    register int i,j;
+    int i,j;
 
     for (i = NumExtensions - 1; i >= 0; i--)
     {
@@ -300,7 +300,7 @@ CloseDownExtensions()
     lastError = FirstExtensionError;
     for (i=0; i<MAXSCREENS; i++)
     {
-	register ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
+	ScreenProcEntry *spentry = &AuxillaryScreenProcs[i];
 
 	while (spentry->num)
 	{
@@ -363,7 +363,7 @@ ProcListExtensions(ClientPtr client)
 
     if ( NumExtensions )
     {
-        register int i, j;
+        int i, j;
 
         for (i=0;  i<NumExtensions; i++)
 	{
@@ -410,8 +410,8 @@ ProcListExtensions(ClientPtr client)
 ExtensionLookupProc 
 LookupProc(char *name, GCPtr pGC)
 {
-    register int i;
-    register ScreenProcEntry *spentry;
+    int i;
+    ScreenProcEntry *spentry;
     spentry  = &AuxillaryScreenProcs[pGC->pScreen->myNum];
     if (spentry->num)    
     {
@@ -431,8 +431,8 @@ RegisterProc(char *name, GC *pGC, Extens
 Bool
 RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
 {
-    register ScreenProcEntry *spentry;
-    register ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
+    ScreenProcEntry *spentry;
+    ProcEntryPtr procEntry = (ProcEntryPtr)NULL;
     char *newname;
     int i;
 
diff --git a/dix/gc.c b/dix/gc.c
index 5106fcd..89b246d 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -144,12 +144,12 @@ ValidateGC(DrawablePtr pDraw, GC *pGC)
     assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; }
 
 _X_EXPORT int
-dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion)
+dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion)
 {
-    register BITS32 	index2;
-    register int 	error = 0;
-    PixmapPtr 		pPixmap;
-    BITS32		maskQ;
+    BITS32 	index2;
+    int 	error = 0;
+    PixmapPtr 	pPixmap;
+    BITS32	maskQ;
 
     assert( (pC32 && !pUnion) || (!pC32 && pUnion) );
     pGC->serialNumber |= GC_CHANGE_SERIAL_BIT;
@@ -522,7 +522,7 @@ dixChangeGC(ClientPtr client, register G
 /* Publically defined entry to ChangeGC.  Just calls dixChangeGC and tells
  * it that all of the entries are constants or IDs */
 _X_EXPORT int
-ChangeGC(register GC *pGC, register BITS32 mask, XID *pval)
+ChangeGC(GC *pGC, BITS32 mask, XID *pval)
 {
     return (dixChangeGC(NullClient, pGC, mask, pval, NULL));
 }
@@ -548,7 +548,7 @@ NOTE:
 32 bits long
 */
 _X_EXPORT int
-DoChangeGC(register GC *pGC, register BITS32 mask, XID *pval, int fPointer)
+DoChangeGC(GC *pGC, BITS32 mask, XID *pval, int fPointer)
 {
     if (fPointer)
     /* XXX might be a problem on 64 bit big-endian servers */
@@ -572,11 +572,11 @@ static GCPtr
 AllocateGC(ScreenPtr pScreen)
 {
     GCPtr pGC;
-    register char *ptr;
-    register DevUnion *ppriv;
-    register unsigned *sizes;
-    register unsigned size;
-    register int i;
+    char *ptr;
+    DevUnion *ppriv;
+    unsigned *sizes;
+    unsigned size;
+    int i;
 
     pGC = (GCPtr)xalloc(pScreen->totalGCSize);
     if (pGC)
@@ -602,7 +602,7 @@ AllocateGC(ScreenPtr pScreen)
 _X_EXPORT GCPtr
 CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus)
 {
-    register GCPtr pGC;
+    GCPtr pGC;
 
     pGC = AllocateGC(pDrawable->pScreen);
     if (!pGC)
@@ -724,11 +724,11 @@ CreateDefaultTile (GCPtr pGC)
 }
 
 _X_EXPORT int
-CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask)
+CopyGC(GC *pgcSrc, GC *pgcDst, BITS32 mask)
 {
-    register BITS32	index2;
-    BITS32		maskQ;
-    int 		error = 0;
+    BITS32	index2;
+    BITS32	maskQ;
+    int 	error = 0;
 
     if (pgcSrc == pgcDst)
 	return Success;
@@ -934,7 +934,7 @@ go with CreateGC() or ChangeGC().)
 _X_EXPORT GCPtr
 CreateScratchGC(ScreenPtr pScreen, unsigned depth)
 {
-    register GCPtr pGC;
+    GCPtr pGC;
 
     pGC = AllocateGC(pScreen);
     if (!pGC)
@@ -986,8 +986,8 @@ CreateScratchGC(ScreenPtr pScreen, unsig
 void
 FreeGCperDepth(int screenNum)
 {
-    register int i;
-    register ScreenPtr pScreen;
+    int i;
+    ScreenPtr pScreen;
     GCPtr *ppGC;
 
     pScreen = screenInfo.screens[screenNum];
@@ -1002,8 +1002,8 @@ FreeGCperDepth(int screenNum)
 Bool
 CreateGCperDepth(int screenNum)
 {
-    register int i;
-    register ScreenPtr pScreen;
+    int i;
+    ScreenPtr pScreen;
     DepthPtr pDepth;
     GCPtr *ppGC;
 
@@ -1035,7 +1035,7 @@ CreateGCperDepth(int screenNum)
 Bool
 CreateDefaultStipple(int screenNum)
 {
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     XID tmpval[3];
     xRectangle rect;
     CARD16 w, h;
@@ -1077,10 +1077,10 @@ FreeDefaultStipple(int screenNum)
 }
 
 _X_EXPORT int
-SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash)
+SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash)
 {
-    register long i;
-    register unsigned char *p, *indash;
+    long i;
+    unsigned char *p, *indash;
     BITS32 maskQ = 0;
 
     i = ndash;
@@ -1135,8 +1135,8 @@ SetDashes(register GCPtr pGC, unsigned o
 _X_EXPORT int
 VerifyRectOrder(int nrects, xRectangle *prects, int ordering)
 {
-    register xRectangle	*prectP, *prectN;
-    register int	i;
+    xRectangle	*prectP, *prectN;
+    int	i;
 
     switch(ordering)
     {
@@ -1220,10 +1220,10 @@ SetClipRects(GCPtr pGC, int xOrigin, int
    you use it often enough it will become real.)
 */
 _X_EXPORT GCPtr
-GetScratchGC(register unsigned depth, register ScreenPtr pScreen)
+GetScratchGC(unsigned depth, ScreenPtr pScreen)
 {
-    register int i;
-    register GCPtr pGC;
+    int i;
+    GCPtr pGC;
 
     for (i=0; i<=pScreen->numDepths; i++)
         if ( pScreen->GCperDepth[i]->depth == depth &&
@@ -1269,10 +1269,10 @@ mark it as available.
    if not, free it for real
 */
 _X_EXPORT void
-FreeScratchGC(register GCPtr pGC)
+FreeScratchGC(GCPtr pGC)
 {
-    register ScreenPtr pScreen = pGC->pScreen;
-    register int i;
+    ScreenPtr pScreen = pGC->pScreen;
+    int i;
 
     for (i=0; i<=pScreen->numDepths; i++)
     {
diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c
index c1c545f..70b1ff8 100644
--- a/dix/glyphcurs.c
+++ b/dix/glyphcurs.c
@@ -74,10 +74,10 @@ cursor metrics.
 */
 
 int
-ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, unsigned char **ppbits)
+ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned char **ppbits)
 {
-    register ScreenPtr pScreen;
-    register GCPtr pGC;
+    ScreenPtr pScreen;
+    GCPtr pGC;
     xRectangle rect;
     PixmapPtr ppix;
     long nby;
@@ -140,7 +140,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsig
 
 
 Bool
-CursorMetricsFromGlyph(register FontPtr pfont, unsigned ch, register CursorMetricPtr cm)
+CursorMetricsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm)
 {
     CharInfoPtr 	pci;
     unsigned long	nglyphs;
diff --git a/dix/grabs.c b/dix/grabs.c
index 0c2b05e..714fea3 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -128,7 +128,7 @@ FreeGrab(GrabPtr pGrab)
 int
 DeletePassiveGrab(pointer value, XID id)
 {
-    register GrabPtr g, prev;
+    GrabPtr g, prev;
     GrabPtr pGrab = (GrabPtr)value;
 
     /* it is OK if the grab isn't found */
@@ -153,8 +153,8 @@ DeletePassiveGrab(pointer value, XID id)
 static Mask *
 DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail)
 {
-    register Mask *mask;
-    register int i;
+    Mask *mask;
+    int i;
 
     mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask);
     if (mask)
@@ -305,7 +305,7 @@ AddPassiveGrabToList(GrabPtr pGrab)
 Bool
 DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
 {
-    register GrabPtr grab;
+    GrabPtr grab;
     GrabPtr *deletes, *adds;
     Mask ***updates, **details;
     int i, ndels, nadds, nups;
diff --git a/dix/privates.c b/dix/privates.c
index a61c3cb..a66fc3d 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -225,7 +225,7 @@ AllocateWindowPrivateIndex()
 }
 
 _X_EXPORT Bool
-AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
+AllocateWindowPrivate(ScreenPtr pScreen, int index2, unsigned amount)
 {
     unsigned oldamount;
 
@@ -275,7 +275,7 @@ AllocateGCPrivateIndex()
 }
 
 _X_EXPORT Bool
-AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
+AllocateGCPrivate(ScreenPtr pScreen, int index2, unsigned amount)
 {
     unsigned oldamount;
 
@@ -324,7 +324,7 @@ AllocatePixmapPrivateIndex()
 }
 
 _X_EXPORT Bool
-AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
+AllocatePixmapPrivate(ScreenPtr pScreen, int index2, unsigned amount)
 {
     unsigned oldamount;
 
diff --git a/dix/property.c b/dix/property.c
index d402849..034d86f 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -76,7 +76,7 @@ static void
 PrintPropertys(WindowPtr pWin)
 {
     PropertyPtr pProp;
-    register int j;
+    int j;
 
     pProp = pWin->userProps;
     while (pProp)
@@ -97,7 +97,7 @@ ProcRotateProperties(ClientPtr client)
     int     i, j, delta, rc;
     REQUEST(xRotatePropertiesReq);
     WindowPtr pWin;
-    register    Atom * atoms;
+    Atom * atoms;
     PropertyPtr * props;               /* array of pointer */
     PropertyPtr pProp;
     xEvent event;
@@ -622,7 +622,7 @@ ProcListProperties(ClientPtr client)
 }
 
 int 
-ProcDeleteProperty(register ClientPtr client)
+ProcDeleteProperty(ClientPtr client)
 {
     WindowPtr pWin;
     REQUEST(xDeletePropertyReq);
diff --git a/dix/resource.c b/dix/resource.c
index 4468f45..7092b2f 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -257,7 +257,7 @@ ClientResourceRec clientTable[MAXCLIENTS
 Bool
 InitClientResources(ClientPtr client)
 {
-    register int i, j;
+    int i, j;
  
     if (client == serverClient)
     {
@@ -314,7 +314,7 @@ InitClientResources(ClientPtr client)
 
 
 static int
-Hash(int client, register XID id)
+Hash(int client, XID id)
 {
     id &= RESOURCE_ID_MASK;
     switch (clientTable[client].hashsize)
@@ -337,12 +337,12 @@ Hash(int client, register XID id)
 
 static XID
 AvailableID(
-    register int client,
-    register XID id,
-    register XID maxid,
-    register XID goodid)
+    int client,
+    XID id,
+    XID maxid,
+    XID goodid)
 {
-    register ResourcePtr res;
+    ResourcePtr res;
 
     if ((goodid >= id) && (goodid <= maxid))
 	return goodid;
@@ -360,10 +360,10 @@ AvailableID(
 _X_EXPORT void
 GetXIDRange(int client, Bool server, XID *minp, XID *maxp)
 {
-    register XID id, maxid;
-    register ResourcePtr *resp;
-    register ResourcePtr res;
-    register int i;
+    XID id, maxid;
+    ResourcePtr *resp;
+    ResourcePtr res;
+    int i;
     XID goodid;
 
     id = (Mask)client << CLIENTOFFSET;
@@ -436,7 +436,7 @@ GetXIDList(ClientPtr pClient, unsigned c
  */
 
 _X_EXPORT XID
-FakeClientID(register int client)
+FakeClientID(int client)
 {
     XID id, maxid;
 
@@ -460,8 +460,8 @@ _X_EXPORT Bool
 AddResource(XID id, RESTYPE type, pointer value)
 {
     int client;
-    register ClientResourceRec *rrec;
-    register ResourcePtr res, *head;
+    ClientResourceRec *rrec;
+    ResourcePtr res, *head;
     	
 #ifdef XSERVER_DTRACE
     XSERVER_RESOURCE_ALLOC(id, type, value, TypeNameString(type));
@@ -498,10 +498,10 @@ AddResource(XID id, RESTYPE type, pointe
 static void
 RebuildTable(int client)
 {
-    register int j;
-    register ResourcePtr res, next;
+    int j;
+    ResourcePtr res, next;
     ResourcePtr **tails, *resources;
-    register ResourcePtr **tptr, *rptr;
+    ResourcePtr **tptr, *rptr;
 
     /*
      * For now, preserve insertion order, since some ddx layers depend
@@ -548,9 +548,9 @@ _X_EXPORT void
 FreeResource(XID id, RESTYPE skipDeleteFuncType)
 {
     int		cid;
-    register    ResourcePtr res;
-    register	ResourcePtr *prev, *head;
-    register	int *eltptr;
+    ResourcePtr res;
+    ResourcePtr *prev, *head;
+    int *eltptr;
     int		elements;
     Bool	gotOne = FALSE;
 
@@ -600,8 +600,8 @@ _X_EXPORT void
 FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
 {
     int		cid;
-    register    ResourcePtr res;
-    register	ResourcePtr *prev, *head;
+    ResourcePtr res;
+    ResourcePtr *prev, *head;
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
     {
 	head = &clientTable[cid].resources[Hash(cid, id)];
@@ -644,7 +644,7 @@ _X_EXPORT Bool
 ChangeResourceValue (XID id, RESTYPE rtype, pointer value)
 {
     int    cid;
-    register    ResourcePtr res;
+    ResourcePtr res;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
     {
@@ -675,10 +675,10 @@ FindClientResourcesByType(
     FindResType func,
     pointer cdata
 ){
-    register ResourcePtr *resources;
-    register ResourcePtr this, next;
+    ResourcePtr *resources;
+    ResourcePtr this, next;
     int i, elements;
-    register int *eltptr;
+    int *eltptr;
 
     if (!client)
 	client = serverClient;
@@ -706,10 +706,10 @@ FindAllClientResources(
     FindAllRes func,
     pointer cdata
 ){
-    register ResourcePtr *resources;
-    register ResourcePtr this, next;
+    ResourcePtr *resources;
+    ResourcePtr this, next;
     int i, elements;
-    register int *eltptr;
+    int *eltptr;
 
     if (!client)
         client = serverClient;
@@ -796,8 +796,8 @@ FreeClientNeverRetainResources(ClientPtr
 void
 FreeClientResources(ClientPtr client)
 {
-    register ResourcePtr *resources;
-    register ResourcePtr this;
+    ResourcePtr *resources;
+    ResourcePtr this;
     int j;
 
     /* This routine shouldn't be called with a null client, but just in
@@ -856,7 +856,7 @@ FreeAllResources()
 }
 
 _X_EXPORT Bool
-LegalNewID(XID id, register ClientPtr client)
+LegalNewID(XID id, ClientPtr client)
 {
 
 #ifdef PANORAMIX
@@ -887,7 +887,7 @@ _X_EXPORT pointer
 SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode)
 {
     int    cid;
-    register    ResourcePtr res;
+    ResourcePtr res;
     pointer retval = NULL;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
@@ -914,7 +914,7 @@ _X_EXPORT pointer
 SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode)
 {
     int    cid;
-    register ResourcePtr res = NULL;
+    ResourcePtr res = NULL;
     pointer retval = NULL;
 
     if (((cid = CLIENT_ID(id)) < MAXCLIENTS) &&
diff --git a/dix/swaprep.c b/dix/swaprep.c
index 08ae6eb..6f4b277 100644
--- a/dix/swaprep.c
+++ b/dix/swaprep.c
@@ -73,10 +73,10 @@ static void SwapFont(xQueryFontReply *pr
  *  \param size size in bytes
  */
 _X_EXPORT void
-Swap32Write(ClientPtr pClient, int size, register CARD32 *pbuf)
+Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
 {
-    register int i;
-    register char n;
+    int i;
+    char n;
 
     size >>= 2;
     for(i = 0; i < size; i++)
@@ -97,7 +97,7 @@ CopySwap32Write(ClientPtr pClient, int s
 {
     int bufsize = size;
     CARD32 *pbufT;
-    register CARD32 *from, *to, *fromLast, *toLast;
+    CARD32 *from, *to, *fromLast, *toLast;
     CARD32 tmpbuf[1];
     
     /* Allocate as big a buffer as we can... */
@@ -145,7 +145,7 @@ CopySwap16Write(ClientPtr pClient, int s
 {
     int bufsize = size;
     short *pbufT;
-    register short *from, *to, *fromLast, *toLast;
+    short *from, *to, *fromLast, *toLast;
     short tmpbuf[2];
     
     /* Allocate as big a buffer as we can... */
@@ -189,7 +189,7 @@ CopySwap16Write(ClientPtr pClient, int s
 void
 SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     (void)WriteToClient(pClient, size, (char *) pRep);
@@ -200,7 +200,7 @@ void
 SGetWindowAttributesReply(ClientPtr pClient, int size,
                           xGetWindowAttributesReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -218,7 +218,7 @@ SGetWindowAttributesReply(ClientPtr pCli
 void
 SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->root, n);
@@ -233,7 +233,7 @@ SGetGeometryReply(ClientPtr pClient, int
 void
 SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -246,7 +246,7 @@ SQueryTreeReply(ClientPtr pClient, int s
 void
 SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->atom, n);
@@ -256,7 +256,7 @@ SInternAtomReply(ClientPtr pClient, int 
 void
 SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -268,7 +268,7 @@ SGetAtomNameReply(ClientPtr pClient, int
 void
 SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -281,7 +281,7 @@ SGetPropertyReply(ClientPtr pClient, int
 void
 SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -293,7 +293,7 @@ void
 SGetSelectionOwnerReply(ClientPtr pClient, int size,
                         xGetSelectionOwnerReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->owner, n);
@@ -304,7 +304,7 @@ SGetSelectionOwnerReply(ClientPtr pClien
 void
 SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->root, n);
@@ -320,7 +320,7 @@ SQueryPointerReply(ClientPtr pClient, in
 void
 SwapTimecoord(xTimecoord* pCoord)
 {
-    register char n;
+    char n;
 
     swapl(&pCoord->time, n);
     swaps(&pCoord->x, n);
@@ -346,7 +346,7 @@ SwapTimeCoordWrite(ClientPtr pClient, in
 void
 SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -357,7 +357,7 @@ SGetMotionEventsReply(ClientPtr pClient,
 void
 STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->child, n);
@@ -369,7 +369,7 @@ STranslateCoordsReply(ClientPtr pClient,
 void
 SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->focus, n);
@@ -380,7 +380,7 @@ SGetInputFocusReply(ClientPtr pClient, i
 void
 SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -390,7 +390,7 @@ SQueryKeymapReply(ClientPtr pClient, int
 static void
 SwapCharInfo(xCharInfo *pInfo)
 {
-    register char n;
+    char n;
 
     swaps(&pInfo->leftSideBearing, n);
     swaps(&pInfo->rightSideBearing, n);
@@ -403,7 +403,7 @@ SwapCharInfo(xCharInfo *pInfo)
 static void
 SwapFontInfo(xQueryFontReply *pr)
 {
-    register char		n;
+    char n;
 
     swaps(&pr->minCharOrByte2, n);
     swaps(&pr->maxCharOrByte2, n);
@@ -423,7 +423,7 @@ SwapFont(xQueryFontReply *pr, Bool hasGl
     xCharInfo *	pxci;
     unsigned	nchars, nprops;
     char	*pby;
-    register char n;
+    char n;
 
     swaps(&pr->sequenceNumber, n);
     swapl(&pr->length, n);
@@ -458,7 +458,7 @@ SQueryFontReply(ClientPtr pClient, int s
 void
 SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->fontAscent, n);
@@ -474,7 +474,7 @@ SQueryTextExtentsReply(ClientPtr pClient
 void
 SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -493,7 +493,7 @@ SListFontsWithInfoReply(ClientPtr pClien
 void
 SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -504,7 +504,7 @@ SGetFontPathReply(ClientPtr pClient, int
 void
 SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -517,7 +517,7 @@ void
 SListInstalledColormapsReply(ClientPtr pClient, int size,
                              xListInstalledColormapsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -531,7 +531,7 @@ SAllocColorReply(pClient, size, pRep)
     int			size;
     xAllocColorReply	*pRep;
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->red, n);
@@ -544,7 +544,7 @@ SAllocColorReply(pClient, size, pRep)
 void
 SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->pixel, n);
@@ -560,7 +560,7 @@ SAllocNamedColorReply(ClientPtr pClient,
 void
 SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -573,7 +573,7 @@ SAllocColorCellsReply(ClientPtr pClient,
 void
 SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -587,7 +587,7 @@ SAllocColorPlanesReply(ClientPtr pClient
 void
 SwapRGB(xrgb *prgb)
 {
-    register char n;
+    char n;
 
     swaps(&prgb->red, n);
     swaps(&prgb->green, n);
@@ -613,7 +613,7 @@ SQColorsExtend(ClientPtr pClient, int si
 void
 SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -624,7 +624,7 @@ SQueryColorsReply(ClientPtr pClient, int
 void
 SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->exactRed, n);
@@ -639,7 +639,7 @@ SLookupColorReply(ClientPtr pClient, int
 void
 SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->width, n);
@@ -650,7 +650,7 @@ SQueryBestSizeReply(ClientPtr pClient, i
 void
 SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -661,7 +661,7 @@ void
 SGetKeyboardMappingReply(ClientPtr pClient, int size,
                          xGetKeyboardMappingReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -672,7 +672,7 @@ void
 SGetPointerMappingReply(ClientPtr pClient, int size,
                         xGetPointerMappingReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -683,7 +683,7 @@ void
 SGetModifierMappingReply(ClientPtr pClient, int size,
                          xGetModifierMappingReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -693,7 +693,7 @@ SGetModifierMappingReply(ClientPtr pClie
 void
 SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
@@ -706,7 +706,7 @@ SGetKeyboardControlReply(ClientPtr pClie
 void
 SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->accelNumerator, n);
@@ -718,7 +718,7 @@ SGetPointerControlReply(ClientPtr pClien
 void
 SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swaps(&pRep->timeout, n);
@@ -734,7 +734,7 @@ SLHostsExtend(ClientPtr pClient, int siz
     while (bufT < endbuf) {
 	xHostEntry *host = (xHostEntry *) bufT;
 	int len = host->length;
-        register char n;
+        char n;
 	swaps (&host->length, n);
 	bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2);
 	}
@@ -744,7 +744,7 @@ SLHostsExtend(ClientPtr pClient, int siz
 void
 SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
 {
-    register char n;
+    char n;
 
     swaps(&pRep->sequenceNumber, n);
     swapl(&pRep->length, n);
diff --git a/dix/swapreq.c b/dix/swapreq.c
index a6a2115..ad60d17 100644
--- a/dix/swapreq.c
+++ b/dix/swapreq.c
@@ -63,9 +63,9 @@ SOFTWARE.
 
 /* Byte swap a list of longs */
 _X_EXPORT void
-SwapLongs (register CARD32 *list, register unsigned long count)
+SwapLongs (CARD32 *list, unsigned long count)
 {
-	register char n;
+	char n;
 
 	while (count >= 8) {
 	    swapl(list+0, n);
@@ -89,9 +89,9 @@ SwapLongs (register CARD32 *list, regist
 
 /* Byte swap a list of shorts */
 _X_EXPORT void
-SwapShorts (register short *list, register unsigned long count)
+SwapShorts (short *list, unsigned long count)
 {
-	register char n;
+	char n;
 
 	while (count >= 16) {
 	    swaps(list+0, n);
@@ -124,9 +124,9 @@ SwapShorts (register short *list, regist
 /* The following is used for all requests that have
    no fields to be swapped (except "length") */
 int
-SProcSimpleReq(register ClientPtr client)
+SProcSimpleReq(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xReq);
     swaps(&stuff->length, n);
@@ -137,9 +137,9 @@ SProcSimpleReq(register ClientPtr client
    only a single 32-bit field to be swapped, coming
    right after the "length" field */
 int
-SProcResourceReq(register ClientPtr client)
+SProcResourceReq(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xResourceReq);
     swaps(&stuff->length, n);
@@ -149,9 +149,9 @@ SProcResourceReq(register ClientPtr clie
 }
 
 int
-SProcCreateWindow(register ClientPtr client)
+SProcCreateWindow(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xCreateWindowReq);
     swaps(&stuff->length, n);
@@ -171,9 +171,9 @@ SProcCreateWindow(register ClientPtr cli
 }
 
 int
-SProcChangeWindowAttributes(register ClientPtr client)
+SProcChangeWindowAttributes(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xChangeWindowAttributesReq);
     swaps(&stuff->length, n);
@@ -185,9 +185,9 @@ SProcChangeWindowAttributes(register Cli
 }
 
 int
-SProcReparentWindow(register ClientPtr client)
+SProcReparentWindow(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xReparentWindowReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xReparentWindowReq);
@@ -199,9 +199,9 @@ SProcReparentWindow(register ClientPtr c
 }
 
 int
-SProcConfigureWindow(register ClientPtr client)
+SProcConfigureWindow(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xConfigureWindowReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
@@ -214,9 +214,9 @@ SProcConfigureWindow(register ClientPtr 
 
 
 int
-SProcInternAtom(register ClientPtr client)
+SProcInternAtom(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xInternAtomReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xInternAtomReq);
@@ -225,9 +225,9 @@ SProcInternAtom(register ClientPtr clien
 }
 
 int
-SProcChangeProperty(register ClientPtr client)
+SProcChangeProperty(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangePropertyReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
@@ -249,9 +249,9 @@ SProcChangeProperty(register ClientPtr c
 }
 
 int 
-SProcDeleteProperty(register ClientPtr client)
+SProcDeleteProperty(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xDeletePropertyReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xDeletePropertyReq);
@@ -262,9 +262,9 @@ SProcDeleteProperty(register ClientPtr c
 }
 
 int 
-SProcGetProperty(register ClientPtr client)
+SProcGetProperty(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGetPropertyReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGetPropertyReq);
@@ -277,9 +277,9 @@ SProcGetProperty(register ClientPtr clie
 }
 
 int
-SProcSetSelectionOwner(register ClientPtr client)
+SProcSetSelectionOwner(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetSelectionOwnerReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
@@ -290,9 +290,9 @@ SProcSetSelectionOwner(register ClientPt
 }
 
 int
-SProcConvertSelection(register ClientPtr client)
+SProcConvertSelection(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xConvertSelectionReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xConvertSelectionReq);
@@ -305,9 +305,9 @@ SProcConvertSelection(register ClientPtr
 }
 
 int
-SProcSendEvent(register ClientPtr client)
+SProcSendEvent(ClientPtr client)
 {
-    register char n;
+    char n;
     xEvent eventT;
     EventSwapPtr proc;
     REQUEST(xSendEventReq);
@@ -327,9 +327,9 @@ SProcSendEvent(register ClientPtr client
 }
 
 int
-SProcGrabPointer(register ClientPtr client)
+SProcGrabPointer(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGrabPointerReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGrabPointerReq);
@@ -342,9 +342,9 @@ SProcGrabPointer(register ClientPtr clie
 }
 
 int
-SProcGrabButton(register ClientPtr client)
+SProcGrabButton(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGrabButtonReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGrabButtonReq);
@@ -357,9 +357,9 @@ SProcGrabButton(register ClientPtr clien
 }
 
 int
-SProcUngrabButton(register ClientPtr client)
+SProcUngrabButton(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xUngrabButtonReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xUngrabButtonReq);
@@ -369,9 +369,9 @@ SProcUngrabButton(register ClientPtr cli
 }
 
 int
-SProcChangeActivePointerGrab(register ClientPtr client)
+SProcChangeActivePointerGrab(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangeActivePointerGrabReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
@@ -382,9 +382,9 @@ SProcChangeActivePointerGrab(register Cl
 }
 
 int
-SProcGrabKeyboard(register ClientPtr client)
+SProcGrabKeyboard(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGrabKeyboardReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGrabKeyboardReq);
@@ -394,9 +394,9 @@ SProcGrabKeyboard(register ClientPtr cli
 }
 
 int
-SProcGrabKey(register ClientPtr client)
+SProcGrabKey(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGrabKeyReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGrabKeyReq);
@@ -406,9 +406,9 @@ SProcGrabKey(register ClientPtr client)
 }
 
 int
-SProcUngrabKey(register ClientPtr client)
+SProcUngrabKey(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xUngrabKeyReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xUngrabKeyReq);
@@ -418,9 +418,9 @@ SProcUngrabKey(register ClientPtr client
 }
 
 int
-SProcGetMotionEvents(register ClientPtr client)
+SProcGetMotionEvents(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGetMotionEventsReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGetMotionEventsReq);
@@ -431,9 +431,9 @@ SProcGetMotionEvents(register ClientPtr 
 }
 
 int
-SProcTranslateCoords(register ClientPtr client)
+SProcTranslateCoords(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xTranslateCoordsReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xTranslateCoordsReq);
@@ -445,9 +445,9 @@ SProcTranslateCoords(register ClientPtr 
 }
 
 int
-SProcWarpPointer(register ClientPtr client)
+SProcWarpPointer(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xWarpPointerReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xWarpPointerReq);
@@ -463,9 +463,9 @@ SProcWarpPointer(register ClientPtr clie
 }
 
 int
-SProcSetInputFocus(register ClientPtr client)
+SProcSetInputFocus(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetInputFocusReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xSetInputFocusReq);
@@ -475,9 +475,9 @@ SProcSetInputFocus(register ClientPtr cl
 }
 
 int
-SProcOpenFont(register ClientPtr client)
+SProcOpenFont(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xOpenFontReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xOpenFontReq);
@@ -487,9 +487,9 @@ SProcOpenFont(register ClientPtr client)
 }
 
 int
-SProcListFonts(register ClientPtr client)
+SProcListFonts(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xListFontsReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xListFontsReq);
@@ -499,9 +499,9 @@ SProcListFonts(register ClientPtr client
 }
 
 int
-SProcListFontsWithInfo(register ClientPtr client)
+SProcListFontsWithInfo(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xListFontsWithInfoReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
@@ -511,9 +511,9 @@ SProcListFontsWithInfo(register ClientPt
 }
 
 int
-SProcSetFontPath(register ClientPtr client)
+SProcSetFontPath(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetFontPathReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
@@ -522,9 +522,9 @@ SProcSetFontPath(register ClientPtr clie
 }
 
 int
-SProcCreatePixmap(register ClientPtr client)
+SProcCreatePixmap(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCreatePixmapReq);
 
     swaps(&stuff->length, n);
@@ -537,9 +537,9 @@ SProcCreatePixmap(register ClientPtr cli
 }
 
 int
-SProcCreateGC(register ClientPtr client)
+SProcCreateGC(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCreateGCReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xCreateGCReq);
@@ -551,9 +551,9 @@ SProcCreateGC(register ClientPtr client)
 }
 
 int
-SProcChangeGC(register ClientPtr client)
+SProcChangeGC(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangeGCReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xChangeGCReq);
@@ -564,9 +564,9 @@ SProcChangeGC(register ClientPtr client)
 }
 
 int
-SProcCopyGC(register ClientPtr client)
+SProcCopyGC(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCopyGCReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCopyGCReq);
@@ -577,9 +577,9 @@ SProcCopyGC(register ClientPtr client)
 }
 
 int
-SProcSetDashes(register ClientPtr client)
+SProcSetDashes(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetDashesReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xSetDashesReq);
@@ -591,9 +591,9 @@ SProcSetDashes(register ClientPtr client
 }
 
 int
-SProcSetClipRectangles(register ClientPtr client)
+SProcSetClipRectangles(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetClipRectanglesReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
@@ -605,9 +605,9 @@ SProcSetClipRectangles(register ClientPt
 }
 
 int
-SProcClearToBackground(register ClientPtr client)
+SProcClearToBackground(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xClearAreaReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xClearAreaReq);
@@ -620,9 +620,9 @@ SProcClearToBackground(register ClientPt
 }
 
 int
-SProcCopyArea(register ClientPtr client)
+SProcCopyArea(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCopyAreaReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCopyAreaReq);
@@ -639,9 +639,9 @@ SProcCopyArea(register ClientPtr client)
 }
 
 int
-SProcCopyPlane(register ClientPtr client)
+SProcCopyPlane(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCopyPlaneReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCopyPlaneReq);
@@ -661,9 +661,9 @@ SProcCopyPlane(register ClientPtr client
 /* The following routine is used for all Poly drawing requests
    (except FillPoly, which uses a different request format) */
 int
-SProcPoly(register ClientPtr client)
+SProcPoly(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xPolyPointReq);
     swaps(&stuff->length, n);
@@ -678,9 +678,9 @@ SProcPoly(register ClientPtr client)
    is longer than xPolyPointReq, and we don't want to swap
    the difference as shorts! */
 int
-SProcFillPoly(register ClientPtr client)
+SProcFillPoly(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xFillPolyReq);
     swaps(&stuff->length, n);
@@ -692,9 +692,9 @@ SProcFillPoly(register ClientPtr client)
 }
 
 int
-SProcPutImage(register ClientPtr client)
+SProcPutImage(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xPutImageReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xPutImageReq);
@@ -710,9 +710,9 @@ SProcPutImage(register ClientPtr client)
 }
 
 int
-SProcGetImage(register ClientPtr client)
+SProcGetImage(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xGetImageReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xGetImageReq);
@@ -728,9 +728,9 @@ SProcGetImage(register ClientPtr client)
 /* ProcPolyText used for both PolyText8 and PolyText16 */
 
 int
-SProcPolyText(register ClientPtr client)
+SProcPolyText(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xPolyTextReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xPolyTextReq);
@@ -744,9 +744,9 @@ SProcPolyText(register ClientPtr client)
 /* ProcImageText used for both ImageText8 and ImageText16 */
 
 int
-SProcImageText(register ClientPtr client)
+SProcImageText(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xImageTextReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xImageTextReq);
@@ -758,9 +758,9 @@ SProcImageText(register ClientPtr client
 }
 
 int
-SProcCreateColormap(register ClientPtr client)
+SProcCreateColormap(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCreateColormapReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCreateColormapReq);
@@ -772,9 +772,9 @@ SProcCreateColormap(register ClientPtr c
 
 
 int
-SProcCopyColormapAndFree(register ClientPtr client)
+SProcCopyColormapAndFree(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCopyColormapAndFreeReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
@@ -785,9 +785,9 @@ SProcCopyColormapAndFree(register Client
 }
 
 int
-SProcAllocColor(register ClientPtr client)
+SProcAllocColor(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xAllocColorReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xAllocColorReq);
@@ -799,9 +799,9 @@ SProcAllocColor(register ClientPtr clien
 }
 
 int
-SProcAllocNamedColor(register ClientPtr client)
+SProcAllocNamedColor(ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xAllocNamedColorReq);
     swaps(&stuff->length, n);
@@ -812,9 +812,9 @@ SProcAllocNamedColor(register ClientPtr 
 }
 
 int
-SProcAllocColorCells(register ClientPtr client)
+SProcAllocColorCells(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xAllocColorCellsReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xAllocColorCellsReq);
@@ -825,9 +825,9 @@ SProcAllocColorCells(register ClientPtr 
 }
 
 int
-SProcAllocColorPlanes(register ClientPtr client)
+SProcAllocColorPlanes(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xAllocColorPlanesReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
@@ -840,9 +840,9 @@ SProcAllocColorPlanes(register ClientPtr
 }
 
 int
-SProcFreeColors(register ClientPtr client)
+SProcFreeColors(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xFreeColorsReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
@@ -856,7 +856,7 @@ SProcFreeColors(register ClientPtr clien
 _X_EXPORT void
 SwapColorItem(xColorItem *pItem)
 {
-    register char n;
+    char n;
 
     swapl(&pItem->pixel, n);
     swaps(&pItem->red, n);
@@ -865,9 +865,9 @@ SwapColorItem(xColorItem *pItem)
 }
 
 int
-SProcStoreColors(register ClientPtr client)
+SProcStoreColors(ClientPtr client)
 {
-    register char n;
+    char n;
     long count;
     xColorItem 	*pItem;
 
@@ -882,9 +882,9 @@ SProcStoreColors(register ClientPtr clie
 }
 
 int
-SProcStoreNamedColor (register ClientPtr client)
+SProcStoreNamedColor (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xStoreNamedColorReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
@@ -895,9 +895,9 @@ SProcStoreNamedColor (register ClientPtr
 }
 
 int
-SProcQueryColors (register ClientPtr client)
+SProcQueryColors (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xQueryColorsReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
@@ -907,9 +907,9 @@ SProcQueryColors (register ClientPtr cli
 } 
 
 int
-SProcLookupColor (register ClientPtr client)
+SProcLookupColor (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xLookupColorReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xLookupColorReq);
@@ -919,9 +919,9 @@ SProcLookupColor (register ClientPtr cli
 }
 
 int
-SProcCreateCursor (register ClientPtr client)
+SProcCreateCursor (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCreateCursorReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCreateCursorReq);
@@ -940,9 +940,9 @@ SProcCreateCursor (register ClientPtr cl
 }
 
 int
-SProcCreateGlyphCursor (register ClientPtr client)
+SProcCreateGlyphCursor (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xCreateGlyphCursorReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
@@ -962,9 +962,9 @@ SProcCreateGlyphCursor (register ClientP
 
 
 int
-SProcRecolorCursor (register ClientPtr client)
+SProcRecolorCursor (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xRecolorCursorReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xRecolorCursorReq);
@@ -979,9 +979,9 @@ SProcRecolorCursor (register ClientPtr c
 }
 
 int
-SProcQueryBestSize (register ClientPtr client)
+SProcQueryBestSize (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xQueryBestSizeReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xQueryBestSizeReq);
@@ -993,9 +993,9 @@ SProcQueryBestSize (register ClientPtr c
 }
 
 int
-SProcQueryExtension (register ClientPtr client)
+SProcQueryExtension (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xQueryExtensionReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
@@ -1004,9 +1004,9 @@ SProcQueryExtension (register ClientPtr 
 }
 
 int
-SProcChangeKeyboardMapping (register ClientPtr client)
+SProcChangeKeyboardMapping (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangeKeyboardMappingReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
@@ -1016,9 +1016,9 @@ SProcChangeKeyboardMapping (register Cli
 
 
 int
-SProcChangeKeyboardControl (register ClientPtr client)
+SProcChangeKeyboardControl (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangeKeyboardControlReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
@@ -1028,9 +1028,9 @@ SProcChangeKeyboardControl (register Cli
 }
 
 int
-SProcChangePointerControl (register ClientPtr client)
+SProcChangePointerControl (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xChangePointerControlReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xChangePointerControlReq);
@@ -1042,9 +1042,9 @@ SProcChangePointerControl (register Clie
 
 
 int
-SProcSetScreenSaver (register ClientPtr client)
+SProcSetScreenSaver (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xSetScreenSaverReq);
     swaps(&stuff->length, n);
     REQUEST_SIZE_MATCH(xSetScreenSaverReq);
@@ -1054,9 +1054,9 @@ SProcSetScreenSaver (register ClientPtr 
 }
 
 int
-SProcChangeHosts (register ClientPtr client)
+SProcChangeHosts (ClientPtr client)
 {
-    register char n;
+    char n;
 
     REQUEST(xChangeHostsReq);
     swaps(&stuff->length, n);
@@ -1066,9 +1066,9 @@ SProcChangeHosts (register ClientPtr cli
 
 }
 
-int SProcRotateProperties (register ClientPtr client)
+int SProcRotateProperties (ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xRotatePropertiesReq);
     swaps(&stuff->length, n);
     REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
@@ -1080,9 +1080,9 @@ int SProcRotateProperties (register Clie
 }
 
 int
-SProcNoOperation(register ClientPtr client)
+SProcNoOperation(ClientPtr client)
 {
-    register char n;
+    char n;
     REQUEST(xReq);
     swaps(&stuff->length, n);
     return ((* ProcVector[X_NoOperation])(client));
@@ -1091,7 +1091,7 @@ SProcNoOperation(register ClientPtr clie
 void
 SwapConnClientPrefix(xConnClientPrefix *pCCP)
 {
-    register char n;
+    char n;
 
     swaps(&pCCP->majorVersion, n);
     swaps(&pCCP->minorVersion, n);
diff --git a/dix/window.c b/dix/window.c
index e33140d..2a82f2e 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -220,10 +220,10 @@ PrintWindowTree(void)
 #endif
 
 _X_EXPORT int
-TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data)
+TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data)
 {
-    register int result;
-    register WindowPtr pChild;
+    int result;
+    WindowPtr pChild;
 
     if (!(pChild = pWin))
        return(WT_NOMATCH);
@@ -269,7 +269,7 @@ Bool	enableBackingStore = FALSE;
 Bool	disableSaveUnders = FALSE;
 
 static void
-SetWindowToDefaults(register WindowPtr pWin)
+SetWindowToDefaults(WindowPtr pWin)
 {
     pWin->prevSib = NullWindow;
     pWin->firstChild = NullWindow;
@@ -313,8 +313,8 @@ MakeRootTile(WindowPtr pWin)
     GCPtr pGC;
     unsigned char back[128];
     int len = BitmapBytePad(sizeof(long));
-    register unsigned char *from, *to;
-    register int i, j;
+    unsigned char *from, *to;
+    int i, j;
 
     pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
 						    pScreen->rootDepth);
@@ -353,11 +353,11 @@ WindowPtr
 AllocateWindow(ScreenPtr pScreen)
 {
     WindowPtr pWin;
-    register char *ptr;
-    register DevUnion *ppriv;
-    register unsigned *sizes;
-    register unsigned size;
-    register int i;
+    char *ptr;
+    DevUnion *ppriv;
+    unsigned *sizes;
+    unsigned size;
+    int i;
 
     pWin = (WindowPtr)xalloc(pScreen->totalWindowSize);
     if (pWin)
@@ -540,9 +540,9 @@ InitRootWindow(WindowPtr pWin)
  */
 
 void
-ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn,
-                     register int x, register int y,
-                     register int w, register int h)
+ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
+                     int x, int y,
+                     int w, int h)
 {
     ScreenPtr pScreen;
     BoxRec box;
@@ -579,7 +579,7 @@ RegisterRealChildHeadProc (RealChildHead
 
 
 WindowPtr
-RealChildHead(register WindowPtr pWin)
+RealChildHead(WindowPtr pWin)
 {
     if (realChildHeadProc) {
 	return realChildHeadProc (pWin);
@@ -599,19 +599,19 @@ RealChildHead(register WindowPtr pWin)
  *****/
 
 _X_EXPORT WindowPtr
-CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w,
-             unsigned h, unsigned bw, unsigned class, register Mask vmask, XID *vlist,
+CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
+             unsigned h, unsigned bw, unsigned class, Mask vmask, XID *vlist,
              int depth, ClientPtr client, VisualID visual, int *error)
 {
-    register WindowPtr pWin;
+    WindowPtr pWin;
     WindowPtr pHead;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     xEvent event;
     int idepth, ivisual;
     Bool fOK;
     DepthPtr pDepth;
     PixmapFormatRec *format;
-    register WindowOptPtr ancwopt;
+    WindowOptPtr ancwopt;
 
     if (class == CopyFromParent)
 	class = pParent->drawable.class;
@@ -836,9 +836,9 @@ CreateWindow(Window wid, register Window
 }
 
 static void
-FreeWindowResources(register WindowPtr pWin)
+FreeWindowResources(WindowPtr pWin)
 {
-    register ScreenPtr pScreen = pWin->drawable.pScreen;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
 
     DeleteWindowFromAnySaveSet(pWin);
     DeleteWindowFromAnySelections(pWin);
@@ -869,7 +869,7 @@ FreeWindowResources(register WindowPtr p
 static void
 CrushTree(WindowPtr pWin)
 {
-    register WindowPtr pChild, pSib, pParent;
+    WindowPtr pChild, pSib, pParent;
     UnrealizeWindowProcPtr UnrealizeWindow;
     xEvent event;
 
@@ -926,8 +926,8 @@ CrushTree(WindowPtr pWin)
 int
 DeleteWindow(pointer value, XID wid)
  {
-    register WindowPtr pParent;
-    register WindowPtr pWin = (WindowPtr)value;
+    WindowPtr pParent;
+    WindowPtr pWin = (WindowPtr)value;
     xEvent event;
 
     UnmapWindow(pWin, FALSE);
@@ -959,7 +959,7 @@ DeleteWindow(pointer value, XID wid)
 }
 
 void
-DestroySubwindows(register WindowPtr pWin, ClientPtr client)
+DestroySubwindows(WindowPtr pWin, ClientPtr client)
 {
     /* XXX
      * The protocol is quite clear that each window should be
@@ -986,10 +986,10 @@ DestroySubwindows(register WindowPtr pWi
  *****/
  
 _X_EXPORT int
-ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
+ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
 {
-    register Mask index2;
-    register XID *pVlist;
+    Mask index2;
+    XID *pVlist;
     PixmapPtr pPixmap;
     Pixmap pixID;
     CursorPtr pCursor, pOldCursor;
@@ -999,9 +999,9 @@ ChangeWindowAttributes(register WindowPt
     ColormapPtr	pCmap;
     xEvent xE;
     int result;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     Mask vmaskCopy = 0;
-    register Mask tmask;
+    Mask tmask;
     unsigned int val;
     int error;
     Bool checkOptional = FALSE;
@@ -1520,7 +1520,7 @@ PatchUp:
  *****/
 
 void
-GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa)
+GetWindowAttributes(WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa)
 {
     wa->type = X_Reply;
     wa->bitGravity = pWin->bitGravity;
@@ -1556,9 +1556,9 @@ GetWindowAttributes(register WindowPtr p
 
 
 _X_EXPORT WindowPtr
-MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib)
+MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib)
 {
-    register WindowPtr pParent = pWin->parent;
+    WindowPtr pParent = pWin->parent;
     WindowPtr pFirstChange = pWin; /* highest window where list changes */
 
     if (pWin->nextSib != pNextSib)
@@ -1640,7 +1640,7 @@ MoveWindowInStack(register WindowPtr pWi
 }
 
 _X_EXPORT RegionPtr
-CreateUnclippedWinSize (register WindowPtr pWin)
+CreateUnclippedWinSize (WindowPtr pWin)
 {
     RegionPtr	pRgn;
     BoxRec	box;
@@ -1668,7 +1668,7 @@ CreateUnclippedWinSize (register WindowP
 }
 
 _X_EXPORT void
-SetWinSize (register WindowPtr pWin)
+SetWinSize (WindowPtr pWin)
 {
 #ifdef COMPOSITE
     if (pWin->redirectDraw)
@@ -1707,7 +1707,7 @@ SetWinSize (register WindowPtr pWin)
 }
 
 _X_EXPORT void
-SetBorderSize (register WindowPtr pWin)
+SetBorderSize (WindowPtr pWin)
 {
     int	bw;
 
@@ -1759,9 +1759,9 @@ SetBorderSize (register WindowPtr pWin)
  */
 
 _X_EXPORT void
-GravityTranslate (register int x, register int y, int oldx, int oldy,
+GravityTranslate (int x, int y, int oldx, int oldy,
                   int dw, int dh, unsigned gravity,
-                  register int *destx, register int *desty)
+                  int *destx, int *desty)
 {
     switch (gravity) {
     case NorthGravity:
@@ -1809,10 +1809,10 @@ GravityTranslate (register int x, regist
 
 /* XXX need to retile border on each window with ParentRelative origin */
 _X_EXPORT void
-ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
+ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
 {
-    register ScreenPtr pScreen;
-    register WindowPtr pSib, pChild;
+    ScreenPtr pScreen;
+    WindowPtr pSib, pChild;
     Bool resized = (dw || dh);
 
     pScreen = pWin->drawable.pScreen;
@@ -1904,10 +1904,10 @@ ResizeChildrenWinSize(register WindowPtr
 
 static int
 IsSiblingAboveMe(
-    register WindowPtr pMe,
-    register WindowPtr pSib)
+    WindowPtr pMe,
+    WindowPtr pSib)
 {
-    register WindowPtr pWin;
+    WindowPtr pWin;
 
     pWin = pMe->parent->firstChild;
     while (pWin)
@@ -1923,8 +1923,8 @@ IsSiblingAboveMe(
 
 static BoxPtr
 WindowExtents(
-    register WindowPtr pWin,
-    register BoxPtr pBox)
+    WindowPtr pWin,
+    BoxPtr pBox)
 {
     pBox->x1 = pWin->drawable.x - wBorderWidth (pWin);
     pBox->y1 = pWin->drawable.y - wBorderWidth (pWin);
@@ -1940,7 +1940,7 @@ WindowExtents(
 
 static RegionPtr
 MakeBoundingRegion (
-    register WindowPtr	pWin,
+    WindowPtr	pWin,
     BoxPtr	pBox)
 {
     RegionPtr	pRgn;
@@ -1966,7 +1966,7 @@ ShapeOverlap (
     BoxPtr	pSibBox)
 {
     RegionPtr	pWinRgn, pSibRgn;
-    register ScreenPtr	pScreen;
+    ScreenPtr	pScreen;
     Bool	ret;
 
     if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib))
@@ -1986,11 +1986,11 @@ static Bool
 AnyWindowOverlapsMe(
     WindowPtr pWin,
     WindowPtr pHead,
-    register BoxPtr box)
+    BoxPtr box)
 {
-    register WindowPtr pSib;
+    WindowPtr pSib;
     BoxRec sboxrec;
-    register BoxPtr sbox;
+    BoxPtr sbox;
 
     for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib)
     {
@@ -2011,11 +2011,11 @@ AnyWindowOverlapsMe(
 static Bool
 IOverlapAnyWindow(
     WindowPtr pWin,
-    register BoxPtr box)
+    BoxPtr box)
 {
-    register WindowPtr pSib;
+    WindowPtr pSib;
     BoxRec sboxrec;
-    register BoxPtr sbox;
+    BoxPtr sbox;
 
     for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib)
     {
@@ -2063,8 +2063,8 @@ IOverlapAnyWindow(
 
 static WindowPtr
 WhereDoIGoInTheStack(
-    register WindowPtr pWin,
-    register WindowPtr pSib,
+    WindowPtr pWin,
+    WindowPtr pSib,
     short x,
     short y,
     unsigned short w,
@@ -2072,7 +2072,7 @@ WhereDoIGoInTheStack(
     int smode)
 {
     BoxRec box;
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     WindowPtr pHead, pFirst;
 
     if ((pWin == pWin->parent->firstChild) &&
@@ -2169,8 +2169,8 @@ WhereDoIGoInTheStack(
 
 static void
 ReflectStackChange(
-    register WindowPtr pWin,
-    register WindowPtr pSib,
+    WindowPtr pWin,
+    WindowPtr pSib,
     VTKind  kind)
 {
 /* Note that pSib might be NULL */
@@ -2222,17 +2222,17 @@ ReflectStackChange(
  *****/
 
 int
-ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client)
+ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 {
 #define RESTACK_WIN    0
 #define MOVE_WIN       1
 #define RESIZE_WIN     2
 #define REBORDER_WIN   3
-    register WindowPtr pSib = NullWindow;
-    register WindowPtr pParent = pWin->parent;
+    WindowPtr pSib = NullWindow;
+    WindowPtr pParent = pWin->parent;
     Window sibwid = 0;
     Mask index2, tmask;
-    register XID *pVlist;
+    XID *pVlist;
     short x,   y, beforeX, beforeY;
     unsigned short w = pWin->drawable.width,
 		   h = pWin->drawable.height,
@@ -2509,7 +2509,7 @@ ActuallyDoSomething:
 int
 CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
 {
-    register WindowPtr pWin, pHead, pFirst;
+    WindowPtr pWin, pHead, pFirst;
     xEvent event;
     BoxRec box;
 
@@ -2579,14 +2579,14 @@ CompareWIDs(
  *****/
 
 int
-ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
+ReparentWindow(WindowPtr pWin, WindowPtr pParent,
                int x, int y, ClientPtr client)
 {
     WindowPtr pPrev, pPriorParent;
     Bool WasMapped = (Bool)(pWin->mapped);
     xEvent event;
     int bw = wBorderWidth (pWin);
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
 
     pScreen = pWin->drawable.pScreen;
     if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING)
@@ -2673,7 +2673,7 @@ ReparentWindow(register WindowPtr pWin, 
 static void
 RealizeTree(WindowPtr pWin)
 {
-    register WindowPtr pChild;
+    WindowPtr pChild;
     RealizeWindowProcPtr Realize;
 
     Realize = pWin->drawable.pScreen->RealizeWindow;
@@ -2712,11 +2712,11 @@ RealizeTree(WindowPtr pWin)
  *****/
 
 _X_EXPORT int
-MapWindow(register WindowPtr pWin, ClientPtr client)
+MapWindow(WindowPtr pWin, ClientPtr client)
 {
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
 
-    register WindowPtr pParent;
+    WindowPtr pParent;
 #ifdef DO_SAVE_UNDERS
     Bool	dosave = FALSE;
 #endif
@@ -2832,18 +2832,18 @@ MapWindow(register WindowPtr pWin, Clien
  *****/
 
 void
-MapSubwindows(register WindowPtr pParent, ClientPtr client)
+MapSubwindows(WindowPtr pParent, ClientPtr client)
 {
-    register WindowPtr	pWin;
-    WindowPtr		pFirstMapped = NullWindow;
+    WindowPtr	pWin;
+    WindowPtr	pFirstMapped = NullWindow;
 #ifdef DO_SAVE_UNDERS
-    WindowPtr		pFirstSaveUndered = NullWindow;
+    WindowPtr	pFirstSaveUndered = NullWindow;
 #endif
-    register ScreenPtr	pScreen;
-    register Mask	parentRedirect;
-    register Mask	parentNotify;
-    xEvent		event;
-    Bool		anyMarked;
+    ScreenPtr	pScreen;
+    Mask	parentRedirect;
+    Mask	parentNotify;
+    xEvent	event;
+    Bool	anyMarked;
 #ifdef DO_SAVE_UNDERS
     Bool	dosave = FALSE;
 #endif
@@ -2952,7 +2952,7 @@ UnrealizeTree(
     WindowPtr pWin,
     Bool fromConfigure)
 {
-    register WindowPtr pChild;
+    WindowPtr pChild;
     UnrealizeWindowProcPtr Unrealize;
     MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
 
@@ -3011,9 +3011,9 @@ UnrealizeTree(
  *****/
 
 _X_EXPORT int
-UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
+UnmapWindow(WindowPtr pWin, Bool fromConfigure)
 {
-    register WindowPtr pParent;
+    WindowPtr pParent;
     xEvent event;
     Bool wasRealized = (Bool)pWin->realized;
     Bool wasViewable = (Bool)pWin->viewable;
@@ -3070,9 +3070,9 @@ UnmapWindow(register WindowPtr pWin, Boo
  *****/
 
 void
-UnmapSubwindows(register WindowPtr pWin)
+UnmapSubwindows(WindowPtr pWin)
 {
-    register WindowPtr pChild, pHead;
+    WindowPtr pChild, pHead;
     xEvent event;
     Bool wasRealized = (Bool)pWin->realized;
     Bool wasViewable = (Bool)pWin->viewable;
@@ -3161,10 +3161,10 @@ UnmapSubwindows(register WindowPtr pWin)
 
 
 void
-HandleSaveSet(register ClientPtr client)
+HandleSaveSet(ClientPtr client)
 {
-    register WindowPtr pParent, pWin;
-    register int j;
+    WindowPtr pParent, pWin;
+    int j;
 
     for (j=0; j<client->numSaved; j++)
     {
@@ -3207,7 +3207,7 @@ HandleSaveSet(register ClientPtr client)
  *  \param box  "return" value
  */
 Bool
-VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box)
+VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box)
 {
     if (!pWin->realized)
 	return (FALSE);
@@ -3221,7 +3221,7 @@ VisibleBoundingBoxFromPoint(register Win
  * \param x,y  in root
  */
 Bool
-PointInWindowIsVisible(register WindowPtr pWin, int x, int y)
+PointInWindowIsVisible(WindowPtr pWin, int x, int y)
 {
     BoxRec box;
 
@@ -3240,9 +3240,9 @@ PointInWindowIsVisible(register WindowPt
 
 
 _X_EXPORT RegionPtr
-NotClippedByChildren(register WindowPtr pWin)
+NotClippedByChildren(WindowPtr pWin)
 {
-    register ScreenPtr pScreen;
+    ScreenPtr pScreen;
     RegionPtr pReg;
 
     pScreen = pWin->drawable.pScreen;
@@ -3588,7 +3588,7 @@ TileScreenSaver(int i, int kind)
  */
 
 _X_EXPORT WindowPtr
-FindWindowWithOptional (register WindowPtr w)
+FindWindowWithOptional (WindowPtr w)
 {
     do
 	w = w->parent;
@@ -3605,10 +3605,10 @@ FindWindowWithOptional (register WindowP
  */
 
 _X_EXPORT void
-CheckWindowOptionalNeed (register WindowPtr w)
+CheckWindowOptionalNeed (WindowPtr w)
 {
-    register WindowOptPtr optional;
-    register WindowOptPtr parentOptional;
+    WindowOptPtr optional;
+    WindowOptPtr parentOptional;
 
     if (!w->parent)
 	return;
@@ -3659,10 +3659,10 @@ CheckWindowOptionalNeed (register Window
  */
 
 _X_EXPORT Bool
-MakeWindowOptional (register WindowPtr pWin)
+MakeWindowOptional (WindowPtr pWin)
 {
-    register WindowOptPtr optional;
-    register WindowOptPtr parentOptional;
+    WindowOptPtr optional;
+    WindowOptPtr parentOptional;
 
     if (pWin->optional)
 	return TRUE;
@@ -3701,7 +3701,7 @@ MakeWindowOptional (register WindowPtr p
 }
 
 void
-DisposeWindowOptional (register WindowPtr pWin)
+DisposeWindowOptional (WindowPtr pWin)
 {
     if (!pWin->optional)
 	return;
diff-tree 40ae4f246d8818410490236ab183204a84765629 (from b5fde366e2e21234ac0b81222fd5c42ca3e49cba)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Wed Mar 7 20:52:31 2007 -0800

    Remove stale monitor data when output becomes disconnected.
    
    Remove parsed EDID and EDID property from disconnected outputs.
    (cherry picked from commit ae9d5aa479dd50cc81b755079fcf96a0d02f135a)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 2794496..1a42920 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1158,7 +1158,10 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, 
 	output->status = (*output->funcs->detect)(output);
 
 	if (output->status == XF86OutputStatusDisconnected)
+	{
+	    xf86OutputSetEDID (output, NULL);
 	    continue;
+	}
 
 	memset (&mon_rec, '\0', sizeof (mon_rec));
 	
diff-tree b5fde366e2e21234ac0b81222fd5c42ca3e49cba (from a3d2c5d622d9ca36d6fa2966aff09524e3ea39ac)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Mar 7 12:29:55 2007 -0500

    Properly free device devPrivates - memory leak fix.

diff --git a/dix/devices.c b/dix/devices.c
index 9f42184..d5acb2d 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -494,6 +494,9 @@ CloseDevice(register DeviceIntPtr dev)
 	XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
 #endif
 
+    if (dev->devPrivates)
+	xfree(dev->devPrivates);
+
     xfree(dev->sync.event);
     xfree(dev);
 }
diff-tree a3d2c5d622d9ca36d6fa2966aff09524e3ea39ac (from e9bfb2b3d7dfaafd90d2ad0fa3d0e1acced4380b)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date:   Wed Mar 7 11:02:47 2007 -0500

    XORG_VERSION_CURRENT, not XF86_VERSION_CURRENT.
    
    If only this was the least wrong thing in this code.

diff --git a/hw/xfree86/i2c/uda1380_module.c b/hw/xfree86/i2c/uda1380_module.c
index 3844583..895f8c6 100644
--- a/hw/xfree86/i2c/uda1380_module.c
+++ b/hw/xfree86/i2c/uda1380_module.c
@@ -12,7 +12,7 @@ static XF86ModuleVersionInfo uda1380Vers
         MODULEVENDORSTRING,
         MODINFOSTRING1,
         MODINFOSTRING2,
-        XF86_VERSION_CURRENT,
+        XORG_VERSION_CURRENT,
         1, 0, 0,
         ABI_CLASS_VIDEODRV,             /* This needs the video driver ABI */
         ABI_VIDEODRV_VERSION,
diff-tree e9bfb2b3d7dfaafd90d2ad0fa3d0e1acced4380b (from 72a23d88d73a8c72ed18847b004db05092d3e7be)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Tue Mar 6 23:19:30 2007 -0800

    Add hw/xfree86/docs/README.modes, documenting new mode setting APIs.
    
    This document covers both API and xorg.conf usage of the new mode setting
    APIs.
    (cherry picked from commit a59c31b0f7b94ed1f395c7586c37ef5fe7ba2a25)

diff --git a/hw/xfree86/doc/README.modes b/hw/xfree86/doc/README.modes
new file mode 100644
index 0000000..894e213
--- /dev/null
+++ b/hw/xfree86/doc/README.modes
@@ -0,0 +1,474 @@
+		    Multi-monitor Mode Setting APIs
+	           Keith Packard, <keithp at keithp.com
+		   	   6 March 2007
+
+1. Introduction
+
+This document describes a set of mode setting APIs added in X server version
+1.3 that support multiple monitors per card. These interfaces expose the
+underlying hardware CRTC and output concepts to the xf86 DDX layer so that
+the implementation of initial server setup and mode changes through
+extensions can be shared across drivers. In addition, these new interfaces
+support a new configuration mechanism as well which allows each monitor to
+be customized separately providing a consistent cross-driver configuration
+mechanism that supports the full range of output features.
+
+All of the code implementing this interface can be found in hw/xfree86/modes
+in the X server sources.
+
+2. Overview
+
+This document describes both the driver API and the configuration data
+placed in xorg.conf; these are entirely separate as the driver has no
+interaction with the configuration information at all. Much of the structure
+here is cloned from the RandR extension version 1.2 additions which deal
+with the same kinds of information.
+
+2.1 API overview
+
+The mode setting API is expressed through two new driver-visible objects,
+the 'CRTC' (xf86CrtcRec) and the 'Output' (xf86OutputRec). A CRTC refers to
+hardware within the video system that can scan a subset of the framebuffer
+and generate a video signal. An Output receives that signal and transmits it
+to a monitor, projector or other device.
+
+The xf86CrtcRec and xf86OutputRec contain a small amount of state data
+related to the object along with a pointer to a set of functions provided by
+the driver that manipulate the object in fairly simple ways.
+
+To emulate older behaviour, one of the outputs is picked as the 'compat'
+output; this output changes over time as outputs are detected and used, the
+goal is to always have one 'special' output which is used for operations
+which need a single defined monitor (like XFree86-VidModeExtension mode
+setting, RandR 1.1 mode setting, DDC property setting, etc.).
+
+2.1.1 Output overview 
+
+As outputs are connected to monitors, they hold a list of modes supported by
+the monitor. If the monitor and output support DDC, then the list of modes
+generally comes from the EDID data in the monitor. Otherwise, the server
+uses the standard VESA modes, pruned by monitor timing. If the configuration
+file doesn't contain monitor timing data, the server uses default timing
+information which supports 640x480, 800x600 and 1024x768 all with a 60Hz
+refresh rate.
+
+As hardware often limits possible configuration combinations, each output
+knows the set of CRTCs that it can be connected to as well as the set of
+other outputs which can be simutaneously connected to a CRTC.
+
+2.1.2 CRTC overview
+
+CRTCs serve only to stream frame buffer data to outputs using a mode line.
+Ideally, they would not be presented to the user at all, and in fact the
+configuration file doesn't expose them. The RandR 1.2 protocol does, but the
+hope there is that client-side applications will hide them carefully away.
+
+Each crtc has an associated cursor, along with the current configuration.
+All of the data needed to determine valid configurations is contained within
+the Outputs.
+
+2.2 Configuration overview
+
+As outputs drive monitors, the "Monitor" section has been repurposed to
+define their configuration. This provides for a bit more syntax than
+the large list of driver-specific options that were used in the past for
+similar configuration.
+
+However, the existing "Monitor" section referenced by the active "Screen"
+section no longer has any use at all; some sensible meaning for this
+parameter is needed now that a Screen can have multiple Monitors.
+
+3. Public Functions
+
+3.1 PreInit functions
+
+These functions should be used during the driver PreInit phase, they are
+arranged in the order they should be invoked.
+
+    void
+    xf86CrtcConfigInit (ScrnInfoPtr			scrn
+			const xf86CrtcConfigFuncsRec	*funcs)
+
+This function allocates and initializes structures needed to track CRTC and
+Output state.
+
+    void
+    xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
+			  int minWidth, int minHeight,
+			  int maxWidth, int maxHeight)
+
+This sets the range of screen sizes supported by the driver.
+
+    xf86CrtcPtr
+    xf86CrtcCreate (ScrnInfoPtr             scrn,
+		    const xf86CrtcFuncsRec  *funcs)
+    
+Create one CRTC object. See the discussion below for a description of the
+contents of the xf86CrtcFuncsRec. Note that this is done in PreInit, so it
+should not be re-invoked at each server generation. Create one of these for
+each CRTC present in the hardware.
+    
+    xf86OutputPtr
+    xf86OutputCreate (ScrnInfoPtr              scrn,
+		      const xf86OutputFuncsRec *funcs,
+		      const char	       *name)
+
+Create one Output object. See the discussion below for a description of the
+contents of the xf86OutputFuncsRec. This is also called from PreInit and
+need not be re-invoked at each ScreenInit time. An Output should be created
+for every Output present in the hardware, not just for outputs which have
+detected monitors.
+    
+    Bool
+    xf86OutputRename (xf86OutputPtr output, const char *name)
+
+If necessary, the name of an output can be changed after it is created using
+this function.
+    
+    Bool
+    xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
+
+Using the resources provided, and the configuration specified by the user,
+this function computes an initial configuration for the server. It tries to
+enable as much hardware as possible using some fairly simple heuristics. 
+
+The 'canGrow' parameter indicates that the frame buffer does not have a fixed
+size (fixed size frame buffers are required by XAA). When the frame buffer
+has a fixed size, the configuration selects a 'reasonablely large' frame
+buffer so that common reconfiguration options are possible. For resizable
+frame buffers, the frame buffer is set to the smallest size that encloses
+the desired configuration.
+    
+3.2 ScreenInit functions
+
+These functions should be used during the driver ScreenInit phase.
+
+    Bool
+    xf86DiDGAInit (ScreenPtr screen, unsigned long dga_address)
+
+This function provides driver-independent accelerated DGA support for some
+of the DGA operations; using this, the driver can avoid needing to implement
+any of the rest of DGA.
+
+    Bool
+    xf86SaveScreen(ScreenPtr pScreen, int mode)
+
+Stick this in pScreen->SaveScreen and the core X screen saver will be
+implemented by disabling outputs and crtcs using their dpms functions.
+
+    void
+    xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags)
+
+Pass this function to xf86DPMSInit and all DPMS mode switching will be
+managed by using the dpms functions provided by the Outputs and CRTCs.
+
+    Bool
+    xf86CrtcScreenInit (ScreenPtr screen)
+
+This function completes the screen initialization process for the crtc and
+output objects. Call it near the end of the ScreenInit function, after the
+frame buffer and acceleration layers have been added.
+
+3.3 EnterVT functions
+
+Functions used during EnterVT, or whenever the current configuration needs
+to be applied to the hardware.
+
+    Bool
+    xf86SetDesiredModes (ScrnInfoPtr scrn)
+
+xf86InitialConfiguration selects the desired configuration at PreInit time;
+when the server finally hits ScreenInit, xf86SetDesiredModes is used by the
+driver to take that configuration and apply it to the hardware. In addition,
+successful mode selection at other times updates the configuration that will
+be used by this function, so LeaveVT/EnterVT pairs can simply invoke this
+and return to the previous configuration.
+
+3.4 SwitchMode functions
+
+Functions called from the pScrn->SwitchMode hook, which is used by the
+XFree86-VidModeExtension and the keypad mode switch commands.
+
+    Bool
+    xf86SetSingleMode (ScrnInfoPtr	scrn, 
+		       DisplayModePtr   desired,
+		       Rotation		rotation)
+
+This function applies the specified mode to all active outputs. Which is to
+say, it picks reasonable modes for all active outputs, attempting to get the
+screen to the specified size while not breaking anything that is currently
+working.
+
+3.7 get_modes functions
+
+Functions called during output->get_modes to help build lists of modes
+
+    xf86MonPtr
+    xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
+
+This returns the EDID data structure for the 'output' using the I2C bus
+'pDDCBus'. This has no effect on 'output' itself.
+
+    void
+    xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
+
+Once the EDID data has been fetched, this call applies the EDID data to the
+output object, setting the physical size and also various properties, like
+the DDC root window property (when output is the 'compat' output), and the
+RandR 1.2 EDID output properties.
+
+    DisplayModePtr
+    xf86OutputGetEDIDModes (xf86OutputPtr output)
+
+Given an EDID data structure, this function computes a list of suitable
+modes. This function also applies a sequence of 'quirks' during this process
+so that the returned modes may not actually match the mode data present in
+the EDID data.
+
+3.6 Other functions
+
+These remaining functions in the API can be used by the driver as needed.
+
+    Bool
+    xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+		     int x, int y)
+
+Applies a mode to a CRTC. All of the outputs which are currently using the
+specified CRTC are included in the mode setting process. 'x' and 'y' are the
+offset within the frame buffer that the crtc is placed at. No checking is
+done in this function to ensure that the mode is usable by the active
+outputs.
+    
+    void
+    xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY)
+
+This discards the mode lists for all outputs, re-detects monitor presence
+and then acquires new mode lists for all monitors which are not disconnected.
+Monitor configuration data is used to modify the mode lists returned by the
+outputs. 'maxX' and 'maxY' limit the maximum size modes that will be
+returned.
+    
+    void
+    xf86SetScrnInfoModes (ScrnInfoPtr pScrn)
+
+This copies the 'compat' output mode list into the pScrn modes list which is
+used by the XFree86-VidModeExtension and the keypad mode switching
+operations. The current 'desired' mode for the CRTC associated with the
+'compat' output is placed first in this list to indicate the current mode.
+Usually, the driver won't need to call this function as
+xf86InitialConfiguration will do so automatically, as well as any RandR
+functions which reprobe for modes. However, if the driver reprobes for modes
+at other times using xf86ProbeOutputModes, this function needs to be called.
+    
+    Bool
+    xf86DiDGAReInit (ScreenPtr pScreen)
+
+This is similar to xf86SetScrnInfoModes, but it applies the 'compat' output
+mode list to the set of modes advertised by the DGA extension; it needs to
+be called whenever xf86ProbeOutputModes is invoked.
+
+    void
+    xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
+
+After any sequence of calls using xf86CrtcSetMode, this function cleans up
+any leftover Output and CRTC objects by disabling them, saving power. It is
+safe to call this whenever the server is running as it only disables objects
+which are not currently in use.
+    
+4. CRTC operations
+
+4.1 CRTC functions
+
+These functions provide an abstract interface for the CRTC object; most
+manipulation of the CRTC object is done through these functions.
+
+    void
+    crtc->funcs->dpms (xf86CrtcPtr crtc, int mode)
+
+Where 'mode' is one of DPMSModeOff, DPMSModeSuspend, DPMSModeStandby or
+DPMSModeOn. This requests that the crtc go to the specified power state.
+When changing power states, the output dpms functions are invoked before the
+crtc dpms functions.
+
+    void
+    crtc->funcs->save (xf86CrtcPtr crtc)
+	
+    void
+    crtc->funcs->restore (xf86CrtcPtr crtc)
+
+Preserve/restore any register contents related to the CRTC. These are
+strictly a convenience for the driver writer; if the existing driver has
+fully operation save/restore functions, you need not place any additional
+code here. In particular, the server itself never uses this function.
+
+    Bool
+    crtc->funcs->lock (xf86CrtcPtr crtc)
+	
+    void
+    crtc->funcs->unlock (xf86CrtcPtr crtc)
+
+These functions are invoked around mode setting operations; the intent is
+that DRI locking be done here to prevent DRI applications from manipulating
+the hardware while the server is busy changing the output configuration. If
+the lock function returns FALSE, the unlock function will not be invoked.
+
+    Bool
+    crtc->funcs->mode_fixup (xf86CrtcPtr crtc, 
+			     DisplayModePtr mode,
+			     DisplayModePtr adjusted_mode)
+
+This call gives the CRTC a chance to see what mode will be set and to
+comment on the mode by changing 'adjusted_mode' as needed. This function
+shall not modify the state of the crtc hardware at all. If the CRTC cannot
+accept this mode, this function may return FALSE.
+
+    void
+    crtc->funcs->prepare (xf86CrtcPtr crtc)
+
+This call is made just before the mode is set to make the hardware ready for
+the operation. A usual function to perform here is to disable the crtc so
+that mode setting can occur with clocks turned off and outputs deactivated.
+
+    void
+    crtc->funcs->mode_set (xf86CrtcPtr crtc,
+			   DisplayModePtr mode,
+			   DisplayModePtr adjusted_mode)
+
+This function applies the specified mode (possibly adjusted by the CRTC
+and/or Outputs).
+
+    void
+    crtc->funcs->commit (xf86CrtcPtr crtc)
+
+Once the mode has been applied to the CRTC and Outputs, this function is
+invoked to let the hardware turn things back on.
+
+    void
+    crtc->funcs->gamma_set (xf86CrtcPtr crtc, CARD16 *red,
+			    CARD16 *green, CARD16 *blue, int size)
+
+This function adjusts the gamma ramps for the specified crtc.
+
+    void *
+    crtc->funcs->shadow_allocate (xf86CrtcPtr crtc, int width, int height)
+
+This function allocates frame buffer space for a shadow frame buffer. When
+allocated, the crtc must scan from the shadow instead of the main frame
+buffer. This is used for rotation. The address returned is passed to the
+shadow_create function. This function should return NULL on failure.
+
+    PixmapPtr
+    crtc->funcs->shadow_create (xf86CrtcPtr crtc, void *data,
+				int width, int height)
+
+This function creates a pixmap object that will be used as a shadow of the
+main frame buffer for CRTCs which are rotated or reflected. 'data' is the
+value returned by shadow_allocate.
+
+    void
+    crtc->funcs->shadow_destroy (xf86CrtcPtr crtc, PixmapPtr pPixmap,
+				 void *data)
+
+Destroys any associated shadow objects. If pPixmap is NULL, then a pixmap
+was not created, but 'data' may still be non-NULL indicating that the shadow
+had been allocated.
+
+    void
+    crtc->funcs->destroy (xf86CrtcPtr crtc)
+
+When a CRTC is destroyed (which only happens in error cases), this function
+can clean up any driver-specific data.
+
+4.2 CRTC fields
+
+The CRTC object is not opaque; there are several fields of interest to the
+driver writer.
+
+    struct _xf86Crtc {
+	/**
+	 * Associated ScrnInfo
+	 */
+	ScrnInfoPtr     scrn;
+    
+	/**
+	 * Active state of this CRTC
+	 *
+	 * Set when this CRTC is driving one or more outputs
+	 */
+	Bool            enabled;
+    
+	/** Track whether cursor is within CRTC range  */
+	Bool            cursorInRange;
+    
+	/** Track state of cursor associated with this CRTC */
+	Bool            cursorShown;
+    
+	/**
+	 * Active mode
+	 *
+	 * This reflects the mode as set in the CRTC currently
+	 * It will be cleared when the VT is not active or
+	 * during server startup
+	 */
+	DisplayModeRec  mode;
+	Rotation        rotation;
+	PixmapPtr       rotatedPixmap;
+	void            *rotatedData;
+    
+	/**
+	 * Position on screen
+	 *
+	 * Locates this CRTC within the frame buffer
+	 */
+	int             x, y;
+    
+	/**
+	 * Desired mode
+	 *
+	 * This is set to the requested mode, independent of
+	 * whether the VT is active. In particular, it receives
+	 * the startup configured mode and saves the active mode
+	 * on VT switch.
+	 */
+	DisplayModeRec  desiredMode;
+	Rotation        desiredRotation;
+	int             desiredX, desiredY;
+    
+	/** crtc-specific functions */
+	const xf86CrtcFuncsRec *funcs;
+    
+	/**
+	 * Driver private
+	 *
+	 * Holds driver-private information
+	 */
+	void            *driver_private;
+    #ifdef RANDR_12_INTERFACE
+	/**
+	 * RandR crtc
+	 *
+	 * When RandR 1.2 is available, this
+	 * points at the associated crtc object
+	 */
+	RRCrtcPtr       randr_crtc;
+    #else
+	void            *randr_crtc;
+    #endif
+    };
+
+    
+5. Output functions.
+
+6. Configuration
+
+Because the configuration file syntax is fixed,
+this was done by creating new "Driver" section options that hook specific
+outputs to specific "Monitor" sections in the file. The option:
+section of the form:
+
+	Option	"monitor-VGA" "My VGA Monitor"
+
+connects the VGA output of this driver to the "Monitor" section with
+Identifier "My VGA Monitor". All of the usual monitor options can now be
+placed in that "Monitor" section and will be applied to the VGA output
+configuration.
diff-tree 72a23d88d73a8c72ed18847b004db05092d3e7be (from 81526232bc0119d2ec7b8590be4f78cf066ae359)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Tue Mar 6 23:15:34 2007 -0800

    Add xf86CrtcScreenInit to share initialization across drivers.
    
    xf86CrtcScreenInit performs initialization that needs to happen at
    ScreenInit time.
    (cherry picked from commit 558a4f5588ad2ec11254e0b5d6ce9515b137369e)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 46515fd..2794496 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -545,6 +545,60 @@ xf86OutputDestroy (xf86OutputPtr output)
     xfree (output);
 }
 
+/*
+ * Called during CreateScreenResources to hook up RandR
+ */
+static Bool
+xf86CrtcCreateScreenResources (ScreenPtr screen)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
+
+    screen->CreateScreenResources = config->CreateScreenResources;
+    
+    if (!(*screen->CreateScreenResources)(screen))
+	return FALSE;
+
+    if (!xf86RandR12CreateScreenResources (screen))
+	return FALSE;
+
+    return TRUE;
+}
+
+/*
+ * Called at ScreenInit time to set up
+ */
+Bool
+xf86CrtcScreenInit (ScreenPtr screen)
+{
+    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    /* Rotation */
+    xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n");
+    xf86DisableRandR(); /* Disable old RandR extension support */
+    xf86RandR12Init (screen);
+
+    /* support all rotations if every crtc has the shadow alloc funcs */
+    for (c = 0; c < config->num_crtc; c++)
+    {
+	xf86CrtcPtr crtc = config->crtc[c];
+	if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create)
+	    break;
+    }
+    if (c == config->num_crtc)
+	xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 |
+				 RR_Rotate_180 | RR_Rotate_270);
+    else
+	xf86RandR12SetRotations (screen, RR_Rotate_0);
+    
+    /* Wrap CreateScreenResources so we can initialize the RandR code */
+    config->CreateScreenResources = screen->CreateScreenResources;
+    screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+    return TRUE;
+}
+
 static DisplayModePtr
 xf86DefaultMode (xf86OutputPtr output, int width, int height)
 {
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 062a2db..6152ae4 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -494,6 +494,7 @@ typedef struct _xf86CrtcConfig {
 
     const xf86CrtcConfigFuncsRec *funcs;
 
+    CreateScreenResourcesProcPtr    CreateScreenResources;
 } xf86CrtcConfigRec, *xf86CrtcConfigPtr;
 
 extern int xf86CrtcConfigPrivateIndex;
@@ -525,25 +526,6 @@ xf86CrtcDestroy (xf86CrtcPtr		crtc);
 
 
 /**
- * Allocate a crtc for the specified output
- *
- * Find a currently unused CRTC which is suitable for
- * the specified output
- */
-
-xf86CrtcPtr 
-xf86AllocCrtc (xf86OutputPtr		output);
-
-/**
- * Free a crtc
- *
- * Mark the crtc as unused by any outputs
- */
-
-void
-xf86FreeCrtc (xf86CrtcPtr		crtc);
-
-/**
  * Sets the given video mode on the given crtc
  */
 Bool
@@ -583,6 +565,9 @@ void
 xf86SetScrnInfoModes (ScrnInfoPtr pScrn);
 
 Bool
+xf86CrtcScreenInit (ScreenPtr pScreen);
+
+Bool
 xf86InitialConfiguration (ScrnInfoPtr pScrn, Bool canGrow);
 
 void
diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h
index eae6d64..9dcfef5 100644
--- a/hw/xfree86/modes/xf86Rename.h
+++ b/hw/xfree86/modes/xf86Rename.h
@@ -31,6 +31,7 @@
 #define xf86CrtcDestroy XF86NAME(xf86CrtcDestroy)
 #define xf86CrtcInUse XF86NAME(xf86CrtcInUse)
 #define xf86CrtcRotate XF86NAME(xf86CrtcRotate)
+#define xf86CrtcScreenInit XF86NAME(xf86CrtcScreenInit)
 #define xf86CrtcSetMode XF86NAME(xf86CrtcSetMode)
 #define xf86CrtcSetSizeRange XF86NAME(xf86CrtcSetSizeRange)
 #define xf86CVTMode XF86NAME(xf86CVTMode)
diff-tree 81526232bc0119d2ec7b8590be4f78cf066ae359 (from a7cd53deb99957dec27a55ffd75e548b322ae0ce)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Tue Mar 6 17:19:11 2007 -0500

    remove PIXPRIV check as this flag is always set.

diff --git a/dix/pixmap.c b/dix/pixmap.c
index a5b7b06..c280a3b 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -109,7 +109,6 @@ _X_EXPORT PixmapPtr
 AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
 {
     PixmapPtr pPixmap;
-#ifdef PIXPRIV
     char *ptr;
     DevUnion *ppriv;
     unsigned *sizes;
@@ -136,9 +135,6 @@ AllocatePixmap(ScreenPtr pScreen, int pi
         else
 	    ppriv->ptr = (pointer)NULL;
     }
-#else
-    pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
-#endif
 
 #ifdef _XSERVER64
     if (pPixmap) {
diff-tree a7cd53deb99957dec27a55ffd75e548b322ae0ce (from 024bbc7cbb924daaf3e305ddfc8e74509acd1e15)
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Tue Mar 6 15:32:13 2007 -0500

    remove PIXPRIV checks as this flag is always set.

diff --git a/Xext/shm.c b/Xext/shm.c
index 7cfaa68..ac587be 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -119,9 +119,7 @@ static int pixmapFormat;
 static int shmPixFormat[MAXSCREENS];
 static ShmFuncsPtr shmFuncs[MAXSCREENS];
 static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
-#ifdef PIXPRIV
 static int  shmPixmapPrivate;
-#endif
 static ShmFuncs miFuncs = {NULL, miShmPutImage};
 static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
 
@@ -237,7 +235,6 @@ ShmExtensionInit(INITARGS)
 	    destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
 	    screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
 	}
-#ifdef PIXPRIV
 	shmPixmapPrivate = AllocatePixmapPrivateIndex();
 	for (i = 0; i < screenInfo.numScreens; i++)
 	{
@@ -245,7 +242,6 @@ ShmExtensionInit(INITARGS)
 				       shmPixmapPrivate, 0))
 		return;
 	}
-#endif
       }
     }
     ShmSegType = CreateNewResourceType(ShmDetachSegment);
@@ -299,22 +295,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
     if (pPixmap->refcnt == 1)
     {
 	ShmDescPtr  shmdesc;
-#ifdef PIXPRIV
 	shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr;
-#else
-	char	*base = (char *) pPixmap->devPrivate.ptr;
-	
-	if (base != (pointer) (pPixmap + 1))
-	{
-	    for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next)
-	    {
-		if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size)
-		    break;
-	    }
-	}
-	else
-	    shmdesc = 0;
-#endif
 	if (shmdesc)
 	    ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
     }
@@ -781,9 +762,7 @@ CreatePmap:
 				shmdesc->addr + stuff->offset);
 
 	if (pMap) {
-#ifdef PIXPRIV
             pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
             shmdesc->refcnt++;
 	    pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
 	    pMap->drawable.id = newPix->info[j].id;
@@ -1097,9 +1076,7 @@ CreatePmap:
 			    shmdesc->addr + stuff->offset);
     if (pMap)
     {
-#ifdef PIXPRIV
 	pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
 	shmdesc->refcnt++;
 	pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
 	pMap->drawable.id = stuff->pid;
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
index 6801960..6a3a485 100644
--- a/afb/afbpixmap.c
+++ b/afb/afbpixmap.c
@@ -102,12 +102,8 @@ afbCreatePixmap(pScreen, width, height, 
 	pPixmap->drawable.height = height;
 	pPixmap->devKind = paddedWidth;
 	pPixmap->refcnt = 1;
-#ifdef PIXPRIV
 	pPixmap->devPrivate.ptr =  datasize ?
 				(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-	pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
 	return(pPixmap);
 }
 
diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c
index d51c518..6fdf3ea 100644
--- a/cfb/cfbpixmap.c
+++ b/cfb/cfbpixmap.c
@@ -96,12 +96,8 @@ cfbCreatePixmap (pScreen, width, height,
     pPixmap->drawable.height = height;
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr = datasize ?
 		(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-    pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
     return pPixmap;
 }
 
diff --git a/dix/main.c b/dix/main.c
index 3a77533..92c30b6 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -361,9 +361,7 @@ main(int argc, char *argv[], char *envp[
 	ResetScreenPrivates();
 	ResetWindowPrivates();
 	ResetGCPrivates();
-#ifdef PIXPRIV
 	ResetPixmapPrivates();
-#endif
 	ResetColormapPrivates();
 	ResetFontPrivateIndex();
 	ResetDevicePrivateIndex();
@@ -731,11 +729,9 @@ AddScreen(
     pScreen->GCPrivateSizes = (unsigned *)NULL;
     pScreen->totalGCSize =
         ((sizeof(GC) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
-#ifdef PIXPRIV
     pScreen->PixmapPrivateLen = 0;
     pScreen->PixmapPrivateSizes = (unsigned *)NULL;
     pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8);
-#endif
     pScreen->ClipNotify = 0;	/* for R4 ddx compatibility */
     pScreen->CreateScreenResources = 0;
     
@@ -799,9 +795,7 @@ FreeScreen(ScreenPtr pScreen)
 {
     xfree(pScreen->WindowPrivateSizes);
     xfree(pScreen->GCPrivateSizes);
-#ifdef PIXPRIV
     xfree(pScreen->PixmapPrivateSizes);
-#endif
     xfree(pScreen->devPrivates);
     xfree(pScreen);
 }
diff --git a/dix/privates.c b/dix/privates.c
index b20a1db..a61c3cb 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -309,7 +309,6 @@ AllocateGCPrivate(register ScreenPtr pSc
 /*
  *  pixmap private machinery
  */
-#ifdef PIXPRIV
 static int  pixmapPrivateCount;
 
 void
@@ -355,7 +354,6 @@ AllocatePixmapPrivate(register ScreenPtr
     pScreen->totalPixmapSize = BitmapBytePad(pScreen->totalPixmapSize * 8);
     return TRUE;
 }
-#endif
 
 
 /*
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index c2ddcb0..18c1204 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -43,11 +43,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, in
     if (paddedWidth / 4 > 32767 || height > 32767)
 	return NullPixmap;
     datasize = height * paddedWidth;
-#ifdef PIXPRIV
     base = pScreen->totalPixmapSize;
-#else
-    base = sizeof (PixmapRec);
-#endif
     adjust = 0;
     if (base & 7)
 	adjust = 8 - (base & 7);
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 4a669fd..9340606 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -49,15 +49,11 @@
 /** Initialize a private area in \a pScreen for pixmap information. */
 Bool dmxInitPixmap(ScreenPtr pScreen)
 {
-#ifdef PIXPRIV
     if (!AllocatePixmapPrivate(pScreen, dmxPixPrivateIndex,
 			       sizeof(dmxPixPrivRec)))
 	return FALSE;
 
     return TRUE;
-#else
-#error Must define PIXPRIV to compile DMX X server
-#endif
 }
 
 /** Create a pixmap on the back-end server. */
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index 5bfb4df..7c315d8 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -70,9 +70,7 @@ static unsigned long *dmxCursorGeneratio
 
 int dmxGCPrivateIndex;          /**< Private index for GCs       */
 int dmxWinPrivateIndex;         /**< Private index for Windows   */
-#ifdef PIXPRIV
 int dmxPixPrivateIndex;         /**< Private index for Pixmaps   */
-#endif
 int dmxFontPrivateIndex;        /**< Private index for Fonts     */
 int dmxScreenPrivateIndex;      /**< Private index for Screens   */
 int dmxColormapPrivateIndex;    /**< Private index for Colormaps */
@@ -233,14 +231,10 @@ Bool dmxScreenInit(int idx, ScreenPtr pS
 	if (dmxWinPrivateIndex == -1)
 	    return FALSE;
 
-#ifdef PIXPRIV
 	/* Allocate pixmap private index */
 	dmxPixPrivateIndex = AllocatePixmapPrivateIndex();
 	if (dmxPixPrivateIndex == -1)
 	    return FALSE;
-#else
-#error Must define PIXPRIV to compile DMX X server
-#endif
 
 	/* Allocate font private index */
 	dmxFontPrivateIndex = AllocateFontPrivateIndex();
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 32e0e4f..594bf43 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -271,10 +271,8 @@ _X_HIDDEN void *dixLookupTab[] = {
     SYMFUNC(AllocateColormapPrivateIndex)
     SYMFUNC(AllocateDevicePrivateIndex)
     SYMFUNC(AllocateDevicePrivate)
-#ifdef PIXPRIV
     SYMFUNC(AllocatePixmapPrivateIndex)
     SYMFUNC(AllocatePixmapPrivate)
-#endif
     /* resource.c */
     SYMFUNC(AddResource)
     SYMFUNC(ChangeResourceValue)
diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c
index 9f4cdc9..9b2defd 100644
--- a/hw/xfree86/xf4bpp/ppcPixmap.c
+++ b/hw/xfree86/xf4bpp/ppcPixmap.c
@@ -120,12 +120,8 @@ xf4bppCreatePixmap( pScreen, width, heig
     pPixmap->devKind = size;
     pPixmap->refcnt = 1 ;
     size = height * pPixmap->devKind ;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap)
 					 + pScreen->totalPixmapSize);
-#else
-    pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1);
-#endif
     bzero( (char *) pPixmap->devPrivate.ptr, size ) ;
     return pPixmap ;
 }
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index aa8bed9..612df8d 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -32,9 +32,7 @@ is" without express or implied warranty.
 #include "Screen.h"
 #include "XNPixmap.h"
 
-#ifdef PIXPRIV
 int xnestPixmapPrivateIndex;	    
-#endif
 
 PixmapPtr
 xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
@@ -57,12 +55,8 @@ xnestCreatePixmap(ScreenPtr pScreen, int
   pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
   pPixmap->refcnt = 1;
   pPixmap->devKind = PixmapBytePad(width, depth);
-#ifdef PIXPRIV
   pPixmap->devPrivates[xnestPixmapPrivateIndex].ptr =
       (pointer)((char *)pPixmap + pScreen->totalPixmapSize);
-#else
-  pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
   if (width && height)
       xnestPixmapPriv(pPixmap)->pixmap = 
 	  XCreatePixmap(xnestDisplay, 
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 8e86efb..e6870e7 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -49,9 +49,7 @@ Window xnestScreenSaverWindows[MAXSCREEN
 extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
 #endif
 
-#ifdef PIXPRIV
 int xnestScreenGeneration = -1;
-#endif
 
 ScreenPtr
 xnestScreen(Window window)
@@ -154,7 +152,6 @@ xnestOpenScreen(int index, ScreenPtr pSc
 			    sizeof(xnestPrivGC)))) 
     return False;
 
-#ifdef PIXPRIV
   if (xnestScreenGeneration != serverGeneration) {
       if ((xnestPixmapPrivateIndex = AllocatePixmapPrivateIndex()) < 0)
 	  return False;
@@ -164,7 +161,6 @@ xnestOpenScreen(int index, ScreenPtr pSc
   if (!AllocatePixmapPrivate(pScreen,xnestPixmapPrivateIndex,
 			     sizeof (xnestPrivPixmap)))
       return False;
-#endif
   visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec));
   numVisuals = 0;
 
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index 77cba24..6971b11 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -15,21 +15,14 @@ is" without express or implied warranty.
 #ifndef XNESTPIXMAP_H
 #define XNESTPIXMAP_H
 
-#ifdef PIXPRIV
 extern int xnestPixmapPrivateIndex;
-#endif
 
 typedef struct {
   Pixmap pixmap;
 } xnestPrivPixmap;
 
-#ifdef PIXPRIV
 #define xnestPixmapPriv(pPixmap) \
   ((xnestPrivPixmap *)((pPixmap)->devPrivates[xnestPixmapPrivateIndex].ptr))
-#else
-#define xnestPixmapPriv(pPixmap) \
-  ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr))
-#endif
 
 #define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap)
 
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 628465b..93bd45d 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -86,9 +86,7 @@ typedef struct _Pixmap {
     int			refcnt;
     int			devKind;
     DevUnion		devPrivate;
-#ifdef PIXPRIV
     DevUnion		*devPrivates; /* real devPrivates like gcs & windows */
-#endif
 #ifdef COMPOSITE
     short		screen_x;
     short		screen_y;
diff --git a/include/screenint.h b/include/screenint.h
index e60c248..1f1434a 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -86,8 +86,6 @@ extern int AddScreen(
     int /*argc*/,
     char** /*argv*/);
 
-#ifdef PIXPRIV
-
 extern void ResetPixmapPrivates(void);
 
 extern int AllocatePixmapPrivateIndex(void);
@@ -97,8 +95,6 @@ extern Bool AllocatePixmapPrivate(
     int /* index */,
     unsigned /* amount */);
 
-#endif /* PIXPRIV */
-
 extern void ResetColormapPrivates(void);
 
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 3613515..110f4dc 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -558,11 +558,9 @@ typedef struct _Screen {
 
     PixmapPtr pScratchPixmap;		/* scratch pixmap "pool" */
 
-#ifdef PIXPRIV
     int			PixmapPrivateLen;
     unsigned int		*PixmapPrivateSizes;
     unsigned int		totalPixmapSize;
-#endif
 
     MarkWindowProcPtr		MarkWindow;
     MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c
index 5ec8502..e349724 100644
--- a/mfb/mfbpixmap.c
+++ b/mfb/mfbpixmap.c
@@ -101,12 +101,8 @@ mfbCreatePixmap (pScreen, width, height,
     pPixmap->drawable.height = height;
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr =  datasize ?
 		(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-    pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
     return pPixmap;
 }
 
diff-tree 024bbc7cbb924daaf3e305ddfc8e74509acd1e15 (from 9d94c137596d3f9d9118ec70455b7a30b3582046)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 6 16:18:59 2007 -0800

    Bug #9931: Fix linear allocations with a non-1-byte granularity.
    
    This was introduced in 83080809f9a1c1d24b0318e54632f25f5940da25.  Instead of
    aligning the offset, it doubled it.  Results were appropriately spectacular.

diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index d64cfae..537d53d 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -968,7 +968,7 @@ localAllocateOffscreenLinear(
 	linear->size = h * w;
 	linear->offset = (pitch * area->box.y1) + area->box.x1;
 	if (gran > 1)
-            linear->offset += ((linear->offset + gran - 1) / gran) * gran;
+            linear->offset = ((linear->offset + gran - 1) / gran) * gran;
 	linear->granularity = gran;
 	linear->MoveLinearCallback = moveCB;
 	linear->RemoveLinearCallback = removeCB;
diff-tree 9d94c137596d3f9d9118ec70455b7a30b3582046 (from 81d581e655fc989da3be4256b83849a63b8607b7)
Author: Ben Byer <bbyer at apple.com>
Date:   Tue Mar 6 11:09:30 2007 -0800

    updated todo list

diff --git a/hw/darwin/README.apple b/hw/darwin/README.apple
index 68bc692..229ab17 100644
--- a/hw/darwin/README.apple
+++ b/hw/darwin/README.apple
@@ -22,20 +22,14 @@ The server builds 4 targets:
 Known issues:
 
 * AGL and CGL support for 3D indirect acceleration does not work;
-  indirect.c needs to be rewritten.
+  indirect.c has been rewritten, but not yet integrated into this source tree.
 
 * Fullscreen mode does not work; I don't know why.
 
-* The keyboard and mouse do not work at all; they worked in X11R7.1,
-  and I believe that they were broken by the events changes in dix/.
-
 * Some features in X11.app are not yet implemented; these are marked
   with #ifdef DARWIN_DDX_MISSING in the code.
 
 * The build system code could probably be cleaned up slightly.
 
-* Most testing of this code has occurred under 10.5, but it should
-  also work under 10.4.
-
 Any patches or code contributions would be most welcome and may be
 sent to me at bbyer at apple.com.
diff-tree 81d581e655fc989da3be4256b83849a63b8607b7 (from parents)
Merge: a05ffca8dd0da9bdb5c1bf4c481028aeabf21e34 d5aba03feff41722c72b4c6193f09d141cbf1678
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Tue Mar 6 10:37:29 2007 -0800

    Merge branch 'master' of git+ssh://bbyer@git.freedesktop.org/git/xorg/xserver

diff-tree a05ffca8dd0da9bdb5c1bf4c481028aeabf21e34 (from 3206e9225897989638ad553e1f392b918ac4d21f)
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Tue Mar 6 10:36:51 2007 -0800

    rewrote event handling, Xquartz now has working mouse and keyboard. use it\!

diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m
index 34c0307..57795f4 100644
--- a/hw/darwin/apple/X11Application.m
+++ b/hw/darwin/apple/X11Application.m
@@ -919,11 +919,7 @@ static void send_nsevent (NSEventType ty
       break;
 
     case NSFlagsChanged:
-      bzero(&xe, sizeof(xe));
-      xe.u.u.type = kXDarwinUpdateModifiers;
-      xe.u.clientMessage.u.l.longs0 = [e modifierFlags];
-      DarwinEQEnqueue (&xe);
-      DarwinPokeEQ();
+      DarwinUpdateModKeys([e modifierFlags]);
       break;
     default: break; /* for gcc */
     }	
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index cb30a90..3d7f268 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -63,6 +63,8 @@ typedef struct _Event {
 
 int input_check_zero, input_check_flag;
 
+static int old_flags = 0;  // last known modifier state
+
 typedef struct _EventQueue {
     HWEventQueueType    head, tail; /* long for SetInputCheck */
     CARD32      lastEventTime;      /* to avoid time running backwards */
@@ -81,18 +83,15 @@ xEvent *darwinEvents;
  *  Press or release the given modifier key, specified by its mask.
  */
 static void DarwinPressModifierMask(
-    xEvent *xe,     // must already have type, time and mouse location
+    int pressed,				    
     int mask)       // one of NX_*MASK constants
 {
     int key = DarwinModifierNXMaskToNXKey(mask);
 
     if (key != -1) {
         int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
-        if (keycode != 0) {
-            xe->u.u.detail = keycode + MIN_KEYCODE;
-            (*darwinEventQueue.pKbd->processInputProc)(xe,
-                            (DeviceIntPtr)darwinEventQueue.pKbd, 1);
-        }
+        if (keycode != 0)
+	  DarwinSendKeyboardEvents(pressed, keycode);
     }
 }
 
@@ -125,28 +124,26 @@ static void DarwinPressModifierMask(
  *  Send events to update the modifier state.
  */
 static void DarwinUpdateModifiers(
-    xEvent *xe,         // event template with time and mouse position set
     int pressed,        // KeyPress or KeyRelease
     int flags )         // modifier flags that have changed
 {
-    xe->u.u.type = pressed;
     if (flags & NX_ALPHASHIFTMASK) {
-        DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
+        DarwinPressModifierMask(pressed, NX_ALPHASHIFTMASK);
     }
     if (flags & NX_COMMANDMASK) {
-        DarwinPressModifierMask(xe, COMMAND_MASK(flags));
+        DarwinPressModifierMask(pressed, COMMAND_MASK(flags));
     }
     if (flags & NX_CONTROLMASK) {
-        DarwinPressModifierMask(xe, CONTROL_MASK(flags));
+        DarwinPressModifierMask(pressed, CONTROL_MASK(flags));
     }
     if (flags & NX_ALTERNATEMASK) {
-        DarwinPressModifierMask(xe, ALTERNATE_MASK(flags));
+        DarwinPressModifierMask(pressed, ALTERNATE_MASK(flags));
     }
     if (flags & NX_SHIFTMASK) {
-        DarwinPressModifierMask(xe, SHIFT_MASK(flags));
+        DarwinPressModifierMask(pressed, SHIFT_MASK(flags));
     }
     if (flags & NX_SECONDARYFNMASK) {
-        DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
+        DarwinPressModifierMask(pressed, NX_SECONDARYFNMASK);
     }
 }
 
@@ -163,19 +160,20 @@ static void DarwinUpdateModifiers(
  *  simulate a button 2 press instead of Command-button 2.
  */
 static void DarwinSimulateMouseClick(
-    xEvent *xe,         // event template with time and
-                        // mouse position filled in
+    int pointer_x,
+    int pointer_y,
     int whichButton,    // mouse button to be pressed
     int modifierMask)   // modifiers used for the fake click
 {
     // first fool X into forgetting about the keys
-    DarwinUpdateModifiers(xe, KeyRelease, modifierMask);
+    DarwinUpdateModifiers(KeyRelease, modifierMask);
 
     // push the mouse button
-    xe->u.u.type = ButtonPress;
-    xe->u.u.detail = whichButton;
-    (*darwinEventQueue.pPtr->processInputProc)
-            (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+    DarwinSendPointerEvents(ButtonPress, whichButton, pointer_x, pointer_y);
+    DarwinSendPointerEvents(ButtonRelease, whichButton, pointer_x, pointer_y);
+
+    // restore old modifiers
+    DarwinUpdateModifiers(KeyPress, modifierMask);
 }
 
 
@@ -234,7 +232,7 @@ void DarwinEQEnqueue(const xEvent *e) {
     darwinEventQueue.tail = newtail;
 
     // Signal there is an event ready to handle
-    write(darwinEventWriteFD, &byte, 1);
+    DarwinPokeEQ();
 }
 
 
@@ -265,8 +263,6 @@ void ProcessInputEvents(void) {
     xEvent  xe;
     static int  old_flags = 0;  // last known modifier state
     // button number and modifier mask of currently pressed fake button
-    static int darwinFakeMouseButtonDown = 0;
-    static int darwinFakeMouseButtonMask = 0;
     input_check_flag=0;
 
     //    ErrorF("calling mieqProcessInputEvents\n");
@@ -318,155 +314,35 @@ void ProcessInputEvents(void) {
                 darwinEventQueue.head = 0;
             else
                 ++darwinEventQueue.head;
-            switch (xe.u.u.type)
-            {
+            switch (xe.u.u.type) {
             case KeyPress:
-                if (old_flags == 0
-                    && darwinSyncKeymap && darwinKeymapFile == NULL)
-                {
-                    /* See if keymap has changed. */
-
-                    static unsigned int last_seed;
-                    unsigned int this_seed;
-
-                    this_seed = DarwinModeSystemKeymapSeed();
-                    if (this_seed != last_seed)
-                    {
-                        last_seed = this_seed;
-                        DarwinKeyboardReload(darwinKeyboard);
-                    }
-                }
-                /* fall through */
-
             case KeyRelease:
-                xe.u.u.detail += MIN_KEYCODE;
-                (*darwinEventQueue.pKbd->processInputProc)
-                    (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1);
-                break;
+	      ErrorF("Unexpected Keyboard event in DarwinProcessInputEvents\n");
+	      break;
 
             case ButtonPress:
-                miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
-                                        xe.u.keyButtonPointer.rootY,
-                                        xe.u.keyButtonPointer.time);
-                if (darwinFakeButtons && xe.u.u.detail == 1) {
-                    // Mimic multi-button mouse with modifier-clicks
-                    // If both sets of modifiers are pressed,
-                    // button 2 is clicked.
-                    if ((old_flags & darwinFakeMouse2Mask) ==
-                        darwinFakeMouse2Mask)
-                    {
-                        DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask);
-                        darwinFakeMouseButtonDown = 2;
-                        darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
-                        break;
-                    }
-                    else if ((old_flags & darwinFakeMouse3Mask) ==
-                             darwinFakeMouse3Mask)
-                    {
-                        DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask);
-                        darwinFakeMouseButtonDown = 3;
-                        darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
-                        break;
-                    }
-                }
-                (*darwinEventQueue.pPtr->processInputProc)
-                        (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+	      ErrorF("Unexpected ButtonPress event in DarwinProcessInputEvents\n");
                 break;
 
             case ButtonRelease:
-                miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
-                                        xe.u.keyButtonPointer.rootY,
-                                        xe.u.keyButtonPointer.time);
-                if (darwinFakeButtons && xe.u.u.detail == 1 &&
-                    darwinFakeMouseButtonDown)
-                {
-                    // If last mousedown was a fake click, don't check for
-                    // mouse modifiers here. The user may have released the
-                    // modifiers before the mouse button.
-                    xe.u.u.detail = darwinFakeMouseButtonDown;
-                    darwinFakeMouseButtonDown = 0;
-                    (*darwinEventQueue.pPtr->processInputProc)
-                            (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-
-                    // Bring modifiers back up to date
-                    DarwinUpdateModifiers(&xe, KeyPress,
-                            darwinFakeMouseButtonMask & old_flags);
-                    darwinFakeMouseButtonMask = 0;
-                } else {
-                    (*darwinEventQueue.pPtr->processInputProc)
-                            (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-                }
+	      ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
                 break;
 
             case MotionNotify:
-                miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
-                                        xe.u.keyButtonPointer.rootY,
-                                        xe.u.keyButtonPointer.time);
+	      ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
                 break;
 
             case kXDarwinUpdateModifiers:
-            {
-                // Update modifier state.
-                // Any amount of modifiers may have changed.
-                int flags = xe.u.clientMessage.u.l.longs0;
-                DarwinUpdateModifiers(&xe, KeyRelease,
-                                      old_flags & ~flags);
-                DarwinUpdateModifiers(&xe, KeyPress,
-                                      ~old_flags & flags);
-                old_flags = flags;
-                break;
-            }
+	      ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
+	      break;
 
             case kXDarwinUpdateButtons:
-            {
-                long hwDelta = xe.u.clientMessage.u.l.longs0;
-                long hwButtons = xe.u.clientMessage.u.l.longs1;
-                int i;
-
-                for (i = 1; i < 5; i++) {
-                    if (hwDelta & (1 << i)) {
-                        // IOKit and X have different numbering for the
-                        // middle and right mouse buttons.
-                        if (i == 1) {
-                            xe.u.u.detail = 3;
-                        } else if (i == 2) {
-                            xe.u.u.detail = 2;
-                        } else {
-                            xe.u.u.detail = i + 1;
-                        }
-                        if (hwButtons & (1 << i)) {
-                            xe.u.u.type = ButtonPress;
-                        } else {
-                            xe.u.u.type = ButtonRelease;
-                        }
-                        (*darwinEventQueue.pPtr->processInputProc)
-                    (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-                    }
-                }
-                break;
-            }
+	      ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n");
+	      break;
 
-            case kXDarwinScrollWheel:
-            {
-                short count = xe.u.clientMessage.u.s.shorts0;
-
-                if (count > 0) {
-                    xe.u.u.detail = SCROLLWHEELUPFAKE;
-                } else {
-                    xe.u.u.detail = SCROLLWHEELDOWNFAKE;
-                    count = -count;
-                }
-
-                for (; count; --count) {
-                    xe.u.u.type = ButtonPress;
-                    (*darwinEventQueue.pPtr->processInputProc)
-                            (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-                    xe.u.u.type = ButtonRelease;
-                    (*darwinEventQueue.pPtr->processInputProc)
-                            (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
-                }
-                break;
-            }
+            case kXDarwinScrollWheel: 
+	      ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n");
+	      break;
 
             default:
                 // Check for mode specific event
@@ -475,7 +351,7 @@ void ProcessInputEvents(void) {
         }
     }
 
-    miPointerUpdate();
+    //    miPointerUpdate();
 }
 
 /* Sends a null byte down darwinEventWriteFD, which will cause the
@@ -488,18 +364,58 @@ void DarwinPokeEQ(void) {
 }
 
 void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) {
-  int i;
+  static int darwinFakeMouseButtonDown = 0;
+  static int darwinFakeMouseButtonMask = 0;
+  int i, num_events;
   int valuators[2] = {pointer_x, pointer_y};
-  int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
-				    POINTER_ABSOLUTE, 0, 2, valuators);
+  if (ev_type == ButtonPress && darwinFakeButtons && ev_button == 1) {
+    // Mimic multi-button mouse with modifier-clicks
+    // If both sets of modifiers are pressed,
+    // button 2 is clicked.
+    if ((old_flags & darwinFakeMouse2Mask) == darwinFakeMouse2Mask) {
+      DarwinSimulateMouseClick(pointer_x, pointer_y, 2, darwinFakeMouse2Mask);
+      darwinFakeMouseButtonDown = 2;
+      darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
+    } else if ((old_flags & darwinFakeMouse3Mask) == darwinFakeMouse3Mask) {
+      DarwinSimulateMouseClick(pointer_x, pointer_y, 3, darwinFakeMouse3Mask);
+      darwinFakeMouseButtonDown = 3;
+      darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
+    }
+  }
+  if (ev_type == ButtonRelease && darwinFakeButtons && darwinFakeMouseButtonDown) {
+    // If last mousedown was a fake click, don't check for
+    // mouse modifiers here. The user may have released the
+    // modifiers before the mouse button.
+    ev_button = darwinFakeMouseButtonDown;
+    darwinFakeMouseButtonDown = 0;
+    // Bring modifiers back up to date
+    DarwinUpdateModifiers(KeyPress, darwinFakeMouseButtonMask & old_flags);
+    darwinFakeMouseButtonMask = 0;
+  } 
+
+  num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
+				POINTER_ABSOLUTE, 0, 2, valuators);
       
   for(i=0; i<num_events; i++) mieqEnqueue (darwinPointer,&darwinEvents[i]);
   DarwinPokeEQ();
 }
 
 void DarwinSendKeyboardEvents(int ev_type, int keycode) {
-  int i;
-  int num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
+  int i, num_events;
+  if (old_flags == 0 && darwinSyncKeymap && darwinKeymapFile == NULL) {
+    /* See if keymap has changed. */
+
+    static unsigned int last_seed;
+    unsigned int this_seed;
+
+    this_seed = DarwinModeSystemKeymapSeed();
+    if (this_seed != last_seed) {
+      last_seed = this_seed;
+      DarwinKeyboardReload(darwinKeyboard);
+    }
+  }
+
+  num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
   for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
   DarwinPokeEQ();
 }
@@ -520,3 +436,11 @@ void DarwinSendScrollEvents(float count,
   }
   DarwinPokeEQ();
 }
+
+/* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to
+   reflect changing modifier flags (alt, control, meta, etc) */
+void DarwinUpdateModKeys(int flags) {
+  DarwinUpdateModifiers(KeyRelease, old_flags & ~flags);
+  DarwinUpdateModifiers(KeyPress, ~old_flags & flags);
+  old_flags = flags;
+}
diff-tree d5aba03feff41722c72b4c6193f09d141cbf1678 (from 0ccd1443fd6db397b42e5b99ce733ce1316c785e)
Author: Drew Parsons <dparsons at debian.org>
Date:   Tue Mar 6 23:53:23 2007 +1100

    Xprint: shorten font filename to fit in tar length limit
    
    The length of the Xprint font file NewCenturySchlbk-BoldItalic.pmf
    pushes the full path over the traditional 100 character limit for
    tarballs (when module version number is included).  Shorten it to
    NewCentSchlbk-BoldItal.pmf to get back below the limit and rename
    other font files in that family to match.

diff --git a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
index c574c5c..7a7ecc3 100644
--- a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
@@ -19,10 +19,10 @@ XPFONTS = \
         LubalinGraph-BookOblique.pmf \
         LubalinGraph-Demi.pmf \
         LubalinGraph-DemiOblique.pmf \
-        NewCenturySchlbk-Bold.pmf \
-        NewCenturySchlbk-BoldItalic.pmf \
-        NewCenturySchlbk-Italic.pmf \
-        NewCenturySchlbk-Roman.pmf \
+        NewCentSchlbk-Bold.pmf \
+        NewCentSchlbk-BoldItal.pmf \
+        NewCentSchlbk-Ital.pmf \
+        NewCentSchlbk-Roman.pmf \
         Souvenir-Demi.pmf \
         Souvenir-DemiItalic.pmf \
         Souvenir-Light.pmf \
diff --git a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
index 634db1f..f4f4243 100644
--- a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
@@ -19,10 +19,10 @@ XPFONTS = \
         LubalinGraph-BookOblique.pmf \
         LubalinGraph-Demi.pmf \
         LubalinGraph-DemiOblique.pmf \
-        NewCenturySchlbk-Bold.pmf \
-        NewCenturySchlbk-BoldItalic.pmf \
-        NewCenturySchlbk-Italic.pmf \
-        NewCenturySchlbk-Roman.pmf \
+        NewCentSchlbk-Bold.pmf \
+        NewCentSchlbk-BoldItal.pmf \
+        NewCentSchlbk-Ital.pmf \
+        NewCentSchlbk-Roman.pmf \
         Souvenir-Demi.pmf \
         Souvenir-DemiItalic.pmf \
         Souvenir-Light.pmf \
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
index 1e8c8a7..40f1e3d 100644
--- a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
@@ -17,10 +17,10 @@ dist_xpc_DATA =				\
 	LubalinGraph-Book.pmf		\
 	LubalinGraph-DemiOblique.pmf	\
 	LubalinGraph-Demi.pmf		\
-	NewCenturySchlbk-Bold.pmf	\
-	NewCenturySchlbk-BoldItalic.pmf \
-	NewCenturySchlbk-Italic.pmf	\
-	NewCenturySchlbk-Roman.pmf	\
+	NewCentSchlbk-Bold.pmf		\
+	NewCentSchlbk-BoldItal.pmf 	\
+	NewCentSchlbk-Ital.pmf		\
+	NewCentSchlbk-Roman.pmf		\
 	Souvenir-DemiItalic.pmf		\
 	Souvenir-Demi.pmf		\
 	Souvenir-LightItalic.pmf	\
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Bold.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Bold.pmf
new file mode 100644
index 0000000..ab22aab
Binary files /dev/null and b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Bold.pmf differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-BoldItal.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-BoldItal.pmf
new file mode 100644
index 0000000..e68811e
Binary files /dev/null and b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-BoldItal.pmf differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Ital.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Ital.pmf
new file mode 100644
index 0000000..390f223
Binary files /dev/null and b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Ital.pmf differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Roman.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Roman.pmf
new file mode 100644
index 0000000..655b9b6
Binary files /dev/null and b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Roman.pmf differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf
deleted file mode 100644
index ab22aab..0000000
Binary files a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf and /dev/null differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf
deleted file mode 100644
index e68811e..0000000
Binary files a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf and /dev/null differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf
deleted file mode 100644
index 390f223..0000000
Binary files a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf and /dev/null differ
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf
deleted file mode 100644
index 655b9b6..0000000
Binary files a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf and /dev/null differ
diff-tree 3206e9225897989638ad553e1f392b918ac4d21f (from 0ccd1443fd6db397b42e5b99ce733ce1316c785e)
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Tue Mar 6 02:31:59 2007 -0800

    moved new event-handling code from X11Application.m to darwinEvents.c in preparation for making all Darwin servers use it

diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m
index cfc9750..34c0307 100644
--- a/hw/darwin/apple/X11Application.m
+++ b/hw/darwin/apple/X11Application.m
@@ -855,48 +855,6 @@ convert_flags (unsigned int nsflags) {
     return xflags;
 }
 
-/* Sends a null byte down darwinEventWriteFD, which will cause the
-   Dispatch() event loop to check out event queue */
-void DarwinPokeEQ(void) {
-  char nullbyte=0;
-  input_check_flag++;
-  //  <daniels> bushing: oh, i ... er ... christ.
-  write(darwinEventWriteFD, &nullbyte, 1);
-}
-
-void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) {
-  int i;
-  int valuators[2] = {pointer_x, pointer_y};
-  int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
-				    POINTER_ABSOLUTE, 0, 2, valuators);
-      
-  for(i=0; i<num_events; i++) mieqEnqueue (darwinPointer,&darwinEvents[i]);
-  DarwinPokeEQ();
-}
-
-void DarwinSendKeyboardEvents(int ev_type, int keycode) {
-  int i;
-  int num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
-  for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
-  DarwinPokeEQ();
-}
-
-/* Send the appropriate number of button 4 / 5 clicks to emulate scroll wheel */
-void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y) {
-  int i;
-  int ev_button = count > 0.0f ? 4 : 5;
-  int valuators[2] = {pointer_x, pointer_y};
-
-  for (count = fabs(count); count > 0.0; count = count - 1.0f) {
-    int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, 
-				      POINTER_ABSOLUTE, 0, 2, valuators);
-    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
-    num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, 
-				      POINTER_ABSOLUTE, 0, 2, valuators);
-    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
-  }
-  DarwinPokeEQ();
-}
 
 // This code should probably be merged with that in XDarwin's XServer.m - BB
 static void send_nsevent (NSEventType type, NSEvent *e) {
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index ac03e5a..cb30a90 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -477,3 +477,46 @@ void ProcessInputEvents(void) {
 
     miPointerUpdate();
 }
+
+/* Sends a null byte down darwinEventWriteFD, which will cause the
+   Dispatch() event loop to check out event queue */
+void DarwinPokeEQ(void) {
+  char nullbyte=0;
+  input_check_flag++;
+  //  <daniels> bushing: oh, i ... er ... christ.
+  write(darwinEventWriteFD, &nullbyte, 1);
+}
+
+void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) {
+  int i;
+  int valuators[2] = {pointer_x, pointer_y};
+  int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
+				    POINTER_ABSOLUTE, 0, 2, valuators);
+      
+  for(i=0; i<num_events; i++) mieqEnqueue (darwinPointer,&darwinEvents[i]);
+  DarwinPokeEQ();
+}
+
+void DarwinSendKeyboardEvents(int ev_type, int keycode) {
+  int i;
+  int num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
+  for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
+  DarwinPokeEQ();
+}
+
+/* Send the appropriate number of button 4 / 5 clicks to emulate scroll wheel */
+void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y) {
+  int i;
+  int ev_button = count > 0.0f ? 4 : 5;
+  int valuators[2] = {pointer_x, pointer_y};
+
+  for (count = fabs(count); count > 0.0; count = count - 1.0f) {
+    int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, 
+				      POINTER_ABSOLUTE, 0, 2, valuators);
+    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+    num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, 
+				      POINTER_ABSOLUTE, 0, 2, valuators);
+    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+  }
+  DarwinPokeEQ();
+}
diff-tree 0ccd1443fd6db397b42e5b99ce733ce1316c785e (from parents)
Merge: ec1ef8a56d6217ca2b04899043874ce0bcad9784 9b6bb06f13a71f6078f762b4a78fa516faccb638
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Tue Mar 6 01:04:50 2007 -0800

    Merge branch 'master' of git+ssh://bbyer@git.freedesktop.org/git/xorg/xserver

diff-tree ec1ef8a56d6217ca2b04899043874ce0bcad9784 (from 33d2cf93fb50464941e74efe246b10aee212223a)
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Tue Mar 6 00:57:23 2007 -0800

    Fixed Darwin's Makefile.am to fix a problem building X11.app

diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index 75d028e..3e28d32 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -112,7 +112,7 @@ macos_PROGRAMS = XDarwinApp
 macos_SCRIPTS = x11app
 
 x11app:
-	cd apple && xcodebuild
+	cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
 
 XDarwinApp_SOURCES = \
                 $(top_srcdir)/fb/fbcmap.c \
@@ -275,7 +275,7 @@ install-data-hook: $(HOOK_TARGETS)
 
 xquartz-install-hook:
 	mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
-        cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
+	cd apple && xcodebuild install
 
 EXTRA_DIST = \
 	darwin.c \
diff-tree 9b6bb06f13a71f6078f762b4a78fa516faccb638 (from bed76caa6caaea6a6598755b82a54425a9d9f73e)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Mon Mar 5 23:49:35 2007 -0800

    Allow relative positions to use output names or monitor identifiers.
    
    Previous version used monitor identifiers if present, otherwise output
    names. That caused existing working configurations to break when additional
    information was added to the configuration file.
    (cherry picked from commit 3f5cedf00a82f08a433c95ffbb7f8ac69dcf6a50)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c38da62..46515fd 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -879,13 +879,17 @@ xf86InitialOutputPositions (ScrnInfoPtr 
 		{
 		    xf86OutputPtr	out_rel = config->output[or];
 		    XF86ConfMonitorPtr	rel_mon = out_rel->conf_monitor;
-		    char		*name;
 
 		    if (rel_mon)
-			name = rel_mon->mon_identifier;
-		    else
-			name = out_rel->name;
-		    if (!strcmp (relative_name, name))
+		    {
+			if (xf86nameCompare (rel_mon->mon_identifier,
+					      relative_name) == 0)
+			{
+			    relative = config->output[or];
+			    break;
+			}
+		    }
+		    if (strcmp (out_rel->name, relative_name) == 0)
 		    {
 			relative = config->output[or];
 			break;
diff-tree bed76caa6caaea6a6598755b82a54425a9d9f73e (from 47f8361c3a64834587e54507653d8d5b258c2530)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Mon Mar 5 23:36:00 2007 -0800

    Use EDID data to set screen physical size at server startup.
    
    Screen physical size is set to a random value before the RandR code gets
    control, override that and reset it to a value based on the compat_output
    physical size (if available). If that output has no physical size, just use
    96dpi as the default resolution and set the physical size as appropriate.
    (cherry picked from commit 843077f23a1b49bd712d931421753e3a09d4008c)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 052d12a..ce780b6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -422,8 +422,28 @@ xf86RandR12CreateScreenResources (Screen
 	}
 	else
 	{
-	    mmWidth = pScreen->mmWidth;
-	    mmHeight = pScreen->mmHeight;
+	    xf86OutputPtr   output = config->output[config->compat_output];
+	    xf86CrtcPtr	    crtc = output->crtc;
+
+	    if (crtc && crtc->mode.HDisplay &&
+		output->mm_width && output->mm_height)
+	    {
+		/*
+		 * If the output has a mode and a declared size, use that
+		 * to scale the screen size
+		 */
+		DisplayModePtr	mode = &crtc->mode;
+		mmWidth = output->mm_width * width / mode->HDisplay;
+		mmHeight = output->mm_height * height / mode->VDisplay;
+	    }
+	    else
+	    {
+		/*
+		 * Otherwise, just set the screen to 96dpi
+		 */
+		mmWidth = width * 25.4 / 96;
+		mmHeight = height * 25.4 / 96;
+	    }
 	}
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		   "Setting screen physical size to %d x %d\n",
diff-tree 47f8361c3a64834587e54507653d8d5b258c2530 (from 33d2cf93fb50464941e74efe246b10aee212223a)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Mon Mar 5 22:07:01 2007 -0800

    Add xf86SetDesiredModes to apply desired modes to crtcs.
    
    xf86SetDesiredModes applies the desired modes to each crtc (as selected by
    xf86InitialConfiguration initially and modified by successful mode settings
    afterwards). For crtcs without a desired mode, pScrn->currentMode is used to
    select something workable.
    (cherry picked from commit bcade98ccaa18298d844a606cb44271f0254c185)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3d28293..c38da62 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1542,6 +1542,63 @@ xf86InitialConfiguration (ScrnInfoPtr sc
     return TRUE;
 }
 
+/*
+ * Using the desired mode information in each crtc, set
+ * modes (used in EnterVT functions, or at server startup)
+ */
+
+Bool
+xf86SetDesiredModes (ScrnInfoPtr scrn)
+{
+    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(scrn);
+    int			c;
+
+    for (c = 0; c < config->num_crtc; c++)
+    {
+	xf86CrtcPtr	crtc = config->crtc[c];
+	xf86OutputPtr	output = NULL;
+	int		o;
+
+	if (config->output[config->compat_output]->crtc == crtc)
+	    output = config->output[config->compat_output];
+	else
+	{
+	    for (o = 0; o < config->num_output; o++)
+		if (config->output[o]->crtc == crtc)
+		{
+		    output = config->output[o];
+		    break;
+		}
+	}
+	/*
+	 * Skip disabled crtcs
+	 */
+	if (!output)
+	    continue;
+
+	/* Mark that we'll need to re-set the mode for sure */
+	memset(&crtc->mode, 0, sizeof(crtc->mode));
+	if (!crtc->desiredMode.CrtcHDisplay)
+	{
+	    DisplayModePtr  mode = xf86OutputFindClosestMode (output, scrn->currentMode);
+
+	    if (!mode)
+		return FALSE;
+	    crtc->desiredMode = *mode;
+	    crtc->desiredRotation = RR_Rotate_0;
+	    crtc->desiredX = 0;
+	    crtc->desiredY = 0;
+	}
+
+	if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation,
+			      crtc->desiredX, crtc->desiredY))
+	    return FALSE;
+    }
+
+    xf86DisableUnusedFunctions(scrn);
+    return TRUE;
+}
+
 /**
  * In the current world order, there are lists of modes per output, which may
  * or may not include the mode that was asked to be set by XFree86's mode
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 56c7769..062a2db 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -644,4 +644,12 @@ xf86CrtcSetScreenSubpixelOrder (ScreenPt
 char *
 xf86ConnectorGetName(xf86ConnectorType connector);
 
+/*
+ * Using the desired mode information in each crtc, set
+ * modes (used in EnterVT functions, or at server startup)
+ */
+
+Bool
+xf86SetDesiredModes (ScrnInfoPtr pScrn);
+
 #endif /* _XF86CRTC_H_ */
diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h
index 6cfa5ca..eae6d64 100644
--- a/hw/xfree86/modes/xf86Rename.h
+++ b/hw/xfree86/modes/xf86Rename.h
@@ -76,5 +76,8 @@
 #define xf86CrtcSetScreenSubpixelOrder XF86NAME(xf86CrtcSetScreenSubpixelOrder)
 #define xf86ModeWidth XF86NAME(xf86ModeWidth)
 #define xf86ModeHeight XF86NAME(xf86ModeHeight)
+#define xf86OutputFindClosestMode XF86NAME(xf86OutputFindClosestMode)
+#define xf86SetSingleMode XF86NAME(xf86SetSingleMode)
+#define xf86SetDesiredModes XF86NAME(xf86SetDesiredModes)
 
 #endif /* _XF86RENAME_H_ */
diff-tree 33d2cf93fb50464941e74efe246b10aee212223a (from 689d52b6242434507a64a8fff27b01607628c393)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sat Mar 3 23:10:31 2007 -0800

    Move xf86SetSingleMode into X server from intel driver.
    
    This function applies a single mode to the screen (as from RandR 1.1,
    XFree86-VidModeExtension or XFree86-DGA) using a policy that selects one
    output to reconfigure to the requested mode and then makes all other outputs
    fit within that size.
    (cherry picked from commit 5a595c1f767a8d666348b845d18934aee0cfe38f)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 2ffa956..3d28293 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1543,6 +1543,132 @@ xf86InitialConfiguration (ScrnInfoPtr sc
 }
 
 /**
+ * In the current world order, there are lists of modes per output, which may
+ * or may not include the mode that was asked to be set by XFree86's mode
+ * selection.  Find the closest one, in the following preference order:
+ *
+ * - Equality
+ * - Closer in size to the requested mode, but no larger
+ * - Closer in refresh rate to the requested mode.
+ */
+
+DisplayModePtr
+xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired)
+{
+    DisplayModePtr	best = NULL, scan = NULL;
+
+    for (scan = output->probed_modes; scan != NULL; scan = scan->next) 
+    {
+	/* If there's an exact match, we're done. */
+	if (xf86ModesEqual(scan, desired)) {
+	    best = desired;
+	    break;
+	}
+
+	/* Reject if it's larger than the desired mode. */
+	if (scan->HDisplay > desired->HDisplay || 
+	    scan->VDisplay > desired->VDisplay)
+	{
+	    continue;
+	}
+
+	/*
+	 * If we haven't picked a best mode yet, use the first
+	 * one in the size range
+	 */
+	if (best == NULL) 
+	{
+	    best = scan;
+	    continue;
+	}
+
+	/* Find if it's closer to the right size than the current best
+	 * option.
+	 */
+	if ((scan->HDisplay > best->HDisplay &&
+	     scan->VDisplay >= best->VDisplay) ||
+	    (scan->HDisplay >= best->HDisplay &&
+	     scan->VDisplay > best->VDisplay))
+	{
+	    best = scan;
+	    continue;
+	}
+
+	/* Find if it's still closer to the right refresh than the current
+	 * best resolution.
+	 */
+	if (scan->HDisplay == best->HDisplay &&
+	    scan->VDisplay == best->VDisplay &&
+	    (fabs(scan->VRefresh - desired->VRefresh) <
+	     fabs(best->VRefresh - desired->VRefresh))) {
+	    best = scan;
+	}
+    }
+    return best;
+}
+
+/**
+ * When setting a mode through XFree86-VidModeExtension or XFree86-DGA,
+ * take the specified mode and apply it to the crtc connected to the compat
+ * output. Then, find similar modes for the other outputs, as with the
+ * InitialConfiguration code above. The goal is to clone the desired
+ * mode across all outputs that are currently active.
+ */
+
+Bool
+xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
+{
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(pScrn);
+    Bool		ok = TRUE;
+    xf86OutputPtr	compat_output = config->output[config->compat_output];
+    DisplayModePtr	compat_mode;
+    int			c;
+
+    /*
+     * Let the compat output drive the final mode selection
+     */
+    compat_mode = xf86OutputFindClosestMode (compat_output, desired);
+    if (compat_mode)
+	desired = compat_mode;
+    
+    for (c = 0; c < config->num_crtc; c++)
+    {
+	xf86CrtcPtr	crtc = config->crtc[c];
+	DisplayModePtr	crtc_mode = NULL;
+	int		o;
+
+	if (!crtc->enabled)
+	    continue;
+	
+	for (o = 0; o < config->num_output; o++)
+	{
+	    xf86OutputPtr   output = config->output[o];
+	    DisplayModePtr  output_mode;
+
+	    /* skip outputs not on this crtc */
+	    if (output->crtc != crtc)
+		continue;
+	    
+	    if (crtc_mode)
+	    {
+		output_mode = xf86OutputFindClosestMode (output, crtc_mode);
+		if (output_mode != crtc_mode)
+		    output->crtc = NULL;
+	    }
+	    else
+		crtc_mode = xf86OutputFindClosestMode (output, desired);
+	}
+	if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
+	    ok = FALSE;
+	else
+	    crtc->desiredMode = *crtc_mode;
+    }
+    xf86DisableUnusedFunctions(pScrn);
+    return ok;
+}
+
+
+/**
  * Set the DPMS power mode of all outputs and CRTCs.
  *
  * If the new mode is off, it will turn off outputs and then CRTCs.
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 537df3a..56c7769 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -594,6 +594,12 @@ xf86SaveScreen(ScreenPtr pScreen, int mo
 void
 xf86DisableUnusedFunctions(ScrnInfoPtr pScrn);
 
+DisplayModePtr
+xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired);
+    
+Bool
+xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation);
+
 /**
  * Set the EDID information for the specified output
  */
diff-tree 689d52b6242434507a64a8fff27b01607628c393 (from fe7b8f4237874e3e45fe25a6bf06faddfa1ab8e1)
Author: Jens Granseuer <jensgr at gmx.net>
Date:   Mon Mar 5 15:31:44 2007 -0800

    Bugzilla #7145: fix build with gcc 2.95
    
    Bugzilla #7145: <http://bugs.freedesktop.org/show_bug.cgi?id=7145>
    Patch #8987: <http://bugs.freedesktop.org/attachment.cgi?id=8987>

diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
index d59dfdb..1857bc1 100644
--- a/GL/glx/glxcmdsswap.c
+++ b/GL/glx/glxcmdsswap.c
@@ -496,11 +496,11 @@ int __glXDispSwap_CopySubBufferMESA(__GL
     GLXDrawable		 *drawId;
     int			 *buffer;
 
+    __GLX_DECLARE_SWAP_VARIABLES;
+
     (void) drawId;
     (void) buffer;
 
-    __GLX_DECLARE_SWAP_VARIABLES;
-
     pc += __GLX_VENDPRIV_HDR_SIZE;
 
     __GLX_SWAP_SHORT(&req->length);
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 1f7462f..db506f4 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -490,7 +490,7 @@ RRCrtcInit (void)
 int
 ProcRRGetCrtcInfo (ClientPtr client)
 {
-    REQUEST(xRRGetCrtcInfoReq);;
+    REQUEST(xRRGetCrtcInfoReq);
     xRRGetCrtcInfoReply	rep;
     RRCrtcPtr			crtc;
     CARD8			*extra;
diff --git a/randr/rroutput.c b/randr/rroutput.c
index a664330..df1741f 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -366,7 +366,7 @@ RROutputInit (void)
 int
 ProcRRGetOutputInfo (ClientPtr client)
 {
-    REQUEST(xRRGetOutputInfoReq);;
+    REQUEST(xRRGetOutputInfoReq);
     xRRGetOutputInfoReply	rep;
     RROutputPtr			output;
     CARD8			*extra;
diff --git a/randr/rrpointer.c b/randr/rrpointer.c
index 802dcb2..c88a0f8 100644
--- a/randr/rrpointer.c
+++ b/randr/rrpointer.c
@@ -103,7 +103,7 @@ void
 RRPointerMoved (ScreenPtr pScreen, int x, int y)
 {
     rrScrPriv (pScreen);
-    RRCrtcPtr	pointerCrtc = pScrPriv->pointerCrtc;;
+    RRCrtcPtr	pointerCrtc = pScrPriv->pointerCrtc;
     int	c;
 
     /* Check last known CRTC */
diff-tree fe7b8f4237874e3e45fe25a6bf06faddfa1ab8e1 (from 537dc5ecde46d0525c503d1d2b39b6eb89a1298e)
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Mon Mar 5 03:48:27 2007 -0800

    began to factor out code to move to darwinEvents.c

diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m
index c50f704..cfc9750 100644
--- a/hw/darwin/apple/X11Application.m
+++ b/hw/darwin/apple/X11Application.m
@@ -855,21 +855,58 @@ convert_flags (unsigned int nsflags) {
     return xflags;
 }
 
+/* Sends a null byte down darwinEventWriteFD, which will cause the
+   Dispatch() event loop to check out event queue */
+void DarwinPokeEQ(void) {
+  char nullbyte=0;
+  input_check_flag++;
+  //  <daniels> bushing: oh, i ... er ... christ.
+  write(darwinEventWriteFD, &nullbyte, 1);
+}
+
+void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) {
+  int i;
+  int valuators[2] = {pointer_x, pointer_y};
+  int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
+				    POINTER_ABSOLUTE, 0, 2, valuators);
+      
+  for(i=0; i<num_events; i++) mieqEnqueue (darwinPointer,&darwinEvents[i]);
+  DarwinPokeEQ();
+}
+
+void DarwinSendKeyboardEvents(int ev_type, int keycode) {
+  int i;
+  int num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
+  for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
+  DarwinPokeEQ();
+}
+
+/* Send the appropriate number of button 4 / 5 clicks to emulate scroll wheel */
+void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y) {
+  int i;
+  int ev_button = count > 0.0f ? 4 : 5;
+  int valuators[2] = {pointer_x, pointer_y};
+
+  for (count = fabs(count); count > 0.0; count = count - 1.0f) {
+    int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, 
+				      POINTER_ABSOLUTE, 0, 2, valuators);
+    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+    num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, 
+				      POINTER_ABSOLUTE, 0, 2, valuators);
+    for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+  }
+  DarwinPokeEQ();
+}
+
 // This code should probably be merged with that in XDarwin's XServer.m - BB
 static void send_nsevent (NSEventType type, NSEvent *e) {
-    static unsigned int button_state = 0;
+  //    static unsigned int button_state = 0;
     NSRect screen;
     NSPoint location;
     NSWindow *window;
     int pointer_x, pointer_y, ev_button, ev_type; 
-    int num_events=0, i=0, state;
-    int valuators[2];
-    float count;
+    //    int num_events=0, i=0, state;
     xEvent xe;
-    char nullbyte=0;
-
-    bzero(&xe, sizeof(xe));
-    input_check_flag++;
 	
     /* convert location to global top-left coordinates */
     location = [e locationInWindow];
@@ -886,11 +923,8 @@ static void send_nsevent (NSEventType ty
       pointer_y = (screen.origin.y + screen.size.height) - location.y;
     }
     
-//    ErrorF("send_nsevent: type=%d pointer=(%d,%d)\n", type, pointer_x, pointer_y);
-    
-    valuators[0] = pointer_x;
-    valuators[1] = pointer_y - aquaMenuBarHeight;
-    state = convert_flags ([e modifierFlags]);
+    pointer_y -= aquaMenuBarHeight;
+    //    state = convert_flags ([e modifierFlags]);
     
     switch (type) {
     case NSLeftMouseDown:    ev_button=1; ev_type=ButtonPress; goto handle_mouse;
@@ -905,50 +939,34 @@ static void send_nsevent (NSEventType ty
     case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
     handle_mouse:
       
-      if(ev_type==ButtonPress) {
+      /* I'm not sure the below code is necessary or useful (-bb)
+	if(ev_type==ButtonPress) {
 	if (!quartzProcs->IsX11Window([e window], [e windowNumber])) {
 	  fprintf(stderr, "Dropping event because it's not a window\n");
 	  break;
 	}
 	button_state |= (1 << ev_button);
+	DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
       } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break;
-      
-      num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
-				    POINTER_ABSOLUTE, 0, 2, valuators);
-      
-      for(i=0; i<num_events; i++)
-	mieqEnqueue (darwinPointer,&darwinEvents[i]);
+      */
+      DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
       break;
     case NSScrollWheel: 
-      count = [e deltaY];
-      ev_button = count > 0.0f ? 4 : 5;
-      for (count = fabs(count); count > 0.0; count = count - 1.0f) {
-	num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, 
-				      POINTER_ABSOLUTE, 0, 2, valuators);
-	for(i=0; i<num_events; i++) 
-	  mieqEnqueue(darwinPointer,&darwinEvents[i]);
-	num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, 
-				      POINTER_ABSOLUTE, 0, 2, valuators);
-	for(i=0; i<num_events; i++)
-	  mieqEnqueue(darwinPointer,&darwinEvents[i]);
-      }
+      DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y);
       break;
       
     case NSKeyDown:  // do we need to translate these keyCodes?
     case NSKeyUp:
-      num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, 
-				     (type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
-      for(i=0; i<num_events; i++) 
-	mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
+      DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
       break;
 
     case NSFlagsChanged:
+      bzero(&xe, sizeof(xe));
       xe.u.u.type = kXDarwinUpdateModifiers;
       xe.u.clientMessage.u.l.longs0 = [e modifierFlags];
       DarwinEQEnqueue (&xe);
+      DarwinPokeEQ();
       break;
     default: break; /* for gcc */
     }	
-    //  <daniels> bushing: oh, i ... er ... christ.
-    write(darwinEventWriteFD, &nullbyte, 1);
 }
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
index 48a2224..fc4a58a 100644
--- a/hw/darwin/darwin.h
+++ b/hw/darwin/darwin.h
@@ -58,6 +58,10 @@ Bool DarwinEQInit(DevicePtr pKbd, Device
 void DarwinEQEnqueue(const xEvent *e);
 void DarwinEQPointerPost(xEvent *e);
 void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+void DarwinPokeEQ(void);
+void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
+void DarwinSendKeyboardEvents(int ev_type, int keycode);
+void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
 
 // From darwinKeyboard.c
 int DarwinModifierNXKeyToNXKeycode(int key, int side);
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index 1eb2336..ac03e5a 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -269,7 +269,7 @@ void ProcessInputEvents(void) {
     static int darwinFakeMouseButtonMask = 0;
     input_check_flag=0;
 
-    ErrorF("calling mieqProcessInputEvents\n");
+    //    ErrorF("calling mieqProcessInputEvents\n");
     mieqProcessInputEvents();
 
     // Empty the signaling pipe
@@ -292,12 +292,12 @@ void ProcessInputEvents(void) {
         xe.u.keyButtonPointer.rootY -= darwinMainScreenY +
                 dixScreenOrigins[miPointerCurrentScreen()->myNum].y;
 	
-	ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n",
+	/*	ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n",
 	       xe.u.keyButtonPointer.rootX, xe.u.keyButtonPointer.rootY,
 	       darwinMainScreenX, darwinMainScreenY,
 	       miPointerCurrentScreen()->myNum,
 	       dixScreenOrigins[miPointerCurrentScreen()->myNum].x,
-	       dixScreenOrigins[miPointerCurrentScreen()->myNum].y);
+	       dixScreenOrigins[miPointerCurrentScreen()->myNum].y); */
 
 	//Assumption - screen switching can only occur on motion events
 
diff-tree 537dc5ecde46d0525c503d1d2b39b6eb89a1298e (from 8ba5e8d82014b774a52f3e050ddbbb8bde4e0933)
Author: Ben Byer <bbyer at bbyer.(none)>
Date:   Mon Mar 5 02:30:56 2007 -0800

    started moving new input code into darwinEvents.c so that it may be shared by the three servers

diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m
index 0be1e40..c50f704 100644
--- a/hw/darwin/apple/X11Application.m
+++ b/hw/darwin/apple/X11Application.m
@@ -56,7 +56,7 @@ extern int darwinFakeButtons, input_chec
 // extern Bool enable_stereo; 
 Bool enable_stereo;  //<-- this needs to go back to being an extern once glxCGL is fixed
 
-static xEvent *quartzEvents;
+extern xEvent *darwinEvents;
 
 X11Application *X11App;
 
@@ -805,7 +805,6 @@ void X11ApplicationMain (int argc, const
     pool = [[NSAutoreleasePool alloc] init];
 	
     X11App = (X11Application *) [X11Application sharedApplication];
-    quartzEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum());
 
     init_ports ();
 	
@@ -914,33 +913,33 @@ static void send_nsevent (NSEventType ty
 	button_state |= (1 << ev_button);
       } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break;
       
-      num_events = GetPointerEvents(quartzEvents, darwinPointer, ev_type, ev_button, 
+      num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 
 				    POINTER_ABSOLUTE, 0, 2, valuators);
       
       for(i=0; i<num_events; i++)
-	mieqEnqueue (darwinPointer,&quartzEvents[i]);
+	mieqEnqueue (darwinPointer,&darwinEvents[i]);
       break;
     case NSScrollWheel: 
       count = [e deltaY];
       ev_button = count > 0.0f ? 4 : 5;
       for (count = fabs(count); count > 0.0; count = count - 1.0f) {
-	num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonPress, ev_button, 
+	num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, 
 				      POINTER_ABSOLUTE, 0, 2, valuators);
 	for(i=0; i<num_events; i++) 
-	  mieqEnqueue(darwinPointer,&quartzEvents[i]);
-	num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonRelease, ev_button, 
+	  mieqEnqueue(darwinPointer,&darwinEvents[i]);
+	num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, 
 				      POINTER_ABSOLUTE, 0, 2, valuators);
 	for(i=0; i<num_events; i++)
-	  mieqEnqueue(darwinPointer,&quartzEvents[i]);
+	  mieqEnqueue(darwinPointer,&darwinEvents[i]);
       }
       break;
       
     case NSKeyDown:  // do we need to translate these keyCodes?
     case NSKeyUp:
-      num_events = GetKeyboardEvents(quartzEvents, darwinKeyboard, 
+      num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, 
 				     (type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
       for(i=0; i<num_events; i++) 
-	mieqEnqueue(darwinKeyboard,&quartzEvents[i]);
+	mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
       break;
 
     case NSFlagsChanged:
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index 2a27ac4..1eb2336 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -74,6 +74,7 @@ typedef struct _EventQueue {
 } EventQueueRec, *EventQueuePtr;
 
 static EventQueueRec darwinEventQueue;
+xEvent *darwinEvents;
 
 /*
  * DarwinPressModifierMask
@@ -179,6 +180,7 @@ static void DarwinSimulateMouseClick(
 
 
 Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) { 
+    darwinEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum());
     mieqInit();
     darwinEventQueue.head = darwinEventQueue.tail = 0;
     darwinEventQueue.lastEventTime = GetTimeInMillis ();
diff-tree 8ba5e8d82014b774a52f3e050ddbbb8bde4e0933 (from 2e31872e05c2408d53ba0182bcddc5dabb3615fe)
Author: Dave Airlie <airlied at linux.ie>
Date:   Mon Mar 5 13:46:41 2007 +1100

    add a standard connector type and name for us as an output property

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 8b13e2b..2ffa956 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1738,3 +1738,12 @@ xf86OutputGetEDID (xf86OutputPtr output,
 
     return xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus);
 }
+
+static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D",
+				      "DVI-A", "Composite", "S-Video",
+				      "Component", "LFP", "Proprietary" };
+char *
+xf86ConnectorGetName(xf86ConnectorType connector)
+{
+    return _xf86ConnectorNames[connector];
+}
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index c8aafc1..537df3a 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -41,6 +41,20 @@
 typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
 typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
 
+/* define a standard for connector types */
+typedef enum _xf86ConnectorType {
+   XF86ConnectorNone,
+   XF86ConnectorVGA,
+   XF86ConnectorDVI_I,
+   XF86ConnectorDVI_D,
+   XF86ConnectorDVI_A,
+   XF86ConnectorComposite,
+   XF86ConnectorSvideo,
+   XF86ConnectorComponent,
+   XF86ConnectorLFP,
+   XF86ConnectorProprietary,
+} xf86ConnectorType;
+
 typedef enum _xf86OutputStatus {
    XF86OutputStatusConnected,
    XF86OutputStatusDisconnected,
@@ -618,4 +632,10 @@ xf86DiDGAReInit (ScreenPtr pScreen);
 void
 xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen);
 
+/*
+ * Get a standard string name for a connector type 
+ */
+char *
+xf86ConnectorGetName(xf86ConnectorType connector);
+
 #endif /* _XF86CRTC_H_ */
diff-tree 2e31872e05c2408d53ba0182bcddc5dabb3615fe (from 06b01186f6ae17aafdd1f628c306466ddea9e065)
Author: Dave Airlie <airlied at linux.ie>
Date:   Mon Feb 26 09:40:00 2007 +1100

    modes: add commit/prepare hooks

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c53d2a8..8b13e2b 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -282,7 +282,7 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
 	goto done;
     }
 
-    /* Disable the outputs and CRTCs before setting the mode. */
+    /* Prepare the outputs and CRTCs before setting the mode. */
     for (i = 0; i < xf86_config->num_output; i++) {
 	xf86OutputPtr output = xf86_config->output[i];
 
@@ -290,10 +290,10 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
 	    continue;
 
 	/* Disable the output as the first thing we do. */
-	output->funcs->dpms(output, DPMSModeOff);
+	output->funcs->prepare(output);
     }
 
-    crtc->funcs->dpms(crtc, DPMSModeOff);
+    crtc->funcs->prepare(crtc);
 
     /* Set up the DPLL and any output state that needs to adjust or depend
      * on the DPLL.
@@ -307,12 +307,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
     }
 
     /* Now, enable the clocks, plane, pipe, and outputs that we set up. */
-    crtc->funcs->dpms(crtc, DPMSModeOn);
+    crtc->funcs->commit(crtc);
     for (i = 0; i < xf86_config->num_output; i++) 
     {
 	xf86OutputPtr output = xf86_config->output[i];
 	if (output->crtc == crtc)
-	    output->funcs->dpms(output, DPMSModeOn);
+	    output->funcs->commit(output);
     }
 
     /* XXX free adjustedmode */
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index b04f7f3..c8aafc1 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -97,6 +97,12 @@ typedef struct _xf86CrtcFuncs {
 		  DisplayModePtr adjusted_mode);
 
     /**
+     * Prepare CRTC for an upcoming mode set.
+     */
+    void
+    (*prepare)(xf86CrtcPtr crtc);
+
+    /**
      * Callback for setting up a video mode after fixups have been made.
      */
     void
@@ -105,6 +111,12 @@ typedef struct _xf86CrtcFuncs {
 		DisplayModePtr adjusted_mode,
 		int x, int y);
 
+    /**
+     * Commit mode changes to a CRTC
+     */
+    void
+    (*commit)(xf86CrtcPtr crtc);
+
     /* Set the color ramps for the CRTC to the given values. */
     void
     (*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
@@ -264,6 +276,18 @@ typedef struct _xf86OutputFuncs {
 		  DisplayModePtr adjusted_mode);
 
     /**
+     * Callback for preparing mode changes on an output
+     */
+    void
+    (*prepare)(xf86OutputPtr output);
+
+    /**
+     * Callback for committing mode changes on an output
+     */
+    void
+    (*commit)(xf86OutputPtr output);
+
+    /**
      * Callback for setting up a video mode after fixups have been made.
      *
      * This is only called while the output is disabled.  The dpms callback
diff-tree 06b01186f6ae17aafdd1f628c306466ddea9e065 (from c14507b6837387d867792a24778786311b2b38d5)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sun Mar 4 17:15:24 2007 -0800

    Remove debugging ErrorF from rotation code.
    (cherry picked from commit e6af7569f201842b4754aec6e72b30dc2daefdfb)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index ef637ee..6826b62 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -143,10 +143,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crt
 			 &include_inferiors,
 			 serverClient,
 			 &error);
-    if (!src) {
-	ErrorF("couldn't create src pict\n");
+    if (!src)
 	return;
-    }
+
     dst = CreatePicture (None,
 			 &dst_pixmap->drawable,
 			 format,
@@ -154,10 +153,8 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crt
 			 NULL,
 			 serverClient,
 			 &error);
-    if (!dst) {
-	ErrorF("couldn't create src pict\n");
+    if (!dst)
 	return;
-    }
 
     memset (&transform, '\0', sizeof (transform));
     transform.matrix[2][2] = IntToxFixed(1);
@@ -198,17 +195,13 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crt
     }
 
     error = SetPictureTransform (src, &transform);
-    if (error) {
-	ErrorF("Couldn't set transform\n");
+    if (error)
 	return;
-    }
 
     while (n--)
     {
 	BoxRec	dst_box;
 
-	ErrorF ("painting %d,%d - %d,%d\n",
-		b->x1, b->y1, b->x2, b->y2);
 	xf86TransformBox (&dst_box, b, crtc->rotation,
 			  crtc->x, crtc->y,
 			  crtc->mode.HDisplay, crtc->mode.VDisplay);
@@ -235,8 +228,6 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
     damage_box.x2 = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation);
     damage_box.y1 = crtc->y;
     damage_box.y2 = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation);
-    ErrorF ("damaged %d,%d - %d,%d\n",
-	    damage_box.x1, damage_box.y1, damage_box.x2, damage_box.y2);
     REGION_INIT (pScreen, &damage_region, &damage_box, 1);
     DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
 			&damage_region);
diff-tree c14507b6837387d867792a24778786311b2b38d5 (from 97978b515b7af5fbaaa32b1729e835f3bfb9f5c6)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sun Mar 4 17:06:37 2007 -0800

    Handle non-zero origin rotated crtc. Damage crtc area on re-rotate.
    
    Box transformation from source to dest area was broken, leaving the wrong
    areas painted when the crtc origin was non-zero.
    
    When rotating from left to right, the pixmap doesn't get reallocated, and so
    no damage was left in the pixmap from xf86RotatePrepare. Separately damage
    the whole crtc area when this occurs to repaint the area.
    (cherry picked from commit 2a50ca2160bc05af1c24421ec079e902ff730277)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 7b20498..ef637ee 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -69,31 +69,44 @@ compWindowFormat (WindowPtr pWin)
 }
 
 static void
-xf86RotateBox (BoxPtr dst, BoxPtr src, Rotation rotation,
-	       int dest_width, int dest_height)
+xf86TranslateBox (BoxPtr b, int dx, int dy)
 {
+    b->x1 += dx;
+    b->y1 += dy;
+    b->x2 += dx;
+    b->y2 += dy;
+}
+
+static void
+xf86TransformBox (BoxPtr dst, BoxPtr src, Rotation rotation,
+		  int xoff, int yoff,
+		  int dest_width, int dest_height)
+{
+    BoxRec  stmp = *src;
+    
+    xf86TranslateBox (&stmp, -xoff, -yoff);
     switch (rotation & 0xf) {
     default:
     case RR_Rotate_0:
-	*dst = *src;
+	*dst = stmp;
 	break;
     case RR_Rotate_90:
-	dst->x1 = src->y1;
-	dst->y1 = dest_height - src->x2;
-	dst->x2 = src->y2;
-	dst->y2 = dest_height - src->x1;
+	dst->x1 = stmp.y1;
+	dst->y1 = dest_height - stmp.x2;
+	dst->x2 = stmp.y2;
+	dst->y2 = dest_height - stmp.x1;
 	break;
     case RR_Rotate_180:
-	dst->x1 = dest_width - src->x2;
-	dst->y1 = dest_height - src->y2;
-	dst->x2 = dest_width - src->x1;
-	dst->y2 = dest_height - src->y1;
+	dst->x1 = dest_width - stmp.x2;
+	dst->y1 = dest_height - stmp.y2;
+	dst->x2 = dest_width - stmp.x1;
+	dst->y2 = dest_height - stmp.y1;
 	break;
     case RR_Rotate_270:
-	dst->x1 = dest_width - src->y2;
-	dst->y1 = src->x1;
-	dst->y2 = src->x2;
-	dst->x2 = dest_width - src->y1;
+	dst->x1 = dest_width - stmp.y2;
+	dst->y1 = stmp.x1;
+	dst->y2 = stmp.x2;
+	dst->x2 = dest_width - stmp.y1;
 	break;
     }
     if (rotation & RR_Reflect_X) {
@@ -194,8 +207,11 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crt
     {
 	BoxRec	dst_box;
 
-	xf86RotateBox (&dst_box, b, crtc->rotation,
-		       crtc->mode.HDisplay, crtc->mode.VDisplay);
+	ErrorF ("painting %d,%d - %d,%d\n",
+		b->x1, b->y1, b->x2, b->y2);
+	xf86TransformBox (&dst_box, b, crtc->rotation,
+			  crtc->x, crtc->y,
+			  crtc->mode.HDisplay, crtc->mode.VDisplay);
 	CompositePicture (PictOpSrc,
 			  src, NULL, dst,
 			  dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1,
@@ -208,6 +224,26 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crt
 }
 
 static void
+xf86CrtcDamageShadow (xf86CrtcPtr crtc)
+{
+    ScrnInfoPtr	pScrn = crtc->scrn;
+    BoxRec	damage_box;
+    RegionRec   damage_region;
+    ScreenPtr	pScreen = pScrn->pScreen;
+
+    damage_box.x1 = crtc->x;
+    damage_box.x2 = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation);
+    damage_box.y1 = crtc->y;
+    damage_box.y2 = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation);
+    ErrorF ("damaged %d,%d - %d,%d\n",
+	    damage_box.x1, damage_box.y1, damage_box.x2, damage_box.y2);
+    REGION_INIT (pScreen, &damage_region, &damage_box, 1);
+    DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+			&damage_region);
+    REGION_UNINIT (pScreen, &damage_region);
+}
+
+static void
 xf86RotatePrepare (ScreenPtr pScreen)
 {
     ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
@@ -220,9 +256,6 @@ xf86RotatePrepare (ScreenPtr pScreen)
 	
 	if (crtc->rotatedData && !crtc->rotatedPixmap)
 	{
-	    BoxRec	    damage_box;
-	    RegionRec   damage_region;
-
 	    crtc->rotatedPixmap = crtc->funcs->shadow_create (crtc,
 							     crtc->rotatedData,
 							     crtc->mode.HDisplay,
@@ -231,14 +264,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
 	    DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
 			    xf86_config->rotationDamage);
 	    
-	    damage_box.x1 = 0;
-	    damage_box.y1 = 0;
-	    damage_box.x2 = xf86ModeWidth (&crtc->mode, crtc->rotation);
-	    damage_box.y2 = xf86ModeHeight (&crtc->mode, crtc->rotation);
-	    REGION_INIT (pScreen, &damage_region, &damage_box, 1);
-	    DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
-				&damage_region);
-	    REGION_UNINIT (pScreen, &damage_region);
+	    xf86CrtcDamageShadow (crtc);
 	}
     }
 }
@@ -357,6 +383,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	    if (!shadowData)
 		goto bail1;
 	    crtc->rotatedData = shadowData;
+	    /* shadow will be damaged in xf86RotatePrepare */
+	}
+	else
+	{
+	    /* mark shadowed area as damaged so it will be repainted */
+	    xf86CrtcDamageShadow (crtc);
 	}
 	
 	if (!xf86_config->rotationDamage)
diff-tree 97978b515b7af5fbaaa32b1729e835f3bfb9f5c6 (from 215e3691b76a63e6af19865790193b20b105ec5a)
Author: Drew Parsons <drew at pug.localdomain>
Date:   Sun Mar 4 16:28:54 2007 +1100

    Xprint: fix font symlinks
    
    Change symlinks to Xprint base fonts in model/PSdefault using local
    relative links.  This facilitates moving the Xprint config files, for
    instance for FHS compliance placing data files in /usr/share rather
    than /usr/lib.  Also ensures NewCenturySchlbk-BoldItalic.pmf is
    installed.

diff --git a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
index 5be5419..c574c5c 100644
--- a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am
@@ -1,6 +1,6 @@
 xpcdir = @xpconfigdir@/C/print/models/CANONC3200-PS/fonts
 
-parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts
+parentdir = ../../PSdefault/fonts
 
 XPFONTS = \
         AvantGarde-Book.pmf \
diff --git a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
index 2ff9ab7..634db1f 100644
--- a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am
@@ -1,6 +1,6 @@
 xpcdir = @xpconfigdir@/C/print/models/HPLJ4050-PS/fonts
 
-parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts
+parentdir = ../../PSdefault/fonts
 
 XPFONTS = \
         AvantGarde-Book.pmf \
diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
index e7ddb6c..1e8c8a7 100644
--- a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am
@@ -18,6 +18,7 @@ dist_xpc_DATA =				\
 	LubalinGraph-DemiOblique.pmf	\
 	LubalinGraph-Demi.pmf		\
 	NewCenturySchlbk-Bold.pmf	\
+	NewCenturySchlbk-BoldItalic.pmf \
 	NewCenturySchlbk-Italic.pmf	\
 	NewCenturySchlbk-Roman.pmf	\
 	Souvenir-DemiItalic.pmf		\
diff --git a/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am b/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am
index 8cc2694..d1ee6cf 100644
--- a/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am
+++ b/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am
@@ -1,6 +1,6 @@
 xpcdir = @xpconfigdir@/C/print/models/SPSPARC2/fonts
 
-parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts
+parentdir = ../../PSdefault/fonts
 
 XPFONTS = \
         Courier-Bold.pmf \
diff-tree 215e3691b76a63e6af19865790193b20b105ec5a (from ea8dcc458ea8870126cf8d3e21cab9d63d094c5e)
Author: Ben Byer <bbyer at xyzzy.local>
Date:   Sat Mar 3 21:52:56 2007 -0800

    stopped using XTrans internals in X11.app because they're apparently no longer public

diff --git a/hw/darwin/apple/bundle-main.c b/hw/darwin/apple/bundle-main.c
index 12fb1bf..a35e1e3 100644
--- a/hw/darwin/apple/bundle-main.c
+++ b/hw/darwin/apple/bundle-main.c
@@ -601,10 +601,10 @@ display_exists_p (int number)
     int idisplay, iscreen;
     char *conn_auth_name, *conn_auth_data;
     int conn_auth_namelen, conn_auth_datalen;
-	
+#ifdef USE_XTRANS_INTERNALS	
     extern void *_X11TransConnectDisplay ();
     extern void _XDisconnectDisplay ();
-	
+#endif	
     /* Since connecting to the display waits for a few seconds if the
 	 display doesn't exist, check for trivial non-existence - if the
 	 socket in /tmp exists or not.. (note: if the socket exists, the
@@ -613,7 +613,7 @@ display_exists_p (int number)
     sprintf (buf, "/tmp/.X11-unix/X%d", number);
     if (access (buf, F_OK) != 0)
 		return FALSE;
-	
+#ifdef USE_XTRANS_INTERNALS	
     /* This is a private function that we shouldn't really be calling,
 	 but it's the best way to see if the server exists (without
 	 needing to hold the necessary authentication to use it) */
@@ -626,6 +626,7 @@ display_exists_p (int number)
 		return FALSE;
 	
     _XDisconnectDisplay (conn);
+#endif
     return TRUE;
 }
 
diff-tree ea8dcc458ea8870126cf8d3e21cab9d63d094c5e (from 18508212599bf0964c450c69b9790208e5d428be)
Author: Ben Byer <bbyer at xyzzy.local>
Date:   Sat Mar 3 21:51:20 2007 -0800

    Makefile fix for X11.app

diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index 46642cd..75d028e 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -275,7 +275,7 @@ install-data-hook: $(HOOK_TARGETS)
 
 xquartz-install-hook:
 	mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
-	cd apple && xcodebuild install
+        cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
 
 EXTRA_DIST = \
 	darwin.c \
diff-tree 18508212599bf0964c450c69b9790208e5d428be (from 7f2b9f3790456044d01bf8e6404f9a1239b41da6)
Author: Ben Byer <bbyer at xyzzy.local>
Date:   Sat Mar 3 21:41:33 2007 -0800

    fixed X11.xcodeproj to get CFLAGS and LDFLAGS from autoconf script

diff --git a/hw/darwin/apple/X11.xcodeproj/project.pbxproj b/hw/darwin/apple/X11.xcodeproj/project.pbxproj
index 7ca75d4..2fef99b 100644
--- a/hw/darwin/apple/X11.xcodeproj/project.pbxproj
+++ b/hw/darwin/apple/X11.xcodeproj/project.pbxproj
@@ -224,15 +224,12 @@
 				DSTROOT = "$(DSTROOT)";
 				FRAMEWORK_SEARCH_PATHS = "";
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				HEADER_SEARCH_PATHS = /usr/X11/include;
+				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_FILE = Info.plist;
 				INSTALL_PATH = $DSTROOT/Applications/Utilties;
-				LIBRARY_SEARCH_PATHS = /usr/X11/lib;
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = (
-					"-lXau",
-					"-lX11",
-				);
+				LIBRARY_SEARCH_PATHS = "";
+				OTHER_CFLAGS = "$(CFLAGS)";
+				OTHER_LDFLAGS = "$(LDFLAGS)";
 				OTHER_REZFLAGS = "";
 				PRODUCT_NAME = X11;
 				SECTORDER_FLAGS = "";
@@ -252,15 +249,12 @@
 				DSTROOT = "$(DSTROOT)";
 				FRAMEWORK_SEARCH_PATHS = "";
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				HEADER_SEARCH_PATHS = /usr/X11/include;
+				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_FILE = Info.plist;
 				INSTALL_PATH = $DSTROOT/Applications/Utilties;
-				LIBRARY_SEARCH_PATHS = /usr/X11/lib;
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = (
-					"-lXau",
-					"-lX11",
-				);
+				LIBRARY_SEARCH_PATHS = "";
+				OTHER_CFLAGS = "$(CFLAGS)";
+				OTHER_LDFLAGS = "$(LDFLAGS)";
 				OTHER_REZFLAGS = "";
 				PRODUCT_NAME = X11;
 				SECTORDER_FLAGS = "";
@@ -279,15 +273,12 @@
 				DSTROOT = "$(DSTROOT)";
 				FRAMEWORK_SEARCH_PATHS = "";
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				HEADER_SEARCH_PATHS = /usr/X11/include;
+				HEADER_SEARCH_PATHS = "";
 				INFOPLIST_FILE = Info.plist;
 				INSTALL_PATH = $DSTROOT/Applications/Utilties;
-				LIBRARY_SEARCH_PATHS = /usr/X11/lib;
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = (
-					"-lXau",
-					"-lX11",
-				);
+				LIBRARY_SEARCH_PATHS = "";
+				OTHER_CFLAGS = "$(CFLAGS)";
+				OTHER_LDFLAGS = "$(LDFLAGS)";
 				OTHER_REZFLAGS = "";
 				PRODUCT_NAME = X11;
 				SECTORDER_FLAGS = "";
diff-tree 7f2b9f3790456044d01bf8e6404f9a1239b41da6 (from ea1a72946d1aa4c256e6afb9d834c582ba4ac3a1)
Author: Ben Byer <bbyer at xyzzy.local>
Date:   Sat Mar 3 19:27:53 2007 -0800

    autoconf fixes for XDarwin (created DARWIN_LIBS)

diff --git a/configure.ac b/configure.ac
index 9386d87..fe77709 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1298,6 +1298,8 @@ return 0;}
 #               LDFLAGS=$save_LDFLAGS
 #               ])
                xorg_cv_AGL_framework=no
+	       DARWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
+	       AC_SUBST([DARWIN_LIBS])
                AC_CHECK_LIB([Xplugin],[xp_init],[:])
                AC_SUBST([APPLE_APPLICATIONS_DIR])
                CFLAGS="${CFLAGS} -D__DARWIN__"
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index 9b4628e..46642cd 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -17,7 +17,6 @@ SUBDIRS = \
 	  utils \
 	  .
 
-
 darwinappdir = @APPLE_APPLICATIONS_DIR@/XDarwin.app
 
 libdarwinShared_a_SOURCES = darwin.c \
@@ -62,25 +61,11 @@ XDarwin_LDADD = \
 		$(top_builddir)/dix/dixfonts.lo \
 		$(top_builddir)/dix/libdix.la \
 		$(top_builddir)/config/libconfig.a \
-		$(top_builddir)/os/libos.la \
 		./libdarwinShared.a \
 		./iokit/libiokit.a \
-		$(top_builddir)/dix/libxpstubs.la \
 		$(top_builddir)/miext/shadow/libshadow.la \
-		$(top_builddir)/fb/libfb.la \
-		$(top_builddir)/composite/libcomposite.la \
-		$(top_builddir)/damageext/libdamageext.la \
-		$(top_builddir)/miext/damage/libdamage.la \
-		$(top_builddir)/xfixes/libxfixes.la \
 		$(top_builddir)/miext/cw/libcw.la \
-		$(top_builddir)/Xext/libXext.la \
-		$(top_builddir)/xkb/libxkb.la \
-		$(top_builddir)/xkb/libxkbstubs.la \
-		$(top_builddir)/Xi/libXi.la \
-		$(top_builddir)/dbe/libdbe.la \
-		$(top_builddir)/record/librecord.la \
-		$(top_builddir)/XTrap/libxtrap.la \
-		$(XGLX_LIBS) \
+		$(DARWIN_LIBS) \
 		$(top_builddir)/miext/rootless/librootless.la \
 		$(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
 		$(top_builddir)/miext/rootless/accel/librlAccel.la \
@@ -91,23 +76,10 @@ Xquartz_LDADD = \
 		$(top_builddir)/dix/dixfonts.lo \
 		$(top_builddir)/dix/libdix.la \
 		$(top_builddir)/config/libconfig.a \
-		$(top_builddir)/os/libos.la \
 		./libdarwinShared.a \
-		$(top_builddir)/dix/libxpstubs.la \
 		$(top_builddir)/miext/shadow/libshadow.la \
-		$(top_builddir)/fb/libfb.la \
-		$(top_builddir)/composite/libcomposite.la \
-		$(top_builddir)/damageext/libdamageext.la \
-		$(top_builddir)/miext/damage/libdamage.la \
-		$(top_builddir)/xfixes/libxfixes.la \
 		$(top_builddir)/miext/cw/libcw.la \
-		$(top_builddir)/Xext/libXext.la \
-		$(top_builddir)/xkb/libxkb.la \
-		$(top_builddir)/xkb/libxkbstubs.la \
-		$(top_builddir)/Xi/libXi.la \
-		$(top_builddir)/dbe/libdbe.la \
-		$(top_builddir)/record/librecord.la \
-		$(top_builddir)/XTrap/libxtrap.la \
+		$(DARWIN_LIBS) \
 		$(top_builddir)/miext/rootless/librootless.la \
 		$(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
 		$(top_builddir)/miext/rootless/accel/librlAccel.la \
@@ -155,28 +127,14 @@ XDarwinApp_LDADD = \
 		./quartz/XApplication.o \
 		./libdarwinShared.a \
 		./quartz/libXQuartz.a \
-		$(top_builddir)/dix/libxpstubs.la \
 		 $(top_builddir)/miext/shadow/libshadow.la \
-		 $(top_builddir)/fb/libfb.la \
-		 $(top_builddir)/composite/libcomposite.la \
-		 $(top_builddir)/damageext/libdamageext.la \
-		 $(top_builddir)/miext/damage/libdamage.la \
-		 $(top_builddir)/xfixes/libxfixes.la \
 		 $(top_builddir)/miext/cw/libcw.la \
-		 $(top_builddir)/Xext/libXext.la \
-		 $(top_builddir)/xkb/libxkb.la \
-		 $(top_builddir)/xkb/libxkbstubs.la \
-		 $(top_builddir)/Xi/libXi.la \
-		 $(top_builddir)/dbe/libdbe.la \
-		 $(top_builddir)/record/librecord.la \
-		 $(top_builddir)/XTrap/libxtrap.la \
-		 $(XGLX_LIBS) \
+		 $(DARWIN_LIBS) \
 		 $(top_builddir)/miext/rootless/librootless.la \
 		 $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
 		 $(top_builddir)/miext/rootless/accel/librlAccel.la \
 		 @XORG_LIBS@ \
-		 $(XSERVER_LIBS) \
-		 $(top_builddir)/fb/libfb.la 
+		 $(XSERVER_LIBS)
 
 XDarwinApp_LDFLAGS =  \
 		 -XCClinker -Objc \



More information about the xorg-commit mailing list