Bug 440208 - When performance mode is inhibited, plugging in AC cord fails to switch to Balanced
Summary: When performance mode is inhibited, plugging in AC cord fails to switch to Ba...
Status: RESOLVED INTENTIONAL
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.21.90
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Redondo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-23 19:19 UTC by Nate Graham
Modified: 2021-07-26 15:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-07-23 19:19:47 UTC
Everything from git master as of today.


STEPS TO REPRODUCE
1. Configure powerdevil to use the performance profile while on AC power and the Power Save profile while on battery power
2. Make performance mode get inhibited for some reason, so that it changes over to the Balanced profile automatically while still on AC power
3. Unplug the computer
4. Plug the computer back in


OBSERVED RESULT
The profile is not changed from Power Save to Balanced when the cord is plugged in.

I expect this is because powerdevil notices that the desired Performance profile is inhibited, so it doesn't change anything. However it should instead handle this case explicitly so that if the Performance profile was requested but it is inhibited, it should switch to the next-most-performant profile instead of doing nothing. Otherwise, the system's performance will be degraded until the user notices this and manually switches to Balanced mode.
Comment 1 Nate Graham 2021-07-23 19:20:07 UTC
David, can you take a look? Thanks!
Comment 2 David Redondo 2021-07-26 06:51:57 UTC
You're right that such cases can produce surprising/unexpected/inconvenient behavior to the user.

Upstream because of this, the inhibition was obsoloeted, power-profiles-daemon will not set that property anymore and instead a new "degraded" property was introduces. You will be always be able to activate performance but degraded will be set 
https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/commit/99740ead2d5ec4927901e07ecf4190dc100a3768

This is included in 0.9 tag

Plasma MRs to support this
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/973
https://invent.kde.org/plasma/powerdevil/-/merge_requests/53

So I'm gonna make the decision not to implement more state keeping to support this
Comment 3 Nate Graham 2021-07-26 15:25:00 UTC
OK, fair enough.