From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:03:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C0146767C4; Thu, 23 Sep 2021 01:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HFH3w305Jz3wLm; Thu, 23 Sep 2021 01:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 401EF219E9; Thu, 23 Sep 2021 01:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18N13uHr073837; Thu, 23 Sep 2021 01:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N13uI4073836; Thu, 23 Sep 2021 01:03:56 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:03:56 GMT Message-Id: <202109230103.18N13uI4073836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 89edde19d3fe - stable/13 - psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89edde19d3fe13dd6596d9278542d27b42767e26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2021 01:03:56 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=89edde19d3fe13dd6596d9278542d27b42767e26 commit 89edde19d3fe13dd6596d9278542d27b42767e26 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:37:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:57:08 +0000 psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. r123442 introduced solution for clamping of PS/2 mice jitter when using a KVM. Solution is to buffer mouse packets for 0.050ms if mouse activity has not been seen for more than 0.5 seconds. Then flush that data to driver if no validation errors found or drop the entire queue otherwise. While it works well with relative devices it has issues with absolute ones Depending on history buffering may results in delaying of the touch front edge for 0.050ms that affects gesture processing (tap detection). As absolute touchpads usually are built-in devices we can safely disable bufferization and KVM jitter clamping to avoid such a delays. (cherry picked from commit bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa) --- sys/dev/atkbdc/psm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f27a49f82a71..9b47a7a6b0c5 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -3134,8 +3134,12 @@ next: /* * If we've filled the queue then call the softintr ourselves, * otherwise schedule the interrupt for later. + * Do not postpone interrupts for absolute devices as it + * affects tap detection timings. */ - if (!timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || + if (sc->hw.model == MOUSE_MODEL_SYNAPTICS || + sc->hw.model == MOUSE_MODEL_ELANTECH || + !timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || (sc->pqueue_end == sc->pqueue_start)) { if ((sc->state & PSM_SOFTARMED) != 0) { sc->state &= ~PSM_SOFTARMED;