Commit graph

293 commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
5663a041d9 ci: Use multiline args for meson setup for easier maintainability 2024-02-02 16:10:03 +01:00
Marco Trevisan (Treviño)
51be4b76f4 ci: Expose testlog junit report 2024-02-02 16:10:03 +01:00
Marco Trevisan (Treviño)
3079cc1000 ci: Do install/uninstall test after having built for testing
In this way we ensure tests requirements are met
2024-02-02 16:10:03 +01:00
Marco Trevisan (Treviño)
72d62e1ae4 ci: Print error logs on failures
Artifacts are fine but this is more convenient to inspect on immediate
failures.
2024-02-02 16:10:02 +01:00
Marco Trevisan (Treviño)
bf29037cc5 ci: Use meson setup as old command is deprecated 2024-02-02 16:09:52 +01:00
Marco Trevisan (Treviño)
3633439e71 integration-test: Close the polkitd stdout before killing polkitd
Without this we end up leaking the fd as python warns, so let's do it.
2024-02-02 13:45:58 +01:00
Marco Trevisan (Treviño)
7c2619a13d build: Add python dependencies checks on required gi modules too
We do check if gi module is available but not if any requirement gi
module also is, so do this instead of early failing at test point.
2024-02-02 13:34:03 +01:00
Bastien Nocera
19275d52fa main: Fix Python traceback when Ctrl+C'ing a launched app 2024-01-26 12:20:17 +01:00
Bastien Nocera
c19bede0d7 main: Return return code from launched executable
Using powerprofilesctl to launch an app would always result in what was
detected as success, because the code wasn't propagating the retval from
the launched application.
2024-01-26 12:19:55 +01:00
Mario Limonciello
53fb59a2b9 add newline to end of check-news shell script 2024-01-15 06:49:59 +00:00
Mario Limonciello
f1f927c280 Update README.md to match markdown.lint style 2024-01-15 06:46:49 +00:00
Mario Limonciello
0cdf32c3db Don't change governor for amd-pstate at probe
Make the change specifically when changing modes and only set powersave
for balance and powersaver profiles.
2024-01-15 06:38:25 +00:00
Mario Limonciello
5fd9d0e6dd Disable loading amd-pstate when the PM profile is a server or undefined
This mirrors the behavior used by Kernel 6.5 and later where amd-pstate
is configured to default into 'performance' by the kernel.  It's not
as useful in server to be changing it.

Link: 32f80b9adf
2024-01-15 06:28:23 +00:00
Mario Limonciello
bec7dfdf34 Add support for driver blocklist by environment variable
Drivers can be blocked from loading via `POWER_PROFILE_DAEMON_DRIVER_BLOCK`
which is a comma separated value listing the drivers to block.

This is an escape hatch in case CPU or platform driver are failing and a user
would like to block them.
2024-01-15 06:17:42 +00:00
Mario Limonciello
61f7650e35 Allow both CPU and platform drivers to be simultaneously active
This is done by designating all drivers as CPU drivers or platform drivers.
One of each driver can be active at any given time.

When setting an active profile CPU driver is set first as this is less likely to have
failures. If failures occur setting the platform driver then the CPU driver is undone.

If both profiles are degraded then the string for the reason from both drivers will be
comma separated to be compatible with existing API and users.

This is leveraged from https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/123

Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/107
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/125
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/124
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/122
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/129
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/131
2024-01-15 06:17:42 +00:00
Mario Limonciello
e1b53d1f64 Update G_DEFINE_TYPE whitespace
This is a macro not a function.
2024-01-15 06:17:42 +00:00
Mario Limonciello
462b91de55 tests: Split immutable control into a test helper 2024-01-15 06:17:42 +00:00
Mario Limonciello
e1813f29a9 docs: Remove references to files that don't exist 2024-01-15 06:17:42 +00:00
Mario Limonciello
8c1c4d77e8 update gitignore 2024-01-15 06:17:42 +00:00
Kate Hsuan
8ddf592c9a ci-fixes: add python3-packaging 2024-01-15 13:59:42 +08:00
Mario Limonciello
1669b29661 Update whitespace in integration tests to be consistent 2024-01-06 10:07:48 -06:00
Bastien Nocera
be37aea01b intel-pstate: Add more debug to driver probe
Make it easier to see which features are used on the system by
summarising the features the driver will use.

** (power-profiles-daemon:126721): DEBUG: Found Intel p-state settings
** (power-profiles-daemon:126721): DEBUG: 	Energy Performance Preference: yes
** (power-profiles-daemon:126721): DEBUG: 	Energy Performance Bias: yes
** (power-profiles-daemon:126721): DEBUG: 	Has Turbo: yes

Closes: #120
2023-11-21 14:24:09 +01:00
Bastien Nocera
3cb0e750c7 ci: More CI fixes
Support both dnf and dnf5 as we don't know which rawhide Fedora image
will ultimately be used.
2023-11-21 14:20:08 +01:00
Bastien Nocera
ef1d1c394b ci: Fix CI 2023-11-21 14:02:40 +01:00
Bastien Nocera
c20e09a711 0.13 2023-04-26 14:53:07 +02:00
Bastien Nocera
6eaf337c33 intel-pstate: Remove unused variable
src/ppd-driver-intel-pstate.c:174:22: warning: unused variable 'gov_path' [-Wunused-variable]
    g_autofree char *gov_path = NULL;
                     ^
2023-04-26 14:28:14 +02:00
Prajna Sariputra
1b18784f12 README: Add documentation for the AMD P-State driver 2023-04-26 14:28:14 +02:00
Prajna Sariputra
ea0e2be53c tests: Add tests for the AMD P-state driver 2023-04-26 14:23:18 +02:00
Prajna Sariputra
db60051aea main: Add amd_pstate-based driver
The AMD P-states driver has added support for active mode in kernel 6.3,
which exposes a similar interface for controlling energy performance
preference as the Intel P-state driver, with the same presets present,
so make use of it.

See:
https://www.kernel.org/doc/html/v6.3/admin-guide/pm/amd-pstate.html

Closes: #108
2023-04-26 14:23:18 +02:00
Bastien Nocera
414543e881 ci: Use detached pipelines
See https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
2023-03-16 15:11:19 +01:00
Bastien Nocera
0cb116f351 main: Fix pylint warnings
src/powerprofilesctl:137:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
src/powerprofilesctl:126:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
src/powerprofilesctl:134:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
src/powerprofilesctl:154:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
2023-03-16 15:04:48 +01:00
Bastien Nocera
1116e54128 platform-profile: "cool" should be balanced
The "cool" profile isn't a low-power mode, but a mode where the fans are
always running to reduce the temperature, presumably to allow it to run
faster.

At the same time, we need to handle the lack of low-power profile on HP
machines as they only had a cool mode and no low-power mode.

Closes: #89
2023-02-08 16:06:48 +01:00
Bastien Nocera
cbdac3da5b tests: Add tests for checking for profile existence 2022-09-08 11:44:19 +02:00
Bastien Nocera
eefb002ac5 main: Check that profile exists before switching to it
Don't allow switching to an unsupported profile, or holding that
unsupported profile, as that might cause problems for front-ends that
can't display that combination.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1504
2022-09-08 11:44:19 +02:00
Bastien Nocera
674732919a utils: Add debug to monitoring helper
As we don't have easy access to the full path of the attribute
we're monitoring elsewhere.
2022-09-08 11:37:28 +02:00
Bastien Nocera
1ddc98ecd8 0.12 2022-06-28 15:58:14 +02:00
Bastien Nocera
0005a190f0 README: Update README to mention EPB
See https://www.kernel.org/doc/html/v5.17/admin-guide/pm/intel_epb.html
2022-06-28 15:50:27 +02:00
Bastien Nocera
50eb7d3441 intel-pstate: Reapply energy_perf_bias on resume
From https://www.kernel.org/doc/html/v5.17/admin-guide/pm/intel_epb.html?highlight=energy_perf_bias:
"
There are systems where the platform firmware resets the EPB during
system-wide transitions from sleep states back into the working state
effectively causing the previous EPB updates by user space to be lost.
"

So reapply energy_perf_bias on resume.
2022-06-28 15:50:27 +02:00
Bastien Nocera
58d556e85b tests: Add test for energy_perf_bias support 2022-06-28 15:50:27 +02:00
Bastien Nocera
d42af96f9d intel-pstate: Probe EPB on startup 2022-06-28 15:50:27 +02:00
Bastien Nocera
6d03eddcf4 intel-pstate: Add EPB application 2022-06-28 15:50:27 +02:00
Bastien Nocera
f212ffdac9 intel-pstate: Factor out writing to sysfs files 2022-06-28 15:50:27 +02:00
Bastien Nocera
30ce9b1c68 intel-pstate: Rename profile_to_pref() 2022-06-28 15:50:27 +02:00
Bastien Nocera
bc5433e788 intel-pstate: Split probing EPP 2022-06-28 15:50:27 +02:00
Bastien Nocera
ade5c0e1b8 intel-pstate: Split EPP and EPB devices
Split energy_perf_bias and energy_performance_preference devices, as
they use different values.
2022-06-28 15:50:27 +02:00
Bastien Nocera
fbc7cad121 ci: Enable tests in the CI 2022-06-28 15:36:34 +02:00
Bastien Nocera
b0f6aa5e85 build: Make tests optional
And check for dbusmock and gi being available.

Closes: #95
2022-06-28 15:36:03 +02:00
Bastien Nocera
915f3dfc92 build: Install D-Bus config in /usr
/etc should be left for sysadmin overrides.

Closes: #94
2022-06-28 15:32:04 +02:00
Bastien Nocera
e2c4f6fec9 intel-pstate: Fix return type of ->probe() implementation 2022-06-28 14:40:05 +02:00
Bastien Nocera
4684a0ceb8 intel-pstate: Simplify opening policy dir 2022-06-28 14:34:37 +02:00