forked from pool/power-profiles-daemon
Accepting request 1199841 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1199841 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/power-profiles-daemon?expand=0&rev=12
This commit is contained in:
commit
8530ff8f3c
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 9 18:54:06 UTC 2024 - Enrico Belleri <kilgore.trout@idesmi.eu>
|
||||
|
||||
- Add respect-dpm-manual.patch:
|
||||
Don't override user settings for dpm if set to manual
|
||||
(glfo#upower/power-profiles-daemon#163)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 3 06:20:18 UTC 2024 - Enrico Belleri <kilgore.trout@idesmi.eu>
|
||||
|
||||
|
@ -25,6 +25,8 @@ URL: https://gitlab.freedesktop.org/upower/power-profiles-daemon
|
||||
Source: %{url}/-/archive/%{version}/%{name}-%{version}.tar.bz2
|
||||
# PATCH-FEATURE-OPENSUSE hold-profile-hardening.patch boo#1189900 -- Hardening of HoldProfile D-Bus method
|
||||
Patch0: hold-profile-hardening.patch
|
||||
# PATCH-FIX-UPSTREAM respect-dpm-manual.patch -- based on commit 21b58819 glfo#upower/power-profiles-daemon#163 : Don't override user settings for dpm if set to manual
|
||||
Patch1: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/21b58819edcbbd87fc161474d1501debfd9b84b7.patch#/respect-dpm-manual.patch
|
||||
BuildRequires: c_compiler
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gtk-doc
|
||||
|
63
respect-dpm-manual.patch
Normal file
63
respect-dpm-manual.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From 21b58819edcbbd87fc161474d1501debfd9b84b7 Mon Sep 17 00:00:00 2001
|
||||
From: Mario Limonciello <mario.limonciello@amd.com>
|
||||
Date: Thu, 5 Sep 2024 18:53:50 -0500
|
||||
Subject: [PATCH] action-amdgpu-dpm: Don't override user settings for dpm if
|
||||
set to `manual`
|
||||
|
||||
---
|
||||
src/ppd-action-amdgpu-dpm.c | 5 +++++
|
||||
tests/integration_test.py | 22 ++++++++++++++++++++++
|
||||
2 files changed, 27 insertions(+)
|
||||
|
||||
diff --git a/src/ppd-action-amdgpu-dpm.c b/src/ppd-action-amdgpu-dpm.c
|
||||
index 7e141de..e8e34b9 100644
|
||||
--- a/src/ppd-action-amdgpu-dpm.c
|
||||
+++ b/src/ppd-action-amdgpu-dpm.c
|
||||
@@ -99,6 +99,11 @@ ppd_action_amdgpu_dpm_update_target (PpdActionAmdgpuDpm *self, GError **error)
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (g_strcmp0 (value, "manual") == 0) {
|
||||
+ g_info ("Device %s is in manual mode, not changing", g_udev_device_get_sysfs_path (dev));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
g_info ("Setting device %s to %s", g_udev_device_get_sysfs_path (dev), target);
|
||||
if (!ppd_utils_write_sysfs (dev, DPM_SYSFS_NAME, target, error))
|
||||
return FALSE;
|
||||
diff --git a/tests/integration_test.py b/tests/integration_test.py
|
||||
index 30ae097..6c898fd 100644
|
||||
--- a/tests/integration_test.py
|
||||
+++ b/tests/integration_test.py
|
||||
@@ -1646,6 +1646,28 @@ class Tests(dbusmock.DBusTestCase):
|
||||
upowerd_obj.Set("org.freedesktop.UPower", "OnBattery", True)
|
||||
self.assert_file_eventually_contains(energy_prefs, "balance_power")
|
||||
|
||||
+ def test_amdgpu_dpm_manual(self):
|
||||
+ """Verify AMDGPU dpm power actions avoid manual"""
|
||||
+ amdgpu_dpm = "device/power_dpm_force_performance_level"
|
||||
+ card = self.testbed.add_device(
|
||||
+ "drm",
|
||||
+ "card0",
|
||||
+ None,
|
||||
+ [amdgpu_dpm, "manual\n"],
|
||||
+ ["DEVTYPE", "drm_minor"],
|
||||
+ )
|
||||
+ self.create_amd_apu()
|
||||
+
|
||||
+ self.start_daemon()
|
||||
+
|
||||
+ self.assertIn("amdgpu_dpm", self.get_dbus_property("Actions"))
|
||||
+
|
||||
+ self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("balanced"))
|
||||
+ self.assert_sysfs_attr_eventually_is(card, amdgpu_dpm, "manual")
|
||||
+
|
||||
+ self.set_dbus_property("ActiveProfile", GLib.Variant.new_string("power-saver"))
|
||||
+ self.assert_sysfs_attr_eventually_is(card, amdgpu_dpm, "manual")
|
||||
+
|
||||
def test_amdgpu_dpm(self):
|
||||
"""Verify AMDGPU dpm power actions"""
|
||||
amdgpu_dpm = "device/power_dpm_force_performance_level"
|
||||
--
|
||||
GitLab
|
||||
|
Loading…
Reference in New Issue
Block a user