mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-01-06 13:00:18 +01:00
amdgpu_dpm: Default to opt-in (disabled)
While in power-saver mode the clock changes are reported to be too aggressive for some users requested behavior. Change the action to opt-in so that users that want to use it can still enable it. Fixes: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/issues/164
This commit is contained in:
parent
2f83eb0a54
commit
faad209f7b
2 changed files with 33 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ ppd_action_amdgpu_dpm_constructor (GType type,
|
|||
g_object_set (object,
|
||||
"action-name", "amdgpu_dpm",
|
||||
"action-description", "Adjust GPU dynamic power management",
|
||||
"action-optin", FALSE,
|
||||
"action-optin", TRUE,
|
||||
NULL);
|
||||
|
||||
return object;
|
||||
|
|
|
|||
|
|
@ -1645,6 +1645,10 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
self.start_daemon()
|
||||
|
||||
self.call_dbus_method(
|
||||
"SetActionEnabled", GLib.Variant("(sb)", ("amdgpu_dpm", True))
|
||||
)
|
||||
|
||||
self.assert_action_enabled("amdgpu_dpm")
|
||||
|
||||
self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("balanced"))
|
||||
|
|
@ -1667,6 +1671,10 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
self.start_daemon()
|
||||
|
||||
self.call_dbus_method(
|
||||
"SetActionEnabled", GLib.Variant("(sb)", ("amdgpu_dpm", True))
|
||||
)
|
||||
|
||||
self.assert_action_enabled("amdgpu_dpm")
|
||||
|
||||
self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("balanced"))
|
||||
|
|
@ -2623,6 +2631,30 @@ class LegacyDBusNameTests(Tests):
|
|||
# the old name anyways.
|
||||
pass
|
||||
|
||||
def test_amdgpu_dpm(self):
|
||||
amdgpu_dpm = "device/power_dpm_force_performance_level"
|
||||
self.testbed.add_device(
|
||||
"drm",
|
||||
"card0",
|
||||
None,
|
||||
[amdgpu_dpm, "auto\n"],
|
||||
["DEVTYPE", "drm_minor"],
|
||||
)
|
||||
self.create_amd_apu()
|
||||
|
||||
self.start_daemon()
|
||||
|
||||
# verify can't enable it on legacy interface
|
||||
with self.assertRaises(gi.repository.GLib.GError) as error:
|
||||
self.call_dbus_method(
|
||||
"SetActionEnabled", GLib.Variant("(sb)", ("amdgpu_dpm", True))
|
||||
)
|
||||
self.assertIn("UnknownMethod", str(error.exception))
|
||||
|
||||
def test_amdgpu_dpm_manual(self):
|
||||
# should fail same way as test_amdgpu_dpm
|
||||
self.test_amdgpu_dpm()
|
||||
|
||||
def test_amdgpu_panel_power(self):
|
||||
amdgpu_panel_power_savings = "amdgpu/panel_power_savings"
|
||||
self.testbed.add_device(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue