CFT: EVDEV support in psm(4) driver

From: Vladimir Kondratyev <vladimir_at_kondratyev.su>
Date: Sun, 16 Apr 2017 22:18:00 +0300
Hi, FreeBSD laptop users

Following patch [1] bring in multitouch EVDEV support for Synaptics and 
Elan PS/2
touchpads found in many laptops. (And for generic relative PS/2 mices as 
well).
This allows to replace our limited in-kernel gesture processor with 
full-blown
one from xf86-input-synaptics or xf86-input-libinput driver and makes
Synaptics and Elan PS/2 touchpad support to be mostly on par with Linux

Other mostly evdev-unrelated fixes and improvements are:

1. Fix rare but quite annoying issue in Elan hw v.4 touchpads support.
    Triple-finger taps are reported as double-finger taps under several 
circumstances.
2. Adjust tap min queue size on Elans to make multifinger tap detection 
more reliable.
3. Adjust Elantech palm width threshold to nearly match synaptics 
defaults
4. Discard pointer movements rather then mouse packets on palm detection 
to reduce cursor jumping.
5. Enable palm detection on two finger touches for multitouch trackpads.
6. Reduce synaptics touch sensitivity
    Increase hw.psm.synaptics.min_pressure default value from 16 to 32
    to nearly match Linux driver (30-35 hysteresis loop).
    This makes libinput tap detection more reliable.
7. Serialize atkbdc ports and psm softc access with mutexes
    and mark psm interrupt and cdev handlers MPSAFE

Patch is made for 12-CURRENT and most probably can be applied to recent 
11-STABLE (not tested)


How to test.

1. Apply patch [1]
2. Add `device evdev` and `options EVDEV_SUPPORT` to kernel config file 
and rebuild kernel
3. Add hw.psm.elantech_support=1 or hw.psm.synaptics_support=1 to 
/boot/loader.conf
4. Add kern.evdev.rcpt_mask=12 to /etc/sysctl.conf to enable psm source 
and disable sysmouse
5. Install x11-drivers/xf86-input-synaptics port compiled with EVDEV 
support enabled or
     x11-drivers/xf86-input-libinput
6. Tell XOrg to use synaptics or libinput driver as primary mouse 
driver:

Section "InputDevice"
     Identifier  "Mouse0"
     Driver      "synaptics"
#   Driver      "libinput"
     Option      "Device" "/dev/input/eventXXX"
EndSection

Exact value of "/dev/input/eventXXX" can be obtained with evemu-record 
utiliy [2].
In most cases I have seen psm event device is located at 
/dev/input/event2.
Lenovo trackpoint should appear as separate relative event device and is
handled with xf86-input-evdev driver (not tested yet)
Note: Neither HAL nor DEVD Xorg configuration backends support evdev at 
present time so
x11-servers/xorg-server should be recompiled w/o autoconfiguration 
support.
Alternatively DEVD or UDEV backends from coming Xorg update [3] can be 
used
7. Reboot and test touchpad with XOrg or evemu-record

[1] psm(4) evdev support: https://reviews.freebsd.org/D10207
     Raw diff: 
https://reviews.freebsd.org/file/data/pqjvpuhwfgsu5nnamibg/PHID-FILE-uuyjx66blb344hre3nc2/D10207.vson.id27478.whitespaceignore-most.diff
[2] evemu port: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218383 
  Not commited yet.
[3] Xorg 1.19.3 update: 
https://lists.freebsd.org/pipermail/freebsd-x11/2017-March/019100.html 
(Patch content is slightly garbled)


-- 
WBR
Vladimir Kondratyev
Received on Sun Apr 16 2017 - 17:25:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC