NetBSD Problem Report #45853

From khorben@defora.org  Tue Jan 17 23:56:06 2012
Return-Path: <khorben@defora.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4BA6663C2FF
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 17 Jan 2012 23:56:06 +0000 (UTC)
Message-Id: <20120117235446.649C5172@kwarx.defora.lan>
Date: Wed, 18 Jan 2012 00:54:46 +0100 (CET)
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: Support for touchscreens in xf86-input-mouse
X-Send-Pr-Version: 3.95

>Number:         45853
>Category:       pkg
>Synopsis:       Support for touchscreens in xf86-input-mouse
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 18 00:00:00 +0000 2012
>Closed-Date:    Thu Sep 27 09:03:48 +0000 2012
>Last-Modified:  Thu Sep 27 09:25:01 +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:/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

>Release-Note:

>Audit-Trail:
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@NetBSD.org
Cc: tech-x11@netbsd.org
Subject: Re: pkg/45853: Support for touchscreens in xf86-input-mouse
Date: Thu, 26 Jan 2012 20:57:39 +0100

 			Hi,

 as it seems, this PR also applies to xsrc, where
 xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c would have to be
 patched as well.

 Should I submit an extra PR for this?

 Cheers,
 -- 
 khorben

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45853 CVS commit: xsrc/external/mit/xf86-input-mouse/dist/src
Date: Thu, 26 Jan 2012 17:43:06 -0500

 Module Name:	xsrc
 Committed By:	christos
 Date:		Thu Jan 26 22:43:06 UTC 2012

 Modified Files:
 	xsrc/external/mit/xf86-input-mouse/dist/src: bsd_mouse.c

 Log Message:
 PR/45853: Pierre Pronchery: Add support for absolute positioning (tablets)


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 \
     xsrc/external/mit/xf86-input-mouse/dist/src/bsd_mouse.c

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

State-Changed-From-To: open->closed
State-Changed-By: liamjfoy@NetBSD.org
State-Changed-When: Thu, 27 Sep 2012 09:03:48 +0000
State-Changed-Why:
This can be closed. Changes have been made to xsrc and I have just 
added the changes to pkgsrc.

Module Name:	pkgsrc
Committed By:	liamjfoy
Date:		Wed Sep 26 14:11:26 UTC 2012

Modified Files:
	pkgsrc/x11/xf86-input-mouse: Makefile distinfo
	pkgsrc/x11/xf86-input-mouse/patches: patch-ac

Log Message:
Fix package to work with uts(4)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/x11/xf86-input-mouse/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/x11/xf86-input-mouse/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/x11/xf86-input-mouse/patches/patch-ac

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


From: Takahiro Kambe <taca@back-street.net>
To: gnats-bugs@NetBSD.org, liamjfoy@NetBSD.org
Cc: 
Subject: Re: pkg/45853 (Support for touchscreens in xf86-input-mouse)
Date: Thu, 27 Sep 2012 18:08:52 +0900 (JST)

 In message <20120927090350.7CAB963B9BC@www.NetBSD.org>
 	on Thu, 27 Sep 2012 09:03:50 +0000 (UTC),
 	liamjfoy@NetBSD.org wrote:
 > Synopsis: Support for touchscreens in xf86-input-mouse
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: liamjfoy@NetBSD.org
 > State-Changed-When: Thu, 27 Sep 2012 09:03:48 +0000
 > State-Changed-Why:
 > This can be closed. Changes have been made to xsrc and I have just 
 > added the changes to pkgsrc.
 Have you read current pkgsrc/x11/xf86-input-mouse/patches/patch-ac?

 -- 
 Takahiro Kambe <taca@back-street.net>

From: Takahiro Kambe <taca@back-street.net>
To: gnats-bugs@NetBSD.org, liamjfoy@NetBSD.org
Cc: 
Subject: Re: pkg/45853 (Support for touchscreens in xf86-input-mouse)
Date: Thu, 27 Sep 2012 18:18:14 +0900 (JST)

 In message <20120927.180852.1568838938087114491.taca@back-street.net>
 	on Thu, 27 Sep 2012 18:08:52 +0900 (JST),
 	Takahiro Kambe <taca@back-street.net> wrote:
 > In message <20120927090350.7CAB963B9BC@www.NetBSD.org>
 > 	on Thu, 27 Sep 2012 09:03:50 +0000 (UTC),
 > 	liamjfoy@NetBSD.org wrote:
 >> Synopsis: Support for touchscreens in xf86-input-mouse
 >> 
 >> State-Changed-From-To: open->closed
 >> State-Changed-By: liamjfoy@NetBSD.org
 >> State-Changed-When: Thu, 27 Sep 2012 09:03:48 +0000
 >> State-Changed-Why:
 >> This can be closed. Changes have been made to xsrc and I have just 
 >> added the changes to pkgsrc.
 > Have you read current pkgsrc/x11/xf86-input-mouse/patches/patch-ac?
 Oh, please ignore my prervious message.

 -- 
 Takahiro Kambe <taca@back-street.net>

From: "Liam J. Foy" <li@mfoy.co.uk>
To: Takahiro Kambe <taca@back-street.net>
Cc: gnats-bugs@NetBSD.org, liamjfoy@NetBSD.org
Subject: Re: pkg/45853 (Support for touchscreens in xf86-input-mouse)
Date: Thu, 27 Sep 2012 10:20:22 +0100

 On 27/09/2012 10:18, Takahiro Kambe wrote:
 > In message <20120927.180852.1568838938087114491.taca@back-street.net>
 > 	on Thu, 27 Sep 2012 18:08:52 +0900 (JST),
 > 	Takahiro Kambe <taca@back-street.net> wrote:
 >> In message <20120927090350.7CAB963B9BC@www.NetBSD.org>
 >> 	on Thu, 27 Sep 2012 09:03:50 +0000 (UTC),
 >> 	liamjfoy@NetBSD.org wrote:
 >>> Synopsis: Support for touchscreens in xf86-input-mouse
 >>>
 >>> State-Changed-From-To: open->closed
 >>> State-Changed-By: liamjfoy@NetBSD.org
 >>> State-Changed-When: Thu, 27 Sep 2012 09:03:48 +0000
 >>> State-Changed-Why:
 >>> This can be closed. Changes have been made to xsrc and I have just
 >>> added the changes to pkgsrc.
 >> Have you read current pkgsrc/x11/xf86-input-mouse/patches/patch-ac?
 > Oh, please ignore my prervious message.
 >

 OK. sborrill just fixed the checksum. We tested it here - works fine.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.