From 032e1ec20e6308e6e34c0398d727374360650d1c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 26 Jan 2024 01:28:05 +0100 Subject: [PATCH] patched to fix crash seend with ddcutil 2.1.0 [release 5.27.10-2mamba;Thu Jan 25 2024] --- powerdevil-5.19.5-libddcutil-0.9.9.patch | 11 -------- powerdevil-5.21.5-systemd-248.patch | 34 ------------------------ powerdevil-5.27.10-ddcutil-2.1.0.patch | 12 +++++++++ powerdevil.spec | 12 +++++---- 4 files changed, 19 insertions(+), 50 deletions(-) delete mode 100644 powerdevil-5.19.5-libddcutil-0.9.9.patch delete mode 100644 powerdevil-5.21.5-systemd-248.patch create mode 100644 powerdevil-5.27.10-ddcutil-2.1.0.patch diff --git a/powerdevil-5.19.5-libddcutil-0.9.9.patch b/powerdevil-5.19.5-libddcutil-0.9.9.patch deleted file mode 100644 index 5bf6001..0000000 --- a/powerdevil-5.19.5-libddcutil-0.9.9.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- powerdevil-5.19.5/daemon/backends/upower/ddcutilbrightness.cpp.orig 2020-09-02 09:38:36.855000000 +0200 -+++ powerdevil-5.19.5/daemon/backends/upower/ddcutilbrightness.cpp 2020-09-02 09:37:12.911000000 +0200 -@@ -56,7 +56,7 @@ - - DDCA_Feature_List vcpList; - ddca_get_feature_list_by_dref(DDCA_SUBSET_COLOR, dh, false, &vcpList); -- qCDebug(POWERDEVIL) << "ddca_feature_list: "<< ddca_feature_list_string(&vcpList, "0x", ","); -+ qCDebug(POWERDEVIL) << "ddca_feature_list: "<< ddca_feature_list_string(vcpList, "0x", ","); - QVector tmpVcpList; - for (int iVcp = 0; iVcp < m_usedVcp.count(); ++iVcp) { - DDCA_Non_Table_Vcp_Value returnValue; diff --git a/powerdevil-5.21.5-systemd-248.patch b/powerdevil-5.21.5-systemd-248.patch deleted file mode 100644 index fa07d83..0000000 --- a/powerdevil-5.21.5-systemd-248.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d7c1181a5736bc5c6b2585fb0df9065510efcd7c Mon Sep 17 00:00:00 2001 -From: Yaroslav Sidlovsky -Date: Wed, 5 May 2021 14:32:32 +0300 -Subject: [PATCH] GetSessionByPID DBUS call always fails on newer systemd - versions - -GetSessionByPID returns this error: -``` -Error org.freedesktop.login1.NoSessionForPID: PID 2469 does not belong to any known session -``` -So instead we will get session by calling GetSession("auto"). -Tested on Fedora, should also work on openSUSE & KDE Neon. - -BUG: 433408 ---- - daemon/powerdevilpolicyagent.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/daemon/powerdevilpolicyagent.cpp b/daemon/powerdevilpolicyagent.cpp -index 653d1eef..d3993d78 100644 ---- a/daemon/powerdevilpolicyagent.cpp -+++ b/daemon/powerdevilpolicyagent.cpp -@@ -236,7 +236,7 @@ void PolicyAgent::onSessionHandlerRegistered(const QString & serviceName) - return; - } - -- QDBusPendingReply session = m_managerIface.data()->asyncCall(QLatin1String("GetSessionByPID"), (quint32) QCoreApplication::applicationPid()); -+ QDBusPendingReply session = m_managerIface.data()->asyncCall(QLatin1String("GetSession"), QLatin1String("auto")); - session.waitForFinished(); - - if (!session.isValid()) { --- -GitLab - diff --git a/powerdevil-5.27.10-ddcutil-2.1.0.patch b/powerdevil-5.27.10-ddcutil-2.1.0.patch new file mode 100644 index 0000000..dfb225f --- /dev/null +++ b/powerdevil-5.27.10-ddcutil-2.1.0.patch @@ -0,0 +1,12 @@ +diff -Nru powerdevil-5.27.10.orig/daemon/backends/upower/ddcutilbrightness.cpp powerdevil-5.27.10/daemon/backends/upower/ddcutilbrightness.cpp +--- powerdevil-5.27.10.orig/daemon/backends/upower/ddcutilbrightness.cpp 2023-12-05 20:23:32.000000000 +0100 ++++ powerdevil-5.27.10/daemon/backends/upower/ddcutilbrightness.cpp 2024-01-25 21:54:50.855340922 +0100 +@@ -49,7 +49,7 @@ + qCDebug(POWERDEVIL) << "Check for monitors using ddca_get_displays()..."; + // Inquire about detected monitors. + DDCA_Display_Info_List * dlist = nullptr; +- ddca_get_display_info_list2(true, &dlist); ++ ddca_get_display_info_list2(false, &dlist); + qCInfo(POWERDEVIL) << "[DDCutilBrightness] " << dlist->ct << "display(s) were detected"; + + for (const DDCA_Display_Handle displayHandle : std::as_const(m_displayHandleList)) { diff --git a/powerdevil.spec b/powerdevil.spec index 5cadd48..ca7bbbd 100644 --- a/powerdevil.spec +++ b/powerdevil.spec @@ -2,7 +2,7 @@ Name: powerdevil Version: 5.27.10 -Release: 1mamba +Release: 2mamba Summary: KDE Plasma 5 power management Group: Graphical Desktop/Applications/Configuration Vendor: openmamba @@ -10,8 +10,7 @@ Distribution: openmamba Packager: Silvan Calarco URL: https://kde.org/ Source: https://download.kde.org/stable/plasma/%{plasmaver}/powerdevil-%{version}.tar.xz -Patch0: powerdevil-5.19.5-libddcutil-0.9.9.patch -Patch1: powerdevil-5.21.5-systemd-248.patch +Patch0: powerdevil-5.27.10-ddcutil-2.1.0.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -73,8 +72,8 @@ This package contains shared libraries for %{name}. %prep %setup -q #-D -T -#%patch0 -p1 -#%patch1 -p1 +%patch 0 -p1 + %build #:<< _EOF @@ -122,6 +121,9 @@ This package contains shared libraries for %{name}. %{_libexecdir}/org_kde_powerdevil %changelog +* Thu Jan 25 2024 Silvan Calarco 5.27.10-2mamba +- patched to fix crash seend with ddcutil 2.1.0 + * Thu Dec 07 2023 Automatic Build System 5.27.10-1mamba - automatic version update by autodist