pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

xf86-input-mouse-dfbsd: Tune patch-src_bsd__mouse.c



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Mon Jul 22 22:41:05 2019 -0700
Changeset:	e2bc8da2db4dc59a1094dec41a9dd37834592fce

Modified Files:
	xf86-input-mouse-dfbsd/Makefile
	xf86-input-mouse-dfbsd/distinfo
	xf86-input-mouse-dfbsd/patches/patch-src_bsd__mouse.c
Added Files:
	xf86-input-mouse-dfbsd/TODO

Log Message:
xf86-input-mouse-dfbsd: Tune patch-src_bsd__mouse.c

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e2bc8da2db4dc59a1094dec41a9dd37834592fce

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 xf86-input-mouse-dfbsd/Makefile                    | 19 +++++-
 xf86-input-mouse-dfbsd/TODO                        |  4 ++
 xf86-input-mouse-dfbsd/distinfo                    |  2 +-
 .../patches/patch-src_bsd__mouse.c                 | 74 +++++++---------------
 4 files changed, 43 insertions(+), 56 deletions(-)

diffs:
diff --git a/xf86-input-mouse-dfbsd/Makefile b/xf86-input-mouse-dfbsd/Makefile
index 611b7d7cd9..4d7e68318c 100644
--- a/xf86-input-mouse-dfbsd/Makefile
+++ b/xf86-input-mouse-dfbsd/Makefile
@@ -15,18 +15,31 @@ GNU_CONFIGURE=	YES
 USE_TOOLS+=	pkg-config
 
 CONFIGURE_ENV.SunOS+=	DRIVER_MAN_SUFFIX=4
-CFLAGS.DragonFly+=	-Wno-array-bounds
+CFLAGS.DragonFly+= -Wno-array-bounds
 
 .include "../../mk/bsd.prefs.mk"
 
 .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
-SUBST_CLASSES+=			freebsdusb
+SUBST_CLASSES+=                 freebsdusb 
 SUBST_STAGE.freebsdusb=		post-extract
-SUBST_MESSAGE.freebsdusb=	Patching src/Makefile.in for DragonFly or FreeBSD compatible USB
+SUBST_MESSAGE.freebsdusb=	Patching src/Makefile.in for DragonFly or FreeBSD compatible USB 
 SUBST_FILES.freebsdusb+=	src/Makefile.in
 SUBST_SED.freebsdusb+=		-e 's|-module -avoid-version|-module -avoid-version -lusbhid|'
 .endif
 
+PKG_OPTIONS_VAR=	PKG_OPTIONS.xf86-input-mouse
+PKG_SUPPORTED_OPTIONS=  debug	
+PKG_SUGGESTED_OPTIONS=  debug	
+
+.include "../../mk/bsd.options.mk"
+
+# Debug flags recommended for server and drivers by:
+# https://www.x.org/wiki/Development/Documentation/ServerDebugging/
+.if !empty(PKG_OPTIONS:Mdebug)
+CPPFLAGS+=		-DDEBUG
+CFLAGS+=		-O0 -g3
+.endif
+
 .include "../../x11/xorgproto/buildlink3.mk"
 .include "../../x11/modular-xorg-server/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/xf86-input-mouse-dfbsd/TODO b/xf86-input-mouse-dfbsd/TODO
new file mode 100644
index 0000000000..a2a09184ab
--- /dev/null
+++ b/xf86-input-mouse-dfbsd/TODO
@@ -0,0 +1,4 @@
+Should the
+Jun 7, 2016 upstream patch
+bsd: Don't try to use SIGIO for input ABI >= 23
+apply to NetBSD
diff --git a/xf86-input-mouse-dfbsd/distinfo b/xf86-input-mouse-dfbsd/distinfo
index 459f888662..f9dc0fb544 100644
--- a/xf86-input-mouse-dfbsd/distinfo
+++ b/xf86-input-mouse-dfbsd/distinfo
@@ -4,7 +4,7 @@ SHA1 (xf86-input-mouse-1.9.3.tar.bz2) = b3982998808ba43117fc066c4ecc94ce67c5818e
 RMD160 (xf86-input-mouse-1.9.3.tar.bz2) = f73da46dfc7d389531d52e0495db2c2bc4990027
 SHA512 (xf86-input-mouse-1.9.3.tar.bz2) = d99f5b4b1ef1aa4cbf1a92549e412f54f121bc804e4d6643248ad7ea18081b38b958bd289dc8476ebc0f6ef5f7424c2f2a8abcfaa30cae5378829549af6b148f
 Size (xf86-input-mouse-1.9.3.tar.bz2) = 382013 bytes
-SHA1 (patch-src_bsd__mouse.c) = f0718cbe4889f957034e4195a2f138de40b18110
+SHA1 (patch-src_bsd__mouse.c) = 1a99442966ed67902d233f9a72f58352a742e7fe
 SHA1 (patch-src_mouse.c) = 04d063d2ea364727309de23d144a3cc4289887b1
 SHA1 (patch-src_mouse.h) = 365fc23f82de0223872be21563af2244585bd537
 SHA1 (patch-src_mousePriv.h) = 6c4ca5f997514e77a937fa8c739a495a6a5e0a43
diff --git a/xf86-input-mouse-dfbsd/patches/patch-src_bsd__mouse.c b/xf86-input-mouse-dfbsd/patches/patch-src_bsd__mouse.c
index 0ff731eb5f..086401e063 100644
--- a/xf86-input-mouse-dfbsd/patches/patch-src_bsd__mouse.c
+++ b/xf86-input-mouse-dfbsd/patches/patch-src_bsd__mouse.c
@@ -79,18 +79,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  
  #define HUP_GENERIC_DESKTOP     0x0001
  #define HUP_BUTTON              0x0009
-@@ -66,8 +113,10 @@
- #endif /* USBMOUSE_SUPPORT */
- 
- #ifdef USBMOUSE_SUPPORT
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 23
- static void usbSigioReadInput (int fd, void *closure);
- #endif
-+#endif
- static const char *FindDevice(InputInfoPtr, const char *, int);
- 
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-@@ -75,11 +124,17 @@ static const char *FindDevice(InputInfoP
+@@ -75,11 +122,17 @@ static const char *FindDevice(InputInfoPtr, const char
  #define DEFAULT_MOUSE_DEV               "/dev/mouse"
  #define DEFAULT_SYSMOUSE_DEV            "/dev/sysmouse"
  #define DEFAULT_PS2_DEV                 "/dev/psm0"
@@ -108,7 +97,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
          NULL
  };
  #elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-@@ -97,7 +152,7 @@ static const char *mouseDevs[] = {
+@@ -97,7 +150,7 @@ static const char *mouseDevs[] = {
  static int
  SupportedInterfaces(void)
  {
@@ -117,7 +106,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
  #else
      return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC;
-@@ -178,9 +233,35 @@ static struct {
+@@ -178,9 +231,35 @@ static struct {
          { MOUSE_PROTO_SYSMOUSE,         "SysMouse" }
  };
  
@@ -153,7 +142,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      int i;
      mousehw_t hw;
      mousemode_t mode;
-@@ -188,7 +269,15 @@ SetupAuto(InputInfoPtr pInfo, int *proto
+@@ -188,7 +267,15 @@ SetupAuto(InputInfoPtr pInfo, int *protoPara)
      if (pInfo->fd == -1)
          return NULL;
  
@@ -169,7 +158,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      i = 1;
      ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
  
-@@ -207,9 +296,25 @@ SetupAuto(InputInfoPtr pInfo, int *proto
+@@ -207,9 +294,25 @@ SetupAuto(InputInfoPtr pInfo, int *protoPara)
                      protoPara[0] = mode.syncmask[0];
                      protoPara[1] = mode.syncmask[1];
                  }
@@ -195,23 +184,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
              }
          }
      }
-@@ -232,41 +337,41 @@ SetSysMouseRes(InputInfoPtr pInfo, const
-         (protocol && xf86NameCmp(protocol, "SysMouse") == 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.
-          */
-         mode.level = 1;
-     } else
--        mode.level = -1;
--#else
--    mode.level = -1;
- #endif
-+    mode.level = -1;
-     ioctl(pInfo->fd, MOUSE_SETMODE, &mode);
- }
+@@ -246,27 +349,29 @@ SetSysMouseRes(InputInfoPtr pInfo, const char *protoco
  #endif
  
  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
@@ -276,7 +249,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  #endif
          } else {
              /*
-@@ -293,28 +398,32 @@ FindDevice(InputInfoPtr pInfo, const cha
+@@ -293,28 +398,32 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, i
               * the test for whether /dev/sysmouse is usable can be made.
               */
              if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
@@ -322,7 +295,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
                  break;
              }
          }
-@@ -486,8 +595,39 @@ wsconsPreInit(InputInfoPtr pInfo, const
+@@ -486,8 +595,39 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol
  
  #if defined(USBMOUSE_SUPPORT)
  
@@ -424,7 +397,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  
      switch (what) {
      case DEVICE_INIT:
-@@ -518,23 +698,120 @@ usbMouseProc(DeviceIntPtr pPointer, int
+@@ -518,23 +698,120 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
          for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
              map[nbuttons + 1] = nbuttons + 1;
  
@@ -545,7 +518,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
          pInfo->fd = xf86OpenSerial(pInfo->options);
          if (pInfo->fd == -1)
              xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-@@ -553,6 +830,7 @@ usbMouseProc(DeviceIntPtr pPointer, int
+@@ -553,6 +830,7 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
                      AddEnabledDevice(pInfo->fd);
              }
          }
@@ -553,7 +526,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
          pMse->lastButtons = 0;
          pMse->lastMappedButtons = 0;
          pMse->emulateState = 0;
-@@ -562,7 +840,11 @@ usbMouseProc(DeviceIntPtr pPointer, int
+@@ -562,7 +840,11 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
      case DEVICE_OFF:
      case DEVICE_CLOSE:
          if (pInfo->fd != -1) {
@@ -565,7 +538,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
              if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
                  free(pUsbMse->buffer);
              }
-@@ -573,6 +855,9 @@ usbMouseProc(DeviceIntPtr pPointer, int
+@@ -573,6 +855,9 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
              xf86CloseSerial(pInfo->fd);
              pInfo->fd = -1;
          }
@@ -649,7 +622,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      /* discard packets with an id that don't match the mouse */
      /* XXX this is probably not the right thing */
      if (pUsbMse->iid != 0) {
-@@ -619,30 +950,152 @@ usbReadInput(InputInfoPtr pInfo)
+@@ -619,14 +950,120 @@ usbReadInput(InputInfoPtr pInfo)
      dy = hid_get_data(pBuf, &pUsbMse->loc_y);
      dz = hid_get_data(pBuf, &pUsbMse->loc_z);
      dw = hid_get_data(pBuf, &pUsbMse->loc_w);
@@ -769,13 +742,10 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
 +#endif /* defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) */
  }
  
-+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 23
  static void
- usbSigioReadInput (int fd, void *closure)
- {
+@@ -635,14 +1072,28 @@ usbSigioReadInput (int fd, void *closure)
      usbReadInput ((InputInfoPtr) closure);
  }
-+#endif
  
 +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__)
  /* This function is called when the protocol is "usb". */
@@ -802,7 +772,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  
      pUsbMse = malloc(sizeof(UsbMseRec));
      if (pUsbMse == NULL) {
-@@ -651,12 +1104,16 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -651,12 +1102,16 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
          return FALSE;
      }
  
@@ -819,7 +789,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  
      /* Check if the device can be opened. */
      pInfo->fd = xf86OpenSerial(pInfo->options);
-@@ -672,6 +1129,128 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -672,6 +1127,128 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
      }
      /* Get USB informations */
      reportDesc = hid_get_report_desc(pInfo->fd);
@@ -948,7 +918,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      /* Get packet size & iid */
  #ifdef USB_NEW_HID
      if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
-@@ -685,6 +1264,18 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -685,6 +1262,18 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
      pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
                                                &pUsbMse->iid);
  #endif
@@ -967,7 +937,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      /* Allocate buffer */
      if (pUsbMse->packetSize <= 8) {
          pUsbMse->buffer = pMse->protoBuf;
-@@ -694,10 +1285,13 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -694,10 +1283,13 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
      if (pUsbMse->buffer == NULL) {
          xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
          free(pUsbMse);
@@ -981,7 +951,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
  #ifdef USB_NEW_HID
      if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
                     hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
-@@ -734,16 +1328,131 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -734,16 +1326,131 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
              break;
      }
      pMse->buttons = i-1;
@@ -995,7 +965,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 +    return TRUE;
 +}
-+
+ 
 +/* This function is called when the protocol is "usb". */
 +static Bool
 +usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
@@ -1072,7 +1042,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
 +    pMse->hasZ = acol->hasZ;
 +    pMse->hasW = acol->hasW;
 +#endif /* defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) */
- 
++
      /* Process common mouse options (like Emulate3Buttons, etc). */
      pMse->CommonOptions(pInfo);
  
@@ -1113,7 +1083,7 @@ Patches from FreeBSD ports / DragonFly dports x11-drivers/xf86-input-mouse 1.9.2
      /* Setup the local procs. */
      pInfo->device_control = usbMouseProc;
      pInfo->read_input = usbReadInput;
-@@ -786,7 +1495,9 @@ OSMouseInit(int flags)
+@@ -786,7 +1493,9 @@ OSMouseInit(int flags)
      p->CheckProtocol = CheckProtocol;
  #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
      p->SetupAuto = SetupAuto;


Home | Main Index | Thread Index | Old Index