Re: multitouch support again

2016-03-27 Thread Alexandr Shadchin
On Sat, Mar 26, 2016 at 10:37:08PM +0100, Martin Pieuchot wrote:
> On 25/03/16(Fri) 13:23, Ulf Brosziewski wrote:
> > Again, my mail client insisted on the "flowed" text format,
> > sorry. Here is a clean version of the diff.
> 
> Tested with:
> 
>   pms0: Synaptics clickpad, firmware 8.0
> 
> In think this should go in, then we can polish it in-tree and wait for
> regression before converting mice.
> 
> ok mpi@
> 

Also tested with:
 pms0: Synaptics touchpad, firmware 7.4

I support, ok shadchin@

-- 
Alexandr Shadchin



Re: multitouch support again

2016-03-26 Thread Martin Pieuchot
On 25/03/16(Fri) 13:23, Ulf Brosziewski wrote:
> Again, my mail client insisted on the "flowed" text format,
> sorry. Here is a clean version of the diff.

Tested with:

pms0: Synaptics clickpad, firmware 8.0

In think this should go in, then we can polish it in-tree and wait for
regression before converting mice.

ok mpi@



Re: multitouch support again

2016-03-26 Thread Mike Burns
On 2016-03-24 22.34.12 +0100, Ulf Brosziewski wrote:
> Are there any reviews, tests, OKs, or NOs pending?

I'll add on to the list of: no regressions. I do not have the applicable
harware to try the multitouch.

(My status is unchanged: the touch screen works fine until
suspend/resume, and then X treats it like a mouse instead of a touch
screen.)

-Mike



Re: multitouch support again

2016-03-25 Thread Ulf Brosziewski
On 03/25/2016 01:53 PM, Theo Buehler wrote:
> On Fri, Mar 25, 2016 at 01:47:07PM +0100, Matthieu Herrb wrote:
>> On Thu, Mar 24, 2016 at 10:34:12PM +0100, Ulf Brosziewski wrote:
>>> Are there any reviews, tests, OKs, or NOs pending? And if
>>> not, may I ask if someone knows a better way to make progress
>>> in this area? I'm at a loss here. As far as I can see, I
>>> cannot offer a smaller diff; this one contains the minimum
>>> that technically makes sense. And as it just adds the basics,
>>> a lot of things remain that could and possibly should be done
>>> soon, 6.0 isn't far away here.
>>
>> I've been running the previous version of your diff without problem.
>> However, on my laptop (X2240) I can't figure out if the
>> touchpad is supposed to support multitouch or not.
>>
> 
> Same here: I've been running the three patches you sent gzipped on my
> Thinkpad T450 since you posted them and didn't notice any regression so
> far. It just works as I expect it to.
> 
Thanks. Verifying that the new input functions and the modified wsconscomm
don't break anything is more or less all that can be done with these
versions of my diffs. Synaptics touchpads are running in a mode that
doesn't need the MT functions. Only Elantech-v4 models make use of them
currently. ubcmtp and hidmt could apply it, but I haven't adapted the
drivers, it is a bit less trivial than replacing the wsmouse_input call.
If someone wants to do that, or could do the tests for me, please let me
know (up to now, the wsmouse_mtframe and wsmouse_id_to_slot functions have
only been tested with special versions of the elantech handler).

>> I wanted to do more tests (comparing with Linux for instance) but I've
>> lacked time so far.
>>
>> If you have some small test programs (or recipes based on xinput)
>> to suggest I'll try that.
> 
> Yes, it would be very helpful if you could give some good test cases and
> instructions what to look for.
> 
I don't have a very systematic way of testing touchpads. Usually I check
"gestures" that involve changes of the contact count or - possibly -
pointer-control, like two-finger scrolling (with two, one, or alternating
fingers moving), click-and-drag actions with two fingers on clickpads (again,
with alternating fingers moving), tapping, tap-and-drag, and tap-and-drag
with "locked drags".
>> Again, your work on this is much appreciated, even if it's true that
>> we've not provided feedback...
> 
> Seconded.
> 
> 
Thanks again.



Re: multitouch support again

2016-03-25 Thread Theo Buehler
On Fri, Mar 25, 2016 at 01:47:07PM +0100, Matthieu Herrb wrote:
> On Thu, Mar 24, 2016 at 10:34:12PM +0100, Ulf Brosziewski wrote:
> > Are there any reviews, tests, OKs, or NOs pending? And if
> > not, may I ask if someone knows a better way to make progress
> > in this area? I'm at a loss here. As far as I can see, I
> > cannot offer a smaller diff; this one contains the minimum
> > that technically makes sense. And as it just adds the basics,
> > a lot of things remain that could and possibly should be done
> > soon, 6.0 isn't far away here.
> 
> I've been running the previous version of your diff without problem.
> However, on my laptop (X2240) I can't figure out if the
> touchpad is supposed to support multitouch or not.
> 

Same here: I've been running the three patches you sent gzipped on my
Thinkpad T450 since you posted them and didn't notice any regression so
far. It just works as I expect it to.

> I wanted to do more tests (comparing with Linux for instance) but I've
> lacked time so far.
> 
> If you have some small test programs (or recipes based on xinput)
> to suggest I'll try that.

Yes, it would be very helpful if you could give some good test cases and
instructions what to look for.

> Again, your work on this is much appreciated, even if it's true that
> we've not provided feedback...

Seconded.



Re: multitouch support again

2016-03-25 Thread Matthieu Herrb
On Thu, Mar 24, 2016 at 10:34:12PM +0100, Ulf Brosziewski wrote:
> Are there any reviews, tests, OKs, or NOs pending? And if
> not, may I ask if someone knows a better way to make progress
> in this area? I'm at a loss here. As far as I can see, I
> cannot offer a smaller diff; this one contains the minimum
> that technically makes sense. And as it just adds the basics,
> a lot of things remain that could and possibly should be done
> soon, 6.0 isn't far away here.

I've been running the previous version of your diff without problem.
However, on my laptop (X2240) I can't figure out if the
touchpad is supposed to support multitouch or not.

I wanted to do more tests (comparing with Linux for instance) but I've
lacked time so far.

If you have some small test programs (or recipes based on xinput)
to suggest I'll try that.

Again, your work on this is much appreciated, even if it's true that
we've not provided feedback...

Thanks.
> 
> 
> On 03/20/2016 06:18 PM, Ulf Brosziewski wrote:
> >I have been asked to prepare a less invasive version of
> >the MT diffs I posted a week ago. Here it is. It doesn't
> >delete wsmouse_input(). The old and the new infrastructure
> >coexist in wsmouse, and only the touchpad drivers have been
> >changed to use the new one. Except for a stylistic detail
> >(s/timespeccpy/memcpy/), nothing else has changed, and the
> >descriptions I added last week apply to this version as
> >well (the synaptics diff, which needs the modified wsconsio.h,
> >is the first one here, the rest is for the kernel).
> >
> >Tests have been made with an Elantech-v4 touchpad, an ALPS
> >Glidepoint, and an old Synaptics touchpad. I couldn't test
> >the older Elantech models, more recent Synaptics models, or
> >models that run with hidmt or ubcmtp. (The December version
> >had more tests, but this isn't exactly the same code anymore.)
> >
> >
> >[...]

-- 
Matthieu Herrb


pgphKg4PvBKaG.pgp
Description: PGP signature


Re: multitouch support again

2016-03-25 Thread Ulf Brosziewski
Again, my mail client insisted on the "flowed" text format,
sorry. Here is a clean version of the diff.


Index: src/wsconscomm.c
===
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/wsconscomm.c,v
retrieving revision 1.13
diff -u -p -r1.13 wsconscomm.c
--- src/wsconscomm.c29 Aug 2015 08:48:28 -  1.13
+++ src/wsconscomm.c11 Mar 2016 20:46:30 -
@@ -215,45 +215,29 @@ WSConsReadHwState(InputInfoPtr pInfo,
 hw->y = priv->maxy - event->value + priv->miny;
 hw->cumulative_dy = hw->y;
 break;
-case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
+case WSCONS_EVENT_TOUCH_PRESSURE:
 hw->z = event->value;
 break;
-case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
-if (priv->model == MODEL_ELANTECH) {
-/* Elantech touchpads report number of fingers directly. */
-hw->fingerWidth = 5;
-hw->numFingers = event->value;
-break;
-}
-/* XXX magic number mapping which is mirrored in pms driver */
-switch (event->value) {
-case 0:
-hw->fingerWidth = 5;
-hw->numFingers = 2;
-break;
-case 1:
+case WSCONS_EVENT_TOUCH_CONTACTS:
+hw->numFingers = event->value;
+if (hw->numFingers == 0)
+hw->fingerWidth = 0;
+else if (hw->fingerWidth == 0)
 hw->fingerWidth = 5;
-hw->numFingers = 3;
-break;
-case 4 ... 5:
-hw->fingerWidth = event->value;
-hw->numFingers = 1;
-break;
-}
+break;
+case WSCONS_EVENT_TOUCH_WIDTH:
+hw->fingerWidth = event->value;
+break;
+case WSCONS_EVENT_TOUCH_RESET:
+/*
+ * The contact count or the active MT-slot has changed.
+ * Suppress pointer motion and two-finger scrolling.
+ */
+priv->count_packet_finger = 0;
+priv->vert_scroll_twofinger_on = FALSE;
+priv->horiz_scroll_twofinger_on = FALSE;
 break;
 case WSCONS_EVENT_SYNC:
-if (hw->z == 0) {
-hw->fingerWidth = 0;
-hw->numFingers = 0;
-} else if (hw->numFingers == 0) {
-/*
- * Because W may be 0 already, a two-finger touch on a
- * Synaptics touchpad doesn't necessarily produce an update
- * event for W.
- */
-hw->fingerWidth = 5;
-hw->numFingers = 2;
-}
 hw->millis = 1000 * event->time.tv_sec +
 event->time.tv_nsec / 100;
 SynapticsCopyHwState(hwRet, hw);
Index: dev/hid/hidmt.c
===
RCS file: /cvs/src/sys/dev/hid/hidmt.c,v
retrieving revision 1.1
diff -u -p -r1.1 hidmt.c
--- dev/hid/hidmt.c 20 Jan 2016 01:26:00 -  1.1
+++ dev/hid/hidmt.c 20 Mar 2016 14:22:49 -
@@ -329,20 +329,15 @@ hidmt_input(struct hidmt *mt, uint8_t *d
width = 50;
}

-   wsmouse_input(mt->sc_wsmousedev, mt->sc_button,
+   WSMOUSE_TOUCH(mt->sc_wsmousedev, mt->sc_button,
(mt->last_x = mt->sc_contacts[i].x),
(mt->last_y = mt->sc_contacts[i].y),
-   width, tips,
-   WSMOUSE_INPUT_ABSOLUTE_X |
-   WSMOUSE_INPUT_ABSOLUTE_Y |
-   WSMOUSE_INPUT_ABSOLUTE_Z |
-   WSMOUSE_INPUT_ABSOLUTE_W);
+   width, tips);
} else {
-   wsmouse_input(mt->sc_wsmousedev, mt->sc_button,
+   WSMOUSE_INPUT(mt->sc_wsmousedev, mt->sc_button,
(mt->last_x - mt->sc_contacts[i].x),
(mt->last_y - mt->sc_contacts[i].y),
-   0, 0,
-   WSMOUSE_INPUT_DELTA);
+   0, 0);
mt->last_x = mt->sc_contacts[i].x;
mt->last_y = mt->sc_contacts[i].y;
}
Index: dev/pckbc/pms.c
===
RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
retrieving revision 1.68
diff -u -p -r1.68 pms.c
--- dev/pckbc/pms.c 27 Feb 2016 22:01:58 -  1.68
+++ dev/pckbc/pms.c 20 Mar 2016 14:22:52 -
@@ -143,17 +143,8 @@ struct elantech_softc {

int min_x, min_y;
int max_x, max_y;
-   struct {
-   unsigned int x;
-   unsigned int y;
-   unsigned int z;
-   

Re: multitouch support again

2016-03-25 Thread Martin Pieuchot
On 24/03/16(Thu) 22:34, Ulf Brosziewski wrote:
> Are there any reviews, tests, OKs, or NOs pending? And if
> not, may I ask if someone knows a better way to make progress
> in this area? I'm at a loss here. As far as I can see, I
> cannot offer a smaller diff; this one contains the minimum
> that technically makes sense. And as it just adds the basics,
> a lot of things remain that could and possibly should be done
> soon, 6.0 isn't far away here.

I cannot apply your diff.



Re: multitouch support again

2016-03-24 Thread Ulf Brosziewski

Are there any reviews, tests, OKs, or NOs pending? And if
not, may I ask if someone knows a better way to make progress
in this area? I'm at a loss here. As far as I can see, I
cannot offer a smaller diff; this one contains the minimum
that technically makes sense. And as it just adds the basics,
a lot of things remain that could and possibly should be done
soon, 6.0 isn't far away here.


On 03/20/2016 06:18 PM, Ulf Brosziewski wrote:

I have been asked to prepare a less invasive version of
the MT diffs I posted a week ago. Here it is. It doesn't
delete wsmouse_input(). The old and the new infrastructure
coexist in wsmouse, and only the touchpad drivers have been
changed to use the new one. Except for a stylistic detail
(s/timespeccpy/memcpy/), nothing else has changed, and the
descriptions I added last week apply to this version as
well (the synaptics diff, which needs the modified wsconsio.h,
is the first one here, the rest is for the kernel).

Tests have been made with an Elantech-v4 touchpad, an ALPS
Glidepoint, and an old Synaptics touchpad. I couldn't test
the older Elantech models, more recent Synaptics models, or
models that run with hidmt or ubcmtp. (The December version
had more tests, but this isn't exactly the same code anymore.)


[...]




multitouch support again

2016-03-20 Thread Ulf Brosziewski

I have been asked to prepare a less invasive version of
the MT diffs I posted a week ago. Here it is. It doesn't
delete wsmouse_input(). The old and the new infrastructure
coexist in wsmouse, and only the touchpad drivers have been
changed to use the new one. Except for a stylistic detail
(s/timespeccpy/memcpy/), nothing else has changed, and the
descriptions I added last week apply to this version as
well (the synaptics diff, which needs the modified wsconsio.h,
is the first one here, the rest is for the kernel).

Tests have been made with an Elantech-v4 touchpad, an ALPS
Glidepoint, and an old Synaptics touchpad. I couldn't test
the older Elantech models, more recent Synaptics models, or
models that run with hidmt or ubcmtp. (The December version
had more tests, but this isn't exactly the same code anymore.)


Index: src/wsconscomm.c
===
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/wsconscomm.c,v
retrieving revision 1.13
diff -u -p -r1.13 wsconscomm.c
--- src/wsconscomm.c29 Aug 2015 08:48:28 -  1.13
+++ src/wsconscomm.c11 Mar 2016 20:46:30 -
@@ -215,45 +215,29 @@ WSConsReadHwState(InputInfoPtr pInfo,
 hw->y = priv->maxy - event->value + priv->miny;
 hw->cumulative_dy = hw->y;
 break;
-case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
+case WSCONS_EVENT_TOUCH_PRESSURE:
 hw->z = event->value;
 break;
-case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
-if (priv->model == MODEL_ELANTECH) {
-/* Elantech touchpads report number of fingers directly. */
-hw->fingerWidth = 5;
-hw->numFingers = event->value;
-break;
-}
-/* XXX magic number mapping which is mirrored in pms driver */
-switch (event->value) {
-case 0:
-hw->fingerWidth = 5;
-hw->numFingers = 2;
-break;
-case 1:
+case WSCONS_EVENT_TOUCH_CONTACTS:
+hw->numFingers = event->value;
+if (hw->numFingers == 0)
+hw->fingerWidth = 0;
+else if (hw->fingerWidth == 0)
 hw->fingerWidth = 5;
-hw->numFingers = 3;
-break;
-case 4 ... 5:
-hw->fingerWidth = event->value;
-hw->numFingers = 1;
-break;
-}
+break;
+case WSCONS_EVENT_TOUCH_WIDTH:
+hw->fingerWidth = event->value;
+break;
+case WSCONS_EVENT_TOUCH_RESET:
+/*
+ * The contact count or the active MT-slot has changed.
+ * Suppress pointer motion and two-finger scrolling.
+ */
+priv->count_packet_finger = 0;
+priv->vert_scroll_twofinger_on = FALSE;
+priv->horiz_scroll_twofinger_on = FALSE;
 break;
 case WSCONS_EVENT_SYNC:
-if (hw->z == 0) {
-hw->fingerWidth = 0;
-hw->numFingers = 0;
-} else if (hw->numFingers == 0) {
-/*
- * Because W may be 0 already, a two-finger touch on a
- * Synaptics touchpad doesn't necessarily produce an update
- * event for W.
- */
-hw->fingerWidth = 5;
-hw->numFingers = 2;
-}
 hw->millis = 1000 * event->time.tv_sec +
 event->time.tv_nsec / 100;
 SynapticsCopyHwState(hwRet, hw);
Index: dev/hid/hidmt.c
===
RCS file: /cvs/src/sys/dev/hid/hidmt.c,v
retrieving revision 1.1
diff -u -p -r1.1 hidmt.c
--- dev/hid/hidmt.c 20 Jan 2016 01:26:00 -  1.1
+++ dev/hid/hidmt.c 20 Mar 2016 14:22:49 -
@@ -329,20 +329,15 @@ hidmt_input(struct hidmt *mt, uint8_t *d
width = 50;
}

-   wsmouse_input(mt->sc_wsmousedev, mt->sc_button,
+   WSMOUSE_TOUCH(mt->sc_wsmousedev, mt->sc_button,
(mt->last_x = mt->sc_contacts[i].x),
(mt->last_y = mt->sc_contacts[i].y),
-   width, tips,
-   WSMOUSE_INPUT_ABSOLUTE_X |
-   WSMOUSE_INPUT_ABSOLUTE_Y |
-   WSMOUSE_INPUT_ABSOLUTE_Z |
-   WSMOUSE_INPUT_ABSOLUTE_W);
+   width, tips);
} else {
-   wsmouse_input(mt->sc_wsmousedev, mt->sc_button,
+   WSMOUSE_INPUT(mt->sc_wsmousedev, mt->sc_button,
(mt->last_x - mt->sc_contacts[i].x),
(mt->last_y - mt->sc_contacts[i].y),
-   0, 0,
-