From: Daniel Kurtz <redacted>
Hello,
This patch set (against next) is intended to add support for synaptics
"image sensor" touchpads.
Patches 1-3 clean up the current driver slightly and prepare for the image
sensor patches which follow.
Patches 4-7 add up to 3 finger support for image sensor touchpads.
Image sensors do not suffer from the finger tracking issues that plagued
the earlier "profile sensors", and which required the invention of "semi-mt"
(Semi-mt reports a bounding box around two fingers instead of the fingers
themselves). Instead, the image sensors report the actual positions of two
fingers using the same "Advanced Gesture Mode". This driver uses two MT-B slots
to report these two fingers to userspace. In addition, it will also report
the total number of fingers using BTN_TOOL_*TAP EV_KEY events.
Userspace drivers should be aware that the number of fingers reported via
BTN_TOOL_*TAP can be greater than the total number MT-B slots with non-negative
track_ids. Upon opening the device node, userspace should query the maximum
values supported ABS_MT_SLOT, and note the number of supported BTN_TOOL_*TAP
events.
Patches 8-9 adds up to 5 finger support.
In fact, the image sensor touchpads actually track 5 fingers while reporting
just 2 finger positions. These patches add support for properly tracking the
reported slots through 4 and 5 finger transitions, while always reporting two of
them via 2 MT-B slots. In addition, a new event, EV_KEY/BTN_TOOL_QUINTTAP, is
added to the event subsystem to allow reporting up to 5 fingers.
These patches are similar to, and inspired by, a similar patchset recently
submitted by Derek Foreman and Daniel Stone. However, it is not directly built
upon, nor is it compatible with, those patches.
Thanks,
Daniel
Daniel Kurtz (9):
Input: synaptics - refactor y inversion
Input: synaptics - refactor agm packet parsing
Input: synaptics - refactor initialization of abs position axes
Input: synaptics - add image sensor support
Input: synaptics - decode AGM packet types
Input: synaptics - process finger (<=3) transitions
Input: synaptics - improved 2->3 finger transition handling
Input: add BTN_TOOL_QUINTTAP for reporting 5 fingers on touchpad
Input: synaptics - process finger (<=5) transitions
drivers/input/input-mt.c | 1 +
drivers/input/mouse/synaptics.c | 466 ++++++++++++++++++++++++++++++++++++---
drivers/input/mouse/synaptics.h | 27 ++-
include/linux/input.h | 1 +
4 files changed, 458 insertions(+), 37 deletions(-)
--
1.7.3.1
From: Daniel Kurtz <redacted>
When a Synaptics touchpad is in "AGM" mode, and multiple fingers are
detected, the touchpad sends alternating "Advanced Gesture Mode" (AGM) and
"Simple Gesture Mode" (SGM) packets.
The AGM packets have w=2, and contain reduced resolution finger data.
The SGM packets have w={0,1} and contain full resolution finger data.
Refactor the parsing of agm packets to its own function, and rename the
synaptics_data.mt field to .agm to indicate that it contains the contents of
the last agm packet.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 19 ++++++++++++++-----
drivers/input/mouse/synaptics.h | 6 +++++-
2 files changed, 19 insertions(+), 6 deletions(-)
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track 5 fingers, but only report 2.
This patch attempts to deal with some idiosyncrasies of these touchpads:
* When there are 3 or more fingers, only two are reported.
* The number of fingers can change at any time, but is only reported in
SGM packets, thus at a number-of-fingers change, it is not possible
to tell whether the AGM finger is for the original or new number of
fingers.
* When the number of fingers changes from 2->3 it is not
possible to tell which of the 2 fingers are now reported.
* When number of fingers changes from 3->2 it is often not possible to
tell which finger was removed, and which are now being reported.
When 2 or more packets are present on the touchpad, the kernel reports
exactly two MT-B slots containing the position data for the two fingers
reported by the touchpad.
In addition, it reports the total number of fingers using one of the
EV_KEY/BTN_TOOL_*TAP events. Thus, this is a hybrid singletouch/MT-B scheme.
Userspace can detect this condition by noting that the driver supports
more EV_KEY/BTN_TOOL_*TAP events than its maximum EV_ABS/ABS_MT_SLOT.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 229 ++++++++++++++++++++++++++++++++++++---
drivers/input/mouse/synaptics.h | 3 +
2 files changed, 216 insertions(+), 16 deletions(-)
@@ -453,6 +453,9 @@ static void synaptics_parse_agm(const unsigned char buf[],default:break;}++/* Record that at least one AGM has been received since last SGM */+priv->agm_pending=true;}staticintsynaptics_parse_hw_state(constunsignedcharbuf[],
@@ -600,26 +603,44 @@ static void synaptics_report_slot_agm(struct input_dev *dev, int slot,}staticvoidsynaptics_report_mt(structpsmouse*psmouse,-intcount,+structsynaptics_mt_state*mt_state,conststructsynaptics_hw_state*sgm){structinput_dev*dev=psmouse->dev;structsynaptics_data*priv=psmouse->private;structsynaptics_hw_state*agm=&priv->agm;+structsynaptics_mt_state*old=&priv->mt_state;-switch(count){+switch(mt_state->count){case0:synaptics_report_slot_empty(dev,0);synaptics_report_slot_empty(dev,1);break;case1:-synaptics_report_slot_sgm(dev,0,sgm);-synaptics_report_slot_empty(dev,1);+if(mt_state->sgm==0){+synaptics_report_slot_sgm(dev,0,sgm);+synaptics_report_slot_empty(dev,1);+}else{+synaptics_report_slot_empty(dev,0);+synaptics_report_slot_sgm(dev,1,sgm);+}break;-case2:-case3:/* Fall-through case */-synaptics_report_slot_sgm(dev,0,sgm);-synaptics_report_slot_agm(dev,1,agm);+default:+/*+*Forallotherfingercounts,reportsgmin0andagmin1,+*butonlyifthesgm/agmisreportingthesamefinger.+*Ifeitherreportedfingerhaschanged,invalidateitsslot's+*oldtrackingid,instead.+*/+if((old->sgm==-1)||(old->sgm==mt_state->sgm))+synaptics_report_slot_sgm(dev,0,sgm);+else+synaptics_report_slot_empty(dev,0);++if((old->agm==-1)||(old->agm==mt_state->agm))+synaptics_report_slot_agm(dev,1,agm);+else+synaptics_report_slot_empty(dev,1);break;}
@@ -627,28 +648,204 @@ static void synaptics_report_mt(struct psmouse *psmouse,input_mt_report_pointer_emulation(dev,false);/* Send the number of fingers reported by touchpad itself. */-input_mt_report_finger_count(dev,count);+input_mt_report_finger_count(dev,mt_state->count);input_report_key(dev,BTN_LEFT,sgm->left);input_sync(dev);}+/* Handle case where mt_state->count = 0 */+staticvoidsynaptics_image_sensor_0f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+synaptics_mt_state_set(mt_state,0,-1,-1);+}++/* Handle case where mt_state->count = 1 */+staticvoidsynaptics_image_sensor_1f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+structsynaptics_hw_state*agm=&priv->agm;+structsynaptics_mt_state*old=&priv->mt_state;++/*+*IfthelastAGMwas(0,0,0),andthereisonlyonefingerleft,+*thenSGMcontainsslot0,andallotherfingershavebeenremoved.+*/+if(priv->agm_pending&&agm->z==0){+synaptics_mt_state_set(mt_state,1,0,-1);+return;+}++switch(old->count){+case0:+synaptics_mt_state_set(mt_state,1,0,-1);+break;+case1:+/*+*IfpendingAGMandeither:+*(a)thepreviousSGMslotcontainsslot0,or+*(b)therewasnoSGMslot+*thenSGMnowcontainsslot1+*+*(a)The"SGM contains slot 0"casehappenswithveryrapid+*"drum roll"gestures,whereslot0fingerisliftedanda+*newslot1fingertoucheswithinonereportinginterval.+*+*(b)The"no SGM slot"casehappensifinitiallytwoormore+*fingerstapbriefly,andallbutoneliftbeforetheendof+*thefirstreportinginterval.+*+*(Inboththesecases,slot0willbecomeempty,andSGM+*containsanewfingerinslot1)+*+*Else,iftherewasnopreviousSGM,itnowcontainsslot0.+*+*Otherwise,SGMstillcontainsthesameslot.+*/++if(priv->agm_pending&&old->sgm<=0)+synaptics_mt_state_set(mt_state,1,1,-1);+elseif(old->sgm==-1)+synaptics_mt_state_set(mt_state,1,0,-1);+break;+case2:+/*+*SincethelastAGMwasNOT(0,0,0),itwasthefingerin+*slot0thathasbeenremoved.+*So,SGMnowcontainspreviousAGM'sslot,andAGMisnow+*empty.+*/+synaptics_mt_state_set(mt_state,1,old->agm,-1);+break;+case3:+/*+*SincelastAGMwasnot(0,0,0),wedon'tknowwhichfinger+*isleft.+*+*So,emptyallslots.Wewillguessslot0onsubsequent1->1+*/+synaptics_mt_state_set(mt_state,0,-1,-1);+break;+}+}++/* Handle case where mt_state->count = 2 */+staticvoidsynaptics_image_sensor_2f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+structsynaptics_mt_state*old=&priv->mt_state;++switch(old->count){+case0:+synaptics_mt_state_set(mt_state,2,0,1);+break;+case1:+/*+*IfpreviousSGMcontainedslot1orhigher,SGMnowcontains+*slot0(thenewlytouchingfinger)andAGMcontainsSGM's+*previousslot.+*+*Otherwise,SGMstillcontainsslot0andAGMnowcontains+*slot1.+*/+if(old->sgm>=1)+synaptics_mt_state_set(mt_state,2,0,old->sgm);+else+synaptics_mt_state_set(mt_state,2,0,1);+break;+case2:+/*+*mt_stateeitherhasn'tchanged,orwasupdatedbyarecently+*receivedAGM-CONTACTpacket.+*/+break;+case3:+/*+*3->2transitionshavetwounsolvableproblems:+*1)noindicationisgivenwhichfingerwasremoved+*2)nowaytotellifagmpacketwasforfinger3+*before3->2,orfinger2after3->2.+*+*So,emptyallslots.Wewillguessslots[0,1]on+*subsequent2->2+*/+synaptics_mt_state_set(mt_state,0,-1,-1);+break;+}+}++/* Handle case where mt_state->count = 3 */+staticvoidsynaptics_image_sensor_3f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+structsynaptics_mt_state*old=&priv->mt_state;++switch(old->count){+case0:+synaptics_mt_state_set(mt_state,3,0,2);+break;+case1:+/*+*IfpreviousSGMcontainedslot2orhigher,SGMnowcontains+*slot0(oneofthenewlytouchingfingers)andAGMcontains+*SGM'spreviousslot.+*+*Otherwise,SGMnowcontainsslot0andAGMcontainsslot2.+*/+if(old->sgm>=2)+synaptics_mt_state_set(mt_state,3,0,old->sgm);+else+synaptics_mt_state_set(mt_state,3,0,2);+break;+case2:+/*+*On2->3transitions,wearegivennoindicationwhichfinger+*wasadded.+*Wedon'tevenknowwhatfingerthecurrentAGMpacket+*contained.+*+*So,emptyallslots.Theygetfilledonasubsequent3->3+*/+synaptics_mt_state_set(mt_state,0,-1,-1);+break;+case3:+/*+*mt_stateeitherhasn'tchanged,orwasupdatedbyarecently+*receivedAGM-CONTACTpacket.+*/+break;+}+}+staticvoidsynaptics_image_sensor_process(structpsmouse*psmouse,structsynaptics_hw_state*sgm){-intcount;+structsynaptics_data*priv=psmouse->private;+structsynaptics_hw_state*agm=&priv->agm;+structsynaptics_mt_statemt_state;++/* Initialize using current mt_state (as updated by last agm) */+mt_state=agm->mt_state;+/*+*Updatemt_stateusingthenewfingercountandcurrentmt_state.+*/if(sgm->z==0)-count=0;+synaptics_image_sensor_0f(priv,&mt_state);elseif(sgm->w>=4)-count=1;+synaptics_image_sensor_1f(priv,&mt_state);elseif(sgm->w==0)-count=2;-else-count=3;+synaptics_image_sensor_2f(priv,&mt_state);+elseif(sgm->w==1)+synaptics_image_sensor_3f(priv,&mt_state);/* Send resulting input events to user space */-synaptics_report_mt(psmouse,count,sgm);+synaptics_report_mt(psmouse,&mt_state,sgm);++/* Store updated mt_state */+priv->mt_state=agm->mt_state=mt_state;+priv->agm_pending=false;}/*
@@ -161,11 +161,14 @@ struct synaptics_data {structserio*pt_port;/* Pass-through serio port */+structsynaptics_mt_statemt_state;/* Current mt finger state */+/**LastreceivedAdvancedGestureMode(AGM)packet.AnAGMpacket*containspositiondataforasecondcontact,athalfresolution.*/structsynaptics_hw_stateagm;+boolagm_pending;/* new AGM packet received */};voidsynaptics_module_init(void);
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track up to 5 fingers, but only report 2.
They use a special "TYPE=2" (AGM-CONTACT) packet type that reports
the number of tracked fingers and which finger is reported in the SGM
and AGM packets.
With this new packet type, it is possible to tell userspace when 4 or 5
fingers are touching.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 44 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 43 insertions(+), 1 deletions(-)
@@ -836,9 +860,22 @@ static void synaptics_image_sensor_3f(struct synaptics_data *priv,*receivedAGM-CONTACTpacket.*/break;++case4:+case5:+/* mt_state was updated by AGM-CONTACT packet */+break;}}+/* Handle case where mt_state->count = 4, or = 5 */+staticvoidsynaptics_image_sensor_45f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+/* mt_state was updated correctly by AGM-CONTACT packet */+priv->mt_state_lost=false;+}+staticvoidsynaptics_image_sensor_process(structpsmouse*psmouse,structsynaptics_hw_state*sgm){
@@ -858,8 +895,10 @@ static void synaptics_image_sensor_process(struct psmouse *psmouse,synaptics_image_sensor_1f(priv,&mt_state);elseif(sgm->w==0)synaptics_image_sensor_2f(priv,&mt_state);-elseif(sgm->w==1)+elseif(sgm->w==1&&mt_state.count<=3)synaptics_image_sensor_3f(priv,&mt_state);+else+synaptics_image_sensor_45f(priv,&mt_state);/* Send resulting input events to user space */synaptics_report_mt(psmouse,&mt_state,sgm);
@@ -1078,6 +1117,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)input_set_abs_params(dev,ABS_MT_PRESSURE,0,255,0,0);/* Image sensors can sometimes report per-contact width */input_set_abs_params(dev,ABS_MT_TOUCH_MAJOR,4,15,0,0);+/* Image sensors can signal 4 and 5 finger clicks */+__set_bit(BTN_TOOL_QUADTAP,dev->keybit);+__set_bit(BTN_TOOL_QUINTTAP,dev->keybit);}elseif(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)){/* Non-image sensors with AGM use semi-mt */__set_bit(INPUT_PROP_SEMI_MT,dev->propbit);
From: Daniel Kurtz <redacted>
As long as we know which slots are currently contained in SGM and AGM
packets, it is possible to track the slot 0 finger when transitioning from
2->3 fingers. This is the case when fingers are being added one at a
time, 1->2->3.
However, when fingers are removed, we sometimes lose track of which slots
are contained in SGM and AGM. In particular, when transitioning from 3->2
and sometimes 3->1. In both of these cases, we can no longer track slot 0
during 2->3 transitions.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 33 +++++++++++++++++++++++++++------
drivers/input/mouse/synaptics.h | 1 +
2 files changed, 28 insertions(+), 6 deletions(-)
@@ -162,6 +162,7 @@ struct synaptics_data {structserio*pt_port;/* Pass-through serio port */structsynaptics_mt_statemt_state;/* Current mt finger state */+boolmt_state_lost;/* mt_state may be incorrect *//**LastreceivedAdvancedGestureMode(AGM)packet.AnAGMpacket
From: Daniel Kurtz <redacted>
Synaptics touchpads report increasing y from bottom to top.
This is inverted from normal userspace "top of screen is 0" coordinates.
Thus, the kernel driver reports inverted y coordinates to userspace.
This patch refactors this inversion.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
From: Daniel Kurtz <redacted>
A Synaptics image sensor tracks 5 fingers, but can only report 2.
The algorithm for choosing which 2 fingers to report and in which packet:
Touchpad maintains 5 slots, numbered 0 to 4
Initially all slots are empty
As new fingers are detected, assign them to the lowest available slots
The touchpad always reports:
SGM: lowest numbered non-empty slot
AGM: highest numbered non-empty slot, if there is one
In addition, these touchpads have a special AGM packet type which reports
the number of fingers currently being tracked, and which finger is in
each of the two slots. Unfortunately, these "TYPE=2" packets are only used
when more than 3 fingers are being tracked. When less than 4 fingers
are present, the 'w' value must be used to track how many fingers are
present, and knowing which fingers are being reported is much more
difficult, if not impossible.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 38 +++++++++++++++++++++++++++++++-------
drivers/input/mouse/synaptics.h | 14 +++++++++++++-
2 files changed, 44 insertions(+), 8 deletions(-)
@@ -115,9 +115,18 @@#define SYN_REDUCED_FILTER_FUZZ 8/*-*Astructuretodescribethestateofthetouchpadhardware(buttonsandpad)+*Astructuretodescribewhichinternaltouchpadfingerslotsarebeing+*reportedinrawpackets.*/+structsynaptics_mt_state{+intcount;/* num fingers being tracked */+intsgm;/* which slot is reported by sgm pkt */+intagm;/* which slot is reported by agm pkt*/+};+/*+*Astructuretodescribethestateofthetouchpadhardware(buttonsandpad)+*/structsynaptics_hw_state{intx;inty;
@@ -130,6 +139,9 @@ struct synaptics_hw_state {unsignedintdown:1;unsignedcharext_buttons;signedcharscroll;++/* As reported in last AGM-CONTACT packets */+structsynaptics_mt_statemt_state;};structsynaptics_data{
From: Daniel Kurtz <redacted>
Synaptics makes (at least) two kinds of touchpad sensors:
* Older pads use a profile sensor that could only infer the location
of individual fingers based on the projection of their profiles
onto row and column sensors.
* Newer pads use an image sensor that can track true finger position
using a two-dimensional sensor grid.
Both sensor types support an "Advanced Gesture Mode":
When multiple fingers are detected, the touchpad sends alternating
"Advanced Gesture Mode" (AGM) and "Simple Gesture Mode" (SGM)
packets.
The AGM packets have w=2, and contain reduced resolution finger data
The SGM packets have w={0,1} and contain full resolution finger data
Profile sensors try to report the "upper" (larger y value) finger in
the SGM packet, and the lower (smaller y value) in the AGM packet.
However, due to the nature of the profile sensor, they easily get
confused when fingers cross, and can start reporting the x-coordinate
of one with the y-coordinate of the other. Thus, for profile
sensors, "semi-mt" was created, which reports a "bounding box"
created by pairing min and max coordinates of the two pairs of
reported fingers.
Image sensors can report the actual coordinates of two of the fingers
present. This patch detects if the touchpad is an image sensor and
reports finger data using the MT-B protocol.
NOTE: This patch only adds partial support for 2-finger gestures.
The proper interpretation of the slot contents when more than
two fingers are present is left to later patches. Also,
handling of 'number of fingers' transitions is incomplete.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 104 +++++++++++++++++++++++++++++++++++++-
drivers/input/mouse/synaptics.h | 3 +
2 files changed, 104 insertions(+), 3 deletions(-)
@@ -304,7 +304,8 @@ static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)staticunsignedcharparam=0xc8;structsynaptics_data*priv=psmouse->private;-if(!SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))+if(!(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)||+SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)))return0;if(psmouse_sliced_command(psmouse,SYN_QUE_MODEL))
@@ -463,7 +464,9 @@ static int synaptics_parse_hw_state(const unsigned char buf[],hw->down=((buf[0]^buf[3])&0x02)?1:0;}-if(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)&&hw->w==2){+if((SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)+||SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c))+&&hw->w==2){synaptics_parse_agm(buf,priv);return1;}
@@ -543,6 +546,87 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,}}+staticvoidsynaptics_report_slot_empty(structinput_dev*dev,intslot)+{+input_mt_slot(dev,slot);+input_mt_report_slot_state(dev,MT_TOOL_FINGER,false);+}++staticvoidsynaptics_report_slot_sgm(structinput_dev*dev,intslot,+conststructsynaptics_hw_state*sgm)+{+input_mt_slot(dev,slot);+input_mt_report_slot_state(dev,MT_TOOL_FINGER,true);+input_report_abs(dev,ABS_MT_POSITION_X,sgm->x);+input_report_abs(dev,ABS_MT_POSITION_Y,invert_y(sgm->y));+input_report_abs(dev,ABS_MT_PRESSURE,sgm->z);+/* SGM can sometimes contain valid width */+if(sgm->w>=4)+input_report_abs(dev,ABS_MT_TOUCH_MAJOR,sgm->w);+}++staticvoidsynaptics_report_slot_agm(structinput_dev*dev,intslot,+conststructsynaptics_hw_state*agm)+{+input_mt_slot(dev,slot);+input_mt_report_slot_state(dev,MT_TOOL_FINGER,true);+input_report_abs(dev,ABS_MT_POSITION_X,agm->x);+input_report_abs(dev,ABS_MT_POSITION_Y,invert_y(agm->y));+input_report_abs(dev,ABS_MT_PRESSURE,agm->z);+}++staticvoidsynaptics_report_mt(structpsmouse*psmouse,+intcount,+conststructsynaptics_hw_state*sgm)+{+structinput_dev*dev=psmouse->dev;+structsynaptics_data*priv=psmouse->private;+structsynaptics_hw_state*agm=&priv->agm;++switch(count){+case0:+synaptics_report_slot_empty(dev,0);+synaptics_report_slot_empty(dev,1);+break;+case1:+synaptics_report_slot_sgm(dev,0,sgm);+synaptics_report_slot_empty(dev,1);+break;+case2:+case3:/* Fall-through case */+synaptics_report_slot_sgm(dev,0,sgm);+synaptics_report_slot_agm(dev,1,agm);+break;+}++/* Don't use active slot count to generate BTN_TOOL events. */+input_mt_report_pointer_emulation(dev,false);++/* Send the number of fingers reported by touchpad itself. */+input_mt_report_finger_count(dev,count);++input_report_key(dev,BTN_LEFT,sgm->left);+input_sync(dev);+}++staticvoidsynaptics_image_sensor_process(structpsmouse*psmouse,+structsynaptics_hw_state*sgm)+{+intcount;++if(sgm->z==0)+count=0;+elseif(sgm->w>=4)+count=1;+elseif(sgm->w==0)+count=2;+else+count=3;++/* Send resulting input events to user space */+synaptics_report_mt(psmouse,count,sgm);+}+/**calledforeachfullreceivedpacketfromthetouchpad*/
From: Chase Douglas <hidden> Date: 2011-07-23 00:31:11
On 07/20/2011 06:38 AM, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
Synaptics touchpads report increasing y from bottom to top.
This is inverted from normal userspace "top of screen is 0" coordinates.
Thus, the kernel driver reports inverted y coordinates to userspace.
This patch refactors this inversion.
Signed-off-by: Daniel Kurtz <redacted>
From: Chase Douglas <hidden> Date: 2011-07-23 00:32:42
On 07/20/2011 06:38 AM, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
When a Synaptics touchpad is in "AGM" mode, and multiple fingers are
detected, the touchpad sends alternating "Advanced Gesture Mode" (AGM) and
"Simple Gesture Mode" (SGM) packets.
The AGM packets have w=2, and contain reduced resolution finger data.
The SGM packets have w={0,1} and contain full resolution finger data.
Refactor the parsing of agm packets to its own function, and rename the
synaptics_data.mt field to .agm to indicate that it contains the contents of
the last agm packet.
Signed-off-by: Daniel Kurtz <redacted>
From: Chase Douglas <hidden> Date: 2011-07-23 01:02:31
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track up to 5 fingers, but only report 2.
They use a special "TYPE=2" (AGM-CONTACT) packet type that reports
the number of tracked fingers and which finger is reported in the SGM
and AGM packets.
With this new packet type, it is possible to tell userspace when 4 or 5
fingers are touching.
Maybe I'm blind, but I don't see where the QUADTAP and QUINTAP values
are set in the events. I see where the bits are set during
initialization, but not during use.
@@ -836,9 +860,22 @@ static void synaptics_image_sensor_3f(struct synaptics_data *priv,*receivedAGM-CONTACTpacket.*/break;++case4:+case5:+/* mt_state was updated by AGM-CONTACT packet */+break;}}+/* Handle case where mt_state->count = 4, or = 5 */+staticvoidsynaptics_image_sensor_45f(structsynaptics_data*priv,+structsynaptics_mt_state*mt_state)+{+/* mt_state was updated correctly by AGM-CONTACT packet */+priv->mt_state_lost=false;+}+staticvoidsynaptics_image_sensor_process(structpsmouse*psmouse,structsynaptics_hw_state*sgm){
@@ -858,8 +895,10 @@ static void synaptics_image_sensor_process(struct psmouse *psmouse,synaptics_image_sensor_1f(priv,&mt_state);elseif(sgm->w==0)synaptics_image_sensor_2f(priv,&mt_state);-elseif(sgm->w==1)+elseif(sgm->w==1&&mt_state.count<=3)synaptics_image_sensor_3f(priv,&mt_state);+else+synaptics_image_sensor_45f(priv,&mt_state);/* Send resulting input events to user space */synaptics_report_mt(psmouse,&mt_state,sgm);
@@ -1078,6 +1117,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)input_set_abs_params(dev,ABS_MT_PRESSURE,0,255,0,0);/* Image sensors can sometimes report per-contact width */input_set_abs_params(dev,ABS_MT_TOUCH_MAJOR,4,15,0,0);+/* Image sensors can signal 4 and 5 finger clicks */+__set_bit(BTN_TOOL_QUADTAP,dev->keybit);+__set_bit(BTN_TOOL_QUINTTAP,dev->keybit);}elseif(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)){/* Non-image sensors with AGM use semi-mt */__set_bit(INPUT_PROP_SEMI_MT,dev->propbit);
From: Chase Douglas <hidden> Date: 2011-07-23 01:07:39
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted hunk
From: Daniel Kurtz <redacted>
As long as we know which slots are currently contained in SGM and AGM
packets, it is possible to track the slot 0 finger when transitioning from
2->3 fingers. This is the case when fingers are being added one at a
time, 1->2->3.
However, when fingers are removed, we sometimes lose track of which slots
are contained in SGM and AGM. In particular, when transitioning from 3->2
and sometimes 3->1. In both of these cases, we can no longer track slot 0
during 2->3 transitions.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 33 +++++++++++++++++++++++++++------
drivers/input/mouse/synaptics.h | 1 +
2 files changed, 28 insertions(+), 6 deletions(-)
I don't think this should be allowed. We shouldn't be giving userspace
wrong information. One could argue that userspace could watch for these
transitions, but then I would argue that the driver should be handling
this :).
I don't know what the best resolution to this issue is, but any
transition in the number of fingers must be accurate. In uTouch, we
watch for touch count transitions for "continuation" gestures.
quoted hunk
*/
- synaptics_mt_state_set(mt_state, 0, -1, -1);
+ if (priv->mt_state_lost) {
+ synaptics_mt_state_set(mt_state, 0, -1, -1);
+ break;
+ }
+
+ /*
+ * If the (SGM,AGM) really previously contained slots (0, 1),
+ * then we cannot know what slot was just reported by the AGM,
+ * because the 2->3 transition can occur either before or after
+ * the AGM packet. Thus, this most recent AGM could contain
+ * either the same old slot 1 or the new slot 2.
+ * Subsequent AGMs will be reporting slot 2.
+ *
+ * To userspace, the resulting transition will look like:
+ * 2:[0,1] -> 1:[0,-1] -> 3:[0,2]
+ */
+ synaptics_mt_state_set(mt_state, 1, 0, -1);
break;
case 3:
/*
@@ -162,6 +162,7 @@ struct synaptics_data {structserio*pt_port;/* Pass-through serio port */structsynaptics_mt_statemt_state;/* Current mt finger state */+boolmt_state_lost;/* mt_state may be incorrect *//**LastreceivedAdvancedGestureMode(AGM)packet.AnAGMpacket
From: Chase Douglas <hidden> Date: 2011-07-23 01:11:46
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track 5 fingers, but only report 2.
This patch attempts to deal with some idiosyncrasies of these touchpads:
* When there are 3 or more fingers, only two are reported.
* The number of fingers can change at any time, but is only reported in
SGM packets, thus at a number-of-fingers change, it is not possible
to tell whether the AGM finger is for the original or new number of
fingers.
* When the number of fingers changes from 2->3 it is not
possible to tell which of the 2 fingers are now reported.
* When number of fingers changes from 3->2 it is often not possible to
tell which finger was removed, and which are now being reported.
When 2 or more packets are present on the touchpad, the kernel reports
From: Chase Douglas <hidden> Date: 2011-07-23 01:13:21
On 07/20/2011 06:38 AM, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
Patches 4-7 add up to 3 finger support for image sensor touchpads.
Image sensors do not suffer from the finger tracking issues that plagued
the earlier "profile sensors", and which required the invention of "semi-mt"
(Semi-mt reports a bounding box around two fingers instead of the fingers
themselves). Instead, the image sensors report the actual positions of two
fingers using the same "Advanced Gesture Mode". This driver uses two MT-B slots
to report these two fingers to userspace. In addition, it will also report
the total number of fingers using BTN_TOOL_*TAP EV_KEY events.
Userspace drivers should be aware that the number of fingers reported via
BTN_TOOL_*TAP can be greater than the total number MT-B slots with non-negative
track_ids. Upon opening the device node, userspace should query the maximum
values supported ABS_MT_SLOT, and note the number of supported BTN_TOOL_*TAP
events.
I would still rather see a new property bit for devices that track and
report different numbers of touches. I think it is worthwhile to be
explicit here rather than leave it up to voodoo magic in userpace drivers.
This and the touch count transition issue I brought up in a reply to
patch 7 are my only concerns with this part of the patchset.
BTW, I found the commit messages and the code to be very comprehensible.
Good job on cleaning them up!
-- Chase
From: Daniel Kurtz <hidden> Date: 2011-07-23 04:11:48
Hi Chase,
Thanks for all of your reviews!
On Sat, Jul 23, 2011 at 9:02 AM, Chase Douglas
[off-list ref] wrote:
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track up to 5 fingers, but only report 2.
They use a special "TYPE=2" (AGM-CONTACT) packet type that reports
the number of tracked fingers and which finger is reported in the SGM
and AGM packets.
With this new packet type, it is possible to tell userspace when 4 or 5
fingers are touching.
Maybe I'm blind, but I don't see where the QUADTAP and QUINTAP values
are set in the events. I see where the bits are set during
initialization, but not during use.
It's subtle.
The firmware actually report 4/5 in the AGM-CONTACT packet, which the
agm packet parser sets directly in mt_state->count.
This is then reported to userspace when synaptics_report_mt() calls
input_mt_report_finger_count(dev, mt_state->count), which now supports
QUINTTAP (see patch #8).
-Daniel
break;
case 2:
/*
+ * If the AGM previously contained slot 3 or higher, then the
+ * newly touching finger is in the lowest available slot.
+ *
+ * If SGM was previously 1 or higher, then the new SGM is
+ * now slot 0 (with a new finger), otherwise, the new finger
+ * is now in a hidden slot between 0 and AGM's slot.
+ *
+ * In all such cases, the SGM now contains slot 0, and the AGM
+ * continues to contain the same slot as before.
+ */
+ if (old->agm >= 3) {
+ synaptics_mt_state_set(mt_state, 3, 0, old->agm);
+ break;
+ }
+
+ /*
* After some 3->1 and all 3->2 transitions, we lose track
* of which slot is reported by sgm and agm.
*
From: Daniel Kurtz <hidden> Date: 2011-07-23 04:36:58
Hi Chase,
On Sat, Jul 23, 2011 at 9:07 AM, Chase Douglas
[off-list ref] wrote:
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
As long as we know which slots are currently contained in SGM and AGM
packets, it is possible to track the slot 0 finger when transitioning from
2->3 fingers. This is the case when fingers are being added one at a
time, 1->2->3.
However, when fingers are removed, we sometimes lose track of which slots
are contained in SGM and AGM. In particular, when transitioning from 3->2
and sometimes 3->1. In both of these cases, we can no longer track slot 0
during 2->3 transitions.
Signed-off-by: Daniel Kurtz <redacted>
---
drivers/input/mouse/synaptics.c | 33 +++++++++++++++++++++++++++------
drivers/input/mouse/synaptics.h | 1 +
2 files changed, 28 insertions(+), 6 deletions(-)
* So, empty all slots. We will guess slot 0 on subsequent 1->1
*/
synaptics_mt_state_set(mt_state, 0, -1, -1);
+ priv->mt_state_lost = true;
break;
}
}
break;
case 2:
/*
- * On 2->3 transitions, we are given no indication which finger
- * was added.
- * We don't even know what finger the current AGM packet
- * contained.
+ * After some 3->1 and all 3->2 transitions, we lose track
+ * of which slot is reported by sgm and agm.
*
- * So, empty all slots. They get filled on a subsequent 3->3
+ * For 2->3 in this state, empty all slots, and we will guess
+ * (0,1) on a subsequent 0->3.
+ *
+ * To userspace, the resulting transition will look like:
+ * 2:[0,1] -> 0:[-1,-1] -> 3:[0,2]
I don't think this should be allowed. We shouldn't be giving userspace
wrong information. One could argue that userspace could watch for these
transitions, but then I would argue that the driver should be handling
this :).
I don't know what the best resolution to this issue is, but any
transition in the number of fingers must be accurate. In uTouch, we
watch for touch count transitions for "continuation" gestures.
So, you want the count to be accurate.
But, during these transitions, there is not enough information to
guarantee all of the following at the same time:
(1) finger count
(2) track_id
(3) finger position
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
-Daniel
quoted
*/
- synaptics_mt_state_set(mt_state, 0, -1, -1);
+ if (priv->mt_state_lost) {
+ synaptics_mt_state_set(mt_state, 0, -1, -1);
+ break;
+ }
+
+ /*
+ * If the (SGM,AGM) really previously contained slots (0, 1),
+ * then we cannot know what slot was just reported by the AGM,
+ * because the 2->3 transition can occur either before or after
+ * the AGM packet. Thus, this most recent AGM could contain
+ * either the same old slot 1 or the new slot 2.
+ * Subsequent AGMs will be reporting slot 2.
+ *
+ * To userspace, the resulting transition will look like:
+ * 2:[0,1] -> 1:[0,-1] -> 3:[0,2]
+ */
+ synaptics_mt_state_set(mt_state, 1, 0, -1);
break;
case 3:
/*
struct serio *pt_port; /* Pass-through serio port */
struct synaptics_mt_state mt_state; /* Current mt finger state */
+ bool mt_state_lost; /* mt_state may be incorrect */
/*
* Last received Advanced Gesture Mode (AGM) packet. An AGM packet
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jul 20, 2011 at 09:38:58PM +0800, djkurtz@chromium.org wrote:
From: Daniel Kurtz <redacted>
Synaptics touchpads report increasing y from bottom to top.
This is inverted from normal userspace "top of screen is 0" coordinates.
Thus, the kernel driver reports inverted y coordinates to userspace.
This patch refactors this inversion.
I really do not see the point...
Thanks.
--
Dmitry
From: Daniel Kurtz <hidden> Date: 2011-07-26 02:18:31
Hi Dmitry, et al,
On Tue, Jul 26, 2011 at 2:16 AM, Dmitry Torokhov
[off-list ref] wrote:
On Mon, Jul 25, 2011 at 05:14:22PM +0800, Daniel Kurtz wrote:
quoted
On Mon, Jul 25, 2011 at 4:29 PM, Dmitry Torokhov
[off-list ref] wrote:
quoted
On Wed, Jul 20, 2011 at 09:39:05PM +0800, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Do we know what we want to do with this gesture? Because if not I'd
rather not merge it for now, until there are real users.
And do what instead?
Report 5 fingers with BTN_TOOL_QUADTAP?
That, or nothing... The fact that the device can report 5 finger touch
does not mean that anybody cares about this.
--
Dmitry
The only current use of this is to detect "resting thumb + 4-finger-scroll".
"4-finger scroll" is a gesture supported by some applications and
operating systems.
"resting thumb" is when a clickpad user rests a finger (typically a
thumb), in the bottom left "click zone" in anticipation of
click+move=select gestures.
Thus, this 4-finger scroll is actually sometimes a 5-finger gesture.
Similarly, I work with many touchpads from different vendors, some of
which do actually provide 5 independent finger coordinates. The
drivers for these touchpads truly send 5 MT-B slots when 5 fingers are
present.
Should these drivers perform input_mt_report_pointer_emulation()?
If so, should we add BTN_TOOL_QUINTTAP to allow them to report 5
fingers in emulation mode?
Or is that ridiculous, since emulation is only for old userspace
programs which wouldn't know what to do with QUINTTAP, anyway?
-Dan
From: Daniel Kurtz <hidden> Date: 2011-07-26 02:19:59
On Mon, Jul 25, 2011 at 4:27 PM, Dmitry Torokhov
[off-list ref] wrote:
On Wed, Jul 20, 2011 at 09:38:58PM +0800, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Synaptics touchpads report increasing y from bottom to top.
This is inverted from normal userspace "top of screen is 0" coordinates.
Thus, the kernel driver reports inverted y coordinates to userspace.
This patch refactors this inversion.
I really do not see the point...
The point is that this inversion is done in 3 places in the driver.
Refactoring lets us document why this inversion is happening in just a
single place.
From: Chase Douglas <hidden> Date: 2011-07-26 22:59:41
On 07/25/2011 01:27 AM, Dmitry Torokhov wrote:
On Wed, Jul 20, 2011 at 09:38:58PM +0800, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Synaptics touchpads report increasing y from bottom to top.
This is inverted from normal userspace "top of screen is 0" coordinates.
Thus, the kernel driver reports inverted y coordinates to userspace.
This patch refactors this inversion.
I really do not see the point...
It's easier for me to read and comprehend, at least. I agree that it's
really really minor, but if it's in the middle of 10 other patches, then
I don't have a problem with it.
-- Chase
From: Chase Douglas <hidden> Date: 2011-07-26 23:03:47
On 07/25/2011 11:16 AM, Dmitry Torokhov wrote:
On Mon, Jul 25, 2011 at 05:14:22PM +0800, Daniel Kurtz wrote:
quoted
On Mon, Jul 25, 2011 at 4:29 PM, Dmitry Torokhov
[off-list ref] wrote:
quoted
On Wed, Jul 20, 2011 at 09:39:05PM +0800, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Do we know what we want to do with this gesture? Because if not I'd
rather not merge it for now, until there are real users.
And do what instead?
Report 5 fingers with BTN_TOOL_QUADTAP?
That, or nothing... The fact that the device can report 5 finger touch
does not mean that anybody cares about this.
The uTouch gesture stack supports up to 5 touch gestures, and although
most of them are either hard to do on a trackpad or are not possible
with this driver, I can think of uses for 5 finger tap. Unity uses four
finger tap quite effectively I believe.
There is a meaningful limit to this: five fingers on a human hand. It
seems more arbitrary to stick the protocol limit at four fingers.
-- Chase
From: Chase Douglas <hidden> Date: 2011-07-26 23:14:56
On 07/22/2011 09:36 PM, Daniel Kurtz wrote:
On Sat, Jul 23, 2011 at 9:07 AM, Chase Douglas
[off-list ref] wrote:
quoted
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
@@ -800,14 +803,32 @@ static void synaptics_image_sensor_3f(struct synaptics_data *priv, break; case 2: /*- * On 2->3 transitions, we are given no indication which finger- * was added.- * We don't even know what finger the current AGM packet- * contained.+ * After some 3->1 and all 3->2 transitions, we lose track+ * of which slot is reported by sgm and agm. *- * So, empty all slots. They get filled on a subsequent 3->3+ * For 2->3 in this state, empty all slots, and we will guess+ * (0,1) on a subsequent 0->3.+ *+ * To userspace, the resulting transition will look like:+ * 2:[0,1] -> 0:[-1,-1] -> 3:[0,2]
I don't think this should be allowed. We shouldn't be giving userspace
wrong information. One could argue that userspace could watch for these
transitions, but then I would argue that the driver should be handling
this :).
I don't know what the best resolution to this issue is, but any
transition in the number of fingers must be accurate. In uTouch, we
watch for touch count transitions for "continuation" gestures.
So, you want the count to be accurate.
But, during these transitions, there is not enough information to
guarantee all of the following at the same time:
(1) finger count
(2) track_id
(3) finger position
If I had to pick one to give up, it would be the tracking id. It carries
the least useful information for a device that you may not get the whole
touch stream. Semi-mt devices already forsake the tracking id value,
IIRC. The id is always incremented when you create a new slot, but when
you go from 2->3 fingers the ids in the slots stay the same even if the
third finger expands the bounding box.
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
From: Chase Douglas <hidden> Date: 2011-07-26 23:17:44
On 07/22/2011 09:11 PM, Daniel Kurtz wrote:
On Sat, Jul 23, 2011 at 9:02 AM, Chase Douglas
[off-list ref] wrote:
quoted
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
Synaptics image sensor touchpads track up to 5 fingers, but only report 2.
They use a special "TYPE=2" (AGM-CONTACT) packet type that reports
the number of tracked fingers and which finger is reported in the SGM
and AGM packets.
With this new packet type, it is possible to tell userspace when 4 or 5
fingers are touching.
Maybe I'm blind, but I don't see where the QUADTAP and QUINTAP values
are set in the events. I see where the bits are set during
initialization, but not during use.
It's subtle.
The firmware actually report 4/5 in the AGM-CONTACT packet, which the
agm packet parser sets directly in mt_state->count.
This is then reported to userspace when synaptics_report_mt() calls
input_mt_report_finger_count(dev, mt_state->count), which now supports
QUINTTAP (see patch #8).
Ahh, thanks! Conditional upon getting the previous patches merged in
some fashion:
Acked-by: Chase Douglas <redacted>
break;
case 2:
/*
- * On 2->3 transitions, we are given no indication which finger
- * was added.
- * We don't even know what finger the current AGM packet
- * contained.
+ * After some 3->1 and all 3->2 transitions, we lose track
+ * of which slot is reported by sgm and agm.
*
- * So, empty all slots. They get filled on a subsequent 3->3
+ * For 2->3 in this state, empty all slots, and we will guess
+ * (0,1) on a subsequent 0->3.
+ *
+ * To userspace, the resulting transition will look like:
+ * 2:[0,1] -> 0:[-1,-1] -> 3:[0,2]
I don't think this should be allowed. We shouldn't be giving userspace
wrong information. One could argue that userspace could watch for these
transitions, but then I would argue that the driver should be handling
this :).
I don't know what the best resolution to this issue is, but any
transition in the number of fingers must be accurate. In uTouch, we
watch for touch count transitions for "continuation" gestures.
So, you want the count to be accurate.
But, during these transitions, there is not enough information to
guarantee all of the following at the same time:
(1) finger count
(2) track_id
(3) finger position
If I had to pick one to give up, it would be the tracking id. It carries
the least useful information for a device that you may not get the whole
touch stream. Semi-mt devices already forsake the tracking id value,
IIRC. The id is always incremented when you create a new slot, but when
you go from 2->3 fingers the ids in the slots stay the same even if the
third finger expands the bounding box.
For synaptics profile sensors, adding additional fingers does not
change which fingers are reported.
You always get the first two fingers.
AFAICT, you cannot "expand the bounding box" by adding new fingers.
Thus, throwing away the track_id is irrelevant, since once the semi-mt
driver starts reporting 2+ fingers, the track_ids are fixed.
The image sensor does not work that way.
As you add new fingers, the trackpad will, under certain conditions,
switch to reporting the locations of these new fingers.
Changing track_id is how we report this to userspace.
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
Thanks!
-Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Chase Douglas <hidden> Date: 2011-07-27 21:13:56
On 07/26/2011 09:48 PM, Daniel Kurtz wrote:
On Wed, Jul 27, 2011 at 7:14 AM, Chase Douglas
[off-list ref] wrote:
quoted
On 07/22/2011 09:36 PM, Daniel Kurtz wrote:
quoted
On Sat, Jul 23, 2011 at 9:07 AM, Chase Douglas
[off-list ref] wrote:
quoted
On 07/20/2011 06:39 AM, djkurtz@chromium.org wrote:
quoted
From: Daniel Kurtz <redacted>
@@ -800,14 +803,32 @@ static void synaptics_image_sensor_3f(struct synaptics_data *priv, break; case 2: /*- * On 2->3 transitions, we are given no indication which finger- * was added.- * We don't even know what finger the current AGM packet- * contained.+ * After some 3->1 and all 3->2 transitions, we lose track+ * of which slot is reported by sgm and agm. *- * So, empty all slots. They get filled on a subsequent 3->3+ * For 2->3 in this state, empty all slots, and we will guess+ * (0,1) on a subsequent 0->3.+ *+ * To userspace, the resulting transition will look like:+ * 2:[0,1] -> 0:[-1,-1] -> 3:[0,2]
I don't think this should be allowed. We shouldn't be giving userspace
wrong information. One could argue that userspace could watch for these
transitions, but then I would argue that the driver should be handling
this :).
I don't know what the best resolution to this issue is, but any
transition in the number of fingers must be accurate. In uTouch, we
watch for touch count transitions for "continuation" gestures.
So, you want the count to be accurate.
But, during these transitions, there is not enough information to
guarantee all of the following at the same time:
(1) finger count
(2) track_id
(3) finger position
If I had to pick one to give up, it would be the tracking id. It carries
the least useful information for a device that you may not get the whole
touch stream. Semi-mt devices already forsake the tracking id value,
IIRC. The id is always incremented when you create a new slot, but when
you go from 2->3 fingers the ids in the slots stay the same even if the
third finger expands the bounding box.
For synaptics profile sensors, adding additional fingers does not
change which fingers are reported.
You always get the first two fingers.
AFAICT, you cannot "expand the bounding box" by adding new fingers.
Thus, throwing away the track_id is irrelevant, since once the semi-mt
driver starts reporting 2+ fingers, the track_ids are fixed.
Hmmm... you're right. I was completely mistaken here. This changes some
of my thinking about how to handle these devices.
The image sensor does not work that way.
As you add new fingers, the trackpad will, under certain conditions,
switch to reporting the locations of these new fingers.
Changing track_id is how we report this to userspace.
quoted
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
I was thinking that the current patchset does (b). I think (a) is
better, and if it really works that way then I'm fine with it. It's hard
for me to keep track of the flow of the logic across the patches :).
That said, merging this patchset as is effectively means that the number
of slots is completely decoupled from the number of touches on the
device. Previously, one could say that the number of touches on the
device was equal to the number of open slots or more if all slots were
open. With this approach, we could have 0 slots open during a transition
when there are still touches down.
While the distinction makes sense for these synaptics devices, I don't
want the semantics to hold for full multitouch devices. Otherwise, we
would have to add many more BTN_*TAPs. If we go this route, we must have
a way to tell userspace that this is a special device where the number
of active touches can only be determined from BTN_*TAP. Thus, we would
need a property for this exception to normal behavior.
(PS: As I've thought more about it, I don't think we need the property I
was advocating for before. That property was for denoting that the
device tracks more than it reports. If we're going to get this complex
in the protocol, there's not much you can do with bitmask properties to
denote every specific special case.)
-- Chase
From: Daniel Kurtz <hidden> Date: 2011-07-28 01:00:28
On Thu, Jul 28, 2011 at 5:13 AM, Chase Douglas
[off-list ref] wrote:
[...]
quoted
quoted
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
I was thinking that the current patchset does (b). I think (a) is
better, and if it really works that way then I'm fine with it. It's hard
for me to keep track of the flow of the logic across the patches :).
Argh, my bad. You are correct. Current patchset does (b)!
It reports the number of active slots, not the number of touches.
In any case, I really don't know why you need (a). We are talking
about some degenerate transitions here. Your userspace driver should
work just fine with the (b) driver, it just loses some really
complicated continued gestures for hardware that can't support them.
That said, merging this patchset as is effectively means that the number
of slots is completely decoupled from the number of touches on the
device. Previously, one could say that the number of touches on the
device was equal to the number of open slots or more if all slots were
open. With this approach, we could have 0 slots open during a transition
when there are still touches down.
While the distinction makes sense for these synaptics devices, I don't
want the semantics to hold for full multitouch devices. Otherwise, we
would have to add many more BTN_*TAPs. If we go this route, we must have
a way to tell userspace that this is a special device where the number
of active touches can only be determined from BTN_*TAP. Thus, we would
need a property for this exception to normal behavior.
Henrik & Dmitry roughly suggested "do not define a new property; let
userspace detect max BTN_*TAP > ABS_MT_SLOT.max to indicate that
BTN_*TAP carries the total number of touches". I wish they would
chime in on this patchset...
(PS: As I've thought more about it, I don't think we need the property I
was advocating for before. That property was for denoting that the
device tracks more than it reports. If we're going to get this complex
in the protocol, there's not much you can do with bitmask properties to
denote every specific special case.)
-- Chase
From: Chase Douglas <hidden> Date: 2011-07-28 02:07:56
On 07/27/2011 06:00 PM, Daniel Kurtz wrote:
On Thu, Jul 28, 2011 at 5:13 AM, Chase Douglas
[off-list ref] wrote:
[...]
quoted
quoted
quoted
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
I was thinking that the current patchset does (b). I think (a) is
better, and if it really works that way then I'm fine with it. It's hard
for me to keep track of the flow of the logic across the patches :).
Argh, my bad. You are correct. Current patchset does (b)!
It reports the number of active slots, not the number of touches.
In any case, I really don't know why you need (a). We are talking
about some degenerate transitions here. Your userspace driver should
work just fine with the (b) driver, it just loses some really
complicated continued gestures for hardware that can't support them.
To give userspace incorrect information about the number of touches on
the device is always bad. Lets say the degenerate case is when you go
from two touches to three (maybe Synaptics doesn't do this, but someone
else might). When the user performs a three finger tap, we'd see two
touches down, two lifted up, three touches down, three lifted up in
short succession. Userspace is gonna get pretty confused about that :).
(Please don't make me try to come up with a use case we already have in
Unity that would be broken for Synaptics due to this. I could probably
find one, but it would take quite a bit of thinking. :)
quoted
That said, merging this patchset as is effectively means that the number
of slots is completely decoupled from the number of touches on the
device. Previously, one could say that the number of touches on the
device was equal to the number of open slots or more if all slots were
open. With this approach, we could have 0 slots open during a transition
when there are still touches down.
While the distinction makes sense for these synaptics devices, I don't
want the semantics to hold for full multitouch devices. Otherwise, we
would have to add many more BTN_*TAPs. If we go this route, we must have
a way to tell userspace that this is a special device where the number
of active touches can only be determined from BTN_*TAP. Thus, we would
need a property for this exception to normal behavior.
Henrik & Dmitry roughly suggested "do not define a new property; let
userspace detect max BTN_*TAP > ABS_MT_SLOT.max to indicate that
BTN_*TAP carries the total number of touches". I wish they would
chime in on this patchset...
I think it sets a really bad precedent to obey the stated protocol in
most cases, but disregard it in others if specific conditions are met,
which are not documented and are not presented in a clear manner to
userspace. At the *very least*, this change would need documentation to
go in at the same time, but I strongly believe a property is merited here.
-- Chase
From: Daniel Kurtz <hidden> Date: 2011-07-28 13:56:52
On Thu, Jul 28, 2011 at 10:07 AM, Chase Douglas
[off-list ref] wrote:
On 07/27/2011 06:00 PM, Daniel Kurtz wrote:
quoted
On Thu, Jul 28, 2011 at 5:13 AM, Chase Douglas
[off-list ref] wrote:
[...]
quoted
quoted
quoted
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
I was thinking that the current patchset does (b). I think (a) is
better, and if it really works that way then I'm fine with it. It's hard
for me to keep track of the flow of the logic across the patches :).
Argh, my bad. You are correct. Current patchset does (b)!
It reports the number of active slots, not the number of touches.
In any case, I really don't know why you need (a). We are talking
about some degenerate transitions here. Your userspace driver should
work just fine with the (b) driver, it just loses some really
complicated continued gestures for hardware that can't support them.
To give userspace incorrect information about the number of touches on
the device is always bad. Lets say the degenerate case is when you go
from two touches to three (maybe Synaptics doesn't do this, but someone
else might). When the user performs a three finger tap, we'd see two
touches down, two lifted up, three touches down, three lifted up in
short succession. Userspace is gonna get pretty confused about that :).
(Please don't make me try to come up with a use case we already have in
Unity that would be broken for Synaptics due to this. I could probably
find one, but it would take quite a bit of thinking. :)
Just to be clear:
Debouncing num-fingers at the start of a tap works just fine.
For a 3f-tap, you would see one of:
0->1->2->3
0->2->3
0->3
Not:
0->1->2->0->3
0->2->0->3
You only see 2->0->3 if there had previously been 3 fingers down, and
some of those fingers are removed:
0->3->0*->2*->0*->3*
0->3->0*->1*
Where the "*" states are when mt_state_lost = true.
So, with method (b), you might see 3->0->2->0 if the release of the
other two fingers was really slow (longer than 37.5 ms), or, more
likely on a tap, just 3->0.
In any case, I don't think we are making progress arguing (a) vs. (b).
Let me implement method (a), and upload for review.
I agree that it makes some sense to always accurately report number of
touches with the BTN_*, independent of number of slots.
A true MT-B userspace app would always do the right thing with the
slots, legacy apps can always do the right thing in legacy mode, and a
hybrid app get do 2-touch multitouch & use BTN_* to determine total
number of touches.
Was there anything else I should add/change while I'm at it?
You mention documentation below, was there something in particular
that you'd like to see documented better? Where?
-Dan
quoted
quoted
That said, merging this patchset as is effectively means that the number
of slots is completely decoupled from the number of touches on the
device. Previously, one could say that the number of touches on the
device was equal to the number of open slots or more if all slots were
open. With this approach, we could have 0 slots open during a transition
when there are still touches down.
While the distinction makes sense for these synaptics devices, I don't
want the semantics to hold for full multitouch devices. Otherwise, we
would have to add many more BTN_*TAPs. If we go this route, we must have
a way to tell userspace that this is a special device where the number
of active touches can only be determined from BTN_*TAP. Thus, we would
need a property for this exception to normal behavior.
Henrik & Dmitry roughly suggested "do not define a new property; let
userspace detect max BTN_*TAP > ABS_MT_SLOT.max to indicate that
BTN_*TAP carries the total number of touches". I wish they would
chime in on this patchset...
I think it sets a really bad precedent to obey the stated protocol in
most cases, but disregard it in others if specific conditions are met,
which are not documented and are not presented in a clear manner to
userspace. At the *very least*, this change would need documentation to
go in at the same time, but I strongly believe a property is merited here.
-- Chase
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Chase Douglas <hidden> Date: 2011-07-28 17:31:29
On 07/28/2011 06:56 AM, Daniel Kurtz wrote:
On Thu, Jul 28, 2011 at 10:07 AM, Chase Douglas
[off-list ref] wrote:
quoted
On 07/27/2011 06:00 PM, Daniel Kurtz wrote:
quoted
On Thu, Jul 28, 2011 at 5:13 AM, Chase Douglas
[off-list ref] wrote:
[...]
quoted
quoted
quoted
quoted
Would you prefer an implementation that continued to report count (via
BTN_TOUCH*) correctly, but dropped down to 0 or 1 MT-B slots when for
these cases where it could not determine the correct position or track_id
to report?
That may be doable, but I would prefer to just assume that tracking ids
are not valid when (tracked touches > reported touches).
Userspace is free to make this assumption, of course, but, in fact,
the image sensor trackpad actually does a pretty good job of tracking
the fingers - it just has serious issues reporting them!
Since a track_id change is how userspace is told that the identity of
the reported finger is changing, if the track_id of a finger position
datum is unknowable, I'd rather just discard it in the kernel than
report it to userspace with the wrong track_id.
Otherwise, the heuristics used in the userspace finger tracking
algorithms would need to be overly aggressively tuned to handle this
known error cases:
2->3 and 3->2 finger transitions look like 2nd finger motion,
instead of reported finger changes.
quoted
quoted
It seems like it would be more work for userspace to handle this new way
than the simulated number-of-touch transitions, where the transient
states are all normal valid states.
This harkens back to my earlier statements where I said this new
Synaptics protocol is worse than the previous one :).
I agree that the implementation you gave here might be trickier for
userspace, so I'd rather table it unless you feel that the "tracking ids
are meaningless!" solution won't work. If you think there are problems
with that approach, we can re-evaluate.
Thanks!
-- Chase
Yes, I feel there are problems with this approach, as I tried to explain above.
Can you explain why you 'continuation gestures' can't handle 1->2->3
finger transitions looking like 1->2->1->3, and 3->2->3 looking like
3->2->0->3?
I think the only real point left to decide is what BTN_* events should
signify during these rare transition states:
(a) the actually number of fingers on the pad,
(b) the number of fingers being reported via the slots
The current patchset does (a).
We could do (b), if that would get these patches accepted sooner :)
I was thinking that the current patchset does (b). I think (a) is
better, and if it really works that way then I'm fine with it. It's hard
for me to keep track of the flow of the logic across the patches :).
Argh, my bad. You are correct. Current patchset does (b)!
It reports the number of active slots, not the number of touches.
In any case, I really don't know why you need (a). We are talking
about some degenerate transitions here. Your userspace driver should
work just fine with the (b) driver, it just loses some really
complicated continued gestures for hardware that can't support them.
To give userspace incorrect information about the number of touches on
the device is always bad. Lets say the degenerate case is when you go
from two touches to three (maybe Synaptics doesn't do this, but someone
else might). When the user performs a three finger tap, we'd see two
touches down, two lifted up, three touches down, three lifted up in
short succession. Userspace is gonna get pretty confused about that :).
(Please don't make me try to come up with a use case we already have in
Unity that would be broken for Synaptics due to this. I could probably
find one, but it would take quite a bit of thinking. :)
Just to be clear:
Debouncing num-fingers at the start of a tap works just fine.
For a 3f-tap, you would see one of:
0->1->2->3
0->2->3
0->3
Not:
0->1->2->0->3
0->2->0->3
You only see 2->0->3 if there had previously been 3 fingers down, and
some of those fingers are removed:
0->3->0*->2*->0*->3*
0->3->0*->1*
Where the "*" states are when mt_state_lost = true.
So, with method (b), you might see 3->0->2->0 if the release of the
other two fingers was really slow (longer than 37.5 ms), or, more
likely on a tap, just 3->0.
In any case, I don't think we are making progress arguing (a) vs. (b).
Let me implement method (a), and upload for review.
I agree that it makes some sense to always accurately report number of
touches with the BTN_*, independent of number of slots.
A true MT-B userspace app would always do the right thing with the
slots, legacy apps can always do the right thing in legacy mode, and a
hybrid app get do 2-touch multitouch & use BTN_* to determine total
number of touches.
Was there anything else I should add/change while I'm at it?
No, I think functionally I would be happy with the new version. I still
want the property bit :). Dmitry, can you weigh in here? What I remember
was you were disinclined towards a new property bit, but I'd like to see
a firm decision taken and the reasoning behind it.
You mention documentation below, was there something in particular
that you'd like to see documented better? Where?
Documentation of anything that goes against the normal protocol should
be in Documentation/input/event-codes.txt and/or
Documentation/input/multi-touch-protocol.txt. The latter seems the most
appropriate place for this. If you want extra credit you could document
SEMI_MT as well, I think that slipped through the cracks; this isn't a
requirement for me, though :).
Thanks!
quoted
quoted
quoted
That said, merging this patchset as is effectively means that the number
of slots is completely decoupled from the number of touches on the
device. Previously, one could say that the number of touches on the
device was equal to the number of open slots or more if all slots were
open. With this approach, we could have 0 slots open during a transition
when there are still touches down.
While the distinction makes sense for these synaptics devices, I don't
want the semantics to hold for full multitouch devices. Otherwise, we
would have to add many more BTN_*TAPs. If we go this route, we must have
a way to tell userspace that this is a special device where the number
of active touches can only be determined from BTN_*TAP. Thus, we would
need a property for this exception to normal behavior.
Henrik & Dmitry roughly suggested "do not define a new property; let
userspace detect max BTN_*TAP > ABS_MT_SLOT.max to indicate that
BTN_*TAP carries the total number of touches". I wish they would
chime in on this patchset...
I think it sets a really bad precedent to obey the stated protocol in
most cases, but disregard it in others if specific conditions are met,
which are not documented and are not presented in a clear manner to
userspace. At the *very least*, this change would need documentation to
go in at the same time, but I strongly believe a property is merited here.
-- Chase
From: Henrik Rydberg <hidden> Date: 2011-08-11 20:33:22
quoted
That, or nothing... The fact that the device can report 5 finger touch
does not mean that anybody cares about this.
--
Dmitry
The only current use of this is to detect "resting thumb + 4-finger-scroll".
"4-finger scroll" is a gesture supported by some applications and
operating systems.
"resting thumb" is when a clickpad user rests a finger (typically a
thumb), in the bottom left "click zone" in anticipation of
click+move=select gestures.
Thus, this 4-finger scroll is actually sometimes a 5-finger gesture.
Which is actually the same reason QUADTAP was added originally... are
we entering a recursion here? ;-)
I tend to agree with Dmitry - without a clear usage, it makes sense to
instead wait to see which comes first - a five-finger usecase or a
true MT device that everybody can afford.
Similarly, I work with many touchpads from different vendors, some of
which do actually provide 5 independent finger coordinates. The
drivers for these touchpads truly send 5 MT-B slots when 5 fingers are
present.
Should these drivers perform input_mt_report_pointer_emulation()?
If so, should we add BTN_TOOL_QUINTTAP to allow them to report 5
fingers in emulation mode?
Pointer emulation is a separate issue from the number of finger
reports.
Or is that ridiculous, since emulation is only for old userspace
programs which wouldn't know what to do with QUINTTAP, anyway?
I would say yes. ;-)
Cheers,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html