Skip to content

Hold power profile through power-profiles-daemon - #573

Draft
caniko wants to merge 1 commit into
FeralInteractive:masterfrom
caniko:hold-power-profile
Draft

caniko wants to merge 1 commit into
FeralInteractive:masterfrom
caniko:hold-power-profile

Conversation

@caniko

@caniko caniko commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Use the power-profiles-daemon HoldProfile API 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

  • Prefer org.freedesktop.UPower.PowerProfiles.
  • Fall back to the legacy net.hadess.PowerProfiles API used by older PPD versions and compatible implementations such as tuned-ppd.
  • Preserve direct platform_profile handling when neither API exists, desiredprof cannot be represented by a PPD hold, or defaultprof requests exact restoration semantics.
  • Do not bypass a present policy daemon after authorization or operational errors.
  • Let PPD restore the user-selected base profile when the hold ends.

No new dependency or configuration option is added; the implementation uses the existing sd-bus dependency.

Testing

  • scripts/format-check.sh
  • Meson build with -Dwith-examples=true
  • meson test -C builddir --print-errorlogs
  • Live PPD 0.30 modern endpoint: hold appears with the expected application ID, profile, and reason, then disappears on release
  • Two concurrent clients: one hold remains until the final client exits
  • Forced GameMode daemon exit: D-Bus disconnect removes the hold
  • clang-tidy on the changed daemon sources (only existing project-wide logging warnings)

Full gamemoded -t hardware validation is pending the local removal of competing ASUS profile writers, hence this is submitted as a draft.

Fixes #333
Fixes #462

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Try to use power-profiles-daemon API to hold performance profile if available Support for power profiles daemon

1 participant