freebsd-nq/sys/isa
Alfred Perlstein de75fd6d2b Significantly reduce the "jitter" that is typical for PS/2 mice
when using a KVM.

There is no actual solution possible, but this gets us pretty close.

Typically when switching back to a FreeBSD box and moving the mouse
wild data is produced, because the protocol's validation/checksum
system is extremely weak it is impossible to determine that we're
out of sync before dropping several bogus packets to user land.

The actual solution that appears to offer the best clamping of
jitter is to buffer the mouse packets if we've not seen mouse
activity for more than .5 seconds.  Then waiting to flush that data
for 1/20th of a second.  If within that 20th of a second we get any
packets that do fail the weak test we drop the entire queue and
back off accepting data from the mouse for 2 seconds and then repeat
the whole deal.

You can still get _some_ jitter, notably if you switch to the FreeBSD
box, then move the mouse just enough to generate one or two packets.
Those packets may be bogus, but may still pass the validity check.

One way to finally kill the problem once and for all is to check
the initial packets for "wild" values.  Typically one sees packets
in the +/-60 range during normal operation, however when bogus data
is generated it's typically near the outer range of +/-120 or more,
those packets would be a good candidate for dropping or clamping.

I've been running with this for several weeks now and it has
significantly helped me stay sane even with a piece of junk Belkin
KVM causing wild jitter each and every time I switch.

Lastly I'd like to note that my experience with Windows shows me that
somehow the Microsoft PS/2 driver typically avoids this problem, but
that may only be possible when running the mouse in a dumb-ed down PS/2
mode that Belkin recommends on their site.
2003-12-11 11:28:11 +00:00
..
atkbd_isa.c
atkbdc_isa.c
atrtc.c Don't disable the TSC with statclock_disable. 2003-11-13 10:02:12 +00:00
fd.c Look at the equipment list for amd64 as well as i386 for autodetecting 2003-10-23 05:52:52 +00:00
fdreg.h
isa_common.c
isa_common.h
isa_if.m
isahint.c
isareg.h
isavar.h
orm.c
pnp.c
pnpparse.c
pnpreg.h
pnpvar.h
psm.c Significantly reduce the "jitter" that is typical for PS/2 mice 2003-12-11 11:28:11 +00:00
rtc.h
syscons_isa.c Fix a panic that occurs when resuming. For some reason, sc->cur_scp is 2003-10-29 20:48:13 +00:00
vga_isa.c Change fb_attach() and fb_detach() to take a integer unit number rather 2003-09-26 10:41:44 +00:00