From 940c262b740b9f81ae7b9f8d169de4722f890b8c Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 14 Feb 2024 13:35:56 -0600 Subject: [PATCH] amdgpu: reduce panel_power_saving values The loss of color fidelity in battery mode is too dramatic, especially with dark content (such as GNOME in dark mode or a dark background terminal). --- src/ppd-action-amdgpu-panel-power.c | 4 ++-- tests/integration_test.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ppd-action-amdgpu-panel-power.c b/src/ppd-action-amdgpu-panel-power.c index 3316a46..c2e824b 100644 --- a/src/ppd-action-amdgpu-panel-power.c +++ b/src/ppd-action-amdgpu-panel-power.c @@ -149,10 +149,10 @@ ppd_action_amdgpu_panel_update_target (PpdActionAmdgpuPanelPower *self, if (self->on_battery) { switch (self->last_profile) { case PPD_PROFILE_POWER_SAVER: - target = 4; + target = 3; break; case PPD_PROFILE_BALANCED: - target = 3; + target = 1; break; case PPD_PROFILE_PERFORMANCE: target = 0; diff --git a/tests/integration_test.py b/tests/integration_test.py index 8f71f3c..42a142a 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -1318,11 +1318,11 @@ class Tests(dbusmock.DBusTestCase): # verify balanced updated it self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("balanced")) - self.assert_sysfs_attr_eventually_is(edp, amdgpu_panel_power_savings, "3") + self.assert_sysfs_attr_eventually_is(edp, amdgpu_panel_power_savings, "1") # verify power saver updated it self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("power-saver")) - self.assert_sysfs_attr_eventually_is(edp, amdgpu_panel_power_savings, "4") + self.assert_sysfs_attr_eventually_is(edp, amdgpu_panel_power_savings, "3") # add another device that supports the feature edp2 = self.testbed.add_device( @@ -1334,7 +1334,7 @@ class Tests(dbusmock.DBusTestCase): ) # verify power saver got updated for it - self.assert_sysfs_attr_eventually_is(edp2, amdgpu_panel_power_savings, "4") + self.assert_sysfs_attr_eventually_is(edp2, amdgpu_panel_power_savings, "3") # add another device that supports the feature, but panel is disconnected edp3 = self.testbed.add_device(