Repository navigation
Conversation
|
The retained Build and test run reports failure at the current head, but GitHub now returns zero jobs/check runs, so there is no diagnostic evidence available to identify a code failure. My rerun request returned HTTP 403 ( |
Treat an empty HoldProfile reply as a failed hold instead of retaining cookie zero. Exercise the real hold lifecycle against a fake bus so modern and legacy endpoints, missing services, denied requests and malformed replies are checked without changing the host power profile.
|
The signed empty-cookie repair at |
Grinv
left a comment
There was a problem hiding this comment.
Tested on Fedora 44 KDE, kernel 7.2.13, Ryzen 7 5700X3D (amd-pstate-epp) with tuned-ppd. I built 627aac2 in a container (meson test 2/2 OK) and ran it in place of the system gamemoded, default config, clients via gamemoded -r.
- From balanced: performance with 1 hold during, balanced and EPP balance_performance after.
- From power-saver: back to power-saver and EPP power after.
- Two overlapping clients: one hold, released when the last one exits.
On 1.8.2 this setup leaves EPP at performance after a game (#419). With this PR, tuned re-applies the profile when the hold is released, so EPP comes back.
| self->current_profile = prof; | ||
| return 0; | ||
| } | ||
| if (result == GAME_MODE_POWER_PROFILE_FAILED) |
There was a problem hiding this comment.
If the hold fails with an error not covered by power_profiles_api_unavailable(), this returns -1 and the platprofctl fallback from master never runs. A masked PPD is covered (dbus-broker answers NameHasNoOwner); a timeout or AccessDenied is not.
| char default_profile[CONFIG_VALUE_MAX] = { 0 }; | ||
| config_get_default_profile(self->config, default_profile); | ||
| if (default_profile[0] == '\0' && | ||
| (strcmp(prof_str, "performance") == 0 || strcmp(prof_str, "power-saver") == 0)) { |
There was a problem hiding this comment.
Without PPD, power-saver is passed to platprofctl, and the write fails because the kernel name is low-power. The example config now suggests power-saver.
| char prof_config_str[CONFIG_VALUE_MAX] = { 0 }; | ||
| switch (prof) { | ||
| case GAME_MODE_PROFILE_DEFAULT: | ||
| if (self->profile_hold) { |
There was a problem hiding this comment.
A manual profile change drops the hold (tuned-ppd emits ProfileReleased). GameMode doesn't track that, so ReleaseProfile on leave fails with "No active hold for cookie".
| sources: ['gamemode-dbus.c', 'gamemode-power-profile-tests.c'], | ||
| c_args: sd_bus_args + ['-ffunction-sections', '-fdata-sections', '-UNDEBUG'], | ||
| link_args: [ | ||
| '-Wl,--gc-sections', |
There was a problem hiding this comment.
With GCC, meson setup -Db_lto=true fails to link this test: undefined game_mode_context_register and others from gamemode-dbus.c. Master links fine with the same option. clang+lld with LTO, coverage builds and CFLAGS=-flto=auto all work.
Summary
Use the power-profiles-daemon
HoldProfileAPI while GameMode is active.The first registered client requests the configured performance profile, and the final client releases it. The system D-Bus connection remains open for the lifetime of the hold, so daemon exit also releases it.
Behavior
org.freedesktop.UPower.PowerProfiles.net.hadess.PowerProfilesAPI used by older PPD versions and compatible implementations such as tuned-ppd.platform_profilehandling when neither API exists,desiredprofcannot be represented by a PPD hold, ordefaultprofrequests exact restoration semantics.No new dependency or configuration option is added; the implementation uses the existing sd-bus dependency.
Testing
scripts/format-check.sh-Dwith-examples=truemeson test -C builddir --print-errorlogsclang-tidyon the changed daemon sources (only existing project-wide logging warnings)Full
gamemoded -thardware validation is pending the local removal of competing ASUS profile writers, hence this is submitted as a draft.Fixes #333
Fixes #462
Current qualification — 8 October 2026
Head
627aac2f605824d6ba71c73a6c2f7cbd197d661crejects emptyHoldProfilereplies instead of accepting cookie zero. The regression failed before the fix. Native Meson build with examples and all 18 Meson tests pass, including a new host-independent test of modern/legacy endpoints, unavailable services, denied requests, empty/malformed replies and bus failure. Scoped clang-format checks pass.The new test uses a fake system bus. Full hardware/PPD qualification, current Codex review and hosted upstream CI remain outstanding.
Current upstream CI — 8 October 2026
Run 37754242744 is
completed/action_requiredat signed head627aac2f605824d6ba71c73a6c2f7cbd197d661c. Maintainers must approve the fork workflow and obtain passing current-head CI. Native build and all 18 Meson tests pass; hardware/PPD qualification and the existing complete-candidate Codex review remain open.