Merge lp:~alan-griffiths/mir/fix-1696974 into lp:mir
- fix-1696974
- Merge into development-branch
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Alberto Aguirre (community) | Approve | ||
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)
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4195
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Alberto Aguirre (albaguirre) wrote : | # |
LGTM.
Works on my intel haswell laptop (with intel graphics) on top of Unity7.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:4196
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
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 | 487 | */ | 487 | */ |
6 | 488 | unsigned mir_get_client_api_version(); | 488 | unsigned mir_get_client_api_version(); |
7 | 489 | 489 | ||
8 | 490 | /** | ||
9 | 491 | * Enumerates the supported extensions | ||
10 | 492 | * | ||
11 | 493 | * \param [in] connection The connection | ||
12 | 494 | * \param [out] context User data passed to the enumerator function | ||
13 | 495 | * \param [in] enumerator The function to be called for each extension | ||
14 | 496 | * | ||
15 | 497 | */ | ||
16 | 498 | void mir_connection_enumerate_extensions( | ||
17 | 499 | MirConnection* connection, | ||
18 | 500 | void* context, | ||
19 | 501 | void (*enumerator)(void* context, char const* extension, int version)); | ||
20 | 502 | |||
21 | 490 | #ifdef __cplusplus | 503 | #ifdef __cplusplus |
22 | 491 | } | 504 | } |
23 | 492 | /**@}*/ | 505 | /**@}*/ |
24 | 493 | 506 | ||
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 | 1503 | store_error_result->result.get(), | 1503 | store_error_result->result.get(), |
30 | 1504 | gp::NewCallback(&handle_structured_error, store_error_result)); | 1504 | gp::NewCallback(&handle_structured_error, store_error_result)); |
31 | 1505 | } | 1505 | } |
32 | 1506 | |||
33 | 1507 | void MirConnection::enumerate_extensions( | ||
34 | 1508 | void* context, | ||
35 | 1509 | void (*enumerator)(void* context, char const* extension, int version)) | ||
36 | 1510 | { | ||
37 | 1511 | for(auto const& extension : extensions) | ||
38 | 1512 | { | ||
39 | 1513 | for(auto const version : extension.version) | ||
40 | 1514 | { | ||
41 | 1515 | enumerator(context, extension.name.c_str(), version); | ||
42 | 1516 | } | ||
43 | 1517 | } | ||
44 | 1518 | } | ||
45 | 1506 | 1519 | ||
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 | 226 | 226 | ||
51 | 227 | void* request_interface(char const* name, int version); | 227 | void* request_interface(char const* name, int version); |
52 | 228 | 228 | ||
53 | 229 | void enumerate_extensions( | ||
54 | 230 | void* context, | ||
55 | 231 | void (*enumerator)(void* context, char const* extension, int version)); | ||
56 | 232 | |||
57 | 229 | private: | 233 | private: |
58 | 230 | //google cant have callbacks with more than 2 args | 234 | //google cant have callbacks with more than 2 args |
59 | 231 | struct SurfaceCreationRequest | 235 | struct SurfaceCreationRequest |
60 | 232 | 236 | ||
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 | 438 | { | 438 | { |
66 | 439 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); | 439 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); |
67 | 440 | } | 440 | } |
68 | 441 | |||
69 | 442 | void mir_connection_enumerate_extensions( | ||
70 | 443 | MirConnection* connection, | ||
71 | 444 | void* context, | ||
72 | 445 | void (*enumerator)(void* context, char const* extension, int version)) | ||
73 | 446 | try | ||
74 | 447 | { | ||
75 | 448 | mir::require(mir_connection_is_valid(connection)); | ||
76 | 449 | connection->enumerate_extensions(context, enumerator); | ||
77 | 450 | } | ||
78 | 451 | catch (std::exception const& ex) | ||
79 | 452 | { | ||
80 | 453 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); | ||
81 | 454 | } | ||
82 | 455 | |||
83 | 441 | 456 | ||
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 | 583 | global: | 583 | global: |
89 | 584 | mir_buffer_stream_get_microseconds_till_vblank; | 584 | mir_buffer_stream_get_microseconds_till_vblank; |
90 | 585 | mir_connection_apply_session_input_config; | 585 | mir_connection_apply_session_input_config; |
91 | 586 | mir_connection_enumerate_extensions; | ||
92 | 586 | mir_connection_set_base_input_config; | 587 | mir_connection_set_base_input_config; |
93 | 587 | mir_screencast_capture_to_buffer; | 588 | mir_screencast_capture_to_buffer; |
94 | 588 | mir_screencast_capture_to_buffer_sync; | 589 | mir_screencast_capture_to_buffer_sync; |
95 | 589 | 590 | ||
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 | 275 | mir::assert_entry_point_signature<mg::CreateRenderingPlatform>(&create_rendering_platform); | 275 | mir::assert_entry_point_signature<mg::CreateRenderingPlatform>(&create_rendering_platform); |
101 | 276 | 276 | ||
102 | 277 | auto bypass_option = mgm::BypassOption::allowed; | 277 | auto bypass_option = mgm::BypassOption::allowed; |
104 | 278 | if (!options->get<bool>(bypass_option_name)) | 278 | if (options->is_set(bypass_option_name) && !options->get<bool>(bypass_option_name)) |
105 | 279 | bypass_option = mgm::BypassOption::prohibited; | 279 | bypass_option = mgm::BypassOption::prohibited; |
106 | 280 | return mir::make_module_ptr<mgm::GBMPlatform>( | 280 | return mir::make_module_ptr<mgm::GBMPlatform>( |
107 | 281 | bypass_option, mgm::BufferImportMethod::gbm_native_pixmap, platform_authentication); | 281 | bypass_option, mgm::BufferImportMethod::gbm_native_pixmap, platform_authentication); |
108 | 282 | 282 | ||
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 | 82 | virtual std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) = 0; | 82 | virtual std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) = 0; |
114 | 83 | virtual bool supports_passthrough(graphics::BufferUsage) = 0; | 83 | virtual bool supports_passthrough(graphics::BufferUsage) = 0; |
115 | 84 | virtual void apply_input_configuration(MirInputConfig const* config) = 0; | 84 | virtual void apply_input_configuration(MirInputConfig const* config) = 0; |
117 | 85 | 85 | virtual std::vector<ExtensionDescription> extensions() const = 0; | |
118 | 86 | protected: | 86 | protected: |
119 | 87 | HostConnection() = default; | 87 | HostConnection() = default; |
120 | 88 | HostConnection(HostConnection const&) = delete; | 88 | HostConnection(HostConnection const&) = delete; |
121 | 89 | 89 | ||
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 | 709 | mir_connection_apply_session_input_config(mir_connection, config); | 709 | mir_connection_apply_session_input_config(mir_connection, config); |
127 | 710 | } | 710 | } |
128 | 711 | 711 | ||
129 | 712 | std::vector<mir::ExtensionDescription> mgn::MirClientHostConnection::extensions() const | ||
130 | 713 | { | ||
131 | 714 | std::vector<ExtensionDescription> result; | ||
132 | 715 | |||
133 | 716 | auto enumerator = [](void* context, char const* extension, int version) | ||
134 | 717 | { | ||
135 | 718 | auto result = static_cast<std::vector<ExtensionDescription>*>(context); | ||
136 | 719 | result->push_back(ExtensionDescription{extension, {version}}); | ||
137 | 720 | }; | ||
138 | 721 | |||
139 | 722 | mir_connection_enumerate_extensions(mir_connection, &result, enumerator); | ||
140 | 723 | |||
141 | 724 | return result; | ||
142 | 725 | } | ||
143 | 726 | |||
144 | 712 | namespace | 727 | namespace |
145 | 713 | { | 728 | { |
146 | 714 | template<typename T> | 729 | template<typename T> |
147 | 715 | 730 | ||
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 | 90 | std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) override; | 90 | std::shared_ptr<NativeBuffer> create_buffer(geometry::Size, uint32_t format, uint32_t flags) override; |
153 | 91 | bool supports_passthrough(BufferUsage usage) override; | 91 | bool supports_passthrough(BufferUsage usage) override; |
154 | 92 | void apply_input_configuration(MirInputConfig const* config) override; | 92 | void apply_input_configuration(MirInputConfig const* config) override; |
155 | 93 | std::vector<ExtensionDescription> extensions() const override; | ||
156 | 93 | 94 | ||
157 | 94 | optional_value<std::shared_ptr<MesaAuthExtension>> auth_extension() override; | 95 | optional_value<std::shared_ptr<MesaAuthExtension>> auth_extension() override; |
158 | 95 | optional_value<std::shared_ptr<SetGbmExtension>> set_gbm_extension() override; | 96 | optional_value<std::shared_ptr<SetGbmExtension>> set_gbm_extension() override; |
159 | 96 | 97 | ||
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 | 175 | 175 | ||
165 | 176 | std::vector<mir::ExtensionDescription> mgn::NestedDisplayPlatform::extensions() const | 176 | std::vector<mir::ExtensionDescription> mgn::NestedDisplayPlatform::extensions() const |
166 | 177 | { | 177 | { |
168 | 178 | return {}; // TODO can we support extensions transitively? | 178 | return connection->extensions(); |
169 | 179 | } | 179 | } |
170 | 180 | 180 | ||
171 | 181 | mir::UniqueModulePtr<mg::PlatformAuthentication> mgn::NestedDisplayPlatform::create_platform_authentication() | 181 | mir::UniqueModulePtr<mg::PlatformAuthentication> mgn::NestedDisplayPlatform::create_platform_authentication() |
172 | 182 | 182 | ||
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 | 197 | return {}; | 197 | return {}; |
178 | 198 | } | 198 | } |
179 | 199 | void* request_interface(char const*, int) { return nullptr; } | 199 | void* request_interface(char const*, int) { return nullptr; } |
180 | 200 | std::vector<mir::ExtensionDescription> extensions() const { return {}; } | ||
181 | 200 | }; | 201 | }; |
182 | 201 | 202 | ||
183 | 202 | struct MockHostConnection : StubHostConnection | 203 | struct MockHostConnection : StubHostConnection |
184 | @@ -216,6 +217,7 @@ | |||
185 | 216 | if (event_callback) | 217 | if (event_callback) |
186 | 217 | event_callback(event, source_frame); | 218 | event_callback(event, source_frame); |
187 | 218 | } | 219 | } |
188 | 220 | std::vector<ExtensionDescription> extensions() const { return {}; } | ||
189 | 219 | 221 | ||
190 | 220 | MockHostConnection() | 222 | MockHostConnection() |
191 | 221 | { | 223 | { |
192 | 222 | 224 | ||
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 | 52 | { | 52 | { |
198 | 53 | return mt::build_trivial_configuration(); | 53 | return mt::build_trivial_configuration(); |
199 | 54 | } | 54 | } |
200 | 55 | |||
201 | 56 | std::vector<mir::ExtensionDescription> extensions() const { return {}; } | ||
202 | 55 | }; | 57 | }; |
203 | 56 | 58 | ||
204 | 57 | class MockApplyDisplayConfigHostConnection : public SingleDisplayHostConnection | 59 | class MockApplyDisplayConfigHostConnection : public SingleDisplayHostConnection |
PASSED: Continuous integration, rev:4194 /mir-jenkins. ubuntu. com/job/ mir-ci/ 3452/ /mir-jenkins. ubuntu. com/job/ build-mir/ 4708 /mir-jenkins. ubuntu. com/job/ build-0- fetch/4847 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= artful/ 4837 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 4837 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/4837 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= artful/ 4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= artful/ 4745/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4745/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= artful/ 4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= artful/ 4745/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial/ 4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial/ 4745/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4745/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= mesa,release= artful/ 4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= mesa,release= artful/ 4745/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= mesa,release= zesty/4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= mesa,release= zesty/4745/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 4745 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 4745/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 3452/rebuild
https:/