From owner-freebsd-current@freebsd.org Sun Apr 16 19:25:09 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95D9D411AE for ; Sun, 16 Apr 2017 19:25:09 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B1F878C1 for ; Sun, 16 Apr 2017 19:25:09 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: by mailman.ysv.freebsd.org (Postfix) id AE42AD411AC; Sun, 16 Apr 2017 19:25:09 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADBE7D411AB; Sun, 16 Apr 2017 19:25:09 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 294548C0; Sun, 16 Apr 2017 19:25:08 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id EA1E31B400; Sun, 16 Apr 2017 22:18:12 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id ZtICZ7RGzYAJ; Sun, 16 Apr 2017 22:18:11 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id 939961B3F8; Sun, 16 Apr 2017 22:18:11 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id 8E47B574A91; Sun, 16 Apr 2017 22:18:07 +0300 (MSK) X-Virus-Scanned: amavisd-new at cicgroup.ru Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id jcdSUB5wHDjJ; Sun, 16 Apr 2017 22:18:00 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTPA id 94A3A5749BA; Sun, 16 Apr 2017 22:18:00 +0300 (MSK) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 16 Apr 2017 22:18:00 +0300 From: Vladimir Kondratyev To: current@freebsd.org Cc: freebsd-mobile@freebsd.org Subject: CFT: EVDEV support in psm(4) driver Message-ID: <5fa9225de944d6cdac0b7e5749b452a9@kondratyev.su> X-Sender: vladimir@kondratyev.su User-Agent: Roundcube Webmail/1.2.2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Apr 2017 19:25:09 -0000 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