]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iichid(4): Improve idle sampling hysteresis
authorAlexander Motin <mav@FreeBSD.org>
Sat, 23 Dec 2023 03:50:52 +0000 (22:50 -0500)
committerAlexander Motin <mav@FreeBSD.org>
Sat, 23 Dec 2023 03:50:52 +0000 (22:50 -0500)
commit8c86b981240324c1daaa387d4d3f8e3e53db3d2e
treea38cf96bc51b939c860e9427772ea0479a8dd2ee
parenteebb9c2caea1584773ae4cec311cee1eea5b1655
iichid(4): Improve idle sampling hysteresis

In sampling mode some devices return same data indefinitely even if
there is nothing to report.  Previous idle hysteresis implementation
activated only when device returned no data, so some devices ended up
polled at fast rate all the time.  This new implementation compares
each new report with the previous, and, if they are identical, after
reaching threshold also drop sampling rate to slow.

On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces idle power consumption by ~0.5W by reducing number of context
switches in the driver from ~4000 to ~700 per second when not touched.

MFC after: 1 month
sys/dev/iicbus/iichid.c