On Wed, Jul 11, 2012 at 12:53:00AM +0600, Alexandr Shadchin wrote:
> Now in clickpad mode the pointer moves to [1,1] (upper left corner)
> even on a single tap. These patches fixes it.
> 
> On issue pointed gilles@ and matthieu@
> 
> * cd /sys
> * patch < 01_kernel.diff
> * build and install new kernel
> * cd /usr/src
> * (if need - make obj)
> * make includes
> * cd /usr/xenocara/driver/xf86-input-synaptics
> * patch < 02_xenocara.diff
> * make -f Makefile.bsd-wrapper obj build
> * reboot and test
> 
> Also need check on other touchpad.
> 
> Comments ? OK ?
> 

Fixes the issue here too (Thinkpad X200). Not yet tested on other
touchpads I have. 
ok for the X part A few comments inline on the kernel part. 

(and of course you need to commit the kernel part first).

> -- 
> Alexandr Shadchin
> 

> Index: dev/pckbc/pms.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
> retrieving revision 1.30
> diff -u -p -r1.30 pms.c
> --- dev/pckbc/pms.c   1 Jul 2012 12:59:34 -0000       1.30
> +++ dev/pckbc/pms.c   10 Jul 2012 18:17:14 -0000
> @@ -782,6 +782,9 @@ int
>  synaptics_get_hwinfo(struct pms_softc *sc)
>  {
>       struct synaptics_softc *syn = sc->synaptics;
> +#ifdef DEBUG
> +     int i, val;
> +#endif
>  
>       if (synaptics_query(sc, SYNAPTICS_QUE_IDENTIFY, &syn->identify))
>               return (-1);
> @@ -817,6 +820,15 @@ synaptics_get_hwinfo(struct pms_softc *s
>       if (SYNAPTICS_EXT_MODEL_BUTTONS(syn->ext_model) > 8)
>               syn->ext_model &= ~0xf000;
>  
> +#ifdef DEBUG
> +     for (i = 0; i < 16; i++) {
> +             if (synaptics_query(sc, i, &val))
> +                     printf("%s: querie %2d: fail\n", DEVNAME(sc), i);
> +             else
> +                     printf("%s: querie %2d: 0x%06x\n",
> DEVNAME(sc), i, val);

> +     }
> +#endif
'querie' is not correct. use "query" or drop the #ifdef DEBUG part
completely. 

> +
>       return (0);
>  }
>  
> @@ -1026,7 +1038,8 @@ pms_proc_synaptics(struct pms_softc *sc)
>       if (syn->wsmode == WSMOUSE_NATIVE) {
>               wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, w,
>                   WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
> -                 WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W);
> +                 WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
> +                 WSMOUSE_INPUT_SYNC);
>       } else {
>               dx = dy = 0;
>               if (z > SYNAPTICS_PRESSURE) {
> @@ -1335,7 +1348,8 @@ pms_proc_alps(struct pms_softc *sc)
>  
>               wsmouse_input(sc->sc_wsmousedev, buttons, x, y, z, w,
>                   WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
> -                 WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W);
> +                 WSMOUSE_INPUT_ABSOLUTE_Z | WSMOUSE_INPUT_ABSOLUTE_W |
> +                 WSMOUSE_INPUT_SYNC);
>  
>               alps->old_fin = fin;
>       } else {
> Index: dev/wscons/wsconsio.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/wscons/wsconsio.h,v
> retrieving revision 1.65
> diff -u -p -r1.65 wsconsio.h
> --- dev/wscons/wsconsio.h     17 Apr 2012 08:51:24 -0000      1.65
> +++ dev/wscons/wsconsio.h     10 Jul 2012 18:17:14 -0000
> @@ -80,6 +80,7 @@ struct wscons_event {
>                                    /* 12-15, see below */
>  #define      WSCONS_EVENT_MOUSE_DELTA_W      16      /* W delta amount */
>  #define      WSCONS_EVENT_MOUSE_ABSOLUTE_W   17      /* W location */
> +#define      WSCONS_EVENT_SYNC               18
>  /* 
>   * Following events are not real wscons_event but are used as parameters of 
> the
>   * WSDISPLAYIO_WSMOUSED ioctl 
> Index: dev/wscons/wsmouse.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/wscons/wsmouse.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 wsmouse.c
> --- dev/wscons/wsmouse.c      17 Aug 2011 16:10:27 -0000      1.22
> +++ dev/wscons/wsmouse.c      10 Jul 2012 18:17:14 -0000
> @@ -455,6 +455,14 @@ wsmouse_input(struct device *wsmousedev,
>               ub ^= d;
>       }
>  
> +     if (flags & WSMOUSE_INPUT_SYNC) {
> +             NEXT;
> +             ev->type = WSCONS_EVENT_SYNC;
> +             ev->value = 0;
> +             TIMESTAMP;
> +             ADVANCE;
> +     }
> +
>       /* XXX fake wscons_event notifying wsmoused(8) to close mouse device */
>       if (flags & WSMOUSE_INPUT_WSMOUSED_CLOSE) {
>               NEXT;
> Index: dev/wscons/wsmousevar.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/wscons/wsmousevar.h,v
> retrieving revision 1.5
> diff -u -p -r1.5 wsmousevar.h
> --- dev/wscons/wsmousevar.h   10 Apr 2007 22:37:17 -0000      1.5
> +++ dev/wscons/wsmousevar.h   10 Jul 2012 18:17:14 -0000
> @@ -72,6 +72,7 @@ int wsmousedevprint(void *, const char *
>  #define WSMOUSE_INPUT_ABSOLUTE_Y     (1<<1)
>  #define WSMOUSE_INPUT_ABSOLUTE_Z     (1<<2)
>  #define WSMOUSE_INPUT_ABSOLUTE_W     (1<<4)
> +#define WSMOUSE_INPUT_SYNC           (1<<5)
>  #define WSMOUSE_INPUT_WSMOUSED_CLOSE (1<<3) /* notify wsmoused(8) to close
>                                                 mouse device */

Wouldn't it be better to sort those by bit position, to avoid
confusion when adding a new flag ? 

-- 
Matthieu Herrb

Reply via email to