Page MenuHomeFreeBSD

RFC: hms(4): improve scroll with IICHID_SAMPLING
ClosedPublic

Authored by trasz on Nov 16 2024, 7:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 12, 10:30 PM
Unknown Object (File)
Sun, Jan 12, 3:43 PM
Unknown Object (File)
Dec 12 2024, 7:09 PM
Unknown Object (File)
Dec 5 2024, 8:16 AM
Unknown Object (File)
Nov 23 2024, 1:59 PM
Unknown Object (File)
Nov 23 2024, 1:28 PM
Unknown Object (File)
Nov 20 2024, 8:47 AM
Unknown Object (File)
Nov 17 2024, 6:11 PM
Subscribers

Details

Summary

The current quirk is designed to discard duplicated data read from
the chip. Problem is, it also discards real events when they happen
to be identical, which is the case with scroll wheel events;
differently from X/Y they always move by fixed offset. This results
in two-finger scroll that would stop mid-way that could be fixed by
manually setting dev.hms.0.drift_thresh to 0.

To fix that, don't discard duplicates when there's wheel movement.
For users with actual duplicates problem this will result in scroll
suddenly becoming quite inertial, but it will stop moving at any touch,
so shouldn't be terrible.

PR: kern/276709

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz requested review of this revision.Nov 16 2024, 7:41 PM
sys/dev/hid/hms.c
135

Wheel value is signed

151

Ditto. Use hid_get_data()

334

Wheel has hi->code == REL_WHEEL

trasz added inline comments.
sys/dev/hid/hms.c
334

Thanks! However what works for me is REL_HWHEEL and not REL_WHEEL; I'm not sure what REL_WHEEL is.

Okay, so turns out this is the REL_WHEEL, not REL_HWHEEL;
its just that all the offsets within the report are shifted
by one byte. I'm guessing this is the Report ID.

sys/dev/hid/hms.c
311

Leading Report ID byte should be accounted only for multi report devices. Increment sc->wheel_loc.pos only if hi->id != 0

sys/dev/hid/hms.c
150–156

c->wheel_loc.size better suits here as first item in report may have sc->wheel_loc.pos = 0

This revision is now accepted and ready to land.Nov 18 2024, 11:02 AM
This revision was automatically updated to reflect the committed changes.