Merge lp:~nick-dedekind/qtmir/drop-frame-texture-update into lp:qtmir

Proposed by Nick Dedekind
Status: Merged
Approved by: Gerry Boland
Approved revision: 408
Merged at revision: 409
Proposed branch: lp:~nick-dedekind/qtmir/drop-frame-texture-update
Merge into: lp:qtmir
Diff against target: 123 lines (+18/-21)
3 files modified
src/modules/Unity/Application/mirsurface.cpp (+15/-17)
src/modules/Unity/Application/mirsurfaceitem.cpp (+1/-2)
tests/modules/SurfaceManager/mirsurfaceitem_test.cpp (+2/-2)
To merge this branch: bzr merge lp:~nick-dedekind/qtmir/drop-frame-texture-update
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+277440@code.launchpad.net

Commit message

Update surface textures when dropping frames.

Description of the change

Update surface textures when dropping frames.

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

 qCDebug(QTMIR_SURFACES) << "MirSurfaceItem::dropPendingBuffer()"
would you please fix this pet-peeve of mine while you're here? MirSurface::...

I got a crash with phone idle:

Program received signal SIGSEGV, Segmentation fault.
0xa9f6c69a in qtmir::MirSurface::dropPendingBuffer (this=0x28afc78)
    at /home/gerry/dev/projects/qtmir/qtmir-ubuntu-xenial-landing-044/src/modules/Unity/Application/mirsurface.cpp:309
309 /home/gerry/dev/projects/qtmir/qtmir-ubuntu-xenial-landing-044/src/modules/Unity/Application/mirsurface.cpp: No such file or directory.
(gdb) bt
#0 0xa9f6c69a in qtmir::MirSurface::dropPendingBuffer (this=0x28afc78)
    at /home/gerry/dev/projects/qtmir/qtmir-ubuntu-xenial-landing-044/src/modules/Unity/Application/mirsurface.cpp:309
#1 0xb6535ad2 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#2 0xb653ed06 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#3 0xb6536a2a in QObject::event(QEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#4 0xb6515cb2 in QCoreApplication::notify(QObject*, QEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#5 0xb6515d78 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#6 0xb655009c in QTimerInfoList::activateTimers() () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#7 0xb65503b2 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#8 0xb5ca7f68 in g_main_context_dispatch () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
#9 0xb5ca8114 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Revision history for this message
Gerry Boland (gerboland) wrote :

(gdb) info locals
i = 1
userId = 0x7b
renderables = std::vector of length 1, capacity 1 = {std::shared_ptr (count 1, weak 0) 0x2355ce4}
locker = {val = 42663093}
framesPending = 2

Revision history for this message
Gerry Boland (gerboland) wrote :

+ auto renderables = m_surface->generate_renderables(userId);
+ for (uint i = 0; i < renderables.size()-2; i++) {
I don't think this is correct. A single Mir surface can have multiple "Renderables" - something that's not really happening much at the moment, but will more when we start using sub-surfaces/bufferstreams. Use-case is embedding a video into a webbrowser. Video is in a sub-surface.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
408. By Nick Dedekind

proper drop frame texture update

Revision history for this message
Gerry Boland (gerboland) wrote :

Ok, looks reasonable. I'm running every AP test under the sun on all my devices, just to be sure.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Fixes bug, and no regressions that I can observe. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
2--- src/modules/Unity/Application/mirsurface.cpp 2015-11-02 11:22:24 +0000
3+++ src/modules/Unity/Application/mirsurface.cpp 2015-11-13 14:13:14 +0000
4@@ -292,16 +292,11 @@
5
6 int framesPending = m_surface->buffers_ready_for_compositor(userId);
7 if (framesPending > 0) {
8- // The line below looks like an innocent, effect-less, getter. But as this
9- // method returns a unique_pointer, not holding its reference causes the
10- // buffer to be destroyed/released straight away.
11- for (auto const & item : m_surface->generate_renderables(userId))
12- item->buffer();
13- qCDebug(QTMIR_SURFACES) << "MirSurfaceItem::dropPendingBuffer()"
14- << "surface =" << this
15- << "buffer dropped."
16- << framesPending-1
17- << "left.";
18+ qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::dropPendingBuffer() left=" << framesPending-1;
19+
20+ m_textureUpdated = false;
21+ locker.unlock();
22+ updateTexture();
23 } else {
24 // The client can't possibly be blocked in swap buffers if the
25 // queue is empty. So we can safely enter deep sleep now. If the
26@@ -313,13 +308,13 @@
27
28 void MirSurface::stopFrameDropper()
29 {
30- qCDebug(QTMIR_SURFACES) << "MirSurface::stopFrameDropper surface = " << this;
31+ qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::stopFrameDropper()";
32 m_frameDropperTimer.stop();
33 }
34
35 void MirSurface::startFrameDropper()
36 {
37- qCDebug(QTMIR_SURFACES) << "MirSurface::startFrameDropper surface = " << this;
38+ qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::startFrameDropper()";
39 if (!m_frameDropperTimer.isActive()) {
40 m_frameDropperTimer.start();
41 }
42@@ -363,6 +358,8 @@
43 m_size = texture->textureSize();
44 QMetaObject::invokeMethod(this, "emitSizeChanged", Qt::QueuedConnection);
45 }
46+
47+ m_textureUpdated = true;
48 }
49
50 if (m_surface->buffers_ready_for_compositor(userId) > 0) {
51@@ -371,13 +368,12 @@
52 QMetaObject::invokeMethod(&m_frameDropperTimer, "start", Qt::QueuedConnection);
53 }
54
55- m_textureUpdated = true;
56-
57 return texture->hasBuffer();
58 }
59
60 void MirSurface::onCompositorSwappedBuffers()
61 {
62+ QMutexLocker locker(&m_mutex);
63 m_textureUpdated = false;
64 }
65
66@@ -421,9 +417,8 @@
67 if (clientIsRunning() && mirSizeIsDifferent) {
68 mir::geometry::Size newMirSize(width, height);
69 m_surface->resize(newMirSize);
70- qCDebug(QTMIR_SURFACES) << "MirSurface::resize"
71- << "surface =" << this
72- << ", old (" << mirWidth << "," << mirHeight << ")"
73+ qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::resize"
74+ << " old (" << mirWidth << "," << mirHeight << ")"
75 << ", new (" << width << "," << height << ")";
76 }
77 }
78@@ -682,6 +677,9 @@
79
80 void MirSurface::updateVisibility()
81 {
82+ // FIXME: https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1514556
83+ return;
84+
85 bool newVisible = false;
86 QHashIterator<qintptr, View> i(m_views);
87 while (i.hasNext()) {
88
89=== modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp'
90--- src/modules/Unity/Application/mirsurfaceitem.cpp 2015-11-09 19:25:26 +0000
91+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2015-11-13 14:13:14 +0000
92@@ -531,8 +531,7 @@
93 return;
94 }
95
96- // FIXME: https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1514556
97- // m_surface->setViewVisibility((qintptr)this, isVisible());
98+ m_surface->setViewVisibility((qintptr)this, isVisible());
99 }
100
101 void MirSurfaceItem::updateMirSurfaceFocus(bool focused)
102
103=== modified file 'tests/modules/SurfaceManager/mirsurfaceitem_test.cpp'
104--- tests/modules/SurfaceManager/mirsurfaceitem_test.cpp 2015-11-10 09:04:43 +0000
105+++ tests/modules/SurfaceManager/mirsurfaceitem_test.cpp 2015-11-13 14:13:14 +0000
106@@ -100,7 +100,7 @@
107 delete fakeSurface;
108 }
109
110-TEST_F(MirSurfaceItemTest, DISABLED_SetSurfaceInitializesVisiblity)
111+TEST_F(MirSurfaceItemTest, SetSurfaceInitializesVisiblity)
112 {
113 MirSurfaceItem *surfaceItem = new MirSurfaceItem;
114 surfaceItem->setVisible(false);
115@@ -114,7 +114,7 @@
116 delete fakeSurface;
117 }
118
119-TEST_F(MirSurfaceItemTest, DISABLED_ggregateSurfaceVisibility)
120+TEST_F(MirSurfaceItemTest, AggregateSurfaceVisibility)
121 {
122 MirSurfaceItem *surfaceItem1 = new MirSurfaceItem;
123 surfaceItem1->setVisible(true);

Subscribers

People subscribed via source and target branches