Hello community,

here is the log from the commit of package libkscreen2 for openSUSE:Factory 
checked in at 2015-01-30 15:07:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libkscreen2 (Old)
 and      /work/SRC/openSUSE:Factory/.libkscreen2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libkscreen2"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libkscreen2/libkscreen2.changes  2015-01-29 
13:17:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libkscreen2.new/libkscreen2.changes     
2015-01-30 15:08:01.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Jan 29 19:10:34 UTC 2015 - [email protected]
+
+- Added 0001-Fix-crash-when-multiple-EDID-requests-for-the-same-o.patch
+  (kde#343482), from upstream
+
+-------------------------------------------------------------------

New:
----
  0001-Fix-crash-when-multiple-EDID-requests-for-the-same-o.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libkscreen2.spec ++++++
--- /var/tmp/diff_new_pack.9ByT0Q/_old  2015-01-30 15:08:02.000000000 +0100
+++ /var/tmp/diff_new_pack.9ByT0Q/_new  2015-01-30 15:08:02.000000000 +0100
@@ -42,6 +42,8 @@
 Url:            http://www.kde.org
 Source:         libkscreen-%{version}.tar.xz
 Source1:        baselibs.conf
+# PATCH-FIX-UPSTREAM 
0001-Fix-crash-when-multiple-EDID-requests-for-the-same-o.patch
+Patch0:         0001-Fix-crash-when-multiple-EDID-requests-for-the-same-o.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -74,6 +76,7 @@
 
 %prep
 %setup -q -n libkscreen-%{version}
+%patch0 -p1
 
 %build
   %cmake_kf5 -d build

++++++ 0001-Fix-crash-when-multiple-EDID-requests-for-the-same-o.patch ++++++
>From d3aa0f06fd6b657071aae7235472267498b4703f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <[email protected]>
Date: Thu, 29 Jan 2015 16:30:54 +0100
Subject: [PATCH 1/1] Fix crash when multiple EDID requests for the same output
 are enqueued

When the first EDID date are delivered, the output is removed from
the list of pending requests, causing crash when response to the second
request arrives.

This fix makes the code more robust by allowing multiple request for the
same output per single config as well as handling multiple configs.

BUG: 343482
FIXED-IN: 5.2.1
---
 src/configmonitor.cpp | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/src/configmonitor.cpp b/src/configmonitor.cpp
index 
d3f7807469db7ed82410078c201fd5839f0cad2a..727f1e0a68dba589620f02d1f40b7f75b03fa444
 100644
--- a/src/configmonitor.cpp
+++ b/src/configmonitor.cpp
@@ -50,8 +50,7 @@ public:
     QPointer<org::kde::kscreen::Backend> mBackend;
     bool mFirstBackend;
 
-    QSet<int> mPendingEDIDRequests;
-    KScreen::ConfigPtr mPendingConfigUpdate;
+    QMap<KScreen::ConfigPtr, QList<int>> mPendingEDIDRequests;
 private:
     ConfigMonitor *q;
 };
@@ -117,17 +116,17 @@ void ConfigMonitor::Private::backendConfigChanged(const 
QVariantMap &configMap)
     Q_FOREACH (OutputPtr output, newConfig->connectedOutputs()) {
         if (!output->edid() && output->isConnected()) {
             QDBusPendingReply<QByteArray> reply = 
mBackend->getEdid(output->id());
-            mPendingEDIDRequests.insert(output->id());
+            mPendingEDIDRequests[newConfig].append(output->id());
             QDBusPendingCallWatcher *watcher = new 
QDBusPendingCallWatcher(reply);
             watcher->setProperty("outputId", output->id());
+            watcher->setProperty("config", QVariant::fromValue(newConfig));
             connect(watcher, &QDBusPendingCallWatcher::finished,
                     this, &ConfigMonitor::Private::edidReady);
         }
     }
 
-    if (!mPendingEDIDRequests.isEmpty()) {
-        qCDebug(KSCREEN) << "Requesting missing EDID for outputs" << 
mPendingEDIDRequests;
-        mPendingConfigUpdate = newConfig;
+    if (mPendingEDIDRequests.contains(newConfig)) {
+        qCDebug(KSCREEN) << "Requesting missing EDID for outputs" << 
mPendingEDIDRequests[newConfig];
     } else {
         updateConfigs(newConfig);
     }
@@ -136,31 +135,27 @@ void ConfigMonitor::Private::backendConfigChanged(const 
QVariantMap &configMap)
 void ConfigMonitor::Private::edidReady(QDBusPendingCallWatcher* watcher)
 {
     const int outputId = watcher->property("outputId").toInt();
-    Q_ASSERT(!mPendingConfigUpdate.isNull());
-    Q_ASSERT(mPendingEDIDRequests.contains(outputId));
+    const ConfigPtr config = 
watcher->property("config").value<KScreen::ConfigPtr>();
+    Q_ASSERT(mPendingEDIDRequests.contains(config));
+    Q_ASSERT(mPendingEDIDRequests[config].contains(outputId));
 
     watcher->deleteLater();
 
-    mPendingEDIDRequests.remove(watcher->property("outputId").toInt());
+    mPendingEDIDRequests[config].removeOne(outputId);
 
     const QDBusPendingReply<QByteArray> reply = *watcher;
     if (reply.isError()) {
         qCWarning(KSCREEN) << "Error when retrieving EDID: " << 
reply.error().message();
-        if (mPendingEDIDRequests.isEmpty()) {
-            updateConfigs(mPendingConfigUpdate);
+    } else {
+        const QByteArray edid = reply.argumentAt<0>();
+        if (!edid.isEmpty()) {
+            OutputPtr output = config->output(outputId);
+            output->setEdid(edid);
         }
-        return;
-    }
-
-    const QByteArray edid = reply.argumentAt<0>();
-    if (!edid.isEmpty()) {
-        OutputPtr output = mPendingConfigUpdate->output(outputId);
-        output->setEdid(edid);
     }
 
-    if (mPendingEDIDRequests.isEmpty()) {
-        const KScreen::ConfigPtr config = mPendingConfigUpdate;
-        mPendingConfigUpdate.clear();
+    if (mPendingEDIDRequests[config].isEmpty()) {
+        mPendingEDIDRequests.remove(config);
         updateConfigs(config);
     }
 }
-- 
2.2.2

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to