Bug 440208

Summary: When performance mode is inhibited, plugging in AC cord fails to switch to Balanced
Product: [Unmaintained] Powerdevil Reporter: Nate Graham <nate>
Component: generalAssignee: David Redondo <kde>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.21.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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.