Commit graph

526 commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
589208a9fb ppd-utils: Close the opened file when using fallback path 2025-02-06 23:52:40 +01:00
Rogerio Alves
34275b1fef trivial: fixes unknown option value for pylint < 3.3.0
The too-many-positional-arguments warning introduced in commit 4a367430
caused a regression in pylint-integration-tests for versions of pylint < 3.3.0,
as these versions do not support the too-many-positional-arguments check.

Added disable=unknown-option-value to the pylint disable line for compatibility
with pylint < 3.3.0, avoiding test failures.

Kept disable=too-many-positional-arguments for pylint >= 3.3.0, since the
function exceeds the maximum allowed positional arguments (R0917) and may cause
lint errors.

Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/174
2025-01-06 21:15:11 -03:00
Mario Limonciello
000658ac6a trivial: bump fdo container tag 2025-01-01 21:05:21 -06:00
Mario Limonciello
482d618e44 trivial: update ci templates to newer version 2025-01-01 20:40:42 -06:00
Mario Limonciello
095085599c trivial: handle a daemon crash when invalid properties are requested 2024-12-28 02:18:35 +00:00
Mario Limonciello
10aa0f2322 Allow amd-pstate to change modes at runtime
Rather than checking for active mode at startup and then never checking
it again check the mode when trying to write a value.

If it's not active, log something to the journal. This is intentionally
not failing because users could still have an ACPI platform-profile change
occur.

Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/168
2024-12-26 17:07:19 +00:00
Mario Limonciello
4a367430e8 trivial: ignore too many positional arguments in tests 2024-12-26 11:02:53 -06:00
Mario Limonciello
6bb109926c trivial: fix choices not avail during build 2024-12-26 10:58:29 -06:00
Mario Limonciello
54f8fefb06 trivial: update pre-commit config for migration from default_stages occurring in newer versions 2024-12-26 10:38:05 -06:00
Mario Limonciello
e08171fe71 trivial: fix python black whitespace issue 2024-12-26 10:37:35 -06:00
Natalie Clarius
0b00403a22 completions: provide available profiles as choices for 'set' command 2024-10-08 01:34:02 +02:00
Marcos Mello
0084e4fc48 README.md: fix systemctl edit example
From systemd.unit(5):

Note that for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is
not a dependency), such as AssertPathExists= (or e.g. ExecStart= in service units), one needs to first
clear the list before re-adding all entries except the one that is to be removed. Dependencies (After=,
etc.) cannot be reset to an empty list, so dependencies can only be added in drop-ins. If you want to
remove dependencies, you have to override the entire unit.

https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html
2024-09-29 20:13:40 -03:00
Mario Limonciello
96e1a8a20b amd-pstate: drop detection for client vs server
PPD doesn't force the SoC to active mode or to load.

As the policy of whether amd-pstate is loaded is controlled by the
kernel having another policy whether power-profiles-daemon isn't
necessary.
2024-09-10 10:58:27 -05:00
Mario Limonciello
f6b488af02 Release 0.23 version
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
2024-09-09 22:44:19 +00:00
Olaf Flebbe
a75e731388 fix: whitespace 2024-09-08 12:04:30 +02:00
Mario Limonciello
21b58819ed action-amdgpu-dpm: Don't override user settings for dpm if set to manual 2024-09-05 18:56:15 -05:00
Marco Trevisan (Treviño)
e4f250c383 ci: Support images rebuild schedules 2024-09-03 08:49:20 +02:00
Mario Limonciello
bf1985b508 trivial: switch to ci-templates
https://freedesktop.pages.freedesktop.org/ci-templates/templates.html

This will mean that we have a custom image for power-profiles-daemon
CI and don't have any network issues to contend with.

Co-Authored-By: Marco Trevisan (Treviño) <mail@3v1n0.net>
2024-09-03 08:15:19 +02:00
Marco Trevisan (Treviño)
469d835884 0.22 2024-09-03 01:19:43 +00:00
Marco Trevisan (Treviño)
e687484acd integration-tests: Simplify changing battery percentage
Just change the percentage, being the only thing we care about.

It also fixes a race in my setup on this test
2024-09-03 03:10:17 +02:00
Marco Trevisan (Treviño)
09c99280dc power-profiles-daemon: Only start battery changes monitor if required
Do only monitor the battery percentage changes if an action or a driver
needs it
2024-09-03 03:10:17 +02:00
Marco Trevisan (Treviño)
9bb2339f97 power-profiles-daemon: Monitor upower-name owner changes just once
We don't need to do it for each proxy since they're all monitoring
the same owner.

So basically make the first proxy to be setup to win, not connecting to
the signal if the other is already set
2024-09-03 03:09:37 +02:00
Mario Limonciello
0100a228d0 amd-pstate: add missing error in apply_pref_to_devices()
This should fix a possible stack trace of an unset error variable.
2024-09-02 13:41:57 +00:00
Mario Limonciello
b467b893bb amd-pstate: Validate writes work during init
Due a firmware bug on some OEM systems the amd-pstate kernel driver
starts up in active mode but EPP writes don't work.

Admittedly this is a kernel bug that it still advertises support and
it could be handled better by the kernel, but PPD can also validate
writes with a no-op for each CPU at bootup.

Do this to ensure that the CPU driver is only setup if we know it works.
2024-09-02 13:41:57 +00:00
Mario Limonciello
1b17e3c0de trivial: Update README.md to explain modes better
Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/162
2024-09-02 08:32:39 -05:00
Mario Limonciello
29350383d4 amdgpu-dpm: Show log for uevents 2024-08-30 03:26:58 +02:00
Mario Limonciello
f98766fa1d Add support for setting DPM level on APUs
When in power-saver set DPM clocks explicitly down to "low".

Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/158
2024-08-30 03:22:53 +02:00
Mario Limonciello
842fcdd5fa amdgpu-panel-power: drop needless #defines 2024-08-30 03:20:14 +02:00
Mario Limonciello
9f7cea1b2e move CPU check to a helper
This will allow more actions to use a CPU check
2024-08-30 03:20:14 +02:00
Marco Trevisan (Treviño)
7acb7a17eb power-profiles-daemon: Style cleanups 2024-08-30 02:12:29 +02:00
Mario Limonciello
8277adb7cd Start the daemon after multi-user.target instead of before
It's not critical for the boot process in any way, and this should
help with any race conditions form kernel modules still setting
up anything related devices after the initial device uevent.
2024-08-04 13:27:59 -05:00
Mario Limonciello
c180150896 Add debug knobs for upower and logind 2024-07-30 05:21:46 +00:00
Mario Limonciello
04a5a0149b Move entire DebugOptions structure into PpdApp
Storing this information will be required to later support potentially
hotplugging drivers and features.
2024-07-30 05:21:46 +00:00
Mario Limonciello
0ce9b63d47 amdgpu_panel_power: Add support for progressive ABM levels
More users use power saver as their default value than expected, and
so ABM is a more negative experience for some of them.

Instead of a table of values, use "progressive" values that change
based on battery life.

The selected values:
* Balanced + AC:
  ABM 0
* Balanced + battery:
  >= 30% battery
    ABM 0
  < 30% battery
    ABM 1
* Power Saver + AC:
  ABM 0
* Power Saver + battery:
  >= 50% battery
    ABM 0
  30-49% battery
    ABM 1
  20-30% battery
    ABM 2
  <20% battery
    ABM 3
2024-07-30 00:18:25 -05:00
Mario Limonciello
69e90eeb50 Add support for a battery level changed callback for actions and drivers
This will allow actions and drivers to react to battery level changes.
2024-07-30 00:18:25 -05:00
Mario Limonciello
3c2d072231 Clear protected packages during dnf ops
This will help prevent some of the archive inconsistencies seen in
rawhide causing CI failures.

https://discussion.fedoraproject.org/t/psa-rawhide-what-to-do-if-switch-to-dnf5-fails-because-dnf-is-protected/84650/6
2024-07-30 00:01:02 -05:00
Mario Limonciello
5eb1248927 amd-pstate: Program minimum frequency to lowest non-linear frequency
Although the system will save more power at lower frequency, AMD SoCs
have a point when they can operate most efficiently called the lowest
non-linear frequency.

Program the minimum frequency to this value in balanced and performance
modes to improve responsiveness.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
2024-07-02 23:14:55 -05:00
Mario Limonciello
05867e84a4 amd-pstate: Add support for core performance boost
Apply core performance boost in balanced and performance and
disable it when in power saver.
2024-06-21 14:56:58 -05:00
Mario Limonciello
ff7900812c Apply additional systemd hardening options 2024-04-17 16:15:33 +00:00
Mario Limonciello
9e25e84489 trivial: ci: for dist_install job put the results into ./dist 2024-04-17 10:43:43 -05:00
Kate Hsuan
a65b5002ba build: skip shtab for the system without shtab support
Skip python3-shtab for some system that dosen't provide shtab package.
2024-04-17 11:35:50 +08:00
Mario Limonciello
2e00350f92 trivial: Don't assume that turbo_pct is present
According to kernel documentation this file is only exposed if
the value will be the same for all CPUs.

"This attribute is present only if the value exposed by it is the same for all of the CPUs in the system."
Link: https://www.kernel.org/doc/html/v6.9-rc1/admin-guide/pm/intel_pstate.html
2024-04-06 15:05:11 -05:00
Marco Trevisan (Treviño)
ae9076ab19 Release power-profiles-daemon 0.21 2024-04-04 01:55:02 +02:00
Marco Trevisan (Treviño)
d41b0f0f81 ppd-profile: Write PpdPowerChangedReason as string in debug statements 2024-04-04 01:50:48 +02:00
Marco Trevisan (Treviño)
301af78dce build. Do not mention tests on python checks
They're generic now, and there's no need to add further comments
2024-04-04 01:50:48 +02:00
Marco Trevisan (Treviño)
ce02a8fba0 ppd-utils: Support versions earlier than GLib 2.76 2024-04-03 23:28:26 +00:00
Marco Trevisan (Treviño)
a86b9cda94 ppd-utils: Use simpler write without extra copies
Simplify our writing function by just using pure C open/write calls
since we don't really need to be able to create files.

In fact this made possible to spot a test issue where a file was not
present and in fact in some scenarios we had random valgrind errors in
CI.

Plus, since we just need to write the contents as it is, we can avoid
extra buffers.
2024-04-03 23:28:26 +00:00
Marco Trevisan (Treviño)
b41953681b ppd-profile: Use autopointers to hold class values 2024-04-04 00:34:01 +02:00
Marco Trevisan (Treviño)
b0b8e2f78f cleanup: Remove various unneeded "ret" values
We can just return directly most of the times
2024-04-04 00:34:01 +02:00
Marco Trevisan (Treviño)
88c062030b ppd-driver-amd-pstate: Call profile functions just once 2024-04-04 00:34:01 +02:00