Merge lp:~alan-griffiths/mir/nested-sessions-dont-post-buffers-until-something-happens into lp:mir
- nested-sessions-dont-post-buffers-until-something-happens
- Merge into development-branch
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alan Griffiths | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1456 | ||||
Proposed branch: | lp:~alan-griffiths/mir/nested-sessions-dont-post-buffers-until-something-happens | ||||
Merge into: | lp:mir | ||||
Prerequisite: | lp:~alan-griffiths/mir/add-some-intelligence-to-scheduling-compositing | ||||
Diff against target: |
344 lines (+135/-23) 5 files modified
examples/render_surfaces.cpp (+30/-2) src/server/compositor/default_configuration.cpp (+7/-4) src/server/compositor/multi_threaded_compositor.cpp (+27/-9) src/server/compositor/multi_threaded_compositor.h (+5/-1) tests/unit-tests/compositor/test_multi_threaded_compositor.cpp (+66/-7) |
||||
To merge this branch: | bzr merge lp:~alan-griffiths/mir/nested-sessions-dont-post-buffers-until-something-happens | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Alexandros Frantzis (community) | Approve | ||
Alberto Aguirre (community) | Approve | ||
Review via email: mp+209107@code.launchpad.net |
Commit message
compositor: Don't automatically paint the framebuffer when compositing starts. (This is really only appropriate for a host session.)
Description of the change
compositor: Don't automatically paint the framebuffer when compositing starts. (This is really only appropriate for a host session.)
PS Jenkins bot (ps-jenkins) wrote : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
299 + compositor.start();
300 + std::this_
I think the time limit is too small for our whimsical CI. Perhaps a loop checking the condition every 20ms for 5 seconds? (5s is probably too much, but it doesn't matter since we will pay the price only in case of a failure, which should hopefully be never).
302 + // Verify we're still at zero frames
303 + EXPECT_
Wrong comment?
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1448
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alberto Aguirre (albaguirre) wrote : | # |
Looks good.
kevin gunn (kgunn72) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Alan Griffiths (alan-griffiths) wrote : | # |
Trivial merge conflicts resolved.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1449
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'examples/render_surfaces.cpp' | |||
2 | --- examples/render_surfaces.cpp 2014-03-04 10:10:23 +0000 | |||
3 | +++ examples/render_surfaces.cpp 2014-03-05 17:19:32 +0000 | |||
4 | @@ -17,6 +17,7 @@ | |||
5 | 17 | */ | 17 | */ |
6 | 18 | 18 | ||
7 | 19 | #include "mir/compositor/display_buffer_compositor_factory.h" | 19 | #include "mir/compositor/display_buffer_compositor_factory.h" |
8 | 20 | #include "mir/server_status_listener.h" | ||
9 | 20 | #include "mir/compositor/display_buffer_compositor.h" | 21 | #include "mir/compositor/display_buffer_compositor.h" |
10 | 21 | #include "mir/options/default_configuration.h" | 22 | #include "mir/options/default_configuration.h" |
11 | 22 | #include "mir/graphics/graphic_buffer_allocator.h" | 23 | #include "mir/graphics/graphic_buffer_allocator.h" |
12 | @@ -86,6 +87,7 @@ | |||
13 | 86 | 87 | ||
14 | 87 | namespace | 88 | namespace |
15 | 88 | { | 89 | { |
16 | 90 | std::atomic<bool> created{false}; | ||
17 | 89 | bool input_is_on = false; | 91 | bool input_is_on = false; |
18 | 90 | std::weak_ptr<mg::Cursor> cursor; | 92 | std::weak_ptr<mg::Cursor> cursor; |
19 | 91 | static const uint32_t bg_color = 0x00000000; | 93 | static const uint32_t bg_color = 0x00000000; |
20 | @@ -326,6 +328,31 @@ | |||
21 | 326 | } | 328 | } |
22 | 327 | ///\internal [RenderResourcesBufferInitializer_tag] | 329 | ///\internal [RenderResourcesBufferInitializer_tag] |
23 | 328 | 330 | ||
24 | 331 | // Unless the compositor starts before we create the surfaces it won't respond to | ||
25 | 332 | // the change notification that causes. | ||
26 | 333 | std::shared_ptr<mir::ServerStatusListener> the_server_status_listener() | ||
27 | 334 | { | ||
28 | 335 | struct ServerStatusListener : mir::ServerStatusListener | ||
29 | 336 | { | ||
30 | 337 | ServerStatusListener(std::function<void()> create_surfaces, std::shared_ptr<mir::ServerStatusListener> wrapped) : | ||
31 | 338 | create_surfaces(create_surfaces), wrapped(wrapped) {} | ||
32 | 339 | |||
33 | 340 | virtual void paused() override { wrapped->paused(); } | ||
34 | 341 | virtual void resumed() override { wrapped->resumed(); } | ||
35 | 342 | virtual void started() override { wrapped->started(); create_surfaces(); create_surfaces = []{}; } | ||
36 | 343 | |||
37 | 344 | std::function<void()> create_surfaces; | ||
38 | 345 | std::shared_ptr<mir::ServerStatusListener> const wrapped; | ||
39 | 346 | }; | ||
40 | 347 | |||
41 | 348 | return server_status_listener( | ||
42 | 349 | [this]() | ||
43 | 350 | { | ||
44 | 351 | auto wrapped = ServerConfiguration::the_server_status_listener(); | ||
45 | 352 | return std::make_shared<ServerStatusListener>([this] { create_surfaces(); }, wrapped); | ||
46 | 353 | }); | ||
47 | 354 | } | ||
48 | 355 | |||
49 | 329 | ///\internal [RenderSurfacesDisplayBufferCompositor_tag] | 356 | ///\internal [RenderSurfacesDisplayBufferCompositor_tag] |
50 | 330 | // Decorate the DefaultDisplayBufferCompositor in order to move surfaces. | 357 | // Decorate the DefaultDisplayBufferCompositor in order to move surfaces. |
51 | 331 | std::shared_ptr<mc::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory() override | 358 | std::shared_ptr<mc::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory() override |
52 | @@ -344,6 +371,7 @@ | |||
53 | 344 | 371 | ||
54 | 345 | bool composite() | 372 | bool composite() |
55 | 346 | { | 373 | { |
56 | 374 | while (!created) std::this_thread::yield(); | ||
57 | 347 | animate_cursor(); | 375 | animate_cursor(); |
58 | 348 | stop_watch.stop(); | 376 | stop_watch.stop(); |
59 | 349 | if (stop_watch.elapsed_seconds_since_last_restart() >= 1) | 377 | if (stop_watch.elapsed_seconds_since_last_restart() >= 1) |
60 | @@ -460,6 +488,8 @@ | |||
61 | 460 | 2.0f * M_PI * cos(i)); | 488 | 2.0f * M_PI * cos(i)); |
62 | 461 | ++i; | 489 | ++i; |
63 | 462 | } | 490 | } |
64 | 491 | |||
65 | 492 | created = true; | ||
66 | 463 | } | 493 | } |
67 | 464 | 494 | ||
68 | 465 | bool input_is_on() | 495 | bool input_is_on() |
69 | @@ -493,8 +523,6 @@ | |||
70 | 493 | 523 | ||
71 | 494 | mir::run_mir(conf, [&](mir::DisplayServer&) | 524 | mir::run_mir(conf, [&](mir::DisplayServer&) |
72 | 495 | { | 525 | { |
73 | 496 | conf.create_surfaces(); | ||
74 | 497 | |||
75 | 498 | cursor = conf.the_cursor(); | 526 | cursor = conf.the_cursor(); |
76 | 499 | 527 | ||
77 | 500 | input_is_on = conf.input_is_on(); | 528 | input_is_on = conf.input_is_on(); |
78 | 501 | 529 | ||
79 | === modified file 'src/server/compositor/default_configuration.cpp' | |||
80 | --- src/server/compositor/default_configuration.cpp 2014-02-28 13:51:43 +0000 | |||
81 | +++ src/server/compositor/default_configuration.cpp 2014-03-05 17:19:32 +0000 | |||
82 | @@ -25,6 +25,7 @@ | |||
83 | 25 | #include "compositing_screencast.h" | 25 | #include "compositing_screencast.h" |
84 | 26 | 26 | ||
85 | 27 | #include "mir/frontend/screencast.h" | 27 | #include "mir/frontend/screencast.h" |
86 | 28 | #include "mir/options/configuration.h" | ||
87 | 28 | 29 | ||
88 | 29 | #include <boost/throw_exception.hpp> | 30 | #include <boost/throw_exception.hpp> |
89 | 30 | 31 | ||
90 | @@ -59,10 +60,12 @@ | |||
91 | 59 | return compositor( | 60 | return compositor( |
92 | 60 | [this]() | 61 | [this]() |
93 | 61 | { | 62 | { |
98 | 62 | return std::make_shared<mc::MultiThreadedCompositor>(the_display(), | 63 | return std::make_shared<mc::MultiThreadedCompositor>( |
99 | 63 | the_scene(), | 64 | the_display(), |
100 | 64 | the_display_buffer_compositor_factory(), | 65 | the_scene(), |
101 | 65 | the_compositor_report()); | 66 | the_display_buffer_compositor_factory(), |
102 | 67 | the_compositor_report(), | ||
103 | 68 | !the_options()->is_set(options::host_socket_opt)); | ||
104 | 66 | }); | 69 | }); |
105 | 67 | } | 70 | } |
106 | 68 | 71 | ||
107 | 69 | 72 | ||
108 | === modified file 'src/server/compositor/multi_threaded_compositor.cpp' | |||
109 | --- src/server/compositor/multi_threaded_compositor.cpp 2014-03-04 12:16:12 +0000 | |||
110 | +++ src/server/compositor/multi_threaded_compositor.cpp 2014-03-05 17:19:32 +0000 | |||
111 | @@ -147,12 +147,14 @@ | |||
112 | 147 | std::shared_ptr<mg::Display> const& display, | 147 | std::shared_ptr<mg::Display> const& display, |
113 | 148 | std::shared_ptr<mc::Scene> const& scene, | 148 | std::shared_ptr<mc::Scene> const& scene, |
114 | 149 | std::shared_ptr<DisplayBufferCompositorFactory> const& db_compositor_factory, | 149 | std::shared_ptr<DisplayBufferCompositorFactory> const& db_compositor_factory, |
116 | 150 | std::shared_ptr<CompositorReport> const& compositor_report) | 150 | std::shared_ptr<CompositorReport> const& compositor_report, |
117 | 151 | bool compose_on_start) | ||
118 | 151 | : display{display}, | 152 | : display{display}, |
119 | 152 | scene{scene}, | 153 | scene{scene}, |
120 | 153 | display_buffer_compositor_factory{db_compositor_factory}, | 154 | display_buffer_compositor_factory{db_compositor_factory}, |
121 | 154 | report{compositor_report}, | 155 | report{compositor_report}, |
123 | 155 | started{false} | 156 | started{false}, |
124 | 157 | compose_on_start{compose_on_start} | ||
125 | 156 | { | 158 | { |
126 | 157 | } | 159 | } |
127 | 158 | 160 | ||
128 | @@ -161,6 +163,14 @@ | |||
129 | 161 | stop(); | 163 | stop(); |
130 | 162 | } | 164 | } |
131 | 163 | 165 | ||
132 | 166 | void mc::MultiThreadedCompositor::schedule_compositing() | ||
133 | 167 | { | ||
134 | 168 | std::unique_lock<std::mutex> lk(started_guard); | ||
135 | 169 | report->scheduled(); | ||
136 | 170 | for (auto& f : thread_functors) | ||
137 | 171 | f->schedule_compositing(); | ||
138 | 172 | } | ||
139 | 173 | |||
140 | 164 | void mc::MultiThreadedCompositor::start() | 174 | void mc::MultiThreadedCompositor::start() |
141 | 165 | { | 175 | { |
142 | 166 | std::unique_lock<std::mutex> lk(started_guard); | 176 | std::unique_lock<std::mutex> lk(started_guard); |
143 | @@ -184,16 +194,18 @@ | |||
144 | 184 | /* Recomposite whenever the scene changes */ | 194 | /* Recomposite whenever the scene changes */ |
145 | 185 | scene->set_change_callback([this]() | 195 | scene->set_change_callback([this]() |
146 | 186 | { | 196 | { |
150 | 187 | report->scheduled(); | 197 | schedule_compositing(); |
148 | 188 | for (auto& f : thread_functors) | ||
149 | 189 | f->schedule_compositing(); | ||
151 | 190 | }); | 198 | }); |
152 | 191 | 199 | ||
153 | 192 | /* First render */ | ||
154 | 193 | for (auto& f : thread_functors) | ||
155 | 194 | f->schedule_compositing(); | ||
156 | 195 | |||
157 | 196 | started = true; | 200 | started = true; |
158 | 201 | |||
159 | 202 | /* Optional first render */ | ||
160 | 203 | if (compose_on_start) | ||
161 | 204 | { | ||
162 | 205 | lk.unlock(); | ||
163 | 206 | schedule_compositing(); | ||
164 | 207 | } | ||
165 | 208 | |||
166 | 197 | } | 209 | } |
167 | 198 | 210 | ||
168 | 199 | void mc::MultiThreadedCompositor::stop() | 211 | void mc::MultiThreadedCompositor::stop() |
169 | @@ -204,7 +216,9 @@ | |||
170 | 204 | return; | 216 | return; |
171 | 205 | } | 217 | } |
172 | 206 | 218 | ||
173 | 219 | lk.unlock(); | ||
174 | 207 | scene->set_change_callback([]{}); | 220 | scene->set_change_callback([]{}); |
175 | 221 | lk.lock(); | ||
176 | 208 | 222 | ||
177 | 209 | for (auto& f : thread_functors) | 223 | for (auto& f : thread_functors) |
178 | 210 | f->stop(); | 224 | f->stop(); |
179 | @@ -218,4 +232,8 @@ | |||
180 | 218 | report->stopped(); | 232 | report->stopped(); |
181 | 219 | 233 | ||
182 | 220 | started = false; | 234 | started = false; |
183 | 235 | |||
184 | 236 | // If the compositor is restarted we've likely got clients blocked | ||
185 | 237 | // so we will need to schedule compositing immediately | ||
186 | 238 | compose_on_start = true; | ||
187 | 221 | } | 239 | } |
188 | 222 | 240 | ||
189 | === modified file 'src/server/compositor/multi_threaded_compositor.h' | |||
190 | --- src/server/compositor/multi_threaded_compositor.h 2014-03-05 07:21:46 +0000 | |||
191 | +++ src/server/compositor/multi_threaded_compositor.h 2014-03-05 17:19:32 +0000 | |||
192 | @@ -46,7 +46,8 @@ | |||
193 | 46 | MultiThreadedCompositor(std::shared_ptr<graphics::Display> const& display, | 46 | MultiThreadedCompositor(std::shared_ptr<graphics::Display> const& display, |
194 | 47 | std::shared_ptr<Scene> const& scene, | 47 | std::shared_ptr<Scene> const& scene, |
195 | 48 | std::shared_ptr<DisplayBufferCompositorFactory> const& db_compositor_factory, | 48 | std::shared_ptr<DisplayBufferCompositorFactory> const& db_compositor_factory, |
197 | 49 | std::shared_ptr<CompositorReport> const& compositor_report); | 49 | std::shared_ptr<CompositorReport> const& compositor_report, |
198 | 50 | bool compose_on_start); | ||
199 | 50 | ~MultiThreadedCompositor(); | 51 | ~MultiThreadedCompositor(); |
200 | 51 | 52 | ||
201 | 52 | void start(); | 53 | void start(); |
202 | @@ -63,6 +64,9 @@ | |||
203 | 63 | 64 | ||
204 | 64 | std::mutex started_guard; | 65 | std::mutex started_guard; |
205 | 65 | bool started; | 66 | bool started; |
206 | 67 | bool compose_on_start; | ||
207 | 68 | |||
208 | 69 | void schedule_compositing(); | ||
209 | 66 | }; | 70 | }; |
210 | 67 | 71 | ||
211 | 68 | } | 72 | } |
212 | 69 | 73 | ||
213 | === modified file 'tests/unit-tests/compositor/test_multi_threaded_compositor.cpp' | |||
214 | --- tests/unit-tests/compositor/test_multi_threaded_compositor.cpp 2014-03-05 07:21:46 +0000 | |||
215 | +++ tests/unit-tests/compositor/test_multi_threaded_compositor.cpp 2014-03-05 17:19:32 +0000 | |||
216 | @@ -324,7 +324,7 @@ | |||
217 | 324 | auto display = std::make_shared<StubDisplay>(nbuffers); | 324 | auto display = std::make_shared<StubDisplay>(nbuffers); |
218 | 325 | auto scene = std::make_shared<StubScene>(); | 325 | auto scene = std::make_shared<StubScene>(); |
219 | 326 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); | 326 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); |
221 | 327 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report}; | 327 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, true}; |
222 | 328 | 328 | ||
223 | 329 | compositor.start(); | 329 | compositor.start(); |
224 | 330 | 330 | ||
225 | @@ -348,7 +348,8 @@ | |||
226 | 348 | auto mock_report = std::make_shared<mtd::MockCompositorReport>(); | 348 | auto mock_report = std::make_shared<mtd::MockCompositorReport>(); |
227 | 349 | mc::MultiThreadedCompositor compositor{display, scene, | 349 | mc::MultiThreadedCompositor compositor{display, scene, |
228 | 350 | db_compositor_factory, | 350 | db_compositor_factory, |
230 | 351 | mock_report}; | 351 | mock_report, |
231 | 352 | true}; | ||
232 | 352 | 353 | ||
233 | 353 | EXPECT_CALL(*mock_report, started()) | 354 | EXPECT_CALL(*mock_report, started()) |
234 | 354 | .Times(1); | 355 | .Times(1); |
235 | @@ -363,7 +364,7 @@ | |||
236 | 363 | EXPECT_CALL(*mock_report, added_display(_,_,_,_,_)) | 364 | EXPECT_CALL(*mock_report, added_display(_,_,_,_,_)) |
237 | 364 | .Times(1); | 365 | .Times(1); |
238 | 365 | EXPECT_CALL(*mock_report, scheduled()) | 366 | EXPECT_CALL(*mock_report, scheduled()) |
240 | 366 | .Times(1); | 367 | .Times(2); |
241 | 367 | 368 | ||
242 | 368 | display->for_each_mock_buffer([](mtd::MockDisplayBuffer& mock_buf) | 369 | display->for_each_mock_buffer([](mtd::MockDisplayBuffer& mock_buf) |
243 | 369 | { | 370 | { |
244 | @@ -398,7 +399,7 @@ | |||
245 | 398 | auto display = std::make_shared<StubDisplay>(nbuffers); | 399 | auto display = std::make_shared<StubDisplay>(nbuffers); |
246 | 399 | auto scene = std::make_shared<StubScene>(); | 400 | auto scene = std::make_shared<StubScene>(); |
247 | 400 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); | 401 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); |
249 | 401 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report}; | 402 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, true}; |
250 | 402 | 403 | ||
251 | 403 | // Verify we're actually starting at zero frames | 404 | // Verify we're actually starting at zero frames |
252 | 404 | EXPECT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, 0, 0)); | 405 | EXPECT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, 0, 0)); |
253 | @@ -449,6 +450,64 @@ | |||
254 | 449 | compositor.stop(); | 450 | compositor.stop(); |
255 | 450 | } | 451 | } |
256 | 451 | 452 | ||
257 | 453 | TEST(MultiThreadedCompositor, when_no_initial_composite_is_needed_there_is_none) | ||
258 | 454 | { | ||
259 | 455 | using namespace testing; | ||
260 | 456 | |||
261 | 457 | unsigned int const nbuffers = 3; | ||
262 | 458 | |||
263 | 459 | auto display = std::make_shared<StubDisplay>(nbuffers); | ||
264 | 460 | auto scene = std::make_shared<StubScene>(); | ||
265 | 461 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); | ||
266 | 462 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, false}; | ||
267 | 463 | |||
268 | 464 | // Verify we're actually starting at zero frames | ||
269 | 465 | ASSERT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, 0, 0)); | ||
270 | 466 | |||
271 | 467 | compositor.start(); | ||
272 | 468 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | ||
273 | 469 | |||
274 | 470 | // Verify we're still at zero frames | ||
275 | 471 | EXPECT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, 0, 0)); | ||
276 | 472 | |||
277 | 473 | compositor.stop(); | ||
278 | 474 | } | ||
279 | 475 | |||
280 | 476 | TEST(MultiThreadedCompositor, when_no_initial_composite_is_needed_we_still_composite_on_restart) | ||
281 | 477 | { | ||
282 | 478 | using namespace testing; | ||
283 | 479 | |||
284 | 480 | unsigned int const nbuffers = 3; | ||
285 | 481 | |||
286 | 482 | auto display = std::make_shared<StubDisplay>(nbuffers); | ||
287 | 483 | auto scene = std::make_shared<StubScene>(); | ||
288 | 484 | auto db_compositor_factory = std::make_shared<RecordingDisplayBufferCompositorFactory>(); | ||
289 | 485 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, false}; | ||
290 | 486 | |||
291 | 487 | compositor.start(); | ||
292 | 488 | |||
293 | 489 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | ||
294 | 490 | |||
295 | 491 | // Verify we're actually starting at zero frames | ||
296 | 492 | ASSERT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, 0, 0)); | ||
297 | 493 | |||
298 | 494 | compositor.stop(); | ||
299 | 495 | compositor.start(); | ||
300 | 496 | |||
301 | 497 | for (int countdown = 100; | ||
302 | 498 | countdown != 0 && | ||
303 | 499 | !db_compositor_factory->check_record_count_for_each_buffer(nbuffers, composites_per_update, composites_per_update); | ||
304 | 500 | --countdown) | ||
305 | 501 | { | ||
306 | 502 | std::this_thread::sleep_for(std::chrono::milliseconds(10)); | ||
307 | 503 | } | ||
308 | 504 | |||
309 | 505 | // Verify we composited the expected frame | ||
310 | 506 | EXPECT_TRUE(db_compositor_factory->check_record_count_for_each_buffer(nbuffers, composites_per_update, composites_per_update)); | ||
311 | 507 | |||
312 | 508 | compositor.stop(); | ||
313 | 509 | } | ||
314 | 510 | |||
315 | 452 | TEST(MultiThreadedCompositor, surface_update_from_render_doesnt_deadlock) | 511 | TEST(MultiThreadedCompositor, surface_update_from_render_doesnt_deadlock) |
316 | 453 | { | 512 | { |
317 | 454 | using namespace testing; | 513 | using namespace testing; |
318 | @@ -458,7 +517,7 @@ | |||
319 | 458 | auto display = std::make_shared<StubDisplay>(nbuffers); | 517 | auto display = std::make_shared<StubDisplay>(nbuffers); |
320 | 459 | auto scene = std::make_shared<StubScene>(); | 518 | auto scene = std::make_shared<StubScene>(); |
321 | 460 | auto db_compositor_factory = std::make_shared<SurfaceUpdatingDisplayBufferCompositorFactory>(scene); | 519 | auto db_compositor_factory = std::make_shared<SurfaceUpdatingDisplayBufferCompositorFactory>(scene); |
323 | 461 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report}; | 520 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, true}; |
324 | 462 | 521 | ||
325 | 463 | compositor.start(); | 522 | compositor.start(); |
326 | 464 | 523 | ||
327 | @@ -477,7 +536,7 @@ | |||
328 | 477 | auto display = std::make_shared<StubDisplayWithMockBuffers>(nbuffers); | 536 | auto display = std::make_shared<StubDisplayWithMockBuffers>(nbuffers); |
329 | 478 | auto scene = std::make_shared<StubScene>(); | 537 | auto scene = std::make_shared<StubScene>(); |
330 | 479 | auto db_compositor_factory = std::make_shared<NullDisplayBufferCompositorFactory>(); | 538 | auto db_compositor_factory = std::make_shared<NullDisplayBufferCompositorFactory>(); |
332 | 480 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report}; | 539 | mc::MultiThreadedCompositor compositor{display, scene, db_compositor_factory, null_report, true}; |
333 | 481 | 540 | ||
334 | 482 | display->for_each_mock_buffer([](mtd::MockDisplayBuffer& mock_buf) | 541 | display->for_each_mock_buffer([](mtd::MockDisplayBuffer& mock_buf) |
335 | 483 | { | 542 | { |
336 | @@ -505,7 +564,7 @@ | |||
337 | 505 | EXPECT_CALL(*mock_scene, set_change_callback(testing::_)) | 564 | EXPECT_CALL(*mock_scene, set_change_callback(testing::_)) |
338 | 506 | .Times(2); | 565 | .Times(2); |
339 | 507 | 566 | ||
341 | 508 | mc::MultiThreadedCompositor compositor{display, mock_scene, db_compositor_factory, mock_report}; | 567 | mc::MultiThreadedCompositor compositor{display, mock_scene, db_compositor_factory, mock_report, true}; |
342 | 509 | 568 | ||
343 | 510 | compositor.start(); | 569 | compositor.start(); |
344 | 511 | compositor.start(); | 570 | compositor.start(); |
PASSED: Continuous integration, rev:1445 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- ci/971/ jenkins. qa.ubuntu. com/job/ mir-android- trusty- i386-build/ 1096 jenkins. qa.ubuntu. com/job/ mir-clang- trusty- amd64-build/ 1094 jenkins. qa.ubuntu. com/job/ mir-mediumtests -trusty- touch/685 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 703 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 703/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- armhf-ci/ 708 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- armhf-ci/ 708/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- trusty- armhf/686 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- trusty- armhf/686/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/654 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 4437
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- team-mir- development- branch- ci/971/ rebuild
http://