pkgsrc-Bugs archive

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

pkg/45853: Support for touchscreens in xf86-input-mouse



>Number:         45853
>Category:       pkg
>Synopsis:       Support for touchscreens in xf86-input-mouse
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 18 00:00:00 +0000 2012
>Originator:     Pierre Pronchery
>Release:        NetBSD 5.1_STABLE (pkgsrc-2011Q4)
>Organization:
>Environment:
System: NetBSD kwarx.defora.lan 5.1_STABLE NetBSD 5.1_STABLE (GENERIC) #4: Wed 
Jan 4 11:39:18 CET 2012 
khorben%kwarx.defora.lan@localhost:/home/amd64/obj/sys/arch/amd64/compile/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:
This is a follow-up to PR/45850, "USB multi-touch panels are not
supported", in which the newly-introduced uts(4) driver reports absolute
coordonates (on the X and Y axis notably). This is unsupported so far by
the xf86-input-driver for modular-xorg in pkgsrc.

A patch implementing pointer movement when using the wsmouse(4) protocol
is attached to this report (below). Unfortunately, as calibration is not
implemented yet, it is very likely that the pointer movement will not
exactly match the input. However, the uts(4) driver makes use of the
tpcalib framework; it could be that run-time configuration through the
relevant ioctl (WSMOUSEIO_SCALIBCOORDS) will be enough for proper
interaction.

Also, please note that I have not tested (or checked) uts(4) with Xorg
from base yet; a similar patch may be necessary there as well.
>How-To-Repeat:
Touch the screen with hardware supported by the uts(4) driver, running
modular-xorg from pkgsrc; the log for Xorg will complain with "bad
wsmouse event type=...".
>Fix:
Apply the following:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/xf86-input-mouse/Makefile,v
retrieving revision 1.12
diff -p -u -r1.12 Makefile
--- Makefile    14 Sep 2010 11:03:11 -0000      1.12
+++ Makefile    17 Jan 2012 13:05:19 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.12 2010/09/14 11:03:11 wiz Exp $
 
 DISTNAME=      xf86-input-mouse-1.4.0
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    x11
 MASTER_SITES=  ${MASTER_SITE_XORG:=driver/}
 EXTRACT_SUFX=  .tar.bz2
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/xf86-input-mouse/distinfo,v
retrieving revision 1.8
diff -p -u -r1.8 distinfo
--- distinfo    22 May 2009 19:05:57 -0000      1.8
+++ distinfo    17 Jan 2012 13:05:19 -0000
@@ -5,5 +5,5 @@ RMD160 (xf86-input-mouse-1.4.0.tar.bz2) 
 Size (xf86-input-mouse-1.4.0.tar.bz2) = 292626 bytes
 SHA1 (patch-aa) = baf529a3ae260e98fb068cb9549f749705d8213b
 SHA1 (patch-ab) = 632ec0e3908ccd16678a480b5ffa00dba7db640f
-SHA1 (patch-ac) = d32bbb082c0898e6eb6bf9dadb2af401b1e79312
+SHA1 (patch-ac) = f895494521823649d37cbfa8e27385ef2780e28d
 SHA1 (patch-ad) = 8301f21624cecdb19b2f705d546b6bd37d105dc3
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/x11/xf86-input-mouse/patches/patch-ac,v
retrieving revision 1.1
diff -p -u -r1.1 patch-ac
--- patches/patch-ac    22 May 2009 19:05:57 -0000      1.1
+++ patches/patch-ac    17 Jan 2012 13:05:19 -0000
@@ -3,6 +3,7 @@ $NetBSD: patch-ac,v 1.1 2009/05/22 19:05
 Changes from NetBSD xsrc/external/mit/xorg-server/dist/\
 hw/xfree86/os-support/bsd/bsd_mouse.c
 
+add touchscreen support to WSMOUSE driver
 ----------------------------
 revision 1.5
 date: 2009/02/09 09:49:39;  author: plunky;  state: Exp;  lines: +16 -0
@@ -23,8 +24,10 @@ Set the mouse event protocol version. (u
 unless I add this).
 ----------------------------
 
---- src/bsd_mouse.c.orig       2009-05-19 15:12:28 +0300
-+++ src/bsd_mouse.c    2009-05-19 15:13:13 +0300
+Additionally, report absolute events as well.
+
+--- src/bsd_mouse.c.orig       2008-11-27 04:11:36.000000000 +0000
++++ src/bsd_mouse.c
 @@ -53,12 +53,15 @@
  
  #define HUP_GENERIC_DESKTOP     0x0001
@@ -65,7 +68,45 @@ unless I add this).
  #if (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
  
  /* Only support wsmouse configuration for now */
-@@ -496,7 +516,7 @@ typedef struct _UsbMseRec {
+@@ -409,7 +429,7 @@ wsconsReadInput(InputInfoPtr pInfo)
+     n /= sizeof(struct wscons_event);
+     while( n-- ) {
+       int buttons = pMse->lastButtons;
+-      int dx = 0, dy = 0, dz = 0, dw = 0;
++      int dx = 0, dy = 0, dz = 0, dw = 0, x, y;
+       switch (event->type) {
+       case WSCONS_EVENT_MOUSE_UP:
+ #define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value))
+@@ -434,6 +454,28 @@ wsconsReadInput(InputInfoPtr pInfo)
+           dw = event->value;
+           break;
+ #endif
++      case WSCONS_EVENT_MOUSE_ABSOLUTE_X:
++          miPointerGetPosition (pInfo->dev, &x, &y);
++          x = event->value;
++          miPointerSetPosition (pInfo->dev, &x, &y);
++          xf86PostMotionEvent(pInfo->dev, TRUE, 0, 2, x, y);
++          ++event;
++          continue;
++      case WSCONS_EVENT_MOUSE_ABSOLUTE_Y:
++          miPointerGetPosition (pInfo->dev, &x, &y);
++          y = event->value;
++          miPointerSetPosition (pInfo->dev, &x, &y);
++          xf86PostMotionEvent(pInfo->dev, TRUE, 0, 2, x, y);
++          ++event;
++          continue;
++      case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
++          ++event;
++          continue;
++#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_W
++      case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
++          ++event;
++          continue;
++#endif
+       default:
+           xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
+                   event->type);
+@@ -496,7 +538,7 @@ typedef struct _UsbMseRec {
      hid_item_t loc_x;         /* x locator item */
      hid_item_t loc_y;         /* y locator item */
      hid_item_t loc_z;         /* z (wheel) locator item */
@@ -74,7 +115,7 @@ unless I add this).
      hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
     unsigned char *buffer;
  } UsbMseRec, *UsbMsePtr;
-@@ -708,6 +728,9 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -708,6 +750,9 @@ usbPreInit(InputInfoPtr pInfo, const cha
      if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
                   hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
      }
@@ -84,7 +125,7 @@ unless I add this).
  #else
      if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
                   hid_input, &pUsbMse->loc_x) < 0) {
-@@ -720,6 +743,9 @@ usbPreInit(InputInfoPtr pInfo, const cha
+@@ -720,6 +765,9 @@ usbPreInit(InputInfoPtr pInfo, const cha
      if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
                   hid_input, &pUsbMse->loc_z) < 0) {
      }
@@ -94,7 +135,7 @@ unless I add this).
  #endif
      /* Probe for number of buttons */
      for (i = 1; i <= MSE_MAXBUTTONS; i++) {
-@@ -790,6 +816,9 @@ xf86OSMouseInit(int flags)
+@@ -790,6 +838,9 @@ xf86OSMouseInit(int flags)
      p->SetupAuto = SetupAuto;
      p->SetMiscRes = SetMouseRes;
  #endif



Home | Main Index | Thread Index | Old Index