pull upstream patches (upstreamed versions, gcc6-related bits mostly)

This commit is contained in:
Rex Dieter 2016-03-25 07:53:21 -05:00
parent f0e6f2d299
commit aad186629e
11 changed files with 672 additions and 120 deletions

View File

@ -0,0 +1,178 @@
From 8dc55367ca3993f465f270ef79c2cb212d821d0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Mon, 8 Feb 2016 15:02:17 +0100
Subject: [PATCH 058/328] QtGui: Avoid rgba64->rgba32 conversion on every pixel
in gradient
Convert rgba64 color table to a new rgb32 color table only once. Use
this cache when required.
This patch can 2x speed up gradient painting using 32bit color format.
Task-number: QTBUG-50930
Change-Id: I9212e01e397c2e0127cdf3070cc49880a2d8df88
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
---
src/gui/painting/qdrawhelper.cpp | 4 ++--
src/gui/painting/qdrawhelper_p.h | 9 ++++----
src/gui/painting/qpaintengine_raster.cpp | 38 ++++++++++++++++++++++++--------
3 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 28c7099..f0e5810 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -3433,13 +3433,13 @@ static SourceFetchProc64 sourceFetch64[NBlendTypes][QImage::NImageFormats] = {
static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos)
{
int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
- return data->colorTable[qt_gradient_clamp(data, ipos)].toArgb32();
+ return data->colorTable32[qt_gradient_clamp(data, ipos)];
}
static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int fixed_pos)
{
int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
- return data->colorTable[qt_gradient_clamp(data, ipos)];
+ return data->colorTable64[qt_gradient_clamp(data, ipos)];
}
static void QT_FASTCALL getLinearGradientValues(LinearGradientValues *v, const QSpanData *data)
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 1ff19f4..ff98d18 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -268,7 +268,8 @@ struct QGradientData
#define GRADIENT_STOPTABLE_SIZE 1024
#define GRADIENT_STOPTABLE_SIZE_SHIFT 10
- QRgba64* colorTable; //[GRADIENT_STOPTABLE_SIZE];
+ const QRgba64 *colorTable64; //[GRADIENT_STOPTABLE_SIZE];
+ const QRgb *colorTable32; //[GRADIENT_STOPTABLE_SIZE];
uint alphaColor : 1;
};
@@ -376,13 +377,13 @@ static inline uint qt_gradient_clamp(const QGradientData *data, int ipos)
static inline uint qt_gradient_pixel(const QGradientData *data, qreal pos)
{
int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
- return data->colorTable[qt_gradient_clamp(data, ipos)].toArgb32();
+ return data->colorTable32[qt_gradient_clamp(data, ipos)];
}
static inline const QRgba64& qt_gradient_pixel64(const QGradientData *data, qreal pos)
{
int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
- return data->colorTable[qt_gradient_clamp(data, ipos)];
+ return data->colorTable64[qt_gradient_clamp(data, ipos)];
}
static inline qreal qRadialDeterminant(qreal a, qreal b, qreal c)
@@ -550,7 +551,7 @@ public:
delta_det4_vec.v = Simd::v_add(delta_det4_vec.v, v_delta_delta_det16); \
b_vec.v = Simd::v_add(b_vec.v, v_delta_b4); \
for (int i = 0; i < 4; ++i) \
- *buffer++ = (extended_mask | v_buffer_mask.i[i]) & data->gradient.colorTable[index_vec.i[i]].toArgb32(); \
+ *buffer++ = (extended_mask | v_buffer_mask.i[i]) & data->gradient.colorTable32[index_vec.i[i]]; \
}
#define FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP) \
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 05ccff5..fb44a7a 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4138,7 +4138,8 @@ class QGradientCache
{
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
stops(qMove(s)), opacity(op), interpolationMode(mode) {}
- QRgba64 buffer[GRADIENT_STOPTABLE_SIZE];
+ QRgba64 buffer64[GRADIENT_STOPTABLE_SIZE];
+ QRgb buffer32[GRADIENT_STOPTABLE_SIZE];
QGradientStops stops;
int opacity;
QGradient::InterpolationMode interpolationMode;
@@ -4147,7 +4148,9 @@ class QGradientCache
typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash;
public:
- inline const QRgba64 *getBuffer(const QGradient &gradient, int opacity) {
+ typedef QPair<const QRgb *, const QRgba64 *> ColorBufferPair;
+
+ inline ColorBufferPair getBuffer(const QGradient &gradient, int opacity) {
quint64 hash_val = 0;
const QGradientStops stops = gradient.stops();
@@ -4163,7 +4166,8 @@ public:
do {
const CacheInfo &cache_info = it.value();
if (cache_info.stops == stops && cache_info.opacity == opacity && cache_info.interpolationMode == gradient.interpolationMode())
- return cache_info.buffer;
+ return qMakePair(reinterpret_cast<const QRgb *>(cache_info.buffer32),
+ reinterpret_cast<const QRgba64 *>(cache_info.buffer64));
++it;
} while (it != cache.constEnd() && it.key() == hash_val);
// an exact match for these stops and opacity was not found, create new cache
@@ -4177,14 +4181,18 @@ protected:
inline void generateGradientColorTable(const QGradient& g,
QRgba64 *colorTable,
int size, int opacity) const;
- QRgba64 *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
+ ColorBufferPair addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
if (cache.size() == maxCacheSize()) {
// may remove more than 1, but OK
cache.erase(cache.begin() + (qrand() % maxCacheSize()));
}
CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
- generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity);
- return cache.insert(hash_val, cache_entry).value().buffer;
+ generateGradientColorTable(gradient, cache_entry.buffer64, paletteSize(), opacity);
+ for (int i = 0; i < GRADIENT_STOPTABLE_SIZE; ++i)
+ cache_entry.buffer32[i] = cache_entry.buffer64[i].toArgb32();
+ CacheInfo &cache_value = cache.insert(hash_val, cache_entry).value();
+ return qMakePair(reinterpret_cast<const QRgb *>(cache_value.buffer32),
+ reinterpret_cast<const QRgba64 *>(cache_value.buffer64));
}
QGradientColorTableHash cache;
@@ -4418,7 +4426,11 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = LinearGradient;
const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
+
+ QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
+ gradient.colorTable64 = colorBuffers.second;
+ gradient.colorTable32 = colorBuffers.first;
+
gradient.spread = g->spread();
QLinearGradientData &linearData = gradient.linear;
@@ -4435,7 +4447,11 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = RadialGradient;
const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
+
+ QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
+ gradient.colorTable64 = colorBuffers.second;
+ gradient.colorTable32 = colorBuffers.first;
+
gradient.spread = g->spread();
QRadialGradientData &radialData = gradient.radial;
@@ -4456,7 +4472,11 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = ConicalGradient;
const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
+
+ QGradientCache::ColorBufferPair colorBuffers = qt_gradient_cache()->getBuffer(*g, alpha);
+ gradient.colorTable64 = colorBuffers.second;
+ gradient.colorTable32 = colorBuffers.first;
+
gradient.spread = QGradient::RepeatSpread;
QConicalGradientData &conicalData = gradient.conical;
--
1.9.3

View File

@ -0,0 +1,28 @@
From 9868d8af8316c01f28255110c28e11344ea6f7a5 Mon Sep 17 00:00:00 2001
From: Shawn Rutledge <shawn.rutledge@digia.com>
Date: Thu, 18 Feb 2016 14:06:02 +0100
Subject: [PATCH 101/328] xcb: include <cmath>
Fix trouble compiling with gcc 4.4.7 on Centos 6
Change-Id: Id81bd570e896507a07388257c4f75f80b4b468fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
---
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 969b6de..81cdaa5 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -38,6 +38,7 @@
#include "qtouchdevice.h"
#include <qpa/qwindowsysteminterface.h>
#include <QDebug>
+#include <cmath>
#ifdef XCB_USE_XINPUT2
--
1.9.3

View File

@ -0,0 +1,103 @@
From 4f577051676ad8ff161d481030f016d0c6bb324f Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@kdab.com>
Date: Sat, 5 Mar 2016 00:34:01 +0100
Subject: [PATCH 177/328] Fix GCC 6 -Wunused-functions warnings
GCC 6 is able to identify member functions that are unused.
Remove them.
Change-Id: Ic77548164b38a1cd3c957d2c57a5bccb979bc02e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
---
src/gui/painting/qpathclipper.cpp | 8 --------
src/widgets/dialogs/qcolordialog.cpp | 15 ---------------
src/widgets/widgets/qcalendarwidget.cpp | 6 ------
3 files changed, 29 deletions(-)
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 3a686bd..a5557c9 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -252,8 +252,6 @@ class SegmentTree
public:
SegmentTree(QPathSegments &segments);
- QRectF boundingRect() const;
-
void produceIntersections(int segment);
private:
@@ -304,12 +302,6 @@ SegmentTree::SegmentTree(QPathSegments &segments)
m_tree[0] = root;
}
-QRectF SegmentTree::boundingRect() const
-{
- return QRectF(QPointF(m_bounds.x1, m_bounds.y1),
- QPointF(m_bounds.x2, m_bounds.y2));
-}
-
static inline qreal coordinate(const QPointF &pos, int axis)
{
return axis == 0 ? pos.x() : pos.y();
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 468bffe..9a8bfc5 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -190,7 +190,6 @@ public:
QSize sizeHint() const Q_DECL_OVERRIDE;
virtual void setCellBrush(int row, int col, const QBrush &);
- QBrush cellBrush(int row, int col);
inline int cellWidth() const
{ return cellw; }
@@ -459,20 +458,6 @@ void QWellArray::setCellBrush(int row, int col, const QBrush &b)
d->brush[row*numCols()+col] = b;
}
-/*
- Returns the brush set for the cell at \a row, \a column. If no brush is
- set, Qt::NoBrush is returned.
-*/
-
-QBrush QWellArray::cellBrush(int row, int col)
-{
- if (d && row >= 0 && row < numRows() && col >= 0 && col < numCols())
- return d->brush[row*numCols()+col];
- return Qt::NoBrush;
-}
-
-
-
/*!\reimp
*/
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 48b224f..89cde85 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -654,7 +654,6 @@ public:
int dateEditAcceptDelay() const;
void setDateEditAcceptDelay(int delay);
- QDate date() const;
void setDate(const QDate &date);
bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
@@ -690,11 +689,6 @@ void QCalendarTextNavigator::setWidget(QWidget *widget)
m_widget = widget;
}
-QDate QCalendarTextNavigator::date() const
-{
- return m_date;
-}
-
void QCalendarTextNavigator::setDate(const QDate &date)
{
m_date = date;
--
1.9.3

View File

@ -0,0 +1,31 @@
From 992e762f66f6dd5ed2c5e369da77c7b3fdfcfd80 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@kdab.com>
Date: Sat, 5 Mar 2016 01:50:54 +0100
Subject: [PATCH 178/328] qt_common.prf: when looking for GCC >= 4.6, match GCC
6+, too
Change-Id: Ia04690f62faa214fb91dffc758e253b5a64e5648
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
---
mkspecs/features/qt_common.prf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 38602f6..e70d3bf 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -69,9 +69,9 @@ warnings_are_errors:warning_clean {
QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR
}
} else:gcc:!clang:!intel_icc {
- # GCC 4.6-4.9, 5.x
+ # GCC 4.6-4.9, 5.x, ...
ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
- contains(ver, "(4\\.[6789]|5\\..)") {
+ contains(ver, "(4\\.[6789]|[5-9]\\..)") {
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR
# GCC prints this bogus warning, after it has inlined a lot of code
--
1.9.3

View File

@ -0,0 +1,29 @@
From b8f98d956501dfa4ce03a137f15d404930a56066 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Sat, 5 Mar 2016 10:25:33 +0300
Subject: [PATCH 201/328] alsatest: Fix the check to treat alsalib 1.1.x as
correct version
Task-number: QTBUG-51681
Change-Id: I63266c33342f02f4d1a5ea5786f5fbc5a1b421b3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
---
config.tests/unix/alsa/alsatest.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.tests/unix/alsa/alsatest.cpp b/config.tests/unix/alsa/alsatest.cpp
index cab6533..0b45819 100644
--- a/config.tests/unix/alsa/alsatest.cpp
+++ b/config.tests/unix/alsa/alsatest.cpp
@@ -32,7 +32,7 @@
****************************************************************************/
#include <alsa/asoundlib.h>
-#if(!(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10))
+#if SND_LIB_VERSION < 0x1000a // 1.0.10
#error "Alsa version found too old, require >= 1.0.10"
#endif
--
1.9.3

View File

@ -0,0 +1,149 @@
From 2020d2cb63b851723e188c002acbe25b5f066525 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@kdab.com>
Date: Fri, 4 Mar 2016 15:19:50 -0800
Subject: [PATCH 221/328] QObject: fix GCC 6 warning about qt_static_metacall's
'hidden' attribute use
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This warning is triggered when we try to apply the Q_DECL_HIDDEN
attribute to a class in an unnamed namespace. Such classes are
already not exported.
qobjectdefs.h:175:108: warning: visibility attribute ignored [-Wattributes]
qobjectdefs.h:198:108: warning: visibility attribute ignored [-Wattributes]
Added a test on gadgets (and QObjects) in unnamed namespaces,
because qtbase currently does not contain such Q_GADGETs.
Done-with: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Ic747cc2ab45e4dc6bb70ffff1438c747b05c5672
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
---
src/corelib/kernel/qobjectdefs.h | 15 ++++++++++--
tests/auto/tools/moc/tst_moc.cpp | 50 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index b1ed971..2e9ed4f 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -152,6 +152,12 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
# define Q_OBJECT_NO_OVERRIDE_WARNING
#endif
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 600
+# define Q_OBJECT_NO_ATTRIBUTES_WARNING QT_WARNING_DISABLE_GCC("-Wattributes")
+#else
+# define Q_OBJECT_NO_ATTRIBUTES_WARNING
+#endif
+
/* qmake ignore Q_OBJECT */
#define Q_OBJECT \
public: \
@@ -162,10 +168,11 @@ public: \
virtual const QMetaObject *metaObject() const; \
virtual void *qt_metacast(const char *); \
virtual int qt_metacall(QMetaObject::Call, int, void **); \
- QT_WARNING_POP \
QT_TR_FUNCTIONS \
private: \
+ Q_OBJECT_NO_ATTRIBUTES_WARNING \
Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \
+ QT_WARNING_POP \
struct QPrivateSignal {};
/* qmake ignore Q_OBJECT */
@@ -179,7 +186,11 @@ public: \
void qt_check_for_QGADGET_macro(); \
typedef void QtGadgetHelper; \
private: \
- Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);
+ QT_WARNING_PUSH \
+ Q_OBJECT_NO_ATTRIBUTES_WARNING \
+ Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \
+ QT_WARNING_POP \
+ /*end*/
#endif // QT_NO_META_MACROS
#else // Q_MOC_RUN
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index c113b7c..5c16c7a 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -131,6 +131,33 @@ typedef struct {
int doNotConfuseMoc;
} OldStyleCStruct;
+namespace {
+
+ class GadgetInUnnamedNS
+ {
+ Q_GADGET
+ Q_PROPERTY(int x READ x WRITE setX)
+ Q_PROPERTY(int y READ y WRITE setY)
+ public:
+ explicit GadgetInUnnamedNS(int x, int y) : m_x(x), m_y(y) {}
+ int x() const { return m_x; }
+ int y() const { return m_y; }
+ void setX(int x) { m_x = x; }
+ void setY(int y) { m_y = y; }
+
+ private:
+ int m_x, m_y;
+ };
+
+ class ObjectInUnnamedNS : public QObject
+ {
+ Q_OBJECT
+ public:
+ explicit ObjectInUnnamedNS(QObject *parent = Q_NULLPTR) : QObject(parent) {}
+ };
+
+}
+
class Sender : public QObject
{
Q_OBJECT
@@ -597,6 +624,7 @@ private slots:
void relatedMetaObjectsNameConflict_data();
void relatedMetaObjectsNameConflict();
void strignLiteralsInMacroExtension();
+ void unnamedNamespaceObjectsAndGadgets();
void veryLongStringData();
void gadgetHierarchy();
@@ -3421,6 +3449,28 @@ class VeryLongStringData : public QObject
#undef repeat65534
};
+void tst_Moc::unnamedNamespaceObjectsAndGadgets()
+{
+ // these just test very basic functionality of gadgets and objects
+ // defined in unnamed namespaces.
+ {
+ GadgetInUnnamedNS gadget(21, 42);
+ QCOMPARE(gadget.x(), 21);
+ QCOMPARE(gadget.y(), 42);
+ gadget.staticMetaObject.property(0).writeOnGadget(&gadget, 12);
+ gadget.staticMetaObject.property(1).writeOnGadget(&gadget, 24);
+ QCOMPARE(gadget.x(), 12);
+ QCOMPARE(gadget.y(), 24);
+ }
+
+ {
+ ObjectInUnnamedNS object;
+ QObject *qObject = &object;
+ QCOMPARE(static_cast<ObjectInUnnamedNS *>(qObject),
+ qobject_cast<ObjectInUnnamedNS *>(qObject));
+ }
+}
+
void tst_Moc::veryLongStringData()
{
const QMetaObject *mobj = &VeryLongStringData::staticMetaObject;
--
1.9.3

View File

@ -0,0 +1,132 @@
From 2e02de165115c9d67ac343ff0960ed80f9c09bc8 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 15 Mar 2016 11:00:20 -0700
Subject: [PATCH 293/328] Fix QtDBus deadlock inside kded/kiod
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Whenever a message spy was installed, we failed to actually process
looped-back messages by queueing them for processing by the spy. That
had as a consequence that the caller got an error reply. Worse, since
the message had been queued, QtDBus would attempt to deliver it later.
Since that message had isLocal==true, bad things happened inside the
manager thread.
The correct solution is not to queue the message for the filter. If the
message is local, then simply deliver directly, as we're still in the
user's thread. This used to be the behavior in Qt 5.5.
Task-number: QTBUG-51676
Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Jan Kundrát <jkt@kde.org>
---
src/dbus/qdbusintegrator.cpp | 42 ++++++++++++++++++++++++++++++++----------
src/dbus/qdbusintegrator_p.h | 1 +
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index cd44861..478a2c4 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -481,6 +481,11 @@ QDBusSpyCallEvent::~QDBusSpyCallEvent()
void QDBusSpyCallEvent::placeMetaCall(QObject *)
{
+ invokeSpyHooks(msg, hooks, hookCount);
+}
+
+inline void QDBusSpyCallEvent::invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount)
+{
// call the spy hook list
for (int i = 0; i < hookCount; ++i)
hooks[i](msg);
@@ -509,7 +514,12 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
{
if (!ref.load())
return false;
- if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) {
+
+ // local message are always delivered, regardless of filtering
+ // or whether the dispatcher is enabled
+ bool isLocal = QDBusMessagePrivate::isLocal(amsg);
+
+ if (!dispatchEnabled && !isLocal) {
// queue messages only, we'll handle them later
qDBusDebug() << this << "delivery is suspended";
pendingMessages << amsg;
@@ -523,13 +533,23 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
// let them see the signal too
return false;
case QDBusMessage::MethodCallMessage:
- // run it through the spy filters (if any) before the regular processing
+ // run it through the spy filters (if any) before the regular processing:
+ // a) if it's a local message, we're in the caller's thread, so invoke the filter directly
+ // b) if it's an external message, post to the main thread
if (Q_UNLIKELY(qDBusSpyHookList.exists()) && qApp) {
const QDBusSpyHookList &list = *qDBusSpyHookList;
- qDBusDebug() << this << "invoking message spies";
- QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this),
- amsg, list.constData(), list.size()));
- return true;
+ if (isLocal) {
+ Q_ASSERT(QThread::currentThread() != thread());
+ qDBusDebug() << this << "invoking message spies directly";
+ QDBusSpyCallEvent::invokeSpyHooks(amsg, list.constData(), list.size());
+ } else {
+ qDBusDebug() << this << "invoking message spies via event";
+ QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this),
+ amsg, list.constData(), list.size()));
+
+ // we'll be called back, so return
+ return true;
+ }
}
handleObjectCall(amsg);
@@ -1451,9 +1471,9 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
// that means the dispatchLock mutex is locked
// must not call out to user code in that case
//
- // however, if the message is internal, handleMessage was called
- // directly and no lock is in place. We can therefore call out to
- // user code, if necessary
+ // however, if the message is internal, handleMessage was called directly
+ // (user's thread) and no lock is in place. We can therefore call out to
+ // user code, if necessary.
ObjectTreeNode result;
int usedLength;
QThread *objThread = 0;
@@ -1492,12 +1512,14 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
usedLength, msg));
return;
} else if (objThread != QThread::currentThread()) {
- // synchronize with other thread
+ // looped-back message, targeting another thread:
+ // synchronize with it
postEventToThread(HandleObjectCallPostEventAction, result.obj,
new QDBusActivateObjectEvent(QDBusConnection(this), this, result,
usedLength, msg, &sem));
semWait = true;
} else {
+ // looped-back message, targeting current thread
semWait = false;
}
} // release the lock
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index 2bbebdf..c0d9c22 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -145,6 +145,7 @@ public:
{}
~QDBusSpyCallEvent();
void placeMetaCall(QObject *) Q_DECL_OVERRIDE;
+ static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
QDBusConnection conn; // keeps the refcount in QDBusConnectionPrivate up
QDBusMessage msg;
--
1.9.3

View File

@ -1,81 +0,0 @@
From 42e14c187f7b2eedb5be7b7a49efb4031f12a02e Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 15 Mar 2016 11:00:20 -0700
Subject: [PATCH] Fix QtDBus deadlock inside kded/kiod
Whenever a message spy was installed, we failed to actually process
looped-back messages by queueing them for processing by the spy. That
had as a consequence that the caller got an error reply and the message,
later, we attempted to deliver the message. Since that message still was
isLocal==true, bad things happened inside the manager thread.
The correct solution is not to queue the message for the filter. We could
have filtered the message directly, but instead this commit opts not to
filter looped-back messages. That implies kded/kiod must not attempt to
load its modules by way of a looped-back message.
Task-number: QTBUG-51676
Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612
---
src/dbus/qdbusintegrator.cpp | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index cd44861..6052766 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -509,7 +509,12 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
{
if (!ref.load())
return false;
- if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) {
+
+ // local message are always delivered, regardless of filtering
+ // or whether the dispatcher is enabled
+ bool isLocal = QDBusMessagePrivate::isLocal(amsg);
+
+ if (!dispatchEnabled && !isLocal) {
// queue messages only, we'll handle them later
qDBusDebug() << this << "delivery is suspended";
pendingMessages << amsg;
@@ -524,7 +529,7 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
return false;
case QDBusMessage::MethodCallMessage:
// run it through the spy filters (if any) before the regular processing
- if (Q_UNLIKELY(qDBusSpyHookList.exists()) && qApp) {
+ if (Q_UNLIKELY(qDBusSpyHookList.exists()) && !isLocal && qApp) {
const QDBusSpyHookList &list = *qDBusSpyHookList;
qDBusDebug() << this << "invoking message spies";
QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this),
@@ -1451,9 +1456,9 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
// that means the dispatchLock mutex is locked
// must not call out to user code in that case
//
- // however, if the message is internal, handleMessage was called
- // directly and no lock is in place. We can therefore call out to
- // user code, if necessary
+ // however, if the message is internal, handleMessage was called directly
+ // (user's thread) and no lock is in place. We can therefore call out to
+ // user code, if necessary.
ObjectTreeNode result;
int usedLength;
QThread *objThread = 0;
@@ -1492,12 +1497,14 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
usedLength, msg));
return;
} else if (objThread != QThread::currentThread()) {
- // synchronize with other thread
+ // looped-back message, targeting another thread:
+ // synchronize with it
postEventToThread(HandleObjectCallPostEventAction, result.obj,
new QDBusActivateObjectEvent(QDBusConnection(this), this, result,
usedLength, msg, &sem));
semWait = true;
} else {
+ // looped-back message, targeting current thread
semWait = false;
}
} // release the lock
--
2.5.0

View File

@ -1,10 +0,0 @@
--- qtbase-opensource-src-5.6.0-rc/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp.orig 2016-02-15 11:27:10.714918086 +0100
+++ qtbase-opensource-src-5.6.0-rc/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp 2016-02-15 11:52:11.843978315 +0100
@@ -38,6 +38,7 @@
#include "qtouchdevice.h"
#include <qpa/qwindowsysteminterface.h>
#include <QDebug>
+#include <cmath>
#ifdef XCB_USE_XINPUT2

View File

@ -59,7 +59,7 @@
Summary: Qt5 - QtBase components Summary: Qt5 - QtBase components
Name: qt5-qtbase Name: qt5-qtbase
Version: 5.6.0 Version: 5.6.0
Release: 8%{?prerelease:.%{prerelease}}%{?dist} Release: 9%{?prerelease:.%{prerelease}}%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details # See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -97,9 +97,6 @@ Patch50: qt5-poll.patch
# https://bugreports.qt.io/browse/QTBUG-49972 # https://bugreports.qt.io/browse/QTBUG-49972
Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch
# correct check for alsa-1.1
Patch53: qtbase-opensource-src-5.6.0-alsa-1.1.patch
# arm patch # arm patch
Patch54: qtbase-opensource-src-5.6.0-arm.patch Patch54: qtbase-opensource-src-5.6.0-arm.patch
@ -109,19 +106,21 @@ Patch55: QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch
# https://codereview.qt-project.org/#/c/151340/ # https://codereview.qt-project.org/#/c/151340/
Patch56: QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch Patch56: QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch
# https://codereview.qt-project.org/#/c/151459/
Patch57: QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch
# Epel patches
Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch
# recently passed code review, not integrated yet # recently passed code review, not integrated yet
# https://codereview.qt-project.org/126102/ # https://codereview.qt-project.org/126102/
Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch Patch60: moc-get-the-system-defines-from-the-compiler-itself.patch
## upstream patches
# Item views, https://bugreports.qt.io/browse/QTBUG-48870 # Item views, https://bugreports.qt.io/browse/QTBUG-48870
Patch158: 0058-QtGui-Avoid-rgba64-rgba32-conversion-on-every-pixel-.patch
Patch176: 0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch Patch176: 0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch
Patch201: 0101-xcb-include-cmath.patch
Patch277: 0177-Fix-GCC-6-Wunused-functions-warnings.patch
Patch278: 0178-qt_common.prf-when-looking-for-GCC-4.6-match-GCC-6-t.patch
Patch301: 0201-alsatest-Fix-the-check-to-treat-alsalib-1.1.x-as-cor.patch
Patch321: 0221-QObject-fix-GCC-6-warning-about-qt_static_metacall-s.patch
Patch393: 0293-Fix-QtDBus-deadlock-inside-kded-kiod.patch
# macros, be mindful to keep sync'd with macros.qt5 # macros, be mindful to keep sync'd with macros.qt5
Source10: macros.qt5 Source10: macros.qt5
@ -367,17 +366,20 @@ RPM macros for building Qt5 packages.
%patch12 -p1 -b .enable_ft_lcdfilter %patch12 -p1 -b .enable_ft_lcdfilter
%patch52 -p1 -b .moc_WORDSIZE %patch52 -p1 -b .moc_WORDSIZE
%patch53 -p1 -b .alsa1.1
%patch54 -p1 -b .arm %patch54 -p1 -b .arm
%patch55 -p1 -b .QTBUG-51648 %patch55 -p1 -b .QTBUG-51648
## FTBFS, omit for now ## FTBFS, omit for now
%patch56 -p1 -b .QTBUG-51649 %patch56 -p1 -b .QTBUG-51649
%patch57 -p1 -b .QTBUG-51676 %patch60 -p1 -b .moc_system_defines
%patch100 -p1 -b .sqrt %patch158 -p1 -b .0058
%patch150 -p1 -b .moc_system_defines
%patch176 -p1 -b .0076 %patch176 -p1 -b .0076
%patch201 -p1 -b .0101
%patch277 -p1 -b .0177
%patch278 -p1 -b .0178
%patch301 -p1 -b .0201
%patch321 -p1 -b .0221
%patch393 -p1 -b .0293
%define platform linux-g++ %define platform linux-g++
@ -961,6 +963,9 @@ fi
%changelog %changelog
* Fri Mar 25 2016 Rex Dieter <rdieter@fedoraproject.org> 5.6.0-9
- pull upstream patches (upstreamed versions, gcc6-related bits mostly)
* Thu Mar 24 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.0-8 * Thu Mar 24 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.0-8
- make 10-qt5-check-opengl2.sh xinit script more robust - make 10-qt5-check-opengl2.sh xinit script more robust
- enable journald support for el7+ (#1315239) - enable journald support for el7+ (#1315239)

View File

@ -1,12 +0,0 @@
diff -up qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp.than qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp
--- qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp.than 2015-12-14 21:49:46.000000000 +0100
+++ qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp 2016-02-11 13:29:59.249275394 +0100
@@ -32,7 +32,7 @@
****************************************************************************/
#include <alsa/asoundlib.h>
-#if(!(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10))
+#if(!(SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 10)))
#error "Alsa version found too old, require >= 1.0.10"
#endif