xserver: Branch 'master' - 4 commits

Daniel Stone daniels at kemper.freedesktop.org
Wed Jun 10 11:16:04 PDT 2009


 hw/kdrive/ephyr/XF86dri.c     |   46 ++--------
 hw/kdrive/ephyr/ephyr.c       |   20 +---
 hw/kdrive/ephyr/ephyrdriext.c |   44 ++++-----
 hw/kdrive/ephyr/hostx.c       |    2 
 hw/kdrive/linux/evdev.c       |   15 ---
 hw/kdrive/linux/keyboard.c    |    6 -
 hw/kdrive/linux/linux.c       |    2 
 hw/kdrive/src/Makefile.am     |    1 
 hw/kdrive/src/kdrive.c        |    7 -
 hw/kdrive/src/kdrive.h        |    7 -
 hw/kdrive/src/kinput.c        |   72 +++-------------
 hw/kdrive/src/kkeymap.c       |  189 ------------------------------------------
 hw/kdrive/src/kkeymap.h       |   55 ------------
 os/osinit.c                   |   12 +-
 14 files changed, 75 insertions(+), 403 deletions(-)

New commits:
commit 3ea747c0dbbec0db6761d66d4f6c680d2e9ddeaf
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sat Apr 25 16:53:18 2009 +1000

    KDrive: Warning fixes
    
    xEvent vs. InternalEvent confusion still reigns though.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 26296b5..5cfe54f 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -99,7 +99,6 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
     WindowPtr	pChild;
     Bool	WasViewable;
     Bool	anyMarked = FALSE;
-    RegionPtr	pOldClip = 0;
     WindowPtr   pLayerWin;
     BoxRec	box;
 
@@ -340,7 +339,7 @@ AbortDDX(void)
 }
 
 void
-ddxGiveUp ()
+ddxGiveUp (void)
 {
     AbortDDX ();
 }
@@ -1316,10 +1315,10 @@ OsVendorFatalError(void)
 {
 }
 
-#ifdef DPMSExtension
 int
 DPMSSet(ClientPtr client, int level)
 {
+    return Success;
 }
 
 Bool
@@ -1327,5 +1326,3 @@ DPMSSupported (void)
 {
     return FALSE;
 }
-#endif
-
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 94bdfe8..740852e 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -319,7 +319,7 @@ KdDisableInput (void)
 void
 KdEnableInput (void)
 {
-    xEvent xE;
+    InternalEvent ev;
     KdKeyboardInfo *ki;
     KdPointerInfo *pi;
     
@@ -336,8 +336,8 @@ KdEnableInput (void)
     }
 
     /* reset screen saver */
-    xE.u.keyButtonPointer.time = GetTimeInMillis ();
-    NoticeEventTime (&xE);
+    ev.any.time = GetTimeInMillis ();
+    NoticeEventTime (&ev);
 
     KdUnblockSigio ();
 }
@@ -1655,7 +1655,7 @@ char *kdActionNames[] = {
 #endif /* DEBUG */
 
 static void
-KdQueueEvent (DeviceIntPtr pDev, xEvent *ev)
+KdQueueEvent (DeviceIntPtr pDev, InternalEvent *ev)
 {
     KdAssertSigioBlocked ("KdQueueEvent");
     mieqEnqueue (pDev, ev);
@@ -1833,7 +1833,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo   *ki,
 
         nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code);
         for (i = 0; i < nEvents; i++)
-            KdQueueEvent(ki->dixdev, (kdEvents + i)->event);
+            KdQueueEvent(ki->dixdev, (InternalEvent *)((kdEvents + i)->event));
     }
     else {
         ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n",
@@ -1943,7 +1943,7 @@ _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z,
     nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel,
                                0, 3, valuators);
     for (i = 0; i < nEvents; i++)
-        KdQueueEvent(pi->dixdev, (kdEvents + i)->event);
+        KdQueueEvent(pi->dixdev, (InternalEvent *)((kdEvents + i)->event));
 }
 
 void
@@ -2134,7 +2134,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
 };
 
 void
-ProcessInputEvents ()
+ProcessInputEvents (void)
 {
     mieqProcessInputEvents();
     miPointerUpdateSprite(inputInfo.pointer);
@@ -2271,16 +2271,16 @@ NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
 
     if (pi) {
         if (KdAddPointer(pi) != Success ||
-            ActivateDevice(pi->dixdev) != Success ||
-            EnableDevice(pi->dixdev) != TRUE) {
+            ActivateDevice(pi->dixdev, TRUE) != Success ||
+            EnableDevice(pi->dixdev, TRUE) != TRUE) {
             ErrorF("couldn't add or enable pointer\n");
             return BadImplementation;
         }
     }
     else if (ki) {
         if (KdAddKeyboard(ki) != Success ||
-            ActivateDevice(ki->dixdev) != Success ||
-            EnableDevice(ki->dixdev) != TRUE) {
+            ActivateDevice(ki->dixdev, TRUE) != Success ||
+            EnableDevice(ki->dixdev, TRUE) != TRUE) {
             ErrorF("couldn't add or enable keyboard\n");
             return BadImplementation;
         }
@@ -2298,5 +2298,5 @@ NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
 void
 DeleteInputDeviceRequest(DeviceIntPtr pDev)
 {
-    RemoveDevice(pDev);
+    RemoveDevice(pDev, TRUE);
 }
commit 754be1e2ec9be2486bf45000d7244d217556de07
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sat Apr 25 16:51:48 2009 +1000

    KDrive: Xephyr: DRI: Warning fixes
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index a127aef..6e915ab 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -615,10 +615,10 @@ ProcXF86DRIQueryVersion (register ClientPtr client)
 {
     xXF86DRIQueryVersionReply rep;
     register int n;
+    REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
 
     EPHYR_LOG ("enter\n") ;
 
-    REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
@@ -643,10 +643,10 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
     xXF86DRIQueryDirectRenderingCapableReply	rep;
     Bool isCapable;
     register int n;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
     REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
 	client->errorValue = stuff->screen;
 	return BadValue;
@@ -681,10 +681,10 @@ ProcXF86DRIOpenConnection (register ClientPtr client)
     xXF86DRIOpenConnectionReply rep;
     drm_handle_t			hSAREA;
     char*			busIdString;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRIOpenConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
 	client->errorValue = stuff->screen;
 	return BadValue;
@@ -722,10 +722,10 @@ static int
 ProcXF86DRIAuthConnection  (register ClientPtr client)
 {
     xXF86DRIAuthConnectionReply rep;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRIAuthConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
 	client->errorValue = stuff->screen;
 	return BadValue;
@@ -748,9 +748,9 @@ ProcXF86DRIAuthConnection  (register ClientPtr client)
 static int
 ProcXF86DRICloseConnection (register ClientPtr client)
 {
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRICloseConnectionReq);
     REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq);
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
@@ -769,10 +769,10 @@ ProcXF86DRIGetClientDriverName (register ClientPtr client)
 {
     xXF86DRIGetClientDriverNameReply	rep;
     char* clientDriverName;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRIGetClientDriverNameReq);
     REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
 	client->errorValue = stuff->screen;
 	return BadValue;
@@ -811,10 +811,10 @@ ProcXF86DRICreateContext (register ClientPtr client)
     VisualPtr visual;
     int i=0;
     unsigned long context_id=0;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRICreateContextReq);
     REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
 	client->errorValue = stuff->screen;
 	return BadValue;
@@ -852,10 +852,10 @@ ProcXF86DRICreateContext (register ClientPtr client)
 static int
 ProcXF86DRIDestroyContext (register ClientPtr client)
 {
-    EPHYR_LOG ("enter\n") ;
-
     REQUEST(xXF86DRIDestroyContextReq);
     REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq);
+    EPHYR_LOG ("enter\n") ;
+
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
@@ -1024,10 +1024,10 @@ ProcXF86DRICreateDrawable (ClientPtr client)
     EphyrWindowPair *pair=NULL ;
     EphyrDRIWindowPrivPtr win_priv=NULL;
     int rc=0, remote_win=0;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRICreateDrawableReq);
     REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
@@ -1083,12 +1083,12 @@ ProcXF86DRICreateDrawable (ClientPtr client)
 static int
 ProcXF86DRIDestroyDrawable (register ClientPtr client)
 {
-    REQUEST(xXF86DRIDestroyDrawableReq);
     DrawablePtr drawable=NULL;
     WindowPtr window=NULL;
     EphyrWindowPair *pair=NULL;
-    REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
     int rc=0;
+    REQUEST(xXF86DRIDestroyDrawableReq);
+    REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
 
     EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
@@ -1134,11 +1134,11 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client)
     int X=0, Y=0, W=0, H=0, backX=0, backY=0, rc=0, i=0;
     drm_clip_rect_t *clipRects=NULL;
     drm_clip_rect_t *backClipRects=NULL;
+    REQUEST(xXF86DRIGetDrawableInfoReq);
+    REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
 
     EPHYR_LOG ("enter\n") ;
     memset (&rep, 0, sizeof (rep)) ;
-    REQUEST(xXF86DRIGetDrawableInfoReq);
-    REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
@@ -1265,10 +1265,10 @@ ProcXF86DRIGetDeviceInfo (register ClientPtr client)
     xXF86DRIGetDeviceInfoReply	rep;
     drm_handle_t hFrameBuffer;
     void *pDevPrivate;
-
-    EPHYR_LOG ("enter\n") ;
     REQUEST(xXF86DRIGetDeviceInfoReq);
     REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq);
+
+    EPHYR_LOG ("enter\n") ;
     if (stuff->screen >= screenInfo.numScreens) {
         client->errorValue = stuff->screen;
         return BadValue;
commit f534e6bea17746db952feb563ffea7320846b49d
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sat Apr 25 15:38:54 2009 +1000

    OS: Fix compile warnings
    
    It's a marvel the sigaction() ever actually worked.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/os/osinit.c b/os/osinit.c
index 1559135..17a2bed 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -136,8 +136,8 @@ OsSigHandler(int signo)
 
 #ifdef SA_SIGINFO
   if (sip->si_code == SI_USER) {
-      ErrorF("Recieved signal %ld sent by process %ld, uid %ld\n",
-              (long) sip->si_code, (long) sip->si_pid, (long) sip->si_uid);
+      ErrorF("Recieved signal %d sent by process %ld, uid %ld\n",
+	     signo, (long) sip->si_pid, (long) sip->si_uid);
   } else {
       switch (signo) {
           case SIGSEGV:
@@ -179,10 +179,12 @@ OsInit(void)
 #endif
 			  0 /* must be last */ };
 	sigemptyset(&act.sa_mask);
-	act.sa_handler = OsSigHandler;
-	act.sa_flags = 0;
 #ifdef SA_SIGINFO
-	act.sa_flags |= SA_SIGINFO;
+	act.sa_sigaction = OsSigHandler;
+	act.sa_flags = SA_SIGINFO;
+#else
+        act.sa_handler = OsSigHandler;
+        act.sa_flags = 0;
 #endif
 	for (i = 0; siglist[i] != 0; i++) {
 	    if (sigaction(siglist[i], &act, &oact)) {
commit 305ab237f666936cd812c464bf43f86f6079838e
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sat Apr 25 22:11:19 2009 +1000

    KDrive: Warning fixes and cleanups
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c
index 237033a..e94a7f0 100644
--- a/hw/kdrive/ephyr/XF86dri.c
+++ b/hw/kdrive/ephyr/XF86dri.c
@@ -133,11 +133,8 @@ Bool XF86DRIQueryExtension (Display *dpy, int *event_basep, int *error_basep)
     }
 }
 
-Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
-    Display* dpy;
-    int* majorVersion; 
-    int* minorVersion;
-    int* patchVersion;
+Bool XF86DRIQueryVersion(Display *dpy, int *majorVersion, int *minorVersion,
+                         int *patchVersion)
 {
     XExtDisplayInfo *info = find_display (dpy);
     xXF86DRIQueryVersionReply rep;
@@ -241,10 +238,7 @@ XF86DRIOpenConnection (Display *dpy, int screen,
     return True;
 }
 
-Bool XF86DRIAuthConnection(dpy, screen, magic)
-    Display* dpy;
-    int screen;
-    drm_magic_t magic;
+Bool XF86DRIAuthConnection(Display *dpy, int screen, drm_magic_t magic)
 {
     XExtDisplayInfo *info = find_display (dpy);
     xXF86DRIAuthConnectionReq *req;
@@ -272,9 +266,7 @@ Bool XF86DRIAuthConnection(dpy, screen, magic)
     return True;
 }
 
-Bool XF86DRICloseConnection(dpy, screen)
-    Display* dpy;
-    int screen;
+Bool XF86DRICloseConnection(Display *dpy, int screen)
 {
     XExtDisplayInfo *info = find_display (dpy);
     xXF86DRICloseConnectionReq *req;
@@ -294,14 +286,11 @@ Bool XF86DRICloseConnection(dpy, screen)
     return True;
 }
 
-Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, 
-	ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
-    Display* dpy;
-    int screen;
-    int* ddxDriverMajorVersion;
-    int* ddxDriverMinorVersion;
-    int* ddxDriverPatchVersion;
-    char** clientDriverName;
+Bool XF86DRIGetClientDriverName(Display *dpy, int screen,
+                                int *ddxDriverMajorVersion,
+	                        int *ddxDriverMinorVersion,
+                                int *ddxDriverPatchVersion,
+                                char **clientDriverName)
 {
     XExtDisplayInfo *info = find_display (dpy);
     xXF86DRIGetClientDriverNameReply rep;
@@ -344,13 +333,8 @@ Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
     return True;
 }
 
-Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
-	hHWContext)
-    Display* dpy;
-    int screen;
-    int configID;
-    XID* context;
-    drm_context_t * hHWContext;
+Bool XF86DRICreateContextWithConfig(Display *dpy, int screen, int configID,
+                                    XID *context, drm_context_t *hHWContext)
 {
     XExtDisplayInfo *info = find_display (dpy);
     xXF86DRICreateContextReply rep;
@@ -380,12 +364,8 @@ Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
     return True;
 }
 
-Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
-    Display* dpy;
-    int screen;
-    Visual* visual;
-    XID* context;
-    drm_context_t * hHWContext;
+Bool XF86DRICreateContext(Display *dpy, int screen, Visual *visual,
+                          XID *context, drm_context_t *hHWContext)
 {
     return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
 					   context, hHWContext );
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 345ae5b..296284a 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -429,9 +429,7 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
   RRScreenSizePtr	    pSize;
   Rotation		    randr;
   int			    n = 0;
-  
-  EPHYR_LOG("mark");
-  
+ 
   struct { int width, height; } sizes[] = 
     {
       { 1600, 1200 },
@@ -452,6 +450,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
       { 0, 0 }
     };
 
+  EPHYR_LOG("mark");
+
   *rotations = RR_Rotate_All|RR_Reflect_All;
 
   if (!hostx_want_preexisting_window (screen)
@@ -743,6 +743,7 @@ ephyrScreenFini (KdScreenInfo *screen)
 void
 ephyrUpdateModifierState(unsigned int state)
 {
+#if 0
   DeviceIntPtr pkeydev;
   KeyClassPtr  keyc;
   int          i;
@@ -764,7 +765,7 @@ ephyrUpdateModifierState(unsigned int state)
  *
  * -daniels
  */
-#if 0
+
   keyc = pkeydev->key;
   
   state = state & 0xff;
@@ -1120,13 +1121,8 @@ EphyrKeyboardInit (KdKeyboardInfo *ki)
       ErrorF("Couldn't load keymap from host\n");
       return BadAlloc;
   }
-  ki->keySyms.minKeyCode = ephyrKeySyms.minKeyCode;
-  ki->keySyms.maxKeyCode = ephyrKeySyms.maxKeyCode;
-  ki->minScanCode = ki->keySyms.minKeyCode;
-  ki->maxScanCode = ki->keySyms.maxKeyCode;
-  ki->keySyms.mapWidth = ephyrKeySyms.mapWidth;
-  xfree(ki->keySyms.map);
-  ki->keySyms.map = ephyrKeySyms.map;
+  ki->minScanCode = ephyrKeySyms.minKeyCode;
+  ki->maxScanCode = ephyrKeySyms.maxKeyCode;
   ki->name = strdup("Xephyr virtual keyboard");
   ephyrKbd = ki;
   return Success;
@@ -1149,8 +1145,6 @@ EphyrKeyboardDisable (KdKeyboardInfo *ki)
 static void
 EphyrKeyboardFini (KdKeyboardInfo *ki)
 {
-    /* not xfree: we call malloc from hostx.c. */
-    free(ki->keySyms.map);
     ephyrKbd = NULL;
     return;
 }
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 46645d3..d546370 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -595,7 +595,7 @@ hostx_calculate_color_shift(unsigned long mask)
 {
     int shift = 1;
     /* count # of bits in mask */
-    while (mask=(mask>>1)) shift++;
+    while ((mask = (mask >> 1))) shift++;
     /* cmap entry is an unsigned char so adjust it by size of that */
     shift = shift - sizeof(unsigned char) * 8;
     if (shift < 0) shift = 0;
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index e831c9a..f6017ba 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -233,6 +233,8 @@ static Status
 EvdevPtrEnable (KdPointerInfo *pi)
 {        
     int fd;
+    unsigned long   ev[NBITS(EV_MAX)];
+    Kevdev            *ke;
 
     if (!pi || !pi->path)
         return BadImplementation;
@@ -241,8 +243,6 @@ EvdevPtrEnable (KdPointerInfo *pi)
     if (fd < 0)
         return BadMatch;
 
-    unsigned long   ev[NBITS(EV_MAX)];
-    Kevdev            *ke;
         
     if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
     {
@@ -352,18 +352,11 @@ EvdevPtrFini (KdPointerInfo *pi)
 static void
 readMapping (KdKeyboardInfo *ki)
 {
-    int             minScanCode, maxScanCode;
-
     if (!ki)
         return;
 
-    minScanCode = 0;
-    maxScanCode = 193;
-
-    ki->keySyms.mapWidth = 2;
-
-    ki->minScanCode = minScanCode;
-    ki->maxScanCode = maxScanCode;		
+    ki->minScanCode = 0;
+    ki->maxScanCode = 193;
 }
 
 static void
diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index 28ece3d..79cf598 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -42,8 +42,6 @@
 #include <sys/ioctl.h>
 
 extern int LinuxConsoleFd;
-static unsigned char mediumraw_data, mediumraw_up;
-static enum { DEFAULT, EXTBYTE1, EXTBYTE2 } mediumraw_state = DEFAULT;
 
 static const KeySym linux_to_x[256] = {
 	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
@@ -136,6 +134,7 @@ static const KeySym linux_to_x[256] = {
    for the core X keyboard protocol has to be AT-scancode based so that it
    corresponds to the Xkb keymap.
 */
+#if 0
 static unsigned char at2lnx[] =
 {
 	0x0,    /* no valid scancode */
@@ -215,10 +214,12 @@ static unsigned char tbl[KD_MAX_WIDTH] =
     (1 << KG_ALTGR),
     (1 << KG_ALTGR) | (1 << KG_SHIFT)
 };
+#endif
 
 static void
 readKernelMapping(KdKeyboardInfo *ki)
 {
+#if 0
     KeySym	    *k;
     int		    i, j;
     struct kbentry  kbe;
@@ -484,6 +485,7 @@ readKernelMapping(KdKeyboardInfo *ki)
     }
     ki->minScanCode = minKeyCode;
     ki->maxScanCode = maxKeyCode;
+#endif
 }
 
 /*
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index 79f3fbd..3fba056 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -448,7 +448,7 @@ LinuxFini (void)
 }
 
 void
-KdOsAddInputDrivers ()
+KdOsAddInputDrivers (void)
 {
     KdAddPointerDriver(&LinuxMouseDriver);
     KdAddPointerDriver(&MsMouseDriver);
diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am
index 968978e..7ac23c2 100644
--- a/hw/kdrive/src/Makefile.am
+++ b/hw/kdrive/src/Makefile.am
@@ -20,7 +20,6 @@ libkdrive_la_SOURCES =	\
 	kdrive.h	\
 	kinfo.c		\
 	kinput.c	\
-	kkeymap.c	\
 	kmap.c		\
 	kmode.c		\
 	kshadow.c	\
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index ce47cf4..6fdb708 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -275,11 +275,6 @@ typedef struct {
     int    modbit;
 } KdKeySymModsRec;
 
-extern const KeySym       kdDefaultKeymap[KD_MAX_LENGTH * KD_MAX_WIDTH];
-extern const int          kdDefaultKeymapWidth;
-extern const CARD8        kdDefaultModMap[MAP_LENGTH];
-extern const KeySymsRec   kdDefaultKeySyms;
-
 typedef struct _KdKeyboardInfo KdKeyboardInfo;
 
 typedef struct _KdKeyboardDriver {
@@ -308,10 +303,8 @@ struct _KdKeyboardInfo {
     char                *xkbOptions;
     int                 LockLed;
 
-    CARD8               keyState[KD_KEY_COUNT/8];
     int                 minScanCode;
     int                 maxScanCode;
-    KeySymsRec          keySyms; 
 
     int                 leds;
     int                 bellPitch;
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 360739c..94bdfe8 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -846,23 +846,9 @@ KdKeyboardInfo *
 KdNewKeyboard (void)
 {
     KdKeyboardInfo *ki = xcalloc(sizeof(KdKeyboardInfo), 1);
-
     if (!ki)
         return NULL;
-    
-    ki->keySyms.map = (KeySym *)xcalloc(sizeof(KeySym),
-                                        KD_MAX_LENGTH *
-                                         kdDefaultKeySyms.mapWidth);
-    if (!ki->keySyms.map) {
-        xfree(ki);
-        return NULL;
-    }
 
-    memcpy(ki->keySyms.map, kdDefaultKeySyms.map,
-           sizeof(KeySym) * (KD_MAX_LENGTH * kdDefaultKeySyms.mapWidth));
-    ki->keySyms.minKeyCode = kdDefaultKeySyms.minKeyCode;
-    ki->keySyms.maxKeyCode = kdDefaultKeySyms.maxKeyCode;
-    ki->keySyms.mapWidth = kdDefaultKeySyms.mapWidth;
     ki->minScanCode = 0;
     ki->maxScanCode = 0;
     ki->leds = 0;
@@ -1770,41 +1756,10 @@ KdReceiveTimeout (KdPointerInfo *pi)
 
 extern int nClients;
 
-/*
- * kdEnqueueKeyboardEvent
- *
- * This function converts hardware keyboard event information into an X event
- * and enqueues it using MI.  It wakes up the server before returning so that
- * the event will be processed normally.
- *
- */
-
-static void
-KdHandleKeyboardEvent (KdKeyboardInfo *ki, int type, int key)
-{
-    int           byte;
-    CARD8         bit;
-    KdPointerInfo *pi;
-    
-    byte = key >> 3;
-    bit = 1 << (key & 7);
-
-    switch (type) {
-    case KeyPress:
-	ki->keyState[byte] |= bit;
-	break;
-    case KeyRelease:
-	ki->keyState[byte] &= ~bit;
-	break;
-    }
-
-    for (pi = kdPointers; pi; pi = pi->next)
-	KdRunMouseMachine (pi, keyboard, 0, 0, 0, 0, 0, 0);
-}
-
 void
 KdReleaseAllKeys (void)
 {
+#if 0
     int	key, nEvents, i;
     KdKeyboardInfo *ki;
 
@@ -1824,6 +1779,7 @@ KdReleaseAllKeys (void)
     }
 
     KdUnblockSigio ();
+#endif
 }
 
 static void
diff --git a/hw/kdrive/src/kkeymap.c b/hw/kdrive/src/kkeymap.c
deleted file mode 100644
index ae90a34..0000000
--- a/hw/kdrive/src/kkeymap.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright © 1999 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 Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD 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_CONFIG_H
-#include <kdrive-config.h>
-#endif
-#include "kdrive.h"
-#include <X11/keysym.h>
-
-/*
- * Map scan codes (both regular and synthesized from extended keys)
- * to X keysyms
- */
-
-const KeySym kdDefaultKeymap[KD_MAX_LENGTH * KD_MAX_WIDTH] = {
-/* These are directly mapped from DOS scanset 0 */
-/*      1     8 */	 XK_Escape, NoSymbol,
-/*      2     9 */	 XK_1,	XK_exclam,
-/*      3    10 */	 XK_2,	XK_at,
-/*      4    11 */	 XK_3,	XK_numbersign,
-/*      5    12 */	 XK_4,	XK_dollar,
-/*      6    13 */	 XK_5,	XK_percent,
-/*      7    14 */	 XK_6,	XK_asciicircum,
-/*      8    15 */	 XK_7,	XK_ampersand,
-/*      9    16 */	 XK_8,	XK_asterisk,
-/*     10    17 */	 XK_9,	XK_parenleft,
-/*     11    18 */	 XK_0,	XK_parenright,
-/*     12    19 */	 XK_minus,	XK_underscore,
-/*     13    20 */	 XK_equal,	XK_plus,
-/*     14    21 */	 XK_BackSpace,	NoSymbol,
-/*     15    22 */	 XK_Tab,	NoSymbol,
-/*     16    23 */	 XK_Q,	NoSymbol,
-/*     17    24 */	 XK_W,	NoSymbol,
-/*     18    25 */	 XK_E,	NoSymbol,
-/*     19    26 */	 XK_R,	NoSymbol,
-/*     20    27 */	 XK_T,	NoSymbol,
-/*     21    28 */	 XK_Y,	NoSymbol,
-/*     22    29 */	 XK_U,	NoSymbol,
-/*     23    30 */	 XK_I,	NoSymbol,
-/*     24    31 */	 XK_O,	NoSymbol,
-/*     25    32 */	 XK_P,	NoSymbol,
-/*     26    33 */	 XK_bracketleft,	XK_braceleft,
-/*     27    34 */	 XK_bracketright,	XK_braceright,
-/*     28    35 */	 XK_Return,	NoSymbol,
-/*     29    36 */	 XK_Control_L,	NoSymbol,
-/*     30    37 */	 XK_A,	NoSymbol,
-/*     31    38 */	 XK_S,	NoSymbol,
-/*     32    39 */	 XK_D,	NoSymbol,
-/*     33    40 */	 XK_F,	NoSymbol,
-/*     34    41 */	 XK_G,	NoSymbol,
-/*     35    42 */	 XK_H,	NoSymbol,
-/*     36    43 */	 XK_J,	NoSymbol,
-/*     37    44 */	 XK_K,	NoSymbol,
-/*     38    45 */	 XK_L,	NoSymbol,
-/*     39    46 */	 XK_semicolon,	XK_colon,
-/*     40    47 */	 XK_apostrophe,	XK_quotedbl,
-/*     41    48 */	 XK_grave,	XK_asciitilde,
-/*     42    49 */	 XK_Shift_L,	NoSymbol,
-/*     43    50 */	 XK_backslash,	XK_bar,
-/*     44    51 */	 XK_Z,	NoSymbol,
-/*     45    52 */	 XK_X,	NoSymbol,
-/*     46    53 */	 XK_C,	NoSymbol,
-/*     47    54 */	 XK_V,	NoSymbol,
-/*     48    55 */	 XK_B,	NoSymbol,
-/*     49    56 */	 XK_N,	NoSymbol,
-/*     50    57 */	 XK_M,	NoSymbol,
-/*     51    58 */	 XK_comma,	XK_less,
-/*     52    59 */	 XK_period,	XK_greater,
-/*     53    60 */	 XK_slash,	XK_question,
-/*     54    61 */	 XK_Shift_R,	NoSymbol,
-/*     55    62 */	 XK_KP_Multiply,	NoSymbol,
-/*     56    63 */	 XK_Alt_L,	XK_Meta_L,
-/*     57    64 */	 XK_space,	NoSymbol,
-/*     58    65 */	 XK_Caps_Lock,	NoSymbol,
-/*     59    66 */	 XK_F1,	NoSymbol,
-/*     60    67 */	 XK_F2,	NoSymbol,
-/*     61    68 */	 XK_F3,	NoSymbol,
-/*     62    69 */	 XK_F4,	NoSymbol,
-/*     63    70 */	 XK_F5,	NoSymbol,
-/*     64    71 */	 XK_F6,	NoSymbol,
-/*     65    72 */	 XK_F7,	NoSymbol,
-/*     66    73 */	 XK_F8,	NoSymbol,
-/*     67    74 */	 XK_F9,	NoSymbol,
-/*     68    75 */	 XK_F10,	NoSymbol,
-/*     69    76 */	 XK_Break,	XK_Pause,
-/*     70    77 */	 XK_Scroll_Lock,	NoSymbol,
-/*     71    78 */	 XK_KP_Home,	XK_KP_7,
-/*     72    79 */	 XK_KP_Up,	XK_KP_8,
-/*     73    80 */	 XK_KP_Page_Up,	XK_KP_9,
-/*     74    81 */	 XK_KP_Subtract,	NoSymbol,
-/*     75    82 */	 XK_KP_Left,	XK_KP_4,
-/*     76    83 */	 XK_KP_5,	NoSymbol,
-/*     77    84 */	 XK_KP_Right,	XK_KP_6,
-/*     78    85 */	 XK_KP_Add,	NoSymbol,
-/*     79    86 */	 XK_KP_End,	XK_KP_1,
-/*     80    87 */	 XK_KP_Down,	XK_KP_2,
-/*     81    88 */	 XK_KP_Page_Down,	XK_KP_3,
-/*     82    89 */	 XK_KP_Insert,	XK_KP_0,
-/*     83    90 */	 XK_KP_Delete,	XK_KP_Decimal,
-/*     84    91 */     NoSymbol,	NoSymbol,
-/*     85    92 */     NoSymbol,	NoSymbol,
-/*     86    93 */     NoSymbol,	NoSymbol,
-/*     87    94 */	 XK_F11,	NoSymbol,
-/*     88    95 */	 XK_F12,	NoSymbol,
-    
-/* These are remapped from the extended set (using ExtendMap) */
-    
-/*     89    96 */	 XK_Control_R,	NoSymbol,
-/*     90    97 */	 XK_KP_Enter,	NoSymbol,
-/*     91    98 */	 XK_KP_Divide,	NoSymbol,
-/*     92    99 */	 XK_Sys_Req,	XK_Print,
-/*     93   100 */	 XK_Alt_R,	XK_Meta_R,
-/*     94   101 */	 XK_Num_Lock,	NoSymbol,
-/*     95   102 */	 XK_Home,	NoSymbol,
-/*     96   103 */	 XK_Up,		NoSymbol,
-/*     97   104 */	 XK_Page_Up,	NoSymbol,
-/*     98   105 */	 XK_Left,	NoSymbol,
-/*     99   106 */	 XK_Right,	NoSymbol,
-/*    100   107 */	 XK_End,	NoSymbol,
-/*    101   108 */	 XK_Down,	NoSymbol,
-/*    102   109 */	 XK_Page_Down,	NoSymbol,
-/*    103   110 */	 XK_Insert,	NoSymbol,
-/*    104   111 */	 XK_Delete,	NoSymbol,
-/*    105   112 */	 XK_Super_L,	NoSymbol,
-/*    106   113 */	 XK_Super_R,	NoSymbol,
-/*    107   114 */	 XK_Menu,	NoSymbol,
-/*    108   115 */	 NoSymbol,	NoSymbol,
-/*    109   116 */	 NoSymbol,	NoSymbol,
-/*    110   117 */	 NoSymbol,	NoSymbol,
-/*    111   118 */	 NoSymbol,	NoSymbol,
-/*    112   119 */	 NoSymbol,	NoSymbol,
-};
-
-/*
- * List of locking key codes
- */
-
-CARD8 kdLockMap[] = {
-    65,
-    101,
-    77,
-};
-
-#define NUM_LOCK (sizeof (kdLockMap) / sizeof (kdLockMap[0]))
-
-int kdNumLock = NUM_LOCK;
-
-/*
- * Map containing list of keys which the X server makes locking when
- * the KEYMAP_LOCKING_ALTGR flag is set in CEKeymapFlags
- */
-
-CARD8 kdOptionalLockMap[] = {
-    100,
-};
-
-#define NUM_OPTIONAL_LOCK  (sizeof (kdOptionalLockMap) / sizeof (kdOptionalLockMap[0]))
-
-int kdNumOptionalLock = NUM_OPTIONAL_LOCK;
-
-const CARD8 kdDefaultModMap[MAP_LENGTH];
-
-unsigned long kdDefaultKeymapFlags = 0;
-
-const KeySymsRec kdDefaultKeySyms = {
-    kdDefaultKeymap,
-    KD_MIN_KEYCODE,
-    KD_MAX_KEYCODE,
-    KD_MAX_WIDTH
-};
diff --git a/hw/kdrive/src/kkeymap.h b/hw/kdrive/src/kkeymap.h
deleted file mode 100644
index f66cfa4..0000000
--- a/hw/kdrive/src/kkeymap.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright © 1999 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 Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD 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.
- */
-/*
- *  All global variables and functions pertaining to keyboard key mapping
- *  live in this header file.
- */
-
-#ifndef _KKEYMAP_H
-#define _KKEYMAP_H
-
-/* Offset of MIN_SCANCODE to 8 (X minimum scancode value) */
-#define KD_KEY_OFFSET	(8 - kdMinScanCode)
-
-#define KD_MIN_KEYCODE	8
-#define KD_MAX_KEYCODE	254
-#define KD_MAX_WIDTH	4
-#define KD_MAX_LENGTH	(KD_MAX_KEYCODE - KD_MIN_KEYCODE + 1)
-
-extern int		kdMinScanCode;
-extern int		kdMaxScanCode;
-extern int		kdMinKeyCode;
-extern int		kdMaxKeyCode;
-extern int		kdKeymapWidth;
-
-extern KeySym		kdKeymap[KD_MAX_LENGTH * KD_MAX_WIDTH];
-
-extern CARD8		kdModMap[MAP_LENGTH];
-    
-extern KeySymsRec	kdKeySyms;
-
-typedef struct {
-    KeySym  modsym;
-    int	    modbit;
-} KdKeySymModsRec;
-
-#endif /* _KKEYMAP_H */


More information about the xorg-commit mailing list