Merge lp:~nick-dedekind/qtubuntu/occlusion-2.0 into lp:qtubuntu

Proposed by Nick Dedekind
Status: Superseded
Proposed branch: lp:~nick-dedekind/qtubuntu/occlusion-2.0
Merge into: lp:qtubuntu
Diff against target: 251 lines (+70/-31)
4 files modified
debian/control (+0/-1)
debian/gles-patches/convert-to-gles.patch (+36/-23)
debian/rules (+21/-7)
src/ubuntumirclient/window.cpp (+13/-0)
To merge this branch: bzr merge lp:~nick-dedekind/qtubuntu/occlusion-2.0
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Michael Terry Needs Information
PS Jenkins bot continuous-integration Approve
Review via email: mp+283194@code.launchpad.net

This proposal has been superseded by a proposal from 2016-06-14.

Commit message

Re-added window exposure for occlusion detection

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~nick-dedekind/qtmir/occlusion-2.0/+merge/283197

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

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:308
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-1-ci/4/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-1-ci/4/rebuild

review: Approve (continuous-integration)
307. By Olivier Tilloy

Instantiate QKeyEvents with the scan code, native modifiers and native virtual key code, and special-case XKB_KEY_Return and XKB_KEY_KP_Enter to emit a carriage return character. Fixes: #1433138
Approved by: Lukáš Tinkl, PS Jenkins bot

308. By Daniel d'Andrada

Use logging categories and fix coding style (tab length)

So logging can be enabled/disabled at runtime instead of at build time
Approved by: Gerry Boland, PS Jenkins bot

309. By Daniel d'Andrada

Implement QPlatformOffscreenSurface

Otherwise Qt might create a full QPlatformWindow during shutdown (which will cause the creation of a mir surface) while cleaning up the GL context and we don't want that. Fixes: #1527737
Approved by: Gerry Boland, PS Jenkins bot

310. By CI Train Bot Account

Releasing 0.62+16.04.20160128.1-0ubuntu1

Revision history for this message
Michael Terry (mterry) wrote :

What's with the mNeedsExposeCatchup usage? If the window starts occluded, we do a one-time handleExposeEvent call? I'm sure it makes sense, I just don't understand the sequencing.

Revision history for this message
Michael Terry (mterry) wrote :

This has a merge conflict in src/ubuntumirclient/window.cpp it seems (though LP isn't showing it).

Revision history for this message
Michael Terry (mterry) wrote :

I tested this on the phone with the Music app:

QSG_RENDER_TIMING=1 QT_LOGGING_RULES="ubuntumirclient=true" qmlscene -qt5 /usr/share/click/preinstalled/com.ubuntu.music/current/app/music-app.qml --desktop_file_hint=/usr/share/click/preinstalled/com.ubuntu.music/current/com.ubuntu.music_music.desktop

Worked great! I want to try to do some testing with the Desktop stage, but I haven't noticed a regression like bug 1514556 yet.

Revision history for this message
Michael Terry (mterry) wrote :

Desktop mode seems to work fine.

But I get unity8 crashes if I flip between windowed and staged mode on my phone. They don't seem to be there without these branches.

gsettings set com.canonical.Unity8 usage-mode Staged
vs
gsettings set com.canonical.Unity8 usage-mode Windowed

I'm not sure what the exact trigger is. I had Music app playing music in the background, trying to render when it can. And some other windows, one was maximized. And I would just move them around, reorder them, and switch usage-modes. Got a crash a couple times that way.

Do you see that?

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Desktop mode seems to work fine.
>
> But I get unity8 crashes if I flip between windowed and staged mode on my
> phone. They don't seem to be there without these branches.
>
> gsettings set com.canonical.Unity8 usage-mode Staged
> vs
> gsettings set com.canonical.Unity8 usage-mode Windowed
>
> I'm not sure what the exact trigger is. I had Music app playing music in the
> background, trying to render when it can. And some other windows, one was
> maximized. And I would just move them around, reorder them, and switch usage-
> modes. Got a crash a couple times that way.
>
> Do you see that?

hm. supprised u8 crashes since this is mostly a qtubuntu change. I'll take a look.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> > Desktop mode seems to work fine.
> >
> > But I get unity8 crashes if I flip between windowed and staged mode on my
> > phone. They don't seem to be there without these branches.
> >
> > gsettings set com.canonical.Unity8 usage-mode Staged
> > vs
> > gsettings set com.canonical.Unity8 usage-mode Windowed
> >
> > I'm not sure what the exact trigger is. I had Music app playing music in
> the
> > background, trying to render when it can. And some other windows, one was
> > maximized. And I would just move them around, reorder them, and switch
> usage-
> > modes. Got a crash a couple times that way.
> >
> > Do you see that?
>
> hm. supprised u8 crashes since this is mostly a qtubuntu change. I'll take a
> look.

Can't seem to reproduce a crash. Could you please get me a stacktrace?

Revision history for this message
Michael Terry (mterry) wrote :

I had mentioned getting crashes earlier on IRC. But I had been using a poorly built version. Tried again with new build, but still get crashes.

I was toggling between Windowed and Staged modes and got lots of crashes in apps. Here are some stacktraces with just qtmir/qtubuntu symbols:
They all look roughly like (this one was from gallery-app) http://paste.ubuntu.com/15096134/

Revision history for this message
Michael Terry (mterry) wrote :

And here's one with some more symbols: http://paste.ubuntu.com/15096395/

311. By Nick Dedekind

Added support for low shell chrome Fixes: #1535397
Approved by: Gerry Boland, Unity8 CI Bot

312. By Lukáš Tinkl

Support for switching kbd layouts Fixes: #1491340, #1524400
Approved by: Unity8 CI Bot, Michael Terry, PS Jenkins bot

313. By CI Train Bot Account

Releasing 0.62+16.04.20160322-0ubuntu1

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
314. By Daniel d'Andrada

Proper support for multiple screens and dynamic scaling support Fixes: #1534682, #1573532
Approved by: Nick Dedekind, Unity8 CI Bot, Daniel d'Andrada, Gerry Boland

315. By Robert Bruce Park

Inline GLES packaging using a quilt patch.
Approved by: Unity8 CI Bot

316. By CI Train Bot Account

Releasing 0.62+16.04.20160428-0ubuntu1

317. By Albert Astals Cid

Enable workaround_brokenFBOReadBack on the Mali 400

Gives for impressive improvements in QSGDefaultDistanceFieldGlyphCache::storeGlyphs
impressive = 788ms -> 6ms
Approved by: Gerry Boland, Unity8 CI Bot

318. By Albert Astals Cid

Enable workaround_brokenFBOReadBack on the PowerVR Rogue G6200
Approved by: Gerry Boland, Unity8 CI Bot

319. By Albert Astals Cid

Enable workaround_brokenFBOReadBack on the Mali-T760
Approved by: Gerry Boland, Unity8 CI Bot

320. By Michael Terry

Build qtubuntu for arm64, and drop ancient qthybris transition package.

321. By CI Train Bot Account

Releasing 0.62+16.10.20160527.1-0ubuntu1

322. By Nick Dedekind

crossbuild support

323. By Nick Dedekind

added expose catchup

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-05-27 12:19:48 +0000
3+++ debian/control 2016-06-14 10:49:38 +0000
4@@ -15,7 +15,6 @@
5 libudev-dev,
6 libxkbcommon-dev,
7 libxrender-dev,
8- qt5-default,
9 qtbase5-private-dev,
10 quilt,
11 # if you don't have have commit access to this branch but would like to upload
12
13=== modified file 'debian/gles-patches/convert-to-gles.patch'
14--- debian/gles-patches/convert-to-gles.patch 2016-05-27 13:03:49 +0000
15+++ debian/gles-patches/convert-to-gles.patch 2016-06-14 10:49:38 +0000
16@@ -1,14 +1,14 @@
17-Index: arm64/debian/control
18+Index: cross-build-support/debian/control
19 ===================================================================
20---- arm64.orig/debian/control
21-+++ arm64/debian/control
22+--- cross-build-support.orig/debian/control
23++++ cross-build-support/debian/control
24 @@ -1,4 +1,4 @@
25 -Source: qtubuntu
26 +Source: qtubuntu-gles
27 Priority: optional
28 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29 Build-Depends: debhelper (>= 9),
30-@@ -11,12 +11,20 @@ Build-Depends: debhelper (>= 9),
31+@@ -11,11 +11,20 @@ Build-Depends: debhelper (>= 9),
32 libinput-dev,
33 libmirclient-dev (>= 0.13.0),
34 libmtdev-dev,
35@@ -22,15 +22,14 @@
36 libudev-dev,
37 libxkbcommon-dev,
38 libxrender-dev,
39- qt5-default,
40-- qtbase5-private-dev,
41+ qtbase5-private-dev,
42 + qtbase5-gles-dev,
43 + qtbase5-private-gles-dev,
44 + qtdeclarative5-dev,
45 quilt,
46 # if you don't have have commit access to this branch but would like to upload
47 # directly to Ubuntu, don't worry: your changes will be merged back into the
48-@@ -26,7 +34,7 @@ Standards-Version: 3.9.6
49+@@ -25,7 +34,7 @@ Standards-Version: 3.9.6
50 Section: libs
51
52 Package: qtubuntu-android
53@@ -39,7 +38,7 @@
54 Multi-Arch: same
55 Conflicts: qtubuntu-desktop,
56 Replaces: qtubuntu (<< 0.52),
57-@@ -37,31 +45,12 @@ Provides: qtubuntu,
58+@@ -36,31 +45,12 @@ Provides: qtubuntu,
59 Depends: ubuntu-application-api3-touch,
60 ${misc:Depends},
61 ${shlibs:Depends},
62@@ -74,37 +73,53 @@
63 - This variant of the package is for GNU-based desktops.
64 + This variant of the package is for Android-based phones and tablets (built
65 + against the OpenGLES variant of qtbase).
66-Index: arm64/debian/rules
67+Index: cross-build-support/debian/rules
68 ===================================================================
69---- arm64.orig/debian/rules
70-+++ arm64/debian/rules
71-@@ -4,47 +4,25 @@
72- export DPKG_GENSYMBOLS_CHECK_LEVEL=4
73+--- cross-build-support.orig/debian/rules
74++++ cross-build-support/debian/rules
75+@@ -5,60 +5,35 @@ export DPKG_GENSYMBOLS_CHECK_LEVEL=4
76+ export QT_SELECT=5
77
78 ANDROID_DIR = build-android
79 -DESKTOP_DIR = build-desktop
80 TMP1_DIR = $(CURDIR)/debian/tmp1
81 -TMP2_DIR = $(CURDIR)/debian/tmp2
82--
83+
84 -# We only want to build qtubuntu-android on arches using Qt built with OpenGL ES2.0
85--DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
86+ DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
87+ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
88+ DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
89+
90+ export PKG_CONFIG_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
91+
92 -gles2_architectures = arm64 armhf
93-
94+-
95 %:
96 dh $@
97
98 override_dh_clean:
99 -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
100- rm -rf $(TMP1_DIR)
101+- rm -rf $(TMP1_DIR) $(DESKTOP_DIR)
102 -endif
103-- rm -rf $(TMP2_DIR)
104+- rm -rf $(TMP2_DIR) $(ANDROID_DIR)
105++ rm -rf $(TMP1_DIR) $(ANDROID_DIR)
106 dh_clean
107
108 override_dh_auto_configure:
109 -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
110- mkdir -p $(ANDROID_DIR) && dh_auto_configure -B$(ANDROID_DIR) -- "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
111--endif
112-- mkdir -p $(DESKTOP_DIR) && dh_auto_configure -B$(DESKTOP_DIR) -- "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
113+ mkdir -p $(ANDROID_DIR)
114+ ifneq "$(DEB_HOST_ARCH)" "$(DEB_BUILD_ARCH)"
115+ cd $(ANDROID_DIR) && qt5-qmake-$(DEB_HOST_MULTIARCH) "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
116+ else
117+ dh_auto_configure -B$(ANDROID_DIR) -- "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
118+ endif
119+-endif
120+- mkdir -p $(DESKTOP_DIR)
121+-ifneq "$(DEB_HOST_ARCH)" "$(DEB_BUILD_ARCH)"
122+- cd $(DESKTOP_DIR) && qt5-qmake-$(DEB_HOST_MULTIARCH) "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
123+-else
124+- dh_auto_configure -B$(DESKTOP_DIR) -- "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
125+-endif
126
127 override_dh_auto_build:
128 -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
129@@ -116,10 +131,8 @@
130 rm -f debian/*/usr/lib/*/qt5/examples/qtubuntu/qmlscene-ubuntu
131 -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
132 mkdir -p $(TMP1_DIR) && cd $(ANDROID_DIR) && INSTALL_ROOT=$(TMP1_DIR) make install
133- cd $(CURDIR)
134 -endif
135 - mkdir -p $(TMP2_DIR) && cd $(DESKTOP_DIR) && INSTALL_ROOT=$(TMP2_DIR) make install
136-- cd $(CURDIR)
137
138 override_dh_install:
139 -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
140
141=== modified file 'debian/rules'
142--- debian/rules 2016-05-27 13:01:34 +0000
143+++ debian/rules 2016-06-14 10:49:38 +0000
144@@ -2,6 +2,7 @@
145 # -*- makefile -*-
146
147 export DPKG_GENSYMBOLS_CHECK_LEVEL=4
148+export QT_SELECT=5
149
150 ANDROID_DIR = build-android
151 DESKTOP_DIR = build-desktop
152@@ -10,6 +11,11 @@
153
154 # We only want to build qtubuntu-android on arches using Qt built with OpenGL ES2.0
155 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
156+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
157+DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
158+
159+export PKG_CONFIG_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
160+
161 gles2_architectures = arm64 armhf
162
163 %:
164@@ -17,16 +23,26 @@
165
166 override_dh_clean:
167 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
168- rm -rf $(TMP1_DIR)
169+ rm -rf $(TMP1_DIR) $(DESKTOP_DIR)
170 endif
171- rm -rf $(TMP2_DIR)
172+ rm -rf $(TMP2_DIR) $(ANDROID_DIR)
173 dh_clean
174
175 override_dh_auto_configure:
176 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
177- mkdir -p $(ANDROID_DIR) && dh_auto_configure -B$(ANDROID_DIR) -- "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
178-endif
179- mkdir -p $(DESKTOP_DIR) && dh_auto_configure -B$(DESKTOP_DIR) -- "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
180+ mkdir -p $(ANDROID_DIR)
181+ ifneq "$(DEB_HOST_ARCH)" "$(DEB_BUILD_ARCH)"
182+ cd $(ANDROID_DIR) && qt5-qmake-$(DEB_HOST_MULTIARCH) "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
183+ else
184+ dh_auto_configure -B$(ANDROID_DIR) -- "QMAKE_CXXFLAGS=-DPLATFORM_API_TOUCH" $(CURDIR)
185+ endif
186+endif
187+ mkdir -p $(DESKTOP_DIR)
188+ifneq "$(DEB_HOST_ARCH)" "$(DEB_BUILD_ARCH)"
189+ cd $(DESKTOP_DIR) && qt5-qmake-$(DEB_HOST_MULTIARCH) "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
190+else
191+ dh_auto_configure -B$(DESKTOP_DIR) -- "QMAKE_CXXFLAGS=-DQTUBUNTU_USE_OPENGL" $(CURDIR)
192+endif
193
194 override_dh_auto_build:
195 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
196@@ -38,10 +54,8 @@
197 rm -f debian/*/usr/lib/*/qt5/examples/qtubuntu/qmlscene-ubuntu
198 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
199 mkdir -p $(TMP1_DIR) && cd $(ANDROID_DIR) && INSTALL_ROOT=$(TMP1_DIR) make install
200- cd $(CURDIR)
201 endif
202 mkdir -p $(TMP2_DIR) && cd $(DESKTOP_DIR) && INSTALL_ROOT=$(TMP2_DIR) make install
203- cd $(CURDIR)
204
205 override_dh_install:
206 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
207
208=== modified file 'src/ubuntumirclient/window.cpp'
209--- src/ubuntumirclient/window.cpp 2016-04-28 14:44:18 +0000
210+++ src/ubuntumirclient/window.cpp 2016-06-14 10:49:38 +0000
211@@ -280,6 +280,8 @@
212 mMirSurface = createMirSurface(mWindow, mirOutputId, input, connection, surfaceEventCallback, this);
213 mEglSurface = eglCreateWindowSurface(mEglDisplay, config, nativeWindowFor(mMirSurface), nullptr);
214
215+ mNeedsExposeCatchup = mir_surface_get_visibility(mMirSurface) == mir_surface_visibility_occluded;
216+
217 // Window manager can give us a final size different from what we asked for
218 // so let's check what we ended up getting
219 MirSurfaceParameters parameters;
220@@ -335,6 +337,8 @@
221 void setSurfaceParent(MirSurface*);
222 bool hasParent() const { return mParented; }
223
224+ bool mNeedsExposeCatchup;
225+
226 private:
227 static void surfaceEventCallback(MirSurface* surface, const MirEvent *event, void* context);
228 void postEvent(const MirEvent *event);
229@@ -562,6 +566,7 @@
230 QMutexLocker lock(&mMutex);
231 qCDebug(ubuntumirclient, "handleSurfaceExposeChange(window=%p, exposed=%s)", window(), exposed ? "true" : "false");
232
233+ mSurface->mNeedsExposeCatchup = false;
234 if (mWindowExposed == exposed) return;
235 mWindowExposed = exposed;
236
237@@ -728,6 +733,14 @@
238 {
239 QMutexLocker lock(&mMutex);
240 mSurface->onSwapBuffersDone();
241+
242+ if (mSurface->mNeedsExposeCatchup) {
243+ mSurface->mNeedsExposeCatchup = false;
244+ mWindowExposed = false;
245+
246+ lock.unlock();
247+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
248+ }
249 }
250
251 void UbuntuWindow::handleScreenPropertiesChange(MirFormFactor formFactor, float scale)

Subscribers

People subscribed via source and target branches