Merge lp:~vanvugt/mir/revert-r931 into lp:~mir-team/mir/trunk
- revert-r931
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 933 |
Proposed branch: | lp:~vanvugt/mir/revert-r931 |
Merge into: | lp:~mir-team/mir/trunk |
Diff against target: |
2098 lines (+209/-897) 43 files modified
include/client/mir_toolkit/mir_client_library.h (+0/-11) include/platform/mir/graphics/display_configuration.h (+0/-5) include/server/mir/frontend/event_sink.h (+0/-5) include/shared/mir_toolkit/client_types.h (+0/-9) include/test/mir_test/display_config_matchers.h (+28/-83) include/test/mir_test_doubles/null_event_sink.h (+0/-1) include/test/mir_test_doubles/stub_display_configuration.h (+0/-95) src/client/connection_configuration.h (+0/-2) src/client/default_connection_configuration.cpp (+1/-11) src/client/default_connection_configuration.h (+0/-2) src/client/display_configuration.cpp (+29/-95) src/client/display_configuration.h (+2/-32) src/client/mir_client_library.cpp (+2/-9) src/client/mir_connection.cpp (+5/-8) src/client/mir_connection.h (+0/-5) src/client/rpc/make_rpc_channel.h (+0/-2) src/client/rpc/make_socket_rpc_channel.cpp (+1/-2) src/client/rpc/mir_socket_rpc_channel.cpp (+2/-11) src/client/rpc/mir_socket_rpc_channel.h (+0/-3) src/server/frontend/event_sender.cpp (+10/-31) src/server/frontend/event_sender.h (+0/-7) src/server/frontend/protobuf_buffer_packer.cpp (+0/-30) src/server/frontend/protobuf_buffer_packer.h (+0/-6) src/server/frontend/session_mediator.cpp (+24/-2) src/server/graphics/android/android_display.cpp (+1/-2) src/server/graphics/gbm/real_kms_display_configuration.cpp (+2/-5) src/shared/protobuf/mir_protobuf.proto (+4/-6) tests/integration-tests/test_display_info.cpp (+51/-194) tests/mir_test_doubles/test_protobuf_client.cpp (+1/-5) tests/mir_test_framework/testing_server_options.cpp (+1/-2) tests/unit-tests/client/CMakeLists.txt (+0/-1) tests/unit-tests/client/test_client_display_conf.cpp (+0/-78) tests/unit-tests/client/test_mir_connection.cpp (+0/-6) tests/unit-tests/frontend/CMakeLists.txt (+0/-1) tests/unit-tests/frontend/stress_protobuf_communicator.cpp (+1/-5) tests/unit-tests/frontend/test_event_sender.cpp (+0/-68) tests/unit-tests/frontend/test_session_mediator.cpp (+28/-7) tests/unit-tests/frontend/test_session_mediator_gbm.cpp (+7/-3) tests/unit-tests/graphics/gbm/test_gbm_cursor.cpp (+1/-5) tests/unit-tests/graphics/gbm/test_gbm_display_configuration.cpp (+4/-18) tests/unit-tests/graphics/gbm/test_overlapping_output_grouping.cpp (+1/-3) tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+2/-16) tests/unit-tests/graphics/test_display_configuration.cpp (+1/-5) |
To merge this branch: | bzr merge lp:~vanvugt/mir/revert-r931 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Robert Ancell | Approve | ||
Chris Halse Rogers | Approve | ||
Review via email: mp+178877@code.launchpad.net |
Commit message
Revert r931. It is causing instant and widespread crashes (LP: #1209053)
Description of the change
You don't really need to review this as such. Just diff and verify it is equal to r930.
You might also want to test for the crash :)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:932
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Robert Ancell (robert-ancell) wrote : | # |
Confirmed crash in trunk, and fixed in reversion.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'include/client/mir_toolkit/mir_client_library.h' |
2 | --- include/client/mir_toolkit/mir_client_library.h 2013-08-06 16:20:23 +0000 |
3 | +++ include/client/mir_toolkit/mir_client_library.h 2013-08-07 03:18:25 +0000 |
4 | @@ -109,17 +109,6 @@ |
5 | MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection); |
6 | |
7 | /** |
8 | - * Register a callback to be called when the DisplayConfiguration changes. Once a change has occurred, |
9 | - * you can use mir_connection_create_display_config to see the new configuration |
10 | - * \param [in] connection The connection |
11 | - * \param [in] callback The function to be called when a display change occurs |
12 | - * \param [in,out] context User data passed to the callback function |
13 | - */ |
14 | -void mir_connection_set_display_config_change_callback( |
15 | - MirConnection* connection, |
16 | - mir_display_config_callback callback, void* context); |
17 | - |
18 | -/** |
19 | * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config |
20 | * \param [in] display_configuration The display_configuration information resource to be destroyed |
21 | */ |
22 | |
23 | === modified file 'include/platform/mir/graphics/display_configuration.h' |
24 | --- include/platform/mir/graphics/display_configuration.h 2013-08-06 16:20:23 +0000 |
25 | +++ include/platform/mir/graphics/display_configuration.h 2013-08-07 03:18:25 +0000 |
26 | @@ -22,7 +22,6 @@ |
27 | #include "mir/int_wrapper.h" |
28 | #include "mir/geometry/size.h" |
29 | #include "mir/geometry/point.h" |
30 | -#include "mir/geometry/pixel_format.h" |
31 | |
32 | #include <functional> |
33 | #include <vector> |
34 | @@ -62,8 +61,6 @@ |
35 | DisplayConfigurationOutputId id; |
36 | /** The id of the card the output is connected to. */ |
37 | DisplayConfigurationCardId card_id; |
38 | - /** The pixel formats supported by the output */ |
39 | - std::vector<geometry::PixelFormat> pixel_formats; |
40 | /** The modes supported by the output. */ |
41 | std::vector<DisplayConfigurationMode> modes; |
42 | /** The physical size of the output. */ |
43 | @@ -76,8 +73,6 @@ |
44 | geometry::Point top_left; |
45 | /** The index in the 'modes' vector of the current output mode. */ |
46 | size_t current_mode_index; |
47 | - /** The index in the 'pixel_format' vector of the current output pixel format. */ |
48 | - size_t current_format_index; |
49 | }; |
50 | |
51 | std::ostream& operator<<(std::ostream& out, DisplayConfigurationMode const& val); |
52 | |
53 | === modified file 'include/server/mir/frontend/event_sink.h' |
54 | --- include/server/mir/frontend/event_sink.h 2013-08-05 15:39:41 +0000 |
55 | +++ include/server/mir/frontend/event_sink.h 2013-08-07 03:18:25 +0000 |
56 | @@ -23,10 +23,6 @@ |
57 | |
58 | namespace mir |
59 | { |
60 | -namespace graphics |
61 | -{ |
62 | -class DisplayConfiguration; |
63 | -} |
64 | namespace frontend |
65 | { |
66 | class EventSink |
67 | @@ -35,7 +31,6 @@ |
68 | virtual ~EventSink() = default; |
69 | |
70 | virtual void handle_event(MirEvent const& e) = 0; |
71 | - virtual void handle_display_config_change(graphics::DisplayConfiguration const& config) = 0; |
72 | |
73 | protected: |
74 | EventSink() = default; |
75 | |
76 | === modified file 'include/shared/mir_toolkit/client_types.h' |
77 | --- include/shared/mir_toolkit/client_types.h 2013-08-01 20:44:07 +0000 |
78 | +++ include/shared/mir_toolkit/client_types.h 2013-08-07 03:18:25 +0000 |
79 | @@ -76,15 +76,6 @@ |
80 | MirSurface* surface, MirEvent const* event, void* context); |
81 | |
82 | /** |
83 | - * Callback called when a display config change has occurred |
84 | - * \param [in] connection The connection associated with the display change |
85 | - * \param [in,out] context The context provided by client |
86 | - */ |
87 | - |
88 | -typedef void (*mir_display_config_callback)( |
89 | - MirConnection* connection, void* callback); |
90 | - |
91 | -/** |
92 | * The order of components in a format enum matches the |
93 | * order of the components as they would be written in an |
94 | * integer representing a pixel value of that format. |
95 | |
96 | === modified file 'include/test/mir_test/display_config_matchers.h' |
97 | --- include/test/mir_test/display_config_matchers.h 2013-08-05 15:57:31 +0000 |
98 | +++ include/test/mir_test/display_config_matchers.h 2013-08-07 03:18:25 +0000 |
99 | @@ -19,27 +19,15 @@ |
100 | #ifndef MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_ |
101 | #define MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_ |
102 | |
103 | -#include "mir_protobuf.pb.h" |
104 | -#include "mir_toolkit/client_types.h" |
105 | -#include "mir/geometry/pixel_format.h" |
106 | #include <gmock/gmock.h> |
107 | |
108 | -//avoid a valgrind complaint by defining printer for this type |
109 | -static void PrintTo(MirDisplayConfiguration const&, ::std::ostream*) __attribute__ ((unused)); |
110 | -void PrintTo(MirDisplayConfiguration const&, ::std::ostream*) |
111 | -{ |
112 | -} |
113 | - |
114 | namespace mir |
115 | { |
116 | namespace protobuf |
117 | { |
118 | |
119 | +//avoid a valgrind complaint by defining printer for this type |
120 | class Connection; |
121 | -static void PrintTo(mir::protobuf::DisplayConfiguration const&, ::std::ostream*) __attribute__ ((unused)); |
122 | -void PrintTo(mir::protobuf::DisplayConfiguration const&, ::std::ostream*) {} |
123 | - |
124 | -static void PrintTo(mir::protobuf::Connection const&, ::std::ostream*) __attribute__ ((unused)); |
125 | void PrintTo(mir::protobuf::Connection const&, ::std::ostream*) |
126 | { |
127 | } |
128 | @@ -47,7 +35,7 @@ |
129 | } |
130 | namespace test |
131 | { |
132 | -MATCHER_P(ClientTypeConfigMatches, config, "") |
133 | +MATCHER_P2(ClientTypeConfigMatches, config, formats, "") |
134 | { |
135 | //ASSERT_ doesn't work in MATCHER_P apparently. |
136 | EXPECT_EQ(config.size(), arg->num_displays); |
137 | @@ -78,12 +66,14 @@ |
138 | EXPECT_FLOAT_EQ(mode.vrefresh_hz, arg_mode.refresh_rate); |
139 | } |
140 | |
141 | - EXPECT_EQ(info.current_format_index, arg_display.current_output_format); |
142 | - EXPECT_EQ(info.pixel_formats.size(), arg_display.num_output_formats); |
143 | - if (info.pixel_formats.size() != arg_display.num_output_formats) return false; |
144 | - for (j = 0u; j < info.pixel_formats.size(); j++) |
145 | + //TODO: display formats currently is just the formats supported by the allocator. should be |
146 | + // the formats the display can handle, once we have interfaces from mg::Display for that |
147 | + EXPECT_EQ(0u, arg_display.current_output_format); |
148 | + EXPECT_EQ(formats.size(), arg_display.num_output_formats); |
149 | + if (formats.size() != arg_display.num_output_formats) return false; |
150 | + for (j = 0u; j < formats.size(); j++) |
151 | { |
152 | - EXPECT_EQ(info.pixel_formats[j], static_cast<mir::geometry::PixelFormat>(arg_display.output_formats[j])); |
153 | + EXPECT_EQ(formats[j], static_cast<mir::geometry::PixelFormat>(arg_display.output_formats[j])); |
154 | } |
155 | } |
156 | return true; |
157 | @@ -91,7 +81,8 @@ |
158 | return false; |
159 | } |
160 | |
161 | -MATCHER_P(ProtobufConfigMatches, config, "") |
162 | + |
163 | +MATCHER_P2(ProtobufConfigMatches, config, formats, "") |
164 | { |
165 | //ASSERT_ doesn't work in MATCHER_P apparently. |
166 | EXPECT_EQ(config.size(), arg.display_output_size()); |
167 | @@ -101,19 +92,19 @@ |
168 | for (auto const& info : config) |
169 | { |
170 | auto& arg_display = arg.display_output(i++); |
171 | - EXPECT_EQ(info.connected, arg_display.connected()); |
172 | - EXPECT_EQ(info.used, arg_display.used()); |
173 | - EXPECT_EQ(info.id.as_value(), arg_display.output_id()); |
174 | - EXPECT_EQ(info.card_id.as_value(), arg_display.card_id()); |
175 | - EXPECT_EQ(info.physical_size_mm.width.as_uint32_t(), arg_display.physical_width_mm()); |
176 | - EXPECT_EQ(info.physical_size_mm.height.as_uint32_t(), arg_display.physical_height_mm()); |
177 | - EXPECT_EQ(static_cast<int>(info.top_left.x.as_uint32_t()), arg_display.position_x()); |
178 | - EXPECT_EQ(static_cast<int>(info.top_left.y.as_uint32_t()), arg_display.position_y()); |
179 | - EXPECT_EQ(info.current_mode_index, arg_display.current_mode()); |
180 | - EXPECT_EQ(info.modes.size(), arg_display.mode_size()); |
181 | - if (info.modes.size() != static_cast<unsigned int>(arg_display.mode_size())) return false; |
182 | + EXPECT_EQ(info->connected, arg_display.connected()); |
183 | + EXPECT_EQ(info->used, arg_display.used()); |
184 | + EXPECT_EQ(info->id.as_value(), arg_display.output_id()); |
185 | + EXPECT_EQ(info->card_id.as_value(), arg_display.card_id()); |
186 | + EXPECT_EQ(info->physical_size_mm.width.as_uint32_t(), arg_display.physical_width_mm()); |
187 | + EXPECT_EQ(info->physical_size_mm.height.as_uint32_t(), arg_display.physical_height_mm()); |
188 | + EXPECT_EQ(static_cast<int>(info->top_left.x.as_uint32_t()), arg_display.position_x()); |
189 | + EXPECT_EQ(static_cast<int>(info->top_left.y.as_uint32_t()), arg_display.position_y()); |
190 | + EXPECT_EQ(info->current_mode_index, arg_display.current_mode()); |
191 | + EXPECT_EQ(info->modes.size(), arg_display.mode_size()); |
192 | + if (info->modes.size() != static_cast<unsigned int>(arg_display.mode_size())) return false; |
193 | auto j = 0u; |
194 | - for (auto const& mode : info.modes) |
195 | + for (auto const& mode : info->modes) |
196 | { |
197 | auto& arg_mode = arg_display.mode(j++); |
198 | EXPECT_EQ(mode.size.width.as_uint32_t(), arg_mode.horizontal_resolution()); |
199 | @@ -121,64 +112,18 @@ |
200 | EXPECT_FLOAT_EQ(mode.vrefresh_hz, arg_mode.refresh_rate()); |
201 | } |
202 | |
203 | - EXPECT_EQ(info.current_format_index, arg_display.current_format()); |
204 | - EXPECT_EQ(info.pixel_formats.size(), arg_display.pixel_format_size()); |
205 | - if (info.pixel_formats.size() != static_cast<unsigned int>(arg_display.pixel_format_size())) return false; |
206 | - for ( j = 0u; j < info.pixel_formats.size(); j++) |
207 | + EXPECT_EQ(0u, arg_display.current_format()); |
208 | + EXPECT_EQ(formats.size(), arg_display.pixel_format_size()); |
209 | + if (formats.size() != static_cast<unsigned int>(arg_display.pixel_format_size())) return false; |
210 | + for (j=0u; j<formats.size(); j++) |
211 | { |
212 | - EXPECT_EQ(info.pixel_formats[j], static_cast<mir::geometry::PixelFormat>(arg_display.pixel_format(j))); |
213 | + EXPECT_EQ(formats[j], static_cast<mir::geometry::PixelFormat>(arg_display.pixel_format(j))); |
214 | } |
215 | } |
216 | return true;; |
217 | } |
218 | return false; |
219 | } |
220 | - |
221 | -MATCHER_P(ClientTypeMatchesProtobuf, config, "") |
222 | -{ |
223 | - //ASSERT_ doesn't work in MATCHER_P apparently. |
224 | - EXPECT_EQ(config.display_output_size(), arg.num_displays); |
225 | - if (config.display_output_size() == static_cast<int>(arg.num_displays)) |
226 | - { |
227 | - for (auto i = 0u; i < arg.num_displays; i++) |
228 | - { |
229 | - auto& conf_display = config.display_output(i); |
230 | - auto& arg_display = arg.displays[i]; |
231 | - EXPECT_EQ(conf_display.connected(), arg_display.connected); |
232 | - EXPECT_EQ(conf_display.used(), arg_display.used); |
233 | - EXPECT_EQ(conf_display.output_id(), arg_display.output_id); |
234 | - EXPECT_EQ(conf_display.card_id(), arg_display.card_id); |
235 | - EXPECT_EQ(conf_display.physical_width_mm(), arg_display.physical_width_mm); |
236 | - EXPECT_EQ(conf_display.physical_height_mm(), arg_display.physical_height_mm); |
237 | - EXPECT_EQ(conf_display.position_x(), arg_display.position_x); |
238 | - EXPECT_EQ(conf_display.position_y(), arg_display.position_y); |
239 | - |
240 | - EXPECT_EQ(conf_display.current_mode(), arg_display.current_mode); |
241 | - EXPECT_EQ(conf_display.mode_size(), arg_display.num_modes); |
242 | - if (conf_display.mode_size() != static_cast<int>(arg_display.num_modes)) return false; |
243 | - for (auto j = 0u; j < arg_display.num_modes; j++) |
244 | - { |
245 | - auto const& conf_mode = conf_display.mode(j); |
246 | - auto const& arg_mode = arg_display.modes[j]; |
247 | - EXPECT_EQ(conf_mode.horizontal_resolution(), arg_mode.horizontal_resolution); |
248 | - EXPECT_EQ(conf_mode.vertical_resolution(), arg_mode.vertical_resolution); |
249 | - EXPECT_FLOAT_EQ(conf_mode.refresh_rate(), arg_mode.refresh_rate); |
250 | - } |
251 | - |
252 | - EXPECT_EQ(conf_display.current_format(), arg_display.current_output_format); |
253 | - EXPECT_EQ(conf_display.pixel_format_size(), arg_display.num_output_formats); |
254 | - if (conf_display.pixel_format_size() != static_cast<int>(arg_display.num_output_formats)) return false; |
255 | - for (auto j = 0u; j < arg_display.num_output_formats; j++) |
256 | - { |
257 | - EXPECT_EQ(conf_display.pixel_format(j), arg_display.output_formats[j]); |
258 | - } |
259 | - } |
260 | - return true; |
261 | - } |
262 | - return false; |
263 | -} |
264 | - |
265 | - |
266 | } |
267 | } |
268 | #endif /* MIR_TEST_DISPLAY_CONFIG_MATCHERS_H_ */ |
269 | |
270 | === modified file 'include/test/mir_test_doubles/null_event_sink.h' |
271 | --- include/test/mir_test_doubles/null_event_sink.h 2013-08-05 15:39:41 +0000 |
272 | +++ include/test/mir_test_doubles/null_event_sink.h 2013-08-07 03:18:25 +0000 |
273 | @@ -29,7 +29,6 @@ |
274 | struct NullEventSink : public frontend::EventSink |
275 | { |
276 | void handle_event(MirEvent const&) {} |
277 | - void handle_display_config_change(graphics::DisplayConfiguration const&) {} |
278 | }; |
279 | } |
280 | } |
281 | |
282 | === removed file 'include/test/mir_test_doubles/stub_display_configuration.h' |
283 | --- include/test/mir_test_doubles/stub_display_configuration.h 2013-08-01 22:37:20 +0000 |
284 | +++ include/test/mir_test_doubles/stub_display_configuration.h 1970-01-01 00:00:00 +0000 |
285 | @@ -1,95 +0,0 @@ |
286 | -/* |
287 | - * Copyright © 2013 Canonical Ltd. |
288 | - * |
289 | - * This program is free software: you can redistribute it and/or modify it |
290 | - * under the terms of the GNU General Public License version 3, |
291 | - * as published by the Free Software Foundation. |
292 | - * |
293 | - * This program is distributed in the hope that it will be useful, |
294 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
295 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
296 | - * GNU General Public License for more details. |
297 | - * |
298 | - * You should have received a copy of the GNU General Public License |
299 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
300 | - * |
301 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
302 | - */ |
303 | - |
304 | -#ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_ |
305 | -#define MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_ |
306 | -#include "mir/graphics/display_configuration.h" |
307 | -#include <vector> |
308 | - |
309 | -namespace mir |
310 | -{ |
311 | -namespace test |
312 | -{ |
313 | -namespace doubles |
314 | -{ |
315 | - |
316 | -class StubDisplayConfig : public graphics::DisplayConfiguration |
317 | -{ |
318 | -public: |
319 | - StubDisplayConfig() |
320 | - { |
321 | - /* construct a non-trivial dummy display config to send */ |
322 | - int mode_index = 0; |
323 | - for (auto i = 0u; i < 3u; i++) |
324 | - { |
325 | - std::vector<graphics::DisplayConfigurationMode> modes; |
326 | - std::vector<geometry::PixelFormat> pfs{ |
327 | - geometry::PixelFormat::bgr_888, |
328 | - geometry::PixelFormat::abgr_8888, |
329 | - geometry::PixelFormat::xbgr_8888}; |
330 | - |
331 | - for (auto j = 0u; j <= i; j++) |
332 | - { |
333 | - geometry::Size sz{mode_index*4, mode_index*3}; |
334 | - graphics::DisplayConfigurationMode mode{sz, 10.0f * mode_index }; |
335 | - mode_index++; |
336 | - modes.push_back(mode); |
337 | - } |
338 | - |
339 | - size_t mode_index = modes.size() - 1; |
340 | - geometry::Size physical_size{}; |
341 | - geometry::Point top_left{}; |
342 | - graphics::DisplayConfigurationOutput output{ |
343 | - graphics::DisplayConfigurationOutputId{static_cast<int>(i)}, |
344 | - graphics::DisplayConfigurationCardId{static_cast<int>(i)}, |
345 | - pfs, modes, |
346 | - physical_size, |
347 | - ((i % 2) == 0), |
348 | - ((i % 2) == 1), |
349 | - top_left, |
350 | - mode_index, 1u |
351 | - }; |
352 | - |
353 | - outputs.push_back(output); |
354 | - } |
355 | - }; |
356 | - |
357 | - void for_each_card(std::function<void(graphics::DisplayConfigurationCard const&)>) const |
358 | - { |
359 | - } |
360 | - |
361 | - void for_each_output(std::function<void(graphics::DisplayConfigurationOutput const&)> f) const |
362 | - { |
363 | - for (auto& disp : outputs) |
364 | - { |
365 | - f(disp); |
366 | - } |
367 | - } |
368 | - |
369 | - void configure_output(graphics::DisplayConfigurationOutputId, bool, geometry::Point, size_t) |
370 | - { |
371 | - } |
372 | - |
373 | - std::vector<graphics::DisplayConfigurationOutput> outputs; |
374 | -}; |
375 | - |
376 | -} |
377 | -} |
378 | -} |
379 | - |
380 | -#endif /* MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_ */ |
381 | |
382 | === modified file 'src/client/connection_configuration.h' |
383 | --- src/client/connection_configuration.h 2013-08-02 19:12:02 +0000 |
384 | +++ src/client/connection_configuration.h 2013-08-07 03:18:25 +0000 |
385 | @@ -48,7 +48,6 @@ |
386 | class SurfaceMap; |
387 | class Logger; |
388 | class ClientPlatformFactory; |
389 | -class DisplayConfiguration; |
390 | |
391 | class ConnectionConfiguration |
392 | { |
393 | @@ -60,7 +59,6 @@ |
394 | virtual std::shared_ptr<mir::logging::Logger> the_logger() = 0; |
395 | virtual std::shared_ptr<ClientPlatformFactory> the_client_platform_factory() = 0; |
396 | virtual std::shared_ptr<input::receiver::InputPlatform> the_input_platform() = 0; |
397 | - virtual std::shared_ptr<DisplayConfiguration> the_display_configuration() = 0; |
398 | |
399 | protected: |
400 | ConnectionConfiguration() = default; |
401 | |
402 | === modified file 'src/client/default_connection_configuration.cpp' |
403 | --- src/client/default_connection_configuration.cpp 2013-08-02 21:46:57 +0000 |
404 | +++ src/client/default_connection_configuration.cpp 2013-08-07 03:18:25 +0000 |
405 | @@ -18,7 +18,6 @@ |
406 | |
407 | #include "default_connection_configuration.h" |
408 | |
409 | -#include "display_configuration.h" |
410 | #include "rpc/make_rpc_channel.h" |
411 | #include "rpc/null_rpc_report.h" |
412 | #include "mir/logging/dumb_console_logger.h" |
413 | @@ -59,7 +58,7 @@ |
414 | [this] |
415 | { |
416 | return mcl::rpc::make_rpc_channel( |
417 | - the_socket_file(), the_surface_map(), the_display_configuration(), the_rpc_report()); |
418 | + the_socket_file(), the_surface_map(), the_rpc_report()); |
419 | }); |
420 | } |
421 | |
422 | @@ -116,12 +115,3 @@ |
423 | return std::make_shared<mcl::rpc::NullRpcReport>(); |
424 | }); |
425 | } |
426 | - |
427 | -std::shared_ptr<mcl::DisplayConfiguration> mcl::DefaultConnectionConfiguration::the_display_configuration() |
428 | -{ |
429 | - return display_configuration( |
430 | - [] |
431 | - { |
432 | - return std::make_shared<mcl::DisplayConfiguration>(); |
433 | - }); |
434 | -} |
435 | |
436 | === modified file 'src/client/default_connection_configuration.h' |
437 | --- src/client/default_connection_configuration.h 2013-08-02 19:12:02 +0000 |
438 | +++ src/client/default_connection_configuration.h 2013-08-07 03:18:25 +0000 |
439 | @@ -45,7 +45,6 @@ |
440 | std::shared_ptr<mir::logging::Logger> the_logger(); |
441 | std::shared_ptr<ClientPlatformFactory> the_client_platform_factory(); |
442 | std::shared_ptr<input::receiver::InputPlatform> the_input_platform(); |
443 | - std::shared_ptr<DisplayConfiguration> the_display_configuration(); |
444 | |
445 | virtual std::string the_socket_file(); |
446 | virtual std::shared_ptr<rpc::RpcReport> the_rpc_report(); |
447 | @@ -56,7 +55,6 @@ |
448 | CachedPtr<ClientPlatformFactory> client_platform_factory; |
449 | CachedPtr<input::receiver::InputPlatform> input_platform; |
450 | CachedPtr<SurfaceMap> surface_map; |
451 | - CachedPtr<DisplayConfiguration> display_configuration; |
452 | |
453 | CachedPtr<rpc::RpcReport> rpc_report; |
454 | |
455 | |
456 | === modified file 'src/client/display_configuration.cpp' |
457 | --- src/client/display_configuration.cpp 2013-08-05 15:57:31 +0000 |
458 | +++ src/client/display_configuration.cpp 2013-08-07 03:18:25 +0000 |
459 | @@ -31,29 +31,14 @@ |
460 | for(auto i=0u; i< config->num_displays; i++) |
461 | { |
462 | if (config->displays[i].modes) |
463 | - delete[] config->displays[i].modes; |
464 | + ::operator delete(config->displays[i].modes); |
465 | if (config->displays[i].output_formats) |
466 | - delete[] config->displays[i].output_formats; |
467 | + ::operator delete(config->displays[i].output_formats); |
468 | } |
469 | if (config->displays) |
470 | - delete[] config->displays; |
471 | - |
472 | - delete config; |
473 | -} |
474 | - |
475 | -mcl::DisplayOutput::DisplayOutput(size_t num_modes_, size_t num_formats) |
476 | -{ |
477 | - num_modes = num_modes_; |
478 | - modes = new MirDisplayMode[num_modes]; |
479 | - |
480 | - num_output_formats = num_formats; |
481 | - output_formats = new MirPixelFormat[num_formats]; |
482 | -} |
483 | - |
484 | -mcl::DisplayOutput::~DisplayOutput() |
485 | -{ |
486 | - delete[] modes; |
487 | - delete[] output_formats; |
488 | + ::operator delete(config->displays); |
489 | + |
490 | + ::operator delete(config); |
491 | } |
492 | |
493 | namespace |
494 | @@ -63,7 +48,7 @@ |
495 | output.card_id = msg.card_id(); |
496 | output.output_id = msg.output_id(); |
497 | |
498 | - for (auto i = 0u; i < output.num_modes; i++) |
499 | + for(auto i=0u; i < output.num_modes; i++) |
500 | { |
501 | auto mode = msg.mode(i); |
502 | output.modes[i].horizontal_resolution = mode.horizontal_resolution(); |
503 | @@ -72,7 +57,7 @@ |
504 | } |
505 | output.current_mode = msg.current_mode(); |
506 | |
507 | - for (auto i = 0u; i < output.num_output_formats; i++) |
508 | + for(auto i=0u; i < output.num_output_formats; i++) |
509 | { |
510 | output.output_formats[i] = static_cast<MirPixelFormat>(msg.pixel_format(i)); |
511 | } |
512 | @@ -85,77 +70,26 @@ |
513 | output.physical_width_mm = msg.physical_width_mm(); |
514 | output.physical_height_mm = msg.physical_height_mm(); |
515 | } |
516 | - |
517 | -} |
518 | - |
519 | - |
520 | -mcl::DisplayConfiguration::DisplayConfiguration() |
521 | - : notify_change([]{}) |
522 | -{ |
523 | -} |
524 | - |
525 | -mcl::DisplayConfiguration::~DisplayConfiguration() |
526 | -{ |
527 | -} |
528 | - |
529 | -void mcl::DisplayConfiguration::update_configuration(mp::Connection const& connection_msg) |
530 | -{ |
531 | - std::unique_lock<std::mutex> lk(guard); |
532 | - outputs.clear(); |
533 | - for (auto i = 0; i < connection_msg.display_output_size(); i++) |
534 | - { |
535 | - auto const& msg_output = connection_msg.display_output(i); |
536 | - auto output = std::make_shared<mcl::DisplayOutput>(msg_output.mode_size(), msg_output.pixel_format_size()); |
537 | - fill_display_output(*output, msg_output); |
538 | - outputs.push_back(output); |
539 | - } |
540 | -} |
541 | - |
542 | -void mcl::DisplayConfiguration::update_configuration(mp::DisplayConfiguration const& msg) |
543 | -{ |
544 | - { |
545 | - std::unique_lock<std::mutex> lk(guard); |
546 | - outputs.clear(); |
547 | - for (auto i = 0; i < msg.display_output_size(); i++) |
548 | - { |
549 | - auto const& msg_output = msg.display_output(i); |
550 | - auto output = std::make_shared<mcl::DisplayOutput>(msg_output.mode_size(), msg_output.pixel_format_size()); |
551 | - fill_display_output(*output, msg_output); |
552 | - outputs.push_back(output); |
553 | - } |
554 | - } |
555 | - |
556 | - notify_change(); |
557 | -} |
558 | - |
559 | -//user is responsible for freeing the returned value |
560 | -MirDisplayConfiguration* mcl::DisplayConfiguration::copy_to_client() const |
561 | -{ |
562 | - std::unique_lock<std::mutex> lk(guard); |
563 | - auto new_config = new MirDisplayConfiguration; |
564 | - new_config->num_displays = outputs.size(); |
565 | - new_config->displays = new MirDisplayOutput[new_config->num_displays]; |
566 | - |
567 | - auto i=0u; |
568 | - for (auto const& out : outputs) |
569 | - { |
570 | - auto new_info = &new_config->displays[i++]; |
571 | - MirDisplayOutput* output = out.get(); |
572 | - std::memcpy(new_info, output, sizeof(MirDisplayOutput)); |
573 | - |
574 | - new_info->output_formats = new MirPixelFormat[new_info->num_output_formats]; |
575 | - auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats; |
576 | - std::memcpy(new_info->output_formats, output->output_formats, format_size); |
577 | - |
578 | - new_info->modes = new MirDisplayMode[new_info->num_modes]; |
579 | - auto mode_size = sizeof(MirDisplayMode)* new_info->num_modes; |
580 | - std::memcpy(new_info->modes, output->modes, mode_size); |
581 | - } |
582 | - return new_config; |
583 | -} |
584 | - |
585 | -void mcl::DisplayConfiguration::set_display_change_handler(std::function<void()> const& fn) |
586 | -{ |
587 | - std::unique_lock<std::mutex> lk(guard); |
588 | - notify_change = fn; |
589 | +} |
590 | + |
591 | +MirDisplayConfiguration* mcl::set_display_config_from_message(mp::Connection const& connection_msg) |
592 | +{ |
593 | + auto config = static_cast<MirDisplayConfiguration*>(::operator new(sizeof(MirDisplayConfiguration))); |
594 | + config->num_displays = connection_msg.display_output_size(); |
595 | + config->displays = static_cast<MirDisplayOutput*>(::operator new(sizeof(MirDisplayOutput) * config->num_displays)); |
596 | + |
597 | + for(auto i=0u; i < config->num_displays; i++) |
598 | + { |
599 | + auto output = connection_msg.display_output(i); |
600 | + config->displays[i].num_output_formats = output.pixel_format_size(); |
601 | + config->displays[i].output_formats = static_cast<MirPixelFormat*>( |
602 | + ::operator new(sizeof(MirPixelFormat)*config->displays[i].num_output_formats)); |
603 | + |
604 | + config->displays[i].num_modes = output.mode_size(); |
605 | + config->displays[i].modes = static_cast<MirDisplayMode*>( |
606 | + ::operator new(sizeof(MirDisplayMode)*config->displays[i].num_modes)); |
607 | + |
608 | + fill_display_output(config->displays[i], output); |
609 | + } |
610 | + return config; |
611 | } |
612 | |
613 | === modified file 'src/client/display_configuration.h' |
614 | --- src/client/display_configuration.h 2013-08-05 15:51:38 +0000 |
615 | +++ src/client/display_configuration.h 2013-08-07 03:18:25 +0000 |
616 | @@ -22,44 +22,14 @@ |
617 | #include "mir_toolkit/client_types.h" |
618 | #include "mir_protobuf.pb.h" |
619 | |
620 | -#include <mutex> |
621 | -#include <functional> |
622 | -#include <vector> |
623 | -#include <memory> |
624 | - |
625 | namespace mir |
626 | { |
627 | namespace client |
628 | { |
629 | -class DisplayOutput : public MirDisplayOutput |
630 | -{ |
631 | -public: |
632 | - DisplayOutput(size_t num_modes_, size_t num_formats); |
633 | - ~DisplayOutput(); |
634 | -}; |
635 | |
636 | -//convenient helper |
637 | +//convenient helpers |
638 | void delete_config_storage(MirDisplayConfiguration* config); |
639 | - |
640 | -class DisplayConfiguration |
641 | -{ |
642 | -public: |
643 | - DisplayConfiguration(); |
644 | - ~DisplayConfiguration(); |
645 | - |
646 | - void update_configuration(mir::protobuf::Connection const& msg); |
647 | - void update_configuration(mir::protobuf::DisplayConfiguration const& msg); |
648 | - void set_display_change_handler(std::function<void()> const&); |
649 | - |
650 | - //copying to a c POD, so kinda kludgy |
651 | - MirDisplayConfiguration* copy_to_client() const; |
652 | - |
653 | -private: |
654 | - std::mutex mutable guard; |
655 | - std::vector<std::shared_ptr<DisplayOutput>> outputs; |
656 | - std::function<void()> notify_change; |
657 | -}; |
658 | - |
659 | +MirDisplayConfiguration* set_display_config_from_message(mir::protobuf::Connection const& connection_msg); |
660 | |
661 | } |
662 | } |
663 | |
664 | === modified file 'src/client/mir_client_library.cpp' |
665 | --- src/client/mir_client_library.cpp 2013-08-06 16:20:23 +0000 |
666 | +++ src/client/mir_client_library.cpp 2013-08-07 03:18:25 +0000 |
667 | @@ -239,7 +239,7 @@ |
668 | |
669 | MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection) |
670 | { |
671 | - if (connection) |
672 | + if (connection) |
673 | return connection->create_copy_of_display_config(); |
674 | return nullptr; |
675 | } |
676 | @@ -397,17 +397,10 @@ |
677 | return surf ? surf->attrib(mir_surface_attrib_swapinterval) : -1; |
678 | } |
679 | |
680 | -void mir_connection_set_display_config_change_callback(MirConnection* connection, |
681 | - mir_display_config_callback callback, void* context) |
682 | -{ |
683 | - if (connection) |
684 | - connection->register_display_change_callback(callback, context); |
685 | -} |
686 | - |
687 | MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration) |
688 | { |
689 | if (!connection) |
690 | return NULL; |
691 | |
692 | - return connection->configure_display(display_configuration); |
693 | + return connection->configure_display(display_configuration); |
694 | } |
695 | |
696 | === modified file 'src/client/mir_connection.cpp' |
697 | --- src/client/mir_connection.cpp 2013-08-06 16:20:23 +0000 |
698 | +++ src/client/mir_connection.cpp 2013-08-07 03:18:25 +0000 |
699 | @@ -49,7 +49,6 @@ |
700 | logger(conf.the_logger()), |
701 | client_platform_factory(conf.the_client_platform_factory()), |
702 | input_platform(conf.the_input_platform()), |
703 | - display_configuration(conf.the_display_configuration()), |
704 | surface_map(conf.the_surface_map()) |
705 | { |
706 | { |
707 | @@ -157,7 +156,6 @@ |
708 | */ |
709 | platform = client_platform_factory->create_client_platform(this); |
710 | native_display = platform->create_egl_native_display(); |
711 | - display_configuration->update_configuration(connect_result); |
712 | } |
713 | |
714 | callback(this, context); |
715 | @@ -277,7 +275,11 @@ |
716 | MirDisplayConfiguration* MirConnection::create_copy_of_display_config() |
717 | { |
718 | std::lock_guard<std::recursive_mutex> lock(mutex); |
719 | - return display_configuration->copy_to_client(); |
720 | + if (!connect_result.has_error() && (connect_result.display_output_size() > 0)) |
721 | + { |
722 | + return mcl::set_display_config_from_message(connect_result); |
723 | + } |
724 | + return nullptr; |
725 | } |
726 | |
727 | void MirConnection::possible_pixel_formats(MirPixelFormat* formats, |
728 | @@ -322,11 +324,6 @@ |
729 | surface_map->insert(id, surface); |
730 | } |
731 | |
732 | -void MirConnection::register_display_change_callback(mir_display_config_callback callback, void* context) |
733 | -{ |
734 | - display_configuration->set_display_change_handler(std::bind(callback, this, context)); |
735 | -} |
736 | - |
737 | bool MirConnection::validate_user_display_config(MirDisplayConfiguration* config) |
738 | { |
739 | std::lock_guard<std::recursive_mutex> lock(mutex); |
740 | |
741 | === modified file 'src/client/mir_connection.h' |
742 | --- src/client/mir_connection.h 2013-08-06 16:20:23 +0000 |
743 | +++ src/client/mir_connection.h 2013-08-07 03:18:25 +0000 |
744 | @@ -43,7 +43,6 @@ |
745 | class ConnectionConfiguration; |
746 | class ClientPlatformFactory; |
747 | class SurfaceMap; |
748 | -class DisplayConfiguration; |
749 | |
750 | namespace rpc |
751 | { |
752 | @@ -99,8 +98,6 @@ |
753 | mir_drm_auth_magic_callback callback, |
754 | void* context); |
755 | |
756 | - void register_display_change_callback(mir_display_config_callback callback, void* context); |
757 | - |
758 | void populate(MirPlatformPackage& platform_package); |
759 | MirDisplayConfiguration* create_copy_of_display_config(); |
760 | void possible_pixel_formats(MirPixelFormat* formats, |
761 | @@ -147,8 +144,6 @@ |
762 | std::mutex release_wait_handle_guard; |
763 | std::vector<MirWaitHandle*> release_wait_handles; |
764 | |
765 | - std::shared_ptr<mir::client::DisplayConfiguration> const display_configuration; |
766 | - |
767 | std::shared_ptr<mir::client::SurfaceMap> surface_map; |
768 | static std::mutex connection_guard; |
769 | static std::unordered_set<MirConnection*> valid_connections; |
770 | |
771 | === modified file 'src/client/rpc/make_rpc_channel.h' |
772 | --- src/client/rpc/make_rpc_channel.h 2013-08-02 21:46:57 +0000 |
773 | +++ src/client/rpc/make_rpc_channel.h 2013-08-07 03:18:25 +0000 |
774 | @@ -25,7 +25,6 @@ |
775 | namespace client |
776 | { |
777 | class SurfaceMap; |
778 | -class DisplayConfiguration; |
779 | |
780 | namespace rpc |
781 | { |
782 | @@ -35,7 +34,6 @@ |
783 | std::shared_ptr<MirBasicRpcChannel> |
784 | make_rpc_channel(std::string const& name, |
785 | std::shared_ptr<SurfaceMap> const& map, |
786 | - std::shared_ptr<DisplayConfiguration> const& disp_conf, |
787 | std::shared_ptr<RpcReport> const& rpc_report); |
788 | } |
789 | } |
790 | |
791 | === modified file 'src/client/rpc/make_socket_rpc_channel.cpp' |
792 | --- src/client/rpc/make_socket_rpc_channel.cpp 2013-08-02 21:46:57 +0000 |
793 | +++ src/client/rpc/make_socket_rpc_channel.cpp 2013-08-07 03:18:25 +0000 |
794 | @@ -25,8 +25,7 @@ |
795 | std::shared_ptr<mclr::MirBasicRpcChannel> |
796 | mclr::make_rpc_channel(std::string const& name, |
797 | std::shared_ptr<mcl::SurfaceMap> const& map, |
798 | - std::shared_ptr<mcl::DisplayConfiguration> const& disp_conf, |
799 | std::shared_ptr<RpcReport> const& rpc_report) |
800 | { |
801 | - return std::make_shared<MirSocketRpcChannel>(name, map, disp_conf, rpc_report); |
802 | + return std::make_shared<MirSocketRpcChannel>(name, map, rpc_report); |
803 | } |
804 | |
805 | === modified file 'src/client/rpc/mir_socket_rpc_channel.cpp' |
806 | --- src/client/rpc/mir_socket_rpc_channel.cpp 2013-08-02 22:07:12 +0000 |
807 | +++ src/client/rpc/mir_socket_rpc_channel.cpp 2013-08-07 03:18:25 +0000 |
808 | @@ -22,7 +22,6 @@ |
809 | #include "mir/protobuf/google_protobuf_guard.h" |
810 | #include "../surface_map.h" |
811 | #include "../mir_surface.h" |
812 | -#include "../display_configuration.h" |
813 | |
814 | #include "mir_protobuf.pb.h" // For Buffer frig |
815 | #include "mir_protobuf_wire.pb.h" |
816 | @@ -46,15 +45,13 @@ |
817 | mclr::MirSocketRpcChannel::MirSocketRpcChannel( |
818 | std::string const& endpoint, |
819 | std::shared_ptr<mcl::SurfaceMap> const& surface_map, |
820 | - std::shared_ptr<DisplayConfiguration> const& disp_config, |
821 | std::shared_ptr<RpcReport> const& rpc_report) : |
822 | rpc_report(rpc_report), |
823 | pending_calls(rpc_report), |
824 | work(io_service), |
825 | endpoint(endpoint), |
826 | socket(io_service), |
827 | - surface_map(surface_map), |
828 | - display_configuration(disp_config) |
829 | + surface_map(surface_map) |
830 | { |
831 | socket.connect(endpoint); |
832 | |
833 | @@ -322,12 +319,6 @@ |
834 | mir::protobuf::EventSequence seq; |
835 | |
836 | seq.ParseFromString(event); |
837 | - |
838 | - if (seq.has_display_configuration()) |
839 | - { |
840 | - display_configuration->update_configuration(seq.display_configuration()); |
841 | - } |
842 | - |
843 | int const nevents = seq.event_size(); |
844 | for (int i = 0; i != nevents; ++i) |
845 | { |
846 | @@ -359,7 +350,7 @@ |
847 | { |
848 | rpc_report->event_parsing_failed(event); |
849 | } |
850 | - } |
851 | + } |
852 | } |
853 | } |
854 | |
855 | |
856 | === modified file 'src/client/rpc/mir_socket_rpc_channel.h' |
857 | --- src/client/rpc/mir_socket_rpc_channel.h 2013-08-02 21:46:57 +0000 |
858 | +++ src/client/rpc/mir_socket_rpc_channel.h 2013-08-07 03:18:25 +0000 |
859 | @@ -41,7 +41,6 @@ |
860 | |
861 | namespace client |
862 | { |
863 | -class DisplayConfiguration; |
864 | class SurfaceMap; |
865 | namespace rpc |
866 | { |
867 | @@ -53,7 +52,6 @@ |
868 | public: |
869 | MirSocketRpcChannel(std::string const& endpoint, |
870 | std::shared_ptr<SurfaceMap> const& surface_map, |
871 | - std::shared_ptr<DisplayConfiguration> const& disp_config, |
872 | std::shared_ptr<RpcReport> const& rpc_report); |
873 | ~MirSocketRpcChannel(); |
874 | |
875 | @@ -86,7 +84,6 @@ |
876 | mir::protobuf::wire::Result read_message_body(const size_t body_size); |
877 | |
878 | std::shared_ptr<SurfaceMap> surface_map; |
879 | - std::shared_ptr<DisplayConfiguration> display_configuration; |
880 | }; |
881 | |
882 | } |
883 | |
884 | === modified file 'src/server/frontend/event_sender.cpp' |
885 | --- src/server/frontend/event_sender.cpp 2013-08-05 15:39:41 +0000 |
886 | +++ src/server/frontend/event_sender.cpp 2013-08-07 03:18:25 +0000 |
887 | @@ -17,15 +17,11 @@ |
888 | */ |
889 | |
890 | #include "mir/frontend/client_constants.h" |
891 | -#include "mir/graphics/display_configuration.h" |
892 | #include "event_sender.h" |
893 | #include "message_sender.h" |
894 | -#include "protobuf_buffer_packer.h" |
895 | - |
896 | #include "mir_protobuf_wire.pb.h" |
897 | #include "mir_protobuf.pb.h" |
898 | |
899 | -namespace mg = mir::graphics; |
900 | namespace mfd = mir::frontend::detail; |
901 | namespace mp = mir::protobuf; |
902 | |
903 | @@ -45,32 +41,15 @@ |
904 | mp::Event *ev = seq.add_event(); |
905 | ev->set_raw(&e, sizeof(MirEvent)); |
906 | |
907 | - send_event_sequence(seq); |
908 | + std::string buffer; |
909 | + buffer.reserve(serialization_buffer_size); |
910 | + seq.SerializeToString(&buffer); |
911 | + |
912 | + mir::protobuf::wire::Result result; |
913 | + result.add_events(buffer); |
914 | + |
915 | + result.SerializeToString(&buffer); |
916 | + |
917 | + sender->send(buffer); |
918 | } |
919 | } |
920 | - |
921 | -void mfd::EventSender::handle_display_config_change(graphics::DisplayConfiguration const& display_config) |
922 | -{ |
923 | - mp::EventSequence seq; |
924 | - auto message = seq.mutable_display_configuration(); |
925 | - |
926 | - display_config.for_each_output([&message](mg::DisplayConfigurationOutput const& config) |
927 | - { |
928 | - auto disp = message->add_display_output(); |
929 | - mfd::pack_protobuf_display_output(disp, config); |
930 | - }); |
931 | - |
932 | - send_event_sequence(seq); |
933 | -} |
934 | - |
935 | -void mfd::EventSender::send_event_sequence(mp::EventSequence& seq) |
936 | -{ |
937 | - std::string send_buffer; |
938 | - send_buffer.reserve(serialization_buffer_size); |
939 | - seq.SerializeToString(&send_buffer); |
940 | - |
941 | - mir::protobuf::wire::Result result; |
942 | - result.add_events(send_buffer); |
943 | - result.SerializeToString(&send_buffer); |
944 | - sender->send(send_buffer); |
945 | -} |
946 | |
947 | === modified file 'src/server/frontend/event_sender.h' |
948 | --- src/server/frontend/event_sender.h 2013-08-05 15:39:41 +0000 |
949 | +++ src/server/frontend/event_sender.h 2013-08-07 03:18:25 +0000 |
950 | @@ -24,10 +24,6 @@ |
951 | |
952 | namespace mir |
953 | { |
954 | -namespace protobuf |
955 | -{ |
956 | -class EventSequence; |
957 | -} |
958 | namespace frontend |
959 | { |
960 | namespace detail |
961 | @@ -39,11 +35,8 @@ |
962 | public: |
963 | explicit EventSender(std::shared_ptr<MessageSender> const& socket_sender); |
964 | void handle_event(MirEvent const& e); |
965 | - void handle_display_config_change(graphics::DisplayConfiguration const& config); |
966 | |
967 | private: |
968 | - void send_event_sequence(protobuf::EventSequence&); |
969 | - |
970 | std::shared_ptr<MessageSender> const sender; |
971 | }; |
972 | |
973 | |
974 | === modified file 'src/server/frontend/protobuf_buffer_packer.cpp' |
975 | --- src/server/frontend/protobuf_buffer_packer.cpp 2013-08-02 00:01:14 +0000 |
976 | +++ src/server/frontend/protobuf_buffer_packer.cpp 2013-08-07 03:18:25 +0000 |
977 | @@ -18,38 +18,8 @@ |
978 | |
979 | #include "protobuf_buffer_packer.h" |
980 | |
981 | -#include "mir/graphics/display_configuration.h" |
982 | -#include "mir_protobuf.pb.h" |
983 | - |
984 | namespace mfd=mir::frontend::detail; |
985 | |
986 | -void mfd::pack_protobuf_display_output(protobuf::DisplayOutput* output, |
987 | - graphics::DisplayConfigurationOutput const& config) |
988 | -{ |
989 | - output->set_output_id(config.id.as_value()); |
990 | - output->set_card_id(config.card_id.as_value()); |
991 | - output->set_connected(config.connected); |
992 | - output->set_used(config.used); |
993 | - output->set_physical_width_mm(config.physical_size_mm.width.as_uint32_t()); |
994 | - output->set_physical_height_mm(config.physical_size_mm.height.as_uint32_t()); |
995 | - output->set_position_x(config.top_left.x.as_uint32_t()); |
996 | - output->set_position_y(config.top_left.y.as_uint32_t()); |
997 | - for (auto const& mode : config.modes) |
998 | - { |
999 | - auto output_mode = output->add_mode(); |
1000 | - output_mode->set_horizontal_resolution(mode.size.width.as_uint32_t()); |
1001 | - output_mode->set_vertical_resolution(mode.size.height.as_uint32_t()); |
1002 | - output_mode->set_refresh_rate(mode.vrefresh_hz); |
1003 | - } |
1004 | - output->set_current_mode(config.current_mode_index); |
1005 | - |
1006 | - for (auto const& pf : config.pixel_formats) |
1007 | - { |
1008 | - output->add_pixel_format(static_cast<uint32_t>(pf)); |
1009 | - } |
1010 | - output->set_current_format(config.current_format_index); |
1011 | -} |
1012 | - |
1013 | mfd::ProtobufBufferPacker::ProtobufBufferPacker(protobuf::Buffer* response) |
1014 | : buffer_response(response) |
1015 | { |
1016 | |
1017 | === modified file 'src/server/frontend/protobuf_buffer_packer.h' |
1018 | --- src/server/frontend/protobuf_buffer_packer.h 2013-08-04 21:52:14 +0000 |
1019 | +++ src/server/frontend/protobuf_buffer_packer.h 2013-08-07 03:18:25 +0000 |
1020 | @@ -24,17 +24,11 @@ |
1021 | |
1022 | namespace mir |
1023 | { |
1024 | -namespace graphics |
1025 | -{ |
1026 | -struct DisplayConfigurationOutput; |
1027 | -} |
1028 | namespace frontend |
1029 | { |
1030 | namespace detail |
1031 | { |
1032 | |
1033 | -void pack_protobuf_display_output(protobuf::DisplayOutput* output, graphics::DisplayConfigurationOutput const&); |
1034 | - |
1035 | class ProtobufBufferPacker : public graphics::BufferIPCPacker |
1036 | { |
1037 | public: |
1038 | |
1039 | === modified file 'src/server/frontend/session_mediator.cpp' |
1040 | --- src/server/frontend/session_mediator.cpp 2013-08-06 16:20:23 +0000 |
1041 | +++ src/server/frontend/session_mediator.cpp 2013-08-07 03:18:25 +0000 |
1042 | @@ -98,11 +98,33 @@ |
1043 | platform->add_fd(ipc_fds); |
1044 | |
1045 | auto display_config = display_changer->active_configuration(); |
1046 | - display_config->for_each_output([&response](mg::DisplayConfigurationOutput const& config) |
1047 | + auto supported_pfs = buffer_allocator->supported_pixel_formats(); |
1048 | + display_config->for_each_output([&response, &supported_pfs](mg::DisplayConfigurationOutput const& config) |
1049 | { |
1050 | auto output = response->add_display_output(); |
1051 | - mfd::pack_protobuf_display_output(output, config); |
1052 | + output->set_output_id(config.id.as_value()); |
1053 | + output->set_card_id(config.card_id.as_value()); |
1054 | + output->set_connected(config.connected); |
1055 | + output->set_used(config.used); |
1056 | + output->set_physical_width_mm(config.physical_size_mm.width.as_uint32_t()); |
1057 | + output->set_physical_height_mm(config.physical_size_mm.height.as_uint32_t()); |
1058 | + output->set_position_x(config.top_left.x.as_uint32_t()); |
1059 | + output->set_position_y(config.top_left.y.as_uint32_t()); |
1060 | + for (auto const& mode : config.modes) |
1061 | + { |
1062 | + auto output_mode = output->add_mode(); |
1063 | + output_mode->set_horizontal_resolution(mode.size.width.as_uint32_t()); |
1064 | + output_mode->set_vertical_resolution(mode.size.height.as_uint32_t()); |
1065 | + output_mode->set_refresh_rate(mode.vrefresh_hz); |
1066 | + } |
1067 | + output->set_current_mode(config.current_mode_index); |
1068 | |
1069 | + for (auto const& pf : supported_pfs) |
1070 | + { |
1071 | + output->add_pixel_format(static_cast<uint32_t>(pf)); |
1072 | + } |
1073 | + //TODO: should set the actual display format from the display, once display lets us at that info |
1074 | + output->set_current_format(0); |
1075 | }); |
1076 | |
1077 | resource_cache->save_resource(response, ipc_package); |
1078 | |
1079 | === modified file 'src/server/graphics/android/android_display.cpp' |
1080 | --- src/server/graphics/android/android_display.cpp 2013-08-06 16:20:23 +0000 |
1081 | +++ src/server/graphics/android/android_display.cpp 2013-08-07 03:18:25 +0000 |
1082 | @@ -56,13 +56,12 @@ |
1083 | AndroidDisplayConfiguration(geom::Size const& display_size) |
1084 | : configuration{mg::DisplayConfigurationOutputId{0}, |
1085 | mg::DisplayConfigurationCardId{0}, |
1086 | - {geom::PixelFormat::abgr_8888}, |
1087 | {mg::DisplayConfigurationMode{display_size,0.0f}}, |
1088 | geom::Size{0,0}, |
1089 | true, |
1090 | true, |
1091 | geom::Point{0,0}, |
1092 | - 0, 0} |
1093 | + 0} |
1094 | { |
1095 | } |
1096 | void for_each_card(std::function<void(mg::DisplayConfigurationCard const&)>) const |
1097 | |
1098 | === modified file 'src/server/graphics/gbm/real_kms_display_configuration.cpp' |
1099 | --- src/server/graphics/gbm/real_kms_display_configuration.cpp 2013-08-02 22:07:12 +0000 |
1100 | +++ src/server/graphics/gbm/real_kms_display_configuration.cpp 2013-08-07 03:18:25 +0000 |
1101 | @@ -170,9 +170,6 @@ |
1102 | bool connected{connector.connection == DRM_MODE_CONNECTED}; |
1103 | size_t current_mode_index{std::numeric_limits<size_t>::max()}; |
1104 | std::vector<DisplayConfigurationMode> modes; |
1105 | - std::vector<geom::PixelFormat> formats {geom::PixelFormat::abgr_8888, |
1106 | - geom::PixelFormat::xbgr_8888}; |
1107 | - |
1108 | drmModeModeInfo current_mode_info = drmModeModeInfo(); |
1109 | |
1110 | /* Get information about the current mode */ |
1111 | @@ -204,8 +201,8 @@ |
1112 | |
1113 | if (iter == outputs.end()) |
1114 | { |
1115 | - outputs.push_back({id, card_id, formats, modes, physical_size, |
1116 | - connected, false, geom::Point(), current_mode_index, 0u}); |
1117 | + outputs.push_back({id, card_id, modes, physical_size, |
1118 | + connected, false, geom::Point(), current_mode_index}); |
1119 | } |
1120 | else |
1121 | { |
1122 | |
1123 | === modified file 'src/shared/protobuf/mir_protobuf.proto' |
1124 | --- src/shared/protobuf/mir_protobuf.proto 2013-08-06 16:20:23 +0000 |
1125 | +++ src/shared/protobuf/mir_protobuf.proto 2013-08-07 03:18:25 +0000 |
1126 | @@ -144,17 +144,15 @@ |
1127 | optional bytes raw = 1; // MirEvent structure |
1128 | } |
1129 | |
1130 | +message EventSequence { |
1131 | + repeated Event event = 1; |
1132 | +} |
1133 | + |
1134 | message DisplayConfiguration { |
1135 | repeated DisplayOutput display_output = 1; |
1136 | optional string error = 127; |
1137 | } |
1138 | |
1139 | -message EventSequence { |
1140 | - repeated Event event = 1; |
1141 | - optional DisplayConfiguration display_configuration = 2; |
1142 | - optional string error = 127; |
1143 | -} |
1144 | - |
1145 | service DisplayServer { |
1146 | // Platform independent requests |
1147 | rpc connect(ConnectParameters) returns (Connection); |
1148 | |
1149 | === modified file 'tests/integration-tests/test_display_info.cpp' |
1150 | --- tests/integration-tests/test_display_info.cpp 2013-08-06 16:20:23 +0000 |
1151 | +++ tests/integration-tests/test_display_info.cpp 2013-08-07 03:18:25 +0000 |
1152 | @@ -17,30 +17,23 @@ |
1153 | */ |
1154 | |
1155 | #include "mir/graphics/display.h" |
1156 | +#include "mir/graphics/display_configuration.h" |
1157 | #include "mir/graphics/buffer.h" |
1158 | #include "mir/frontend/session_authorizer.h" |
1159 | #include "mir/graphics/graphic_buffer_allocator.h" |
1160 | -#include "mir/frontend/protobuf_ipc_factory.h" |
1161 | -#include "mir/frontend/resource_cache.h" |
1162 | -#include "mir/frontend/session_mediator.h" |
1163 | |
1164 | #include "mir_test_framework/display_server_test_fixture.h" |
1165 | -#include "mir_test_framework/cross_process_sync.h" |
1166 | #include "mir_test_doubles/stub_buffer.h" |
1167 | #include "mir_test_doubles/null_display.h" |
1168 | -#include "mir_test_doubles/null_event_sink.h" |
1169 | #include "mir_test_doubles/null_display_config.h" |
1170 | #include "mir_test_doubles/null_display_changer.h" |
1171 | #include "mir_test_doubles/stub_display_buffer.h" |
1172 | #include "mir_test_doubles/null_platform.h" |
1173 | #include "mir_test/display_config_matchers.h" |
1174 | -#include "mir_test_doubles/stub_display_configuration.h" |
1175 | #include "mir_test/fake_shared.h" |
1176 | |
1177 | #include "mir_toolkit/mir_client_library.h" |
1178 | |
1179 | -#include <condition_variable> |
1180 | -#include <thread> |
1181 | #include <gmock/gmock.h> |
1182 | #include <gtest/gtest.h> |
1183 | |
1184 | @@ -55,6 +48,52 @@ |
1185 | |
1186 | namespace |
1187 | { |
1188 | +class StubDisplayConfig : public mtd::NullDisplayConfig |
1189 | +{ |
1190 | +public: |
1191 | + StubDisplayConfig() |
1192 | + { |
1193 | + /* construct a non-trivial dummy display config to send */ |
1194 | + int mode_index = 0; |
1195 | + for (auto i = 0u; i < 3u; i++) |
1196 | + { |
1197 | + std::vector<mg::DisplayConfigurationMode> modes; |
1198 | + for (auto j = 0u; j <= i; j++) |
1199 | + { |
1200 | + geom::Size sz{mode_index*4, mode_index*3}; |
1201 | + mg::DisplayConfigurationMode mode{sz, 10.0f * mode_index }; |
1202 | + mode_index++; |
1203 | + modes.push_back(mode); |
1204 | + } |
1205 | + |
1206 | + size_t mode_index = modes.size() - 1; |
1207 | + geom::Size physical_size{}; |
1208 | + geom::Point top_left{}; |
1209 | + mg::DisplayConfigurationOutput output{ |
1210 | + mg::DisplayConfigurationOutputId{static_cast<int>(i)}, |
1211 | + mg::DisplayConfigurationCardId{static_cast<int>(i)}, |
1212 | + modes, |
1213 | + physical_size, |
1214 | + ((i % 2) == 0), |
1215 | + ((i % 2) == 1), |
1216 | + top_left, |
1217 | + mode_index |
1218 | + }; |
1219 | + |
1220 | + outputs.push_back(output); |
1221 | + } |
1222 | + }; |
1223 | + |
1224 | + void for_each_output(std::function<void(mg::DisplayConfigurationOutput const&)> f) const override |
1225 | + { |
1226 | + for (auto& disp : outputs) |
1227 | + { |
1228 | + f(disp); |
1229 | + } |
1230 | + } |
1231 | + |
1232 | + std::vector<mg::DisplayConfigurationOutput> outputs; |
1233 | +}; |
1234 | |
1235 | class StubDisplay : public mtd::NullDisplay |
1236 | { |
1237 | @@ -78,13 +117,10 @@ |
1238 | { |
1239 | return mt::fake_shared(stub_display_config); |
1240 | } |
1241 | - |
1242 | - static mtd::StubDisplayConfig stub_display_config; |
1243 | -private: |
1244 | - mtd::NullDisplayBuffer display_buffer; |
1245 | + static StubDisplayConfig stub_display_config; |
1246 | }; |
1247 | +StubDisplayConfig StubChanger::stub_display_config; |
1248 | |
1249 | -mtd::StubDisplayConfig StubChanger::stub_display_config; |
1250 | |
1251 | char const* const mir_test_socket = mtf::test_socket_file().c_str(); |
1252 | |
1253 | @@ -173,7 +209,8 @@ |
1254 | auto connection = mir_connect_sync(mir_test_socket, __PRETTY_FUNCTION__); |
1255 | auto configuration = mir_connection_create_display_config(connection); |
1256 | |
1257 | - EXPECT_THAT(configuration, mt::ClientTypeConfigMatches(StubChanger::stub_display_config.outputs)); |
1258 | + EXPECT_THAT(configuration, mt::ClientTypeConfigMatches(StubChanger::stub_display_config.outputs, |
1259 | + StubGraphicBufferAllocator::pixel_formats)); |
1260 | |
1261 | mir_display_config_destroy(configuration); |
1262 | mir_connection_release(connection); |
1263 | @@ -290,183 +327,3 @@ |
1264 | |
1265 | launch_client_process(client_config); |
1266 | } |
1267 | - |
1268 | - |
1269 | -namespace |
1270 | -{ |
1271 | -class EventSinkSkimmingIpcFactory : public mf::ProtobufIpcFactory |
1272 | -{ |
1273 | -public: |
1274 | - EventSinkSkimmingIpcFactory( |
1275 | - std::shared_ptr<mf::Shell> const& shell, |
1276 | - std::shared_ptr<mf::SessionMediatorReport> const& sm_report, |
1277 | - std::shared_ptr<mf::MessageProcessorReport> const& mr_report, |
1278 | - std::shared_ptr<mg::Platform> const& graphics_platform, |
1279 | - std::shared_ptr<msh::DisplayChanger> const& graphics_changer, |
1280 | - std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator) |
1281 | - : shell(shell), |
1282 | - sm_report(sm_report), |
1283 | - mp_report(mr_report), |
1284 | - cache(std::make_shared<mf::ResourceCache>()), |
1285 | - graphics_platform(graphics_platform), |
1286 | - graphics_changer(graphics_changer), |
1287 | - buffer_allocator(buffer_allocator), |
1288 | - last_event_sink(std::make_shared<mtd::NullEventSink>()) |
1289 | - { |
1290 | - } |
1291 | - |
1292 | - std::shared_ptr<mf::EventSink> last_clients_event_sink() |
1293 | - { |
1294 | - return std::move(last_event_sink); |
1295 | - } |
1296 | - |
1297 | -private: |
1298 | - std::shared_ptr<mf::Shell> shell; |
1299 | - std::shared_ptr<mf::SessionMediatorReport> const sm_report; |
1300 | - std::shared_ptr<mf::MessageProcessorReport> const mp_report; |
1301 | - std::shared_ptr<mf::ResourceCache> const cache; |
1302 | - std::shared_ptr<mg::Platform> const graphics_platform; |
1303 | - std::shared_ptr<msh::DisplayChanger> const graphics_changer; |
1304 | - std::shared_ptr<mg::GraphicBufferAllocator> const buffer_allocator; |
1305 | - std::shared_ptr<mf::EventSink> last_event_sink; |
1306 | - |
1307 | - virtual std::shared_ptr<mir::protobuf::DisplayServer> make_ipc_server( |
1308 | - std::shared_ptr<mf::EventSink> const& sink, bool) |
1309 | - { |
1310 | - last_event_sink = sink; |
1311 | - return std::make_shared<mf::SessionMediator>( |
1312 | - shell, |
1313 | - graphics_platform, |
1314 | - graphics_changer, |
1315 | - buffer_allocator, |
1316 | - sm_report, |
1317 | - sink, |
1318 | - resource_cache()); |
1319 | - } |
1320 | - |
1321 | - virtual std::shared_ptr<mf::ResourceCache> resource_cache() |
1322 | - { |
1323 | - return cache; |
1324 | - } |
1325 | - |
1326 | - virtual std::shared_ptr<mf::MessageProcessorReport> report() |
1327 | - { |
1328 | - return mp_report; |
1329 | - } |
1330 | - |
1331 | -}; |
1332 | - |
1333 | -} |
1334 | - |
1335 | -TEST_F(BespokeDisplayServerTestFixture, display_change_notification) |
1336 | -{ |
1337 | - mtf::CrossProcessSync client_ready_fence; |
1338 | - mtf::CrossProcessSync send_event_fence; |
1339 | - |
1340 | - struct ServerConfig : TestingServerConfiguration |
1341 | - { |
1342 | - ServerConfig(mtf::CrossProcessSync const& send_event_fence) |
1343 | - : send_event_fence(send_event_fence) |
1344 | - { |
1345 | - } |
1346 | - |
1347 | - std::shared_ptr<mg::Platform> the_graphics_platform() override |
1348 | - { |
1349 | - if (!platform) |
1350 | - platform = std::make_shared<StubPlatform>(); |
1351 | - return platform; |
1352 | - } |
1353 | - |
1354 | - std::shared_ptr<mir::frontend::ProtobufIpcFactory> the_ipc_factory( |
1355 | - std::shared_ptr<mf::Shell> const& shell, |
1356 | - std::shared_ptr<mg::GraphicBufferAllocator> const& allocator) override |
1357 | - { |
1358 | - if (!ipc_factory) |
1359 | - { |
1360 | - ipc_factory = std::make_shared<EventSinkSkimmingIpcFactory>( |
1361 | - shell, |
1362 | - the_session_mediator_report(), |
1363 | - the_message_processor_report(), |
1364 | - the_graphics_platform(), |
1365 | - the_shell_display_changer(), allocator); |
1366 | - } |
1367 | - return ipc_factory; |
1368 | - } |
1369 | - |
1370 | - void exec() override |
1371 | - { |
1372 | - change_thread = std::move(std::thread([this](){ |
1373 | - send_event_fence.wait_for_signal_ready_for(std::chrono::milliseconds(1000)); |
1374 | - auto notifier = ipc_factory->last_clients_event_sink(); |
1375 | - notifier->handle_display_config_change(StubChanger::stub_display_config); |
1376 | - })); |
1377 | - } |
1378 | - |
1379 | - void on_exit() override |
1380 | - { |
1381 | - change_thread.join(); |
1382 | - } |
1383 | - |
1384 | - mtf::CrossProcessSync send_event_fence; |
1385 | - std::shared_ptr<EventSinkSkimmingIpcFactory> ipc_factory; |
1386 | - std::shared_ptr<StubPlatform> platform; |
1387 | - std::thread change_thread; |
1388 | - } server_config(send_event_fence); |
1389 | - |
1390 | - struct Client : TestingClientConfiguration |
1391 | - { |
1392 | - Client(mtf::CrossProcessSync const& client_ready_fence) |
1393 | - : client_ready_fence(client_ready_fence) |
1394 | - { |
1395 | - } |
1396 | - |
1397 | - static void change_handler(MirConnection* connection, void* context) |
1398 | - { |
1399 | - auto configuration = mir_connection_create_display_config(connection); |
1400 | - |
1401 | - EXPECT_THAT(configuration, mt::ClientTypeConfigMatches(StubChanger::stub_display_config.outputs)); |
1402 | - mir_display_config_destroy(configuration); |
1403 | - |
1404 | - auto client_config = (Client*) context; |
1405 | - client_config->notify_callback(); |
1406 | - } |
1407 | - |
1408 | - void notify_callback() |
1409 | - { |
1410 | - callback_called = true; |
1411 | - callback_wait.notify_all(); |
1412 | - } |
1413 | - void exec() |
1414 | - { |
1415 | - std::unique_lock<std::mutex> lk(mut); |
1416 | - MirConnection* connection = mir_connect_sync(mir_test_socket, "notifier"); |
1417 | - callback_called = false; |
1418 | - |
1419 | - mir_connection_set_display_config_change_callback(connection, &change_handler, this); |
1420 | - |
1421 | - client_ready_fence.try_signal_ready_for(std::chrono::milliseconds(1000)); |
1422 | - |
1423 | - while(!callback_called) |
1424 | - { |
1425 | - callback_wait.wait(lk); |
1426 | - } |
1427 | - |
1428 | - mir_connection_release(connection); |
1429 | - } |
1430 | - |
1431 | - mtf::CrossProcessSync client_ready_fence; |
1432 | - |
1433 | - std::mutex mut; |
1434 | - std::condition_variable callback_wait; |
1435 | - bool callback_called; |
1436 | - } client_config(client_ready_fence); |
1437 | - |
1438 | - launch_server_process(server_config); |
1439 | - launch_client_process(client_config); |
1440 | - |
1441 | - run_in_test_process([&] |
1442 | - { |
1443 | - client_ready_fence.wait_for_signal_ready_for(std::chrono::milliseconds(1000)); |
1444 | - send_event_fence.try_signal_ready_for(std::chrono::milliseconds(1000)); |
1445 | - }); |
1446 | -} |
1447 | |
1448 | === modified file 'tests/mir_test_doubles/test_protobuf_client.cpp' |
1449 | --- tests/mir_test_doubles/test_protobuf_client.cpp 2013-08-06 16:20:23 +0000 |
1450 | +++ tests/mir_test_doubles/test_protobuf_client.cpp 2013-08-07 03:18:25 +0000 |
1451 | @@ -20,7 +20,6 @@ |
1452 | #include "mir_test_doubles/mock_rpc_report.h" |
1453 | |
1454 | #include "src/client/connection_surface_map.h" |
1455 | -#include "src/client/display_configuration.h" |
1456 | #include "src/client/rpc/make_rpc_channel.h" |
1457 | #include "src/client/rpc/mir_basic_rpc_channel.h" |
1458 | |
1459 | @@ -33,10 +32,7 @@ |
1460 | int timeout_ms) : |
1461 | rpc_report(std::make_shared<testing::NiceMock<doubles::MockRpcReport>>()), |
1462 | channel(mir::client::rpc::make_rpc_channel( |
1463 | - socket_file, |
1464 | - std::make_shared<mir::client::ConnectionSurfaceMap>(), |
1465 | - std::make_shared<mir::client::DisplayConfiguration>(), |
1466 | - rpc_report)), |
1467 | + socket_file,std::make_shared<mir::client::ConnectionSurfaceMap>(),rpc_report)), |
1468 | display_server(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), |
1469 | maxwait(timeout_ms), |
1470 | connect_done_called(false), |
1471 | |
1472 | === modified file 'tests/mir_test_framework/testing_server_options.cpp' |
1473 | --- tests/mir_test_framework/testing_server_options.cpp 2013-08-06 16:20:23 +0000 |
1474 | +++ tests/mir_test_framework/testing_server_options.cpp 2013-08-07 03:18:25 +0000 |
1475 | @@ -79,8 +79,7 @@ |
1476 | { |
1477 | mg::DisplayConfigurationOutput dummy_output_config{ |
1478 | mg::DisplayConfigurationOutputId{0}, mg::DisplayConfigurationCardId{0}, |
1479 | - std::vector<geom::PixelFormat>{geom::PixelFormat::abgr_8888}, |
1480 | - modes, geom::Size{}, true, true, geom::Point{0,0}, 0, 0}; |
1481 | + modes, geom::Size{}, true, true, geom::Point{0,0}, 0}; |
1482 | |
1483 | f(dummy_output_config); |
1484 | } |
1485 | |
1486 | === modified file 'tests/unit-tests/client/CMakeLists.txt' |
1487 | --- tests/unit-tests/client/CMakeLists.txt 2013-08-02 19:12:02 +0000 |
1488 | +++ tests/unit-tests/client/CMakeLists.txt 2013-08-07 03:18:25 +0000 |
1489 | @@ -6,7 +6,6 @@ |
1490 | ${CMAKE_CURRENT_SOURCE_DIR}/test_client_mir_surface.cpp |
1491 | ${CMAKE_CURRENT_SOURCE_DIR}/test_mir_connection.cpp |
1492 | ${CMAKE_CURRENT_SOURCE_DIR}/test_wait_handle.cpp |
1493 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_client_display_conf.cpp |
1494 | ) |
1495 | |
1496 | if(MIR_PLATFORM STREQUAL "android") |
1497 | |
1498 | === removed file 'tests/unit-tests/client/test_client_display_conf.cpp' |
1499 | --- tests/unit-tests/client/test_client_display_conf.cpp 2013-08-04 22:24:19 +0000 |
1500 | +++ tests/unit-tests/client/test_client_display_conf.cpp 1970-01-01 00:00:00 +0000 |
1501 | @@ -1,78 +0,0 @@ |
1502 | -/* |
1503 | - * Copyright © 2013 Canonical Ltd. |
1504 | - * |
1505 | - * This program is free software: you can redistribute it and/or modify |
1506 | - * it under the terms of the GNU General Public License version 3 as |
1507 | - * published by the Free Software Foundation. |
1508 | - * |
1509 | - * This program is distributed in the hope that it will be useful, |
1510 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1511 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1512 | - * GNU General Public License for more details. |
1513 | - * |
1514 | - * You should have received a copy of the GNU General Public License |
1515 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1516 | - * |
1517 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1518 | - */ |
1519 | - |
1520 | -#include "src/client/display_configuration.h" |
1521 | - |
1522 | -#include "mir_test/display_config_matchers.h" |
1523 | -#include "gtest/gtest.h" |
1524 | - |
1525 | -namespace mp = mir::protobuf; |
1526 | -namespace mcl = mir::client; |
1527 | -namespace mt = mir::test; |
1528 | - |
1529 | -namespace |
1530 | -{ |
1531 | -void fill(mp::DisplayOutput* out) |
1532 | -{ |
1533 | - out->add_pixel_format(4); |
1534 | - out->set_current_format(45); |
1535 | - auto mode = out->add_mode(); |
1536 | - mode->set_horizontal_resolution(4); |
1537 | - mode->set_vertical_resolution(558); |
1538 | - mode->set_refresh_rate(4.33f); |
1539 | - out->set_current_mode(0); |
1540 | - out->set_position_x(5); |
1541 | - out->set_position_y(6); |
1542 | - out->set_card_id(7); |
1543 | - out->set_output_id(8); |
1544 | - out->set_connected(1); |
1545 | - out->set_used(1); |
1546 | - out->set_physical_width_mm(11); |
1547 | - out->set_physical_height_mm(12); |
1548 | -} |
1549 | -} |
1550 | - |
1551 | -TEST(TestDisplayConfiguration, configuration_storage) |
1552 | -{ |
1553 | - mp::Connection connect_result; |
1554 | - fill(connect_result.add_display_output()); |
1555 | - fill(connect_result.add_display_output()); |
1556 | - |
1557 | - mcl::DisplayConfiguration internal_config; |
1558 | - |
1559 | - internal_config.update_configuration(connect_result); |
1560 | - MirDisplayConfiguration *info; |
1561 | - info = internal_config.copy_to_client(); |
1562 | - |
1563 | - EXPECT_THAT(*info, mt::ClientTypeMatchesProtobuf(connect_result)); |
1564 | - mcl::delete_config_storage(info); |
1565 | - |
1566 | - int called_count = 0u; |
1567 | - internal_config.set_display_change_handler([&]() { called_count++; }); |
1568 | - |
1569 | - mp::DisplayConfiguration new_result; |
1570 | - fill(new_result.add_display_output()); |
1571 | - |
1572 | - internal_config.update_configuration(new_result); |
1573 | - |
1574 | - info = internal_config.copy_to_client(); |
1575 | - EXPECT_THAT(*info, mt::ClientTypeMatchesProtobuf(new_result)); |
1576 | - EXPECT_EQ(1u, called_count); |
1577 | - |
1578 | - mcl::delete_config_storage(info); |
1579 | -} |
1580 | |
1581 | === modified file 'tests/unit-tests/client/test_mir_connection.cpp' |
1582 | --- tests/unit-tests/client/test_mir_connection.cpp 2013-08-06 16:20:23 +0000 |
1583 | +++ tests/unit-tests/client/test_mir_connection.cpp 2013-08-07 03:18:25 +0000 |
1584 | @@ -124,7 +124,6 @@ |
1585 | std::shared_ptr<mcl::ClientPlatform> const& platform, |
1586 | std::shared_ptr<mcl::rpc::MirBasicRpcChannel> const& channel) |
1587 | : DefaultConnectionConfiguration(""), |
1588 | - disp_config(std::make_shared<mcl::DisplayConfiguration>()), |
1589 | platform{platform}, |
1590 | channel{channel} |
1591 | { |
1592 | @@ -140,12 +139,7 @@ |
1593 | return std::make_shared<StubClientPlatformFactory>(platform); |
1594 | } |
1595 | |
1596 | - std::shared_ptr<mcl::DisplayConfiguration> the_display_configuration() override |
1597 | - { |
1598 | - return disp_config; |
1599 | - } |
1600 | private: |
1601 | - std::shared_ptr<mcl::DisplayConfiguration> disp_config; |
1602 | std::shared_ptr<mcl::ClientPlatform> const platform; |
1603 | std::shared_ptr<mcl::rpc::MirBasicRpcChannel> const channel; |
1604 | }; |
1605 | |
1606 | === modified file 'tests/unit-tests/frontend/CMakeLists.txt' |
1607 | --- tests/unit-tests/frontend/CMakeLists.txt 2013-08-06 16:20:23 +0000 |
1608 | +++ tests/unit-tests/frontend/CMakeLists.txt 2013-08-07 03:18:25 +0000 |
1609 | @@ -8,7 +8,6 @@ |
1610 | ${CMAKE_CURRENT_SOURCE_DIR}/test_resource_cache.cpp |
1611 | ${CMAKE_CURRENT_SOURCE_DIR}/test_session_mediator.cpp |
1612 | ${CMAKE_CURRENT_SOURCE_DIR}/test_socket_session.cpp |
1613 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_event_sender.cpp |
1614 | ) |
1615 | |
1616 | # TODO this test is a mess - something better is needed. |
1617 | |
1618 | === modified file 'tests/unit-tests/frontend/stress_protobuf_communicator.cpp' |
1619 | --- tests/unit-tests/frontend/stress_protobuf_communicator.cpp 2013-08-02 21:46:57 +0000 |
1620 | +++ tests/unit-tests/frontend/stress_protobuf_communicator.cpp 2013-08-07 03:18:25 +0000 |
1621 | @@ -26,7 +26,6 @@ |
1622 | #include "mir_test/test_protobuf_server.h" |
1623 | |
1624 | #include "src/client/connection_surface_map.h" |
1625 | -#include "src/client/display_configuration.h" |
1626 | #include "src/client/rpc/null_rpc_report.h" |
1627 | #include "src/client/rpc/make_rpc_channel.h" |
1628 | #include "src/client/rpc/mir_basic_rpc_channel.h" |
1629 | @@ -173,10 +172,7 @@ |
1630 | int timeout_ms) : |
1631 | rpc_report(std::make_shared<mir::client::rpc::NullRpcReport>()), |
1632 | channel(mir::client::rpc::make_rpc_channel( |
1633 | - socket_file, |
1634 | - std::make_shared<mir::client::ConnectionSurfaceMap>(), |
1635 | - std::make_shared<mir::client::DisplayConfiguration>(), |
1636 | - rpc_report)), |
1637 | + socket_file, std::make_shared<mir::client::ConnectionSurfaceMap>(), rpc_report)), |
1638 | display_server(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), |
1639 | maxwait(timeout_ms), |
1640 | connect_done_called(false), |
1641 | |
1642 | === removed file 'tests/unit-tests/frontend/test_event_sender.cpp' |
1643 | --- tests/unit-tests/frontend/test_event_sender.cpp 2013-08-05 15:39:41 +0000 |
1644 | +++ tests/unit-tests/frontend/test_event_sender.cpp 1970-01-01 00:00:00 +0000 |
1645 | @@ -1,68 +0,0 @@ |
1646 | -/* |
1647 | - * Copyright © 2013 Canonical Ltd. |
1648 | - * |
1649 | - * This program is free software: you can redistribute it and/or modify |
1650 | - * it under the terms of the GNU General Public License version 3 as |
1651 | - * published by the Free Software Foundation. |
1652 | - * |
1653 | - * This program is distributed in the hope that it will be useful, |
1654 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1655 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1656 | - * GNU General Public License for more details. |
1657 | - * |
1658 | - * You should have received a copy of the GNU General Public License |
1659 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1660 | - * |
1661 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1662 | - */ |
1663 | - |
1664 | -#include "src/server/frontend/message_sender.h" |
1665 | -#include "src/server/frontend/event_sender.h" |
1666 | -#include "mir_test_doubles/stub_display_configuration.h" |
1667 | -#include "mir_test/display_config_matchers.h" |
1668 | -#include "mir_test/fake_shared.h" |
1669 | - |
1670 | -#include <vector> |
1671 | -#include "mir_protobuf.pb.h" |
1672 | -#include "mir_protobuf_wire.pb.h" |
1673 | -#include <gtest/gtest.h> |
1674 | -#include <gmock/gmock.h> |
1675 | - |
1676 | -namespace mt=mir::test; |
1677 | -namespace mtd=mir::test::doubles; |
1678 | -namespace mfd=mir::frontend::detail; |
1679 | -namespace geom=mir::geometry; |
1680 | - |
1681 | -namespace |
1682 | -{ |
1683 | -struct MockMsgSender : public mfd::MessageSender |
1684 | -{ |
1685 | - MOCK_METHOD1(send, void(std::string const&)); |
1686 | - MOCK_METHOD1(send_fds, void(std::vector<int32_t> const&)); |
1687 | -}; |
1688 | -} |
1689 | - |
1690 | -TEST(TestEventSender, display_send) |
1691 | -{ |
1692 | - using namespace testing; |
1693 | - |
1694 | - mtd::StubDisplayConfig config; |
1695 | - MockMsgSender mock_msg_sender; |
1696 | - |
1697 | - auto msg_validator = [&config](std::string const& msg){ |
1698 | - mir::protobuf::wire::Result wire; |
1699 | - wire.ParseFromString(msg); |
1700 | - std::string str = wire.events(0); |
1701 | - mir::protobuf::EventSequence seq; |
1702 | - seq.ParseFromString(str); |
1703 | - EXPECT_THAT(seq.display_configuration(), mt::ProtobufConfigMatches(config.outputs)); |
1704 | - }; |
1705 | - |
1706 | - EXPECT_CALL(mock_msg_sender, send(_)) |
1707 | - .Times(1) |
1708 | - .WillOnce(Invoke(msg_validator)); |
1709 | - |
1710 | - mfd::EventSender sender(mt::fake_shared(mock_msg_sender)); |
1711 | - |
1712 | - sender.handle_display_config_change(config); |
1713 | -} |
1714 | |
1715 | === modified file 'tests/unit-tests/frontend/test_session_mediator.cpp' |
1716 | --- tests/unit-tests/frontend/test_session_mediator.cpp 2013-08-06 16:20:23 +0000 |
1717 | +++ tests/unit-tests/frontend/test_session_mediator.cpp 2013-08-07 03:18:25 +0000 |
1718 | @@ -30,7 +30,6 @@ |
1719 | #include "mir_test_doubles/mock_display.h" |
1720 | #include "mir_test_doubles/mock_display_changer.h" |
1721 | #include "mir_test_doubles/null_display.h" |
1722 | -#include "mir_test_doubles/null_event_sink.h" |
1723 | #include "mir_test_doubles/null_display_changer.h" |
1724 | #include "mir_test_doubles/mock_display.h" |
1725 | #include "mir_test_doubles/mock_shell.h" |
1726 | @@ -38,7 +37,6 @@ |
1727 | #include "mir_test_doubles/mock_buffer.h" |
1728 | #include "mir_test_doubles/stub_session.h" |
1729 | #include "mir_test_doubles/stub_surface_builder.h" |
1730 | -#include "mir_test_doubles/stub_display_configuration.h" |
1731 | #include "mir_test/display_config_matchers.h" |
1732 | #include "mir_test/fake_shared.h" |
1733 | #include "mir/frontend/event_sink.h" |
1734 | @@ -162,6 +160,12 @@ |
1735 | std::shared_ptr<mg::Buffer> const&)); |
1736 | }; |
1737 | |
1738 | +class NullEventSink : public mir::frontend::EventSink |
1739 | +{ |
1740 | +public: |
1741 | + void handle_event(MirEvent const& ) override {} |
1742 | +}; |
1743 | + |
1744 | struct SessionMediatorTest : public ::testing::Test |
1745 | { |
1746 | SessionMediatorTest() |
1747 | @@ -173,7 +177,7 @@ |
1748 | resource_cache{std::make_shared<mf::ResourceCache>()}, |
1749 | mediator{shell, graphics_platform, graphics_changer, |
1750 | buffer_allocator, report, |
1751 | - std::make_shared<mtd::NullEventSink>(), |
1752 | + std::make_shared<NullEventSink>(), |
1753 | resource_cache}, |
1754 | stubbed_session{std::make_shared<StubbedSession>()}, |
1755 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} |
1756 | @@ -329,8 +333,15 @@ |
1757 | { |
1758 | using namespace testing; |
1759 | geom::Size sz{1022, 2411}; |
1760 | + |
1761 | + std::vector<mg::DisplayConfigurationMode> modes{{sz, 344.0f},{sz, 234.0f}}; |
1762 | + mg::DisplayConfigurationOutput output{ |
1763 | + mg::DisplayConfigurationOutputId{static_cast<int>(3)}, |
1764 | + mg::DisplayConfigurationCardId{static_cast<int>(2)}, |
1765 | + modes, sz, true, false, |
1766 | + geom::Point{4,12}, 0u}; |
1767 | |
1768 | - mtd::StubDisplayConfig config; |
1769 | + StubConfig config(mt::fake_shared(output)); |
1770 | |
1771 | auto mock_display = std::make_shared<mtd::MockDisplayChanger>(); |
1772 | EXPECT_CALL(*mock_display, active_configuration()) |
1773 | @@ -339,7 +350,7 @@ |
1774 | mf::SessionMediator mediator( |
1775 | shell, graphics_platform, mock_display, |
1776 | buffer_allocator, report, |
1777 | - std::make_shared<mtd::NullEventSink>(), |
1778 | + std::make_shared<NullEventSink>(), |
1779 | resource_cache); |
1780 | |
1781 | mp::ConnectParameters connect_parameters; |
1782 | @@ -348,9 +359,19 @@ |
1783 | connection.clear_display_info(); |
1784 | connection.clear_display_output(); |
1785 | |
1786 | + std::vector<geom::PixelFormat> const pixel_formats{ |
1787 | + geom::PixelFormat::bgr_888, |
1788 | + geom::PixelFormat::abgr_8888, |
1789 | + geom::PixelFormat::xbgr_8888 |
1790 | + }; |
1791 | + |
1792 | + EXPECT_CALL(*buffer_allocator, supported_pixel_formats()) |
1793 | + .WillOnce(Return(pixel_formats)); |
1794 | + |
1795 | + |
1796 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); |
1797 | |
1798 | - EXPECT_THAT(connection, mt::ProtobufConfigMatches(config.outputs)); |
1799 | + EXPECT_THAT(connection, mt::ProtobufConfigMatches(config.outputs, pixel_formats)); |
1800 | } |
1801 | |
1802 | TEST_F(SessionMediatorTest, creating_surface_packs_response_with_input_fds) |
1803 | @@ -490,7 +511,7 @@ |
1804 | |
1805 | mf::SessionMediator session_mediator{ |
1806 | shell, graphics_platform, mock_display_selector, |
1807 | - buffer_allocator, report, std::make_shared<mtd::NullEventSink>(), resource_cache}; |
1808 | + buffer_allocator, report, std::make_shared<NullEventSink>(), resource_cache}; |
1809 | |
1810 | session_mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); |
1811 | |
1812 | |
1813 | === modified file 'tests/unit-tests/frontend/test_session_mediator_gbm.cpp' |
1814 | --- tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-08-06 16:20:23 +0000 |
1815 | +++ tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-08-07 03:18:25 +0000 |
1816 | @@ -29,8 +29,6 @@ |
1817 | #include <boost/exception/errinfo_errno.hpp> |
1818 | #include <boost/throw_exception.hpp> |
1819 | |
1820 | -#include "mir_test_doubles/null_display.h" |
1821 | -#include "mir_test_doubles/null_event_sink.h" |
1822 | #include "mir_test_doubles/null_display_changer.h" |
1823 | #include "mir_test_doubles/null_platform.h" |
1824 | #include "mir_test_doubles/mock_session.h" |
1825 | @@ -75,6 +73,12 @@ |
1826 | MOCK_METHOD1(drm_auth_magic, void(drm_magic_t)); |
1827 | }; |
1828 | |
1829 | +class NullEventSink : public mir::frontend::EventSink |
1830 | +{ |
1831 | +public: |
1832 | + void handle_event(MirEvent const& ) override {} |
1833 | +}; |
1834 | + |
1835 | struct SessionMediatorGBMTest : public ::testing::Test |
1836 | { |
1837 | SessionMediatorGBMTest() |
1838 | @@ -86,7 +90,7 @@ |
1839 | resource_cache{std::make_shared<mf::ResourceCache>()}, |
1840 | mediator{shell, mock_platform, display_changer, |
1841 | buffer_allocator, report, |
1842 | - std::make_shared<mtd::NullEventSink>(), |
1843 | + std::make_shared<NullEventSink>(), |
1844 | resource_cache}, |
1845 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} |
1846 | { |
1847 | |
1848 | === modified file 'tests/unit-tests/graphics/gbm/test_gbm_cursor.cpp' |
1849 | --- tests/unit-tests/graphics/gbm/test_gbm_cursor.cpp 2013-08-06 16:20:23 +0000 |
1850 | +++ tests/unit-tests/graphics/gbm/test_gbm_cursor.cpp 2013-08-07 03:18:25 +0000 |
1851 | @@ -90,7 +90,6 @@ |
1852 | { |
1853 | mg::DisplayConfigurationOutputId{10}, |
1854 | card_id, |
1855 | - {}, |
1856 | { |
1857 | {geom::Size{10, 20}, 59.9}, |
1858 | {geom::Size{200, 100}, 59.9}, |
1859 | @@ -99,14 +98,12 @@ |
1860 | true, |
1861 | true, |
1862 | geom::Point{0, 0}, |
1863 | - 1, |
1864 | - 0 |
1865 | + 1 |
1866 | }); |
1867 | outputs.push_back( |
1868 | { |
1869 | mg::DisplayConfigurationOutputId{11}, |
1870 | card_id, |
1871 | - {}, |
1872 | { |
1873 | {geom::Size{200, 200}, 59.9}, |
1874 | {geom::Size{100, 200}, 59.9}, |
1875 | @@ -115,7 +112,6 @@ |
1876 | true, |
1877 | true, |
1878 | geom::Point{100, 50}, |
1879 | - 0, |
1880 | 0 |
1881 | }); |
1882 | } |
1883 | |
1884 | === modified file 'tests/unit-tests/graphics/gbm/test_gbm_display_configuration.cpp' |
1885 | --- tests/unit-tests/graphics/gbm/test_gbm_display_configuration.cpp 2013-08-01 22:15:25 +0000 |
1886 | +++ tests/unit-tests/graphics/gbm/test_gbm_display_configuration.cpp 2013-08-07 03:18:25 +0000 |
1887 | @@ -174,37 +174,31 @@ |
1888 | { |
1889 | mg::DisplayConfigurationOutputId{connector0_id}, |
1890 | mg::DisplayConfigurationCardId{0}, |
1891 | - {}, |
1892 | conf_modes0, |
1893 | connector0_physical_size_mm, |
1894 | true, |
1895 | true, |
1896 | geom::Point(), |
1897 | - 1, |
1898 | - 0 |
1899 | + 1 |
1900 | }, |
1901 | { |
1902 | mg::DisplayConfigurationOutputId{connector1_id}, |
1903 | mg::DisplayConfigurationCardId{0}, |
1904 | - {}, |
1905 | std::vector<mg::DisplayConfigurationMode>(), |
1906 | connector1_physical_size_mm, |
1907 | false, |
1908 | false, |
1909 | geom::Point(), |
1910 | - std::numeric_limits<size_t>::max(), |
1911 | std::numeric_limits<size_t>::max() |
1912 | }, |
1913 | { |
1914 | mg::DisplayConfigurationOutputId{connector2_id}, |
1915 | mg::DisplayConfigurationCardId{0}, |
1916 | - {}, |
1917 | std::vector<mg::DisplayConfigurationMode>(), |
1918 | connector2_physical_size_mm, |
1919 | false, |
1920 | false, |
1921 | geom::Point(), |
1922 | - std::numeric_limits<size_t>::max(), |
1923 | std::numeric_limits<size_t>::max() |
1924 | } |
1925 | }; |
1926 | @@ -329,26 +323,22 @@ |
1927 | { |
1928 | mg::DisplayConfigurationOutputId(connector_ids[0]), |
1929 | mg::DisplayConfigurationCardId{0}, |
1930 | - {}, |
1931 | conf_modes0, |
1932 | connector_physical_sizes_mm_before[0], |
1933 | true, |
1934 | true, |
1935 | geom::Point(), |
1936 | - 1, |
1937 | - 0 |
1938 | + 1 |
1939 | }, |
1940 | { |
1941 | mg::DisplayConfigurationOutputId(connector_ids[1]), |
1942 | mg::DisplayConfigurationCardId{0}, |
1943 | - {}, |
1944 | std::vector<mg::DisplayConfigurationMode>(), |
1945 | connector_physical_sizes_mm_before[1], |
1946 | false, |
1947 | false, |
1948 | geom::Point(), |
1949 | - std::numeric_limits<size_t>::max(), |
1950 | - std::numeric_limits<size_t>::max() |
1951 | + std::numeric_limits<size_t>::max() |
1952 | }, |
1953 | }; |
1954 | |
1955 | @@ -357,26 +347,22 @@ |
1956 | { |
1957 | mg::DisplayConfigurationOutputId(connector_ids[0]), |
1958 | mg::DisplayConfigurationCardId{0}, |
1959 | - {}, |
1960 | std::vector<mg::DisplayConfigurationMode>(), |
1961 | connector_physical_sizes_mm_after[0], |
1962 | false, |
1963 | true, |
1964 | geom::Point(), |
1965 | - std::numeric_limits<size_t>::max(), |
1966 | std::numeric_limits<size_t>::max() |
1967 | }, |
1968 | { |
1969 | mg::DisplayConfigurationOutputId(connector_ids[1]), |
1970 | mg::DisplayConfigurationCardId{0}, |
1971 | - {}, |
1972 | conf_modes0, |
1973 | connector_physical_sizes_mm_after[1], |
1974 | true, |
1975 | false, |
1976 | geom::Point(), |
1977 | - 1, |
1978 | - 0 |
1979 | + 1 |
1980 | }, |
1981 | }; |
1982 | |
1983 | |
1984 | === modified file 'tests/unit-tests/graphics/gbm/test_overlapping_output_grouping.cpp' |
1985 | --- tests/unit-tests/graphics/gbm/test_overlapping_output_grouping.cpp 2013-08-01 22:15:25 +0000 |
1986 | +++ tests/unit-tests/graphics/gbm/test_overlapping_output_grouping.cpp 2013-08-07 03:18:25 +0000 |
1987 | @@ -69,14 +69,12 @@ |
1988 | { |
1989 | mg::DisplayConfigurationOutputId(i), |
1990 | mg::DisplayConfigurationCardId{1}, |
1991 | - {}, |
1992 | modes, |
1993 | {100, 100}, |
1994 | connected, |
1995 | used, |
1996 | rect.top_left, |
1997 | - i - 1, |
1998 | - 0 |
1999 | + i - 1 |
2000 | }; |
2001 | |
2002 | f(output); |
2003 | |
2004 | === modified file 'tests/unit-tests/graphics/test_default_display_configuration_policy.cpp' |
2005 | --- tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2013-08-01 22:15:25 +0000 |
2006 | +++ tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2013-08-07 03:18:25 +0000 |
2007 | @@ -40,9 +40,6 @@ |
2008 | mg::DisplayConfigurationOutputId{10}, |
2009 | card_id, |
2010 | { |
2011 | - {geom::PixelFormat::abgr_8888} |
2012 | - }, |
2013 | - { |
2014 | {geom::Size{123, 111}, 59.9}, |
2015 | {geom::Size{123, 111}, 59.9}, |
2016 | {geom::Size{123, 111}, 59.9} |
2017 | @@ -51,8 +48,7 @@ |
2018 | true, |
2019 | false, |
2020 | geom::Point{geom::X{123}, geom::Y{343}}, |
2021 | - 1, |
2022 | - 0 |
2023 | + 1 |
2024 | }); |
2025 | /* Connected without modes */ |
2026 | outputs.push_back( |
2027 | @@ -60,12 +56,10 @@ |
2028 | mg::DisplayConfigurationOutputId{11}, |
2029 | card_id, |
2030 | {}, |
2031 | - {}, |
2032 | geom::Size{566, 111}, |
2033 | true, |
2034 | false, |
2035 | geom::Point(), |
2036 | - std::numeric_limits<size_t>::max(), |
2037 | std::numeric_limits<size_t>::max() |
2038 | }); |
2039 | /* Connected with a single mode */ |
2040 | @@ -74,16 +68,12 @@ |
2041 | mg::DisplayConfigurationOutputId{12}, |
2042 | card_id, |
2043 | { |
2044 | - {geom::PixelFormat::abgr_8888} |
2045 | - }, |
2046 | - { |
2047 | {geom::Size{523, 555}, 60.0}, |
2048 | }, |
2049 | geom::Size{324, 642}, |
2050 | true, |
2051 | false, |
2052 | geom::Point(), |
2053 | - 0, |
2054 | 0 |
2055 | }); |
2056 | /* Not connected */ |
2057 | @@ -91,16 +81,12 @@ |
2058 | { |
2059 | mg::DisplayConfigurationOutputId{13}, |
2060 | card_id, |
2061 | - { |
2062 | - {geom::PixelFormat::abgr_8888} |
2063 | - }, |
2064 | {}, |
2065 | geom::Size{324, 642}, |
2066 | false, |
2067 | false, |
2068 | geom::Point(), |
2069 | - 1, |
2070 | - 0 |
2071 | + 1 |
2072 | }); |
2073 | } |
2074 | |
2075 | |
2076 | === modified file 'tests/unit-tests/graphics/test_display_configuration.cpp' |
2077 | --- tests/unit-tests/graphics/test_display_configuration.cpp 2013-08-01 22:15:25 +0000 |
2078 | +++ tests/unit-tests/graphics/test_display_configuration.cpp 2013-08-07 03:18:25 +0000 |
2079 | @@ -31,9 +31,6 @@ |
2080 | mg::DisplayConfigurationOutputId{3}, |
2081 | mg::DisplayConfigurationCardId{2}, |
2082 | { |
2083 | - {geom::PixelFormat::abgr_8888} |
2084 | - }, |
2085 | - { |
2086 | {geom::Size{10, 20}, 60.0}, |
2087 | {geom::Size{10, 20}, 59.0}, |
2088 | {geom::Size{15, 20}, 59.0} |
2089 | @@ -42,8 +39,7 @@ |
2090 | true, |
2091 | true, |
2092 | geom::Point(), |
2093 | - 2, |
2094 | - 0 |
2095 | + 2 |
2096 | }; |
2097 | |
2098 | } |
+1 on the revert. Starting mir_demo_ server_ shell and attaching mir_demo_ client_ eglplasma immediately crashes (although XMir doesn't)