Mir

Merge lp:~alan-griffiths/mir/fix-1696974 into lp:mir

Proposed by Alan Griffiths on 2017-06-09
Status: Merged
Merged at revision: 4195
Proposed branch: lp:~alan-griffiths/mir/fix-1696974
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/remove-guest-platforms
Diff against target: 204 lines (+69/-3)
12 files modified
include/client/mir_toolkit/mir_connection.h (+13/-0)
src/client/mir_connection.cpp (+13/-0)
src/client/mir_connection.h (+4/-0)
src/client/mir_connection_api.cpp (+15/-0)
src/client/symbols.map (+1/-0)
src/platforms/mesa/server/kms/platform_symbols.cpp (+1/-1)
src/server/graphics/nested/host_connection.h (+1/-1)
src/server/graphics/nested/mir_client_host_connection.cpp (+15/-0)
src/server/graphics/nested/mir_client_host_connection.h (+1/-0)
src/server/graphics/nested/platform.cpp (+1/-1)
tests/include/mir/test/doubles/stub_host_connection.h (+2/-0)
tests/unit-tests/platforms/nested/test_nested_display.cpp (+2/-0)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1696974
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2017-06-09
Alberto Aguirre (community) 2017-06-09 Approve on 2017-06-09
Review via email: mp+325392@code.launchpad.net

Commit message

Enable nested platforms to pass through extensions. This enables EGL when Mir is nested on Mir-on-X (LP: #1696974)

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4194
https://mir-jenkins.ubuntu.com/job/mir-ci/3452/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4708
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4847
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4837
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4837
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4837
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4745/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4745
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4745/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3452/rebuild

review: Approve (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4195
https://mir-jenkins.ubuntu.com/job/mir-ci/3453/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4709
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4848
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4838
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4838
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4838
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4746/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4746
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4746/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3453/rebuild

review: Approve (continuous-integration)
Alberto Aguirre (albaguirre) wrote :

LGTM.

Works on my intel haswell laptop (with intel graphics) on top of Unity7.

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4196
https://mir-jenkins.ubuntu.com/job/mir-ci/3455/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4711
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4850
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4840
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4840
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4840
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4748/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4748
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4748/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3455/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/client/mir_toolkit/mir_connection.h'
2--- include/client/mir_toolkit/mir_connection.h 2017-05-25 08:58:03 +0000
3+++ include/client/mir_toolkit/mir_connection.h 2017-06-09 16:26:42 +0000
4@@ -487,6 +487,19 @@
5 */
6 unsigned mir_get_client_api_version();
7
8+/**
9+ * Enumerates the supported extensions
10+ *
11+ * \param [in] connection The connection
12+ * \param [out] context User data passed to the enumerator function
13+ * \param [in] enumerator The function to be called for each extension
14+ *
15+ */
16+void mir_connection_enumerate_extensions(
17+ MirConnection* connection,
18+ void* context,
19+ void (*enumerator)(void* context, char const* extension, int version));
20+
21 #ifdef __cplusplus
22 }
23 /**@}*/
24
25=== modified file 'src/client/mir_connection.cpp'
26--- src/client/mir_connection.cpp 2017-05-25 06:28:52 +0000
27+++ src/client/mir_connection.cpp 2017-06-09 16:26:42 +0000
28@@ -1503,3 +1503,16 @@
29 store_error_result->result.get(),
30 gp::NewCallback(&handle_structured_error, store_error_result));
31 }
32+
33+void MirConnection::enumerate_extensions(
34+ void* context,
35+ void (*enumerator)(void* context, char const* extension, int version))
36+{
37+ for(auto const& extension : extensions)
38+ {
39+ for(auto const version : extension.version)
40+ {
41+ enumerator(context, extension.name.c_str(), version);
42+ }
43+ }
44+}
45
46=== modified file 'src/client/mir_connection.h'
47--- src/client/mir_connection.h 2017-05-17 04:48:46 +0000
48+++ src/client/mir_connection.h 2017-06-09 16:26:42 +0000
49@@ -226,6 +226,10 @@
50
51 void* request_interface(char const* name, int version);
52
53+ void enumerate_extensions(
54+ void* context,
55+ void (*enumerator)(void* context, char const* extension, int version));
56+
57 private:
58 //google cant have callbacks with more than 2 args
59 struct SurfaceCreationRequest
60
61=== modified file 'src/client/mir_connection_api.cpp'
62--- src/client/mir_connection_api.cpp 2017-05-08 03:04:26 +0000
63+++ src/client/mir_connection_api.cpp 2017-06-09 16:26:42 +0000
64@@ -438,3 +438,18 @@
65 {
66 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
67 }
68+
69+void mir_connection_enumerate_extensions(
70+ MirConnection* connection,
71+ void* context,
72+ void (*enumerator)(void* context, char const* extension, int version))
73+try
74+{
75+ mir::require(mir_connection_is_valid(connection));
76+ connection->enumerate_extensions(context, enumerator);
77+}
78+catch (std::exception const& ex)
79+{
80+ MIR_LOG_UNCAUGHT_EXCEPTION(ex);
81+}
82+
83
84=== modified file 'src/client/symbols.map'
85--- src/client/symbols.map 2017-06-06 19:54:54 +0000
86+++ src/client/symbols.map 2017-06-09 16:26:42 +0000
87@@ -583,6 +583,7 @@
88 global:
89 mir_buffer_stream_get_microseconds_till_vblank;
90 mir_connection_apply_session_input_config;
91+ mir_connection_enumerate_extensions;
92 mir_connection_set_base_input_config;
93 mir_screencast_capture_to_buffer;
94 mir_screencast_capture_to_buffer_sync;
95
96=== modified file 'src/platforms/mesa/server/kms/platform_symbols.cpp'
97--- src/platforms/mesa/server/kms/platform_symbols.cpp 2017-06-09 16:26:42 +0000
98+++ src/platforms/mesa/server/kms/platform_symbols.cpp 2017-06-09 16:26:42 +0000
99@@ -275,7 +275,7 @@
100 mir::assert_entry_point_signature<mg::CreateRenderingPlatform>(&create_rendering_platform);
101
102 auto bypass_option = mgm::BypassOption::allowed;
103- if (!options->get<bool>(bypass_option_name))
104+ if (options->is_set(bypass_option_name) && !options->get<bool>(bypass_option_name))
105 bypass_option = mgm::BypassOption::prohibited;
106 return mir::make_module_ptr<mgm::GBMPlatform>(
107 bypass_option, mgm::BufferImportMethod::gbm_native_pixmap, platform_authentication);
108
109=== modified file 'src/server/graphics/nested/host_connection.h'
110--- src/server/graphics/nested/host_connection.h 2017-05-08 03:04:26 +0000
111+++ src/server/graphics/nested/host_connection.h 2017-06-09 16:26:42 +0000
112@@ -82,7 +82,7 @@
113 virtual std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) = 0;
114 virtual bool supports_passthrough(graphics::BufferUsage) = 0;
115 virtual void apply_input_configuration(MirInputConfig const* config) = 0;
116-
117+ virtual std::vector<ExtensionDescription> extensions() const = 0;
118 protected:
119 HostConnection() = default;
120 HostConnection(HostConnection const&) = delete;
121
122=== modified file 'src/server/graphics/nested/mir_client_host_connection.cpp'
123--- src/server/graphics/nested/mir_client_host_connection.cpp 2017-05-25 04:36:14 +0000
124+++ src/server/graphics/nested/mir_client_host_connection.cpp 2017-06-09 16:26:42 +0000
125@@ -709,6 +709,21 @@
126 mir_connection_apply_session_input_config(mir_connection, config);
127 }
128
129+std::vector<mir::ExtensionDescription> mgn::MirClientHostConnection::extensions() const
130+{
131+ std::vector<ExtensionDescription> result;
132+
133+ auto enumerator = [](void* context, char const* extension, int version)
134+ {
135+ auto result = static_cast<std::vector<ExtensionDescription>*>(context);
136+ result->push_back(ExtensionDescription{extension, {version}});
137+ };
138+
139+ mir_connection_enumerate_extensions(mir_connection, &result, enumerator);
140+
141+ return result;
142+}
143+
144 namespace
145 {
146 template<typename T>
147
148=== modified file 'src/server/graphics/nested/mir_client_host_connection.h'
149--- src/server/graphics/nested/mir_client_host_connection.h 2017-05-08 03:04:26 +0000
150+++ src/server/graphics/nested/mir_client_host_connection.h 2017-06-09 16:26:42 +0000
151@@ -90,6 +90,7 @@
152 std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) override;
153 bool supports_passthrough(BufferUsage usage) override;
154 void apply_input_configuration(MirInputConfig const* config) override;
155+ std::vector<ExtensionDescription> extensions() const override;
156
157 optional_value<std::shared_ptr<MesaAuthExtension>> auth_extension() override;
158 optional_value<std::shared_ptr<SetGbmExtension>> set_gbm_extension() override;
159
160=== modified file 'src/server/graphics/nested/platform.cpp'
161--- src/server/graphics/nested/platform.cpp 2017-05-31 17:56:19 +0000
162+++ src/server/graphics/nested/platform.cpp 2017-06-09 16:26:42 +0000
163@@ -175,7 +175,7 @@
164
165 std::vector<mir::ExtensionDescription> mgn::NestedDisplayPlatform::extensions() const
166 {
167- return {}; // TODO can we support extensions transitively?
168+ return connection->extensions();
169 }
170
171 mir::UniqueModulePtr<mg::PlatformAuthentication> mgn::NestedDisplayPlatform::create_platform_authentication()
172
173=== modified file 'tests/include/mir/test/doubles/stub_host_connection.h'
174--- tests/include/mir/test/doubles/stub_host_connection.h 2017-05-08 03:04:26 +0000
175+++ tests/include/mir/test/doubles/stub_host_connection.h 2017-06-09 16:26:42 +0000
176@@ -197,6 +197,7 @@
177 return {};
178 }
179 void* request_interface(char const*, int) { return nullptr; }
180+ std::vector<mir::ExtensionDescription> extensions() const { return {}; }
181 };
182
183 struct MockHostConnection : StubHostConnection
184@@ -216,6 +217,7 @@
185 if (event_callback)
186 event_callback(event, source_frame);
187 }
188+ std::vector<ExtensionDescription> extensions() const { return {}; }
189
190 MockHostConnection()
191 {
192
193=== modified file 'tests/unit-tests/platforms/nested/test_nested_display.cpp'
194--- tests/unit-tests/platforms/nested/test_nested_display.cpp 2017-05-31 17:56:19 +0000
195+++ tests/unit-tests/platforms/nested/test_nested_display.cpp 2017-06-09 16:26:42 +0000
196@@ -52,6 +52,8 @@
197 {
198 return mt::build_trivial_configuration();
199 }
200+
201+ std::vector<mir::ExtensionDescription> extensions() const { return {}; }
202 };
203
204 class MockApplyDisplayConfigHostConnection : public SingleDisplayHostConnection

Subscribers

People subscribed via source and target branches