Index: xorg-server/Makefile =================================================================== RCS file: /home/pcvs/ports/x11-servers/xorg-server/Makefile,v retrieving revision 1.55 diff -u -r1.55 Makefile --- xorg-server/Makefile 1 Apr 2008 18:14:33 -0000 1.55 +++ xorg-server/Makefile 5 Apr 2008 03:33:27 -0000 @@ -7,7 +7,7 @@ PORTNAME= xorg-server PORTVERSION= 1.4 -PORTREVISION= 7 +PORTREVISION= 8 PORTEPOCH= 1 CATEGORIES= x11-servers MASTER_SITES= http://xorg.freedesktop.org/releases/individual/xserver/:fdo \ Index: xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c =================================================================== RCS file: /home/pcvs/ports/x11-servers/xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c,v retrieving revision 1.1 diff -u -r1.1 patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c --- xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c 1 Apr 2008 18:14:34 -0000 1.1 +++ xorg-server/files/patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c 5 Apr 2008 03:33:27 -0000 @@ -1,5 +1,5 @@ --- hw/xfree86/os-support/bsd/bsd_mouse.c.orig 2007-08-23 15:05:48.000000000 -0400 -+++ hw/xfree86/os-support/bsd/bsd_mouse.c 2008-03-28 13:49:17.000000000 -0400 ++++ hw/xfree86/os-support/bsd/bsd_mouse.c 2008-04-04 23:29:41.000000000 -0400 @@ -1,4 +1,3 @@ - /* @@ -21,65 +21,142 @@ NULL }; #elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT) -@@ -184,6 +187,7 @@ +@@ -101,7 +104,11 @@ + #if defined(__NetBSD__) + return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO; + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +- return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC; ++ return MSE_SERIAL | MSE_BUS | MSE_PS2 | ++#ifdef XPS2_SUPPORT ++ MSE_XPS2 | ++#endif ++ MSE_AUTO | MSE_MISC; + #else + return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO; + #endif +@@ -180,10 +187,31 @@ + { MOUSE_PROTO_THINK, "ThinkingMouse" }, + { MOUSE_PROTO_SYSMOUSE, "SysMouse" } + }; +- ++ ++#ifdef XPS2_SUPPORT ++static struct { ++ int dmodel; ++ char *name; ++} ps2proto[] = { ++ { MOUSE_MODEL_NETSCROLL, "NetScrollPS/2" }, ++ { MOUSE_MODEL_NET, "NetMousePS/2" }, ++ { MOUSE_MODEL_GLIDEPOINT, "GlidePointPS/2" }, ++ { MOUSE_MODEL_THINK, "ThinkingMousePS/2" }, ++ { MOUSE_MODEL_INTELLI, "IMPS/2" }, ++ { MOUSE_MODEL_MOUSEMANPLUS, "MouseManPlusPS/2" }, ++ { MOUSE_MODEL_EXPLORER, "ExplorerPS/2" }, ++ { MOUSE_MODEL_4D, "IMPS/2" }, ++ { MOUSE_MODEL_4DPLUS, "IMPS/2" }, ++}; ++#endif ++ static const char * SetupAuto(InputInfoPtr pInfo, int *protoPara) { ++#ifdef XPS2_SUPPORT + char *dev; ++#endif ++ const char *proto; int i; mousehw_t hw; mousemode_t mode; -@@ -192,9 +196,12 @@ +@@ -191,10 +219,20 @@ + if (pInfo->fd == -1) return NULL; ++#ifdef XPS2_SUPPORT /* set the driver operation level, if applicable */ -- i = 1; -- ioctl(pInfo->fd, MOUSE_SETLEVEL, &i); -- -+ if ((dev = xf86FindOptionValue(pInfo->options, "Device")) && -+ !strcmp(dev, DEFAULT_SYSMOUSE_DEV)) { -+ i = 1; ++ if ((dev = xf86FindOptionValue(pInfo->options, "Device"))) { ++ if (!strncmp(dev, DEFAULT_PS2_DEV, 8)) ++ i = 2; ++ else ++ i = 1; + ioctl(pInfo->fd, MOUSE_SETLEVEL, &i); + } ++#else + i = 1; + ioctl(pInfo->fd, MOUSE_SETLEVEL, &i); +- ++#endif + /* interrogate the driver and get some intelligence on the device. */ hw.iftype = MOUSE_IF_UNKNOWN; hw.model = MOUSE_MODEL_GENERIC; -@@ -210,8 +217,8 @@ +@@ -210,9 +248,18 @@ protoPara[0] = mode.syncmask[0]; protoPara[1] = mode.syncmask[1]; } -- xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n", ++ proto = devproto[i].name; ++#ifdef XPS2_SUPPORT ++ if (mode.protocol == MOUSE_PROTO_PS2) ++ for (i = 0; i < sizeof(ps2proto)/sizeof(ps2proto[0]); ++i) ++ if (hw.model == ps2proto[i].dmodel) { ++ proto = ps2proto[i].name; ++ break; ++ } ++#endif + xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n", - pInfo->name, devproto[i].name); -+ xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s, level is %d\n", -+ pInfo->name, devproto[i].name, mode.level); - return devproto[i].name; +- return devproto[i].name; ++ pInfo->name, proto); ++ return proto; } } -@@ -222,6 +229,7 @@ + } +@@ -222,6 +269,9 @@ static void SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res) { ++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(XPS2_SUPPORT) + char *dev; ++#endif mousemode_t mode; MouseDevPtr pMse; -@@ -231,11 +239,11 @@ +@@ -231,45 +281,56 @@ mode.resolution = res > 0 ? res : -1; mode.accelfactor = -1; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) - if (pMse->autoProbe || - (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) { -+ if ((dev = xf86FindOptionValue(pInfo->options, "Device")) && -+ !strcmp(dev, DEFAULT_SYSMOUSE_DEV)) { - /* - * As the FreeBSD sysmouse driver defaults to protocol level 0 +- /* +- * As the FreeBSD sysmouse driver defaults to protocol level 0 - * everytime it is opened we enforce protocol level 1 again at -+ * everytime it is closed we enforce protocol level 1 again at - * this point. - */ +- * this point. +- */ ++ /* ++ * FreeBSD sysmouse(4) and psm(4) default to protocol level 0 ++ * when the device is closed or opened while ums(4) does not. ++ */ ++#ifdef XPS2_SUPPORT ++ if (protocol && xf86NameCmp(protocol, "SysMouse")) mode.level = 1; -@@ -249,27 +257,29 @@ ++ else if ((dev = xf86FindOptionValue(pInfo->options, "Device"))) { ++ if (!strcmp(dev, DEFAULT_SYSMOUSE_DEV)) ++ mode.level = 1; ++ else if (!strncmp(dev, DEFAULT_PS2_DEV, 8)) ++ mode.level = 2; ++ else ++ mode.level = -1; + } else +- mode.level = -1; + #else +- mode.level = -1; ++ if (protocol && xf86NameCmp(protocol, "SysMouse") == 0) ++ mode.level = 1; ++ else + #endif ++#endif ++ mode.level = -1; + ioctl(pInfo->fd, MOUSE_SETMODE, &mode); + } #endif #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) @@ -122,7 +199,7 @@ } return FALSE; } -@@ -309,15 +319,12 @@ +@@ -309,15 +370,12 @@ devMouse = FALSE; } close(fd);