git: bedf31ad7e15 - main - psm(4): Disable KVM switch "jitter" clamping for absolute touchpads.

Vladimir Kondratyev wulf at FreeBSD.org
Thu Sep 9 21:41:42 UTC 2021


The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa

commit bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa
Author:     Vladimir Kondratyev <wulf at FreeBSD.org>
AuthorDate: 2021-09-09 21:37:40 +0000
Commit:     Vladimir Kondratyev <wulf at FreeBSD.org>
CommitDate: 2021-09-09 21:37:40 +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.
    
    MFC after:      2 weeks
---
 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;


More information about the dev-commits-src-all mailing list