Page MenuHomeFreeBSD

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

Authored by trasz on Sat, Nov 16, 7:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 6:11 PM
Unknown Object (File)
Sun, Nov 17, 5:03 AM
Unknown Object (File)
Sun, Nov 17, 3:25 AM
Unknown Object (File)
Sun, Nov 17, 1:48 AM
Unknown Object (File)
Sun, Nov 17, 12:46 AM
Unknown Object (File)
Sat, Nov 16, 7:42 PM
Subscribers

Details

Reviewers
wulf
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 Passed
Unit
No Test Coverage
Build Status
Buildable 60661
Build 57545: arc lint + arc unit

Event Timeline

trasz requested review of this revision.Sat, Nov 16, 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.Mon, Nov 18, 11:02 AM