Bug 432452 - Support ACPI platform profile, /sys/firmware/acpi/platform_profile_choices
Summary: Support ACPI platform profile, /sys/firmware/acpi/platform_profile_choices
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-03 08:43 UTC by Méven Car
Modified: 2021-10-23 11:31 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Méven Car 2021-02-03 08:43:36 UTC
SUMMARY

Kernel starting with 5.12 will allow to select a acpi platform profile through
/sys/firmware/acpi/platform_profile_choices

The basic profiles are low-power, cool, quiet, balanced, and performance.
Lenovo added support for low-power, balanced, and performance.

Powerdevil should allow users to select those profiles.
This is especially important for laptops.
Hopefully other hardware vendors will reuse this interface.

kernel patches:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=a2ff95e018f1d2bc816f3078d5110a655e355f18
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=for-next&id=eabe533904cbcb6c7df530fd807cf2a3c3567d35
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=for-next&id=c3bfcd4c676238e198d5a798b50e5d424bf05497

GNOME added support to their power-profiles-daemon in
https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/commit/4242f2a127636ace34c0b776da7e8372559baa3e

Phoronix covergae
https://www.phoronix.com/scan.php?page=news_item&px=Linux-ACPI-Platform-Profile
https://www.phoronix.com/scan.php?page=news_item&px=Lenovo-Platform-Profile-For-512

Intel has also added a similar feature in Kernel 5.11 https://www.phoronix.com/scan.php?page=news_item&px=Intel-INT340X-Workload-Hints
Hopefully it will be surfaced through the generic /sys/firmware/acpi/platform_profile_choices interface
Comment 1 Nate Graham 2021-02-03 17:50:59 UTC
Kai has this in progress: https://invent.kde.org/plasma/powerdevil/-/merge_requests/34
Comment 2 Tornado99 2021-04-28 13:21:40 UTC
yes i am waiting for this too. kernel 5.12 on my lenovo ideapad and nothing shows up in powerdevil.
Comment 3 Bastian Beischer 2021-10-16 22:03:01 UTC
Was this added in Plasma 5.23? If yes: Why don't I see a toggle in the battery and brightness applet? I'm on a Lenovo T14 Gen 2 which uses ACPI Platform Profiles.
Comment 4 Méven Car 2021-10-17 08:49:16 UTC
(In reply to Bastian Beischer from comment #3)
> Was this added in Plasma 5.23? If yes: Why don't I see a toggle in the
> battery and brightness applet? I'm on a Lenovo T14 Gen 2 which uses ACPI
> Platform Profiles.

Not yet, needs some works, IMO a matter of time (understand 5.24-5.27) since I expect devs to be motivated to work on this feature and we now have a good dependency to work with.
Comment 5 Méven Car 2021-10-18 15:28:31 UTC
https://invent.kde.org/plasma/powerdevil/-/merge_requests/49 added power profile support, but this is only visible for laptops supporting the feature at the driver level and linux 5.12+
Comment 6 Bastian Beischer 2021-10-22 06:56:44 UTC
@Meven: But I am running Linux 5.14.13 and profiles are available via:

/sys/firmware/acpi/platform_profile

Is that not what is needed? I understood that is what is required, so I was confused when I didn't see a toggle.
Comment 7 Méven Car 2021-10-22 07:30:47 UTC
(In reply to Bastian Beischer from comment #6)
> @Meven: But I am running Linux 5.14.13 and profiles are available via:
> 
> /sys/firmware/acpi/platform_profile
> 
> Is that not what is needed? I understood that is what is required, so I was
> confused when I didn't see a toggle.

You need also to install https://gitlab.freedesktop.org/hadess/power-profiles-daemon/ as well if not already installed.
Can you confirm installing power-profies-daemon and logout/in back again makes power profiles visible in UI ?
Comment 8 Bastian Beischer 2021-10-22 13:17:23 UTC
That was it, thanks. It works now. I'll forward this to the arch package maintainer so the power profiles daemon can be included as an optional dependency.
Comment 9 Tornado99 2021-10-23 09:54:01 UTC
I have a supported laptop (lenovo ideapad) and kernel 5.14. I installed the daemon but don't see anything in the UI. Am I missing something? In konsole I get:

powerprofilesctl
* balanced:
    Driver:     placeholder

  power-saver:
    Driver:     placeholder

Although actually mine supports 3 profiles (quiet, balanced, performance)
Comment 10 Méven Car 2021-10-23 10:21:59 UTC
(In reply to Tornado99 from comment #9)
> I have a supported laptop (lenovo ideapad) and kernel 5.14. I installed the
> daemon but don't see anything in the UI. Am I missing something? In konsole
> I get:
> 
> powerprofilesctl
> * balanced:
>     Driver:     placeholder
> 
>   power-saver:
>     Driver:     placeholder
> 
> Although actually mine supports 3 profiles (quiet, balanced, performance)

This output indicates powerprofiles did not find any power profiles drivers (intel_pstate or ACPI), hence "placeholder".

Either your hardware does not actually supports any power profile or powerprofiles daemon or the kernel driver has a bug, or your systems is not properly configured to take advantage of it.

What does `cat /sys/firmware/acpi/platform_profile_choices` report, if the file exists ? Same question for `cat /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference` ?

As for the GUI, did you restart powerdevil after installation, the simplest way to do it is to logout plasma and login again (Disconnect, no reboot necessary) ?

Do you have an AMD cpu ?

What is your distro ?
Comment 11 Tornado99 2021-10-23 10:49:31 UTC
No such file or directory for both 'cat'

I rebooted. AMD Ryzen 3550H.

My system definitely supports 3 profiles. I can switch for example to balanced using:

kdesu bash -c "echo '\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x000FB001' | tee /proc/acpi/call"

I have verified the max clock speed is different with the 3 different profiles using AMD uProf.
Comment 12 Tornado99 2021-10-23 10:50:47 UTC
Manjaro KDE 5.22.5, 5.87.0, kernel 5.14.10-1
Comment 13 Méven Car 2021-10-23 11:31:45 UTC
(In reply to Tornado99 from comment #11)
> No such file or directory for both 'cat'
> 
> I rebooted. AMD Ryzen 3550H.
> 
> My system definitely supports 3 profiles. I can switch for example to
> balanced using:
> 
> kdesu bash -c "echo '\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x000FB001' | tee
> /proc/acpi/call"
> 
> I have verified the max clock speed is different with the 3 different
> profiles using AMD uProf.

As far I can tell this way of setting profile is currently not handled by power-profiles, it should be reported there.
This concerns AMD CPU.

I saw this come from https://wiki.archlinux.org/title/Lenovo_IdeaPad_5_14are05#System_Performance_Mode

This acpi_call direct API is not supported by power-profiled-daemon, and is quite unorthodox.

https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues