From: Benjamin Berg <benjamin@sipsolutions.net>
To: Alex Henrie <alexhenrie24@gmail.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Huw Davies <huw@codeweavers.com>,
linux-pm@vger.kernel.org, Wine Devel <wine-devel@winehq.org>
Subject: Re: How to identify the primary battery (for Wine)
Date: Fri, 17 Jun 2022 13:31:13 +0200 [thread overview]
Message-ID: <e2f00afe78432a13adc23fc879f0631ada49e122.camel@sipsolutions.net> (raw)
In-Reply-To: <CAMMLpeSRQ4T=_J0uwjoh=NNeuO43-Nb3PkzfSoDdUhOfU8_TqQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]
On Tue, 2022-06-14 at 09:17 -0600, Alex Henrie wrote:
> On Tue, Jun 14, 2022 at 8:17 AM Sebastian Reichel
> <sebastian.reichel@collabora.com> wrote:
> > On Tue, Jun 14, 2022 at 2:05 AM Benjamin Berg <benjamin@sipsolutions.net> wrote:
> >
> > > Wouldn't it make sense for Wine to use the UPower provided
> > > DisplayDevice that can be queried through DBus?
> >
> > UPower does the required data aggregation for the 'DisplayDevice'.
> > I don't know enough about the Wine codebase to recommend for or
> > against using UPower.
>
> I also don't know if D-Bus would be a good choice here. It would
> certainly be a bigger change than the patch that I've proposed. What
> are the advantages and disadvantages of querying the battery through
> D-Bus, besides it doing battery aggregation for us?
Well, depends on what you need, it will:
1. Calculate a energy/power values if the HW reports charge/current
2. Try to generate a proper state (charging/discharging, etc.) if the
hardware does not provide it
3. Aggregate multiple batteries
Actually, I think using UPower likely fixes bugs:
* You are currently not supporting modern hardware that reports
energy/power values (rather than charge/current).
* You are only reading one battery
* You are not estimating a rate if the HW does not provide one
(and not smoothing it which might be desirable).
And, well, it should be easy. You can just query properties on a fixed
DBus path. And if it fails, just assume you don't have a battery.
Benjamin
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-06-17 11:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 1:54 How to identify the primary battery (for Wine) Alex Henrie
2022-06-14 8:05 ` Benjamin Berg
2022-06-14 14:17 ` Sebastian Reichel
2022-06-14 15:17 ` Alex Henrie
2022-06-17 11:31 ` Benjamin Berg [this message]
2022-06-18 15:03 ` Alex Henrie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e2f00afe78432a13adc23fc879f0631ada49e122.camel@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=alexhenrie24@gmail.com \
--cc=huw@codeweavers.com \
--cc=linux-pm@vger.kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=wine-devel@winehq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox