Mir

Merge lp:~raof/mir/fix-ftbfs-against-mesa-11 into lp:mir

Proposed by Chris Halse Rogers
Status: Merged
Merged at revision: 2962
Proposed branch: lp:~raof/mir/fix-ftbfs-against-mesa-11
Merge into: lp:mir
Diff against target: 210 lines (+171/-0)
5 files modified
3rd_party/android-deps/android/native_window.h (+126/-0)
3rd_party/android-deps/android/rect.h (+41/-0)
src/common/graphics/android/CMakeLists.txt (+1/-0)
src/platforms/android/client/CMakeLists.txt (+2/-0)
src/platforms/android/server/CMakeLists.txt (+1/-0)
To merge this branch: bzr merge lp:~raof/mir/fix-ftbfs-against-mesa-11
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel van Vugt Approve
Review via email: mp+272203@code.launchpad.net

Commit message

Re-add android/native_window.h and its dependency to 3rd_party.

Khronos' eglplatform.h headers have long #include<>d native_window.h. Now that Mesa has refreshed their header (from 2009) to something more modern this means that we need to provide android/native_window.h.

Fixes the build against Mesa 11.0, now in Wily.

Fixes: https://bugs.launchpad.net/mir/+bug/1499134

Description of the change

Re-add android/native_window.h and its dependency to 3rd_party.

Khronos' eglplatform.h headers have long #include<>d native_window.h. Now that Mesa has refreshed their header (from 2009) to something more modern this means that we need to provide android/native_window.h.

Fixes the build against Mesa 11.0, now in Wily.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Cool.

native_window.h was only recently removed in r2845 (for release in 0.16.0). However a similar fix (just the "include_directories") is still required in older branches like lp:mir/0.15 in order to find the in-tree native_window.h

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

phablet-test-run -x -s 00693fd555c9186a -v umockdev-run -- mir_performance_tests
running umockdev-run -- mir_performance_tests
initctl: unable to determine sessions
initctl: unable to determine sessions
Running main() from main.cpp
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from GLMark2Test
[ RUN ] GLMark2Test.benchmark_fullscreen_default
[1443076724.736955] mirplatform: Found graphics driver: android
[1443076724.737657] mirplatform: Found graphics driver: mesa-kms
[1443076724.738695] mirplatform: Found graphics driver: mesa-x11
[1443076724.739274] mirplatform: Found graphics driver: dummy
ERROR: Throw location unknown (consider using BOOST_THROW_EXCEPTION)
Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_6system12system_errorEEEEE
std::exception::what: bind: No such file or directory

unknown file: Failure
C++ exception with description "Failed to start server thread" thrown in SetUp().
[ FAILED ] GLMark2Test.benchmark_fullscreen_default (10062 ms)
[----------] 1 test from GLMark2Test (10062 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (10064 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] GLMark2Test.benchmark_fullscreen_default

@ "(consider using BOOST_THROW_EXCEPTION)" Weird. Looks like the exception was wrapped by boost, but not identified as such. (RTTI information from different libs not matching?)

Does glmark need an update to match mesa?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

[ RUN ] ThreadedDispatcherSignalTest.keeps_dispatching_after_signal_interruption
==3180==
==3180== FILE DESCRIPTORS: 3 open at exit.
==3180== Open file descriptor 4: /tmp/buildd/mir-0.16.0bzr2962pkg0wily13/obj-i686-linux-gnu/Testing/Temporary/LastTest.log.tmp
==3180== <inherited from parent>
==3180==
==3180== Open file descriptor 2:
==3180== <inherited from parent>
==3180==
==3180== Open file descriptor 1:
==3180== <inherited from parent>
==3180==
==3180==
==3180== HEAP SUMMARY:
==3180== in use at exit: 107,163 bytes in 830 blocks
==3180== total heap usage: 828,191 allocs, 827,361 frees, 98,223,627 bytes allocated
==3180==
==3180== LEAK SUMMARY:
==3180== definitely lost: 0 bytes in 0 blocks
==3180== indirectly lost: 0 bytes in 0 blocks
==3180== possibly lost: 3,544 bytes in 114 blocks
==3180== still reachable: 103,167 bytes in 710 blocks
==3180== suppressed: 0 bytes in 0 blocks
==3180== Reachable blocks (those to which a pointer was found) are not shown.
==3180== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==3180==
==3180== For counts of detected and suppressed errors, rerun with: -v
==3180== Use --track-origins=yes to see where uninitialised values come from
==3180== ERROR SUMMARY: 17534 errors from 16 contexts (suppressed: 1 from 1)
/tmp/buildd/mir-0.16.0bzr2962pkg0wily13/tests/unit-tests/dispatch/test_threaded_dispatcher.cpp:368: Failure
Value of: result.succeeded()
Actual: false
Expected: true
[ FAILED ] ThreadedDispatcherSignalTest.keeps_dispatching_after_signal_interruption (1014 ms)
[----------] 1 test from ThreadedDispatcherSignalTest (1017 ms total)

The same failure in:

https://jenkins.qa.ubuntu.com/job/mir-wily-i386-ci/13/console
https://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-wily-armhf/14/console
https://jenkins.qa.ubuntu.com/job/mir-wily-i386-ci/15/console
https://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-wily-armhf/16/console

Something has changed. Logged as lp:1499229

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The important fail (mir-wily-i386-ci and mir-mediumtests-builder-wily-armhf are marked non-fatal) is:

https://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-mako/6749/consoleFull

...
> creating: package_archive/archive/work/output/
> inflating: package_archive/archive/work/output/libmircookie-dev_0.16.0bzr2962pkg0wily4058+autopilot0_armhf.deb
> inflating: package_archive/archive/work/output/mir-client-platform-mesa-dev_0.16.0bzr2962pkg0wily4058+autopilot0_armhf.deb

So these are *wily* debs? On a vivid+overlay image?

...
> running mir_demo_server --test-client /usr/bin/mir_demo_client_basic
> initctl: unable to determine sessions
> initctl: unable to determine sessions
> [1443083181.507545] mirplatform: Found graphics driver: android
> [1443083181.508430] mirplatform: Found graphics driver: mesa-kms
> [1443083181.508582] mirplatform: Found graphics driver: mesa-x11
> [1443083181.509131] mirplatform: Found graphics driver: dummy
> [1443083181.513890] mirserver: Starting
> [1443083181.514775] mircommon: Loading modules from: /usr/lib/arm-linux-gnueabihf/mir/server-platform
> [1443083181.515171] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-android.so.5
> [1443083181.515294] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-mesa-kms.so.5
> [1443083181.515385] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/server-mesa-x11.so.5
> [1443083181.519473] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/input-evdev.so.2
> [1443083181.522828] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-dummy.so
> [1443083181.524689] mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/input-stub.so
> [1443083181.527313] mirplatform: Found graphics driver: android
> [1443083181.527801] mirplatform: Found graphics driver: mesa-kms
> [1443083181.527953] mirplatform: Found graphics driver: mesa-x11
> [1443083181.528228] mirplatform: Found graphics driver: dummy
> [1443083181.529234] mirserver: Selected driver: android (version 0.16.0)
> [1443083182.041171] mirserver: Initial display configuration:
> [1443083182.045442] mirserver: 0.0: LVDS 4.7" 61x102mm
> [1443083182.045686] mirserver: Current mode 768x1280 60.00Hz
> [1443083182.045778] mirserver: Preferred mode 768x1280 60.00Hz
> [1443083182.045839] mirserver: Logical position +0+0
> [1443083182.045930] mirserver: 0.1: unused DisplayPort
> ERROR: Throw location unknown (consider using BOOST_THROW_EXCEPTION)
> Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_6system12system_errorEEEEE
> std::exception::what: bind: No such file or directory

*Looks* like all clients are dying for lack of an endpoint.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Trying to reproduce (on krillin) I see another error entirely:

Running main() from main.cpp
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from GLMark2Test
[ RUN ] GLMark2Test.benchmark_fullscreen_default
[1443100994.386983] mirplatform: Found graphics driver: android
[1443100994.391768] mirplatform: Found graphics driver: mesa-kms
[1443100994.393662] mirplatform: Found graphics driver: mesa-x11
[1443100994.394339] mirplatform: Found graphics driver: dummy
Error: Requested MapBuffer VBO update method but GL_OES_mapbuffer is not supported!
Error: Requested MapBuffer VBO update method but GL_OES_mapbuffer is not supported!
Error: SceneTerrain requires Vertex Texture Fetch support, but GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS is 0
[ OK ] GLMark2Test.benchmark_fullscreen_default (311016 ms)
[----------] 1 test from GLMark2Test (311018 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (311024 ms total)
[ PASSED ] 1 test.
Segmentation fault (core dumped)

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

I thought native_window.h was included in the android-headers package, but it is not.

Maybe we should ask for it to be included there?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '3rd_party/android-deps/android/native_window.h'
2--- 3rd_party/android-deps/android/native_window.h 1970-01-01 00:00:00 +0000
3+++ 3rd_party/android-deps/android/native_window.h 2015-09-24 04:45:04 +0000
4@@ -0,0 +1,126 @@
5+/*
6+ * Copyright (C) 2010 The Android Open Source Project
7+ *
8+ * Licensed under the Apache License, Version 2.0 (the "License");
9+ * you may not use this file except in compliance with the License.
10+ * You may obtain a copy of the License at
11+ *
12+ * http://www.apache.org/licenses/LICENSE-2.0
13+ *
14+ * Unless required by applicable law or agreed to in writing, software
15+ * distributed under the License is distributed on an "AS IS" BASIS,
16+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+ * See the License for the specific language governing permissions and
18+ * limitations under the License.
19+ */
20+
21+#ifndef ANDROID_NATIVE_WINDOW_H
22+#define ANDROID_NATIVE_WINDOW_H
23+
24+#include <android/rect.h>
25+
26+#ifdef __cplusplus
27+extern "C" {
28+#endif
29+
30+/*
31+ * Pixel formats that a window can use.
32+ */
33+enum {
34+ WINDOW_FORMAT_RGBA_8888 = 1,
35+ WINDOW_FORMAT_RGBX_8888 = 2,
36+ WINDOW_FORMAT_RGB_565 = 4,
37+};
38+
39+struct ANativeWindow;
40+typedef struct ANativeWindow ANativeWindow;
41+
42+typedef struct ANativeWindow_Buffer {
43+ // The number of pixels that are show horizontally.
44+ int32_t width;
45+
46+ // The number of pixels that are shown vertically.
47+ int32_t height;
48+
49+ // The number of *pixels* that a line in the buffer takes in
50+ // memory. This may be >= width.
51+ int32_t stride;
52+
53+ // The format of the buffer. One of WINDOW_FORMAT_*
54+ int32_t format;
55+
56+ // The actual bits.
57+ void* bits;
58+
59+ // Do not touch.
60+ uint32_t reserved[6];
61+} ANativeWindow_Buffer;
62+
63+/**
64+ * Acquire a reference on the given ANativeWindow object. This prevents the object
65+ * from being deleted until the reference is removed.
66+ */
67+void ANativeWindow_acquire(ANativeWindow* window);
68+
69+/**
70+ * Remove a reference that was previously acquired with ANativeWindow_acquire().
71+ */
72+void ANativeWindow_release(ANativeWindow* window);
73+
74+/*
75+ * Return the current width in pixels of the window surface. Returns a
76+ * negative value on error.
77+ */
78+int32_t ANativeWindow_getWidth(ANativeWindow* window);
79+
80+/*
81+ * Return the current height in pixels of the window surface. Returns a
82+ * negative value on error.
83+ */
84+int32_t ANativeWindow_getHeight(ANativeWindow* window);
85+
86+/*
87+ * Return the current pixel format of the window surface. Returns a
88+ * negative value on error.
89+ */
90+int32_t ANativeWindow_getFormat(ANativeWindow* window);
91+
92+/*
93+ * Change the format and size of the window buffers.
94+ *
95+ * The width and height control the number of pixels in the buffers, not the
96+ * dimensions of the window on screen. If these are different than the
97+ * window's physical size, then it buffer will be scaled to match that size
98+ * when compositing it to the screen.
99+ *
100+ * For all of these parameters, if 0 is supplied then the window's base
101+ * value will come back in force.
102+ *
103+ * width and height must be either both zero or both non-zero.
104+ *
105+ */
106+int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window,
107+ int32_t width, int32_t height, int32_t format);
108+
109+/**
110+ * Lock the window's next drawing surface for writing.
111+ * inOutDirtyBounds is used as an in/out parameter, upon entering the
112+ * function, it contains the dirty region, that is, the region the caller
113+ * intends to redraw. When the function returns, inOutDirtyBounds is updated
114+ * with the actual area the caller needs to redraw -- this region is often
115+ * extended by ANativeWindow_lock.
116+ */
117+int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer,
118+ ARect* inOutDirtyBounds);
119+
120+/**
121+ * Unlock the window's drawing surface after previously locking it,
122+ * posting the new buffer to the display.
123+ */
124+int32_t ANativeWindow_unlockAndPost(ANativeWindow* window);
125+
126+#ifdef __cplusplus
127+};
128+#endif
129+
130+#endif // ANDROID_NATIVE_WINDOW_H
131
132=== added file '3rd_party/android-deps/android/rect.h'
133--- 3rd_party/android-deps/android/rect.h 1970-01-01 00:00:00 +0000
134+++ 3rd_party/android-deps/android/rect.h 2015-09-24 04:45:04 +0000
135@@ -0,0 +1,41 @@
136+/*
137+ * Copyright (C) 2010 The Android Open Source Project
138+ *
139+ * Licensed under the Apache License, Version 2.0 (the "License");
140+ * you may not use this file except in compliance with the License.
141+ * You may obtain a copy of the License at
142+ *
143+ * http://www.apache.org/licenses/LICENSE-2.0
144+ *
145+ * Unless required by applicable law or agreed to in writing, software
146+ * distributed under the License is distributed on an "AS IS" BASIS,
147+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
148+ * See the License for the specific language governing permissions and
149+ * limitations under the License.
150+ */
151+
152+
153+#ifndef ANDROID_RECT_H
154+#define ANDROID_RECT_H
155+
156+#include <stdint.h>
157+
158+#ifdef __cplusplus
159+extern "C" {
160+#endif
161+
162+typedef struct ARect {
163+#ifdef __cplusplus
164+ typedef int32_t value_type;
165+#endif
166+ int32_t left;
167+ int32_t top;
168+ int32_t right;
169+ int32_t bottom;
170+} ARect;
171+
172+#ifdef __cplusplus
173+};
174+#endif
175+
176+#endif // ANDROID_RECT_H
177
178=== modified file 'src/common/graphics/android/CMakeLists.txt'
179--- src/common/graphics/android/CMakeLists.txt 2015-06-17 05:20:42 +0000
180+++ src/common/graphics/android/CMakeLists.txt 2015-09-24 04:45:04 +0000
181@@ -1,4 +1,5 @@
182 include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
183+include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/android-deps)
184
185 add_definitions( -DANDROID )
186
187
188=== modified file 'src/platforms/android/client/CMakeLists.txt'
189--- src/platforms/android/client/CMakeLists.txt 2015-07-21 04:30:03 +0000
190+++ src/platforms/android/client/CMakeLists.txt 2015-09-24 04:45:04 +0000
191@@ -1,5 +1,7 @@
192 include_directories(${client_common_include_dirs})
193 include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
194+include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/android-deps)
195+
196 add_definitions(-DANDROID)
197
198 set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)
199
200=== modified file 'src/platforms/android/server/CMakeLists.txt'
201--- src/platforms/android/server/CMakeLists.txt 2015-07-21 04:30:03 +0000
202+++ src/platforms/android/server/CMakeLists.txt 2015-09-24 04:45:04 +0000
203@@ -8,6 +8,7 @@
204 ${GLESv2_INCLUDE_DIRS}
205 ${ANDROID_PROPERTIES_INCLUDE_DIRS}
206 )
207+include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/android-deps)
208
209 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
210 add_definitions( -DANDROID )

Subscribers

People subscribed via source and target branches