On Thu, Mar 16, 2017 at 04:56:31PM -0700, Andrew Duggan wrote:My intent is to notify userspace that there is a palm present. But, if userspace does not have code which explicitly handles the MT_TOOL_PALM type it won't be considered a finger. I think it is only recently that drivers have started reporting MT_TOOL_PALM to userspace so I'm not sure if libraries like libinput make use of it yet.
When the firmware identifies a contact as a palm the driver sets the toolIf we are relying on hardware to do palm rejection, then we should not
type to MT_TOOL_PALM, but sets the slot state as active. Reporting the
palm as active results in userspace input libraries considering the palm
as a valid contact. Touchpads which previously were using hid-multitouch
are now not suppressing palms when switching to the RMI4 driver. This
change fixes palm rejection when using the RMI4 driver.
Signed-off-by: Andrew Duggan <aduggan@xxxxxxxxxxxxx>
Tested-by: Cameron Gutman <aicommander@xxxxxxxxx>
---
drivers/input/rmi4/rmi_2d_sensor.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c
index 8bb866c..8d1f295 100644
--- a/drivers/input/rmi4/rmi_2d_sensor.c
+++ b/drivers/input/rmi4/rmi_2d_sensor.c
@@ -80,7 +80,8 @@ void rmi_2d_sensor_abs_report(struct rmi_2d_sensor *sensor,
input_mt_slot(input, slot);
input_mt_report_slot_state(input, obj->mt_tool,
- obj->type != RMI_2D_OBJECT_NONE);
+ (obj->type != RMI_2D_OBJECT_NONE)
+ && (obj->type != RMI_2D_OBJECT_PALM));
if (obj->type != RMI_2D_OBJECT_NONE) {
obj->x = sensor->tracking_pos[slot].x;
be reporting the rest of the events for palm either (i.e. the condition
in the if statement above should also be updated).
But I do not understand why userspace doe snot do the right thing? Yes,
the slot is active, but reported contact type is MT_TOOL_PALM, so it
knows what it deals with.
Thanks.