]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r348065:
authorallanjude <allanjude@FreeBSD.org>
Thu, 6 Jun 2019 05:10:32 +0000 (05:10 +0000)
committerallanjude <allanjude@FreeBSD.org>
Thu, 6 Jun 2019 05:10:32 +0000 (05:10 +0000)
commite50673d212ecd4fe9225123f94ac6256a3dbe683
treeb675e1eb4949ebb572e58e5ee2368f284dab4396
parentcc93071a2a3c2097363a5af65504af49c705bfed
MFC r348065:

Correct the way remaining battery life is calculated

Previously, if a system had multiple batteries, the remaining life
percentage was calculated as the average of each battery's percent
remaining. This results in rather incorrect values when you consider the
case of the Thinkpad X270 that has a small 3 cell internally battery, and
a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%,
but battery 1 is at 10%, you do not infact have 55% of your capacity
remaining.

The new method calculates the percentage based on remaining capacity
out of total capacity, giving a much more accurate reading.

PR: 229818
Submitted by: Keegan Drake H.P. <kd-dev@pm.me>
Sponsored by: Klara Systems
Event: Waterloo Hackathon 2019
Approved by: re (gjb)
sys/dev/acpica/acpi_battery.c