Commit graph

201 commits

Author SHA1 Message Date
Bastien Nocera
06af2327e4 README: Add mention of asusctl
See https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues/36
2021-10-04 15:11:18 +02:00
Bastien Nocera
2a25f7d4cd tests: Test when switch-profile permission isn't granted 2021-09-28 17:19:40 +02:00
Bastien Nocera
3aca4e9d01 main: Check whether user is allowed to perform action
Check whether a particular user/D-Bus client is allowed to switch
or hold power profiles.

Closes: #47
2021-09-28 13:07:49 +02:00
Bastien Nocera
bb92c628b4 tests: Start mock polkitd in the tests
And allow all us to perform all the actions.
2021-09-28 12:57:44 +02:00
Bastien Nocera
9d6e1735f3 data: Add polkit policy description
Describe and set defaults for switching and holding power profiles.
2021-09-28 12:55:59 +02:00
Bastien Nocera
112df0446d main: Print version on startup
Makes it easier to see startup too.
2021-09-07 23:00:12 +02:00
Bastien Nocera
50d1f5e03a tests: Split the integration test into individual tests
unittest_inspector.py lists the tests in the integration-test.py script,
which are then added as individual tests.
2021-09-07 23:00:12 +02:00
Bastien Nocera
e9f5b04258 tests: Rename integration test script
Add the python suffix.
2021-09-07 23:00:12 +02:00
Bastien Nocera
4ee64adc81 tests: Move test config file to a private directory
If we are to run all the tests in parallel, we need to make sure that
each instance of the daemon gets its own configuration file, otherwise
all of them will be trying to change each other's config behind their
backs.
2021-09-07 23:00:12 +02:00
Bastien Nocera
c48108763b tests: Remove extra spaces 2021-08-23 13:19:44 +02:00
Bastien Nocera
6701c99680 main: Update documentation for PpdDriver
The drivers have needed to handle all the profiles they support since
c7fb31632b where we stopped using a
placeholder driver when a profile wasn't handled.
2021-08-09 11:26:11 +02:00
Bastien Nocera
3fa5eafe57 README: Add mention of system76-power
Closes: #26
2021-08-06 18:42:15 +02:00
Bastien Nocera
42b3341b29 main: Follow pylint recommendation and use "with"
src/powerprofilesctl:185:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Closes: #35
2021-08-05 15:58:24 +02:00
Bastien Nocera
417c830355 README: Mention degraded mode for testing 2021-08-05 15:11:40 +02:00
Bastien Nocera
c7b05fa240 README: Simplify testing section by using powerprofilesctl 2021-08-05 15:11:36 +02:00
Bastien Nocera
6dab356723 README: Remove extra backticks
We already surrounded the command with triple-backticks.
2021-08-05 15:06:52 +02:00
Bastien Nocera
eee63cba70 README: Simplify debug commands
Use -r and -v so we don't have to stop existing instances manually.
2021-07-27 13:07:12 +02:00
Bastien Nocera
20a2d7f7b8 tests: Add tests for quiet profile support 2021-07-24 23:03:25 +02:00
Bastien Nocera
c9b646025d platform-profile: Add support for 'quiet' profile 2021-07-24 23:03:25 +02:00
Bastien Nocera
30d85f1e9e 0.9.0 2021-07-20 15:26:16 +02:00
Bastien Nocera
58cc0ef02b main: Implement profile persistence
Save the current user-selected profile in
/var/lib/power-profiles-daemon/state.ini

Closes: #23
2021-07-19 20:21:29 +02:00
Bastien Nocera
2a87e4be3c tests: Add another platform_profile helper 2021-07-19 20:21:29 +02:00
Bastien Nocera
12a6d18d99 main: Remove restoring profile from kernel
Remove restoring the problem from the on-disk kernel file, as was done
for the platform_profile, as we want to implement actual persistence
across reboots.

We need to be the ones saving that data, as the kernel doesn't know
whether the profile changes are temporary, or permanent, and whether the
user was the one initiating that change.
2021-07-19 20:21:29 +02:00
Bastien Nocera
bca6f4da50 main: Document that the Profiles property is sorted
It was always the case, as visible in the first, 0.1, release:
dfeeebc929/src/power-profiles-daemon.c (L109-134)
2021-07-19 20:13:48 +02:00
James
23157c2aa4 tests: Fix running test under Python 3.6
See https://docs.python.org/3/library/subprocess.html#subprocess.run :
Changed in version 3.7: [...] Added the capture_output parameter.

Closes: #33
2021-07-16 17:35:58 +02:00
Bastien Nocera
8944e16894 tests: Add test for launch command in cli tool 2021-07-16 12:39:27 +02:00
Bastien Nocera
64711bcf7b main: Add list-holds and launch commands 2021-07-16 12:39:27 +02:00
David Redondo
0d293373ed tests: Add test for Hold/ReleaseProfile
Tests holding and relasing of profiles and priority of holds of
different profiles.
2021-07-16 12:39:27 +02:00
David Redondo
58da7f5307 main: Implement Hold/ReleaseProfile
Make it possible for programmes to temporarily change the current
power profile, and "hold" that profile while they're performing a
task or waiting for an event to clear. This would be useful for:
- programmes with a finite workload to finish faster by investing more
  energy resources (eg. compiling software or transcoding media)
- programmes with near constantly high workloads to avoid the costs of
  transitioning between hardware profiles and causing stutters such
  as games or 3D modelling programmes
- OS components to force power-saver mode while battery energy is
  at a premium

Closes: #11

Co-Authored-By: Bastien Nocera <hadess@hadess.net>
2021-07-16 12:39:27 +02:00
Bastien Nocera
08f39e151e main: Remove unused inhibition switch reason 2021-07-05 11:04:33 +02:00
Bastien Nocera
99740ead2d main: Obsolete "Inhibited" property and add Degraded
The PerformanceInhibited property was there to convey that the
performance profile was unavailable, and that the daemon should switch
to a lower profile to avoid using the performance profile.

But it was difficult to communicate whether the daemon should switch
back to the performance profile when the inhibition disappeared, or
whether it should keep the same profile (the latter was what was
implemented).

There was also the problem that depending on the backend, the
performance profile might be able to provide a behaviour that wouldn't
match either of the unhampered performance profile, or the balanced
profile, but somewhere in between.

The PerformanceInhibited property is kept for compatibility reasons with
the existing consumer, GNOME 40. It will be removed in the future and
should not be relied on.

Closes: #24
2021-07-05 11:03:48 +02:00
Bastien Nocera
9ff59f0d1e placeholder: Ignore placeholder driver in the docs
Fixes a gtk-doc warning.
2021-07-05 10:59:56 +02:00
Bastien Nocera
73cbda3756 main: Fix PpdProfileActivationReason API docs
power-profiles-daemon/src/ppd-driver.h:37: warning: Value descriptions for PpdProfileActivationReason are missing in source code comment block.
2021-07-05 10:57:13 +02:00
Luca Stefani
ff0d147b76 platform-profile: Add debug on choices_path error case 2021-04-15 14:59:10 +02:00
Luca Stefani
3b0f72989b platform-profile: Fix crash if kernel built w/o platform_profile
If the kernel is built with platform_profile support,
g_file_get_contents() will fail, and we'll likely crash trying to
access ->message in the struct.

Don't forget to pass the error to g_file_get_contents().
2021-04-15 14:57:19 +02:00
Luca Stefani
24755fec0a build: Start using common_cflags
- Remove -Wall it's implied by warning_level=1
- Remove -std as it's implied by c_std
- Remove -fvisibility=hidden, we aren't a library
2021-04-15 13:20:56 +02:00
Bastien Nocera
bc05738c1d fake: Fix toggling inhibition after driver restart 2021-04-02 14:21:55 +02:00
Bastien Nocera
c483794592 0.8.1 2021-04-01 10:31:54 +02:00
Bastien Nocera
cea4e1a249 build: Add check-news.sh script 2021-04-01 10:30:39 +02:00
Bastien Nocera
915320e3cf intel-pstate: Disable on-battery behaviour
Because of the way gnome-shell's animation framework is built, setting
energy_performance_preference to balance_power has a visible impact
on the smoothness of animations, as the CPU will clock down too quickly
between frames, leading to the appearance of a performance regression.

Disable the on-battery behaviour until gnome-shell is fixed to avoid
being accused of slowing systems down.

See https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues/28#note_862766
2021-04-01 10:14:18 +02:00
Bastien Nocera
510951ab6c 0.8 2021-03-22 11:45:05 +01:00
Bastien Nocera
d00d02c951 ci: Export dist'ed tarballs too 2021-03-22 11:45:05 +01:00
Bastien Nocera
1883a773a1 fake: Print debug when fake driver profile is activated 2021-03-19 17:31:14 +01:00
Bastien Nocera
c318eacbb0 main: Move activation reason helper to PpdDriver 2021-03-19 17:31:14 +01:00
Bastien Nocera
a53fa663c9 ci: Don't install unused build dependencies 2021-03-19 17:26:42 +01:00
Bastien Nocera
62a8116989 main: Pass reason for profile change
When activating a new profile.
2021-03-19 14:22:16 +01:00
Bastien Nocera
334e64ea64 main: Add PpdProfileActivationReason enum 2021-03-19 14:22:16 +01:00
Bastien Nocera
2fbf57b9bd tests: Simplify reading platform_profile value
Which allows us to ignore trailing spaces in the sysfs attribute, as
power-profiles-daemon writes those mock files without a linefeed, but
the real kernel (or some of our setup functions) would always append
a linefeed.
2021-03-19 13:18:43 +01:00
Bastien Nocera
d650d2e6b9 tests: Add helper which strips trailing newlines from sysfs attributes
This will come in handy.
2021-03-19 13:18:43 +01:00
Bastien Nocera
4fc05c84d6 main: Don't throw an error if we select the same profile twice
Just say it worked if we've already selected this profile.
2021-03-19 13:03:16 +01:00