Merge lp:~kdub/mir/fix-1626503 into lp:mir
- fix-1626503
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3719 |
Proposed branch: | lp:~kdub/mir/fix-1626503 |
Merge into: | lp:mir |
Diff against target: |
383 lines (+111/-9) 12 files modified
src/client/buffer_vault.cpp (+9/-0) src/client/mir_connection.cpp (+1/-1) src/client/surface_map.cpp (+7/-7) src/server/compositor/multi_monitor_arbiter.cpp (+11/-0) src/server/compositor/multi_monitor_arbiter.h (+1/-0) src/server/compositor/stream.cpp (+6/-0) src/server/compositor/stream.h (+1/-0) tests/acceptance-tests/throwback/test_presentation_chain.cpp (+51/-0) tests/integration-tests/test_buffer_scheduling.cpp (+4/-0) tests/unit-tests/client/test_mir_connection.cpp (+1/-1) tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp (+13/-0) tests/unit-tests/compositor/test_stream.cpp (+6/-0) |
To merge this branch: | bzr merge lp:~kdub/mir/fix-1626503 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandros Frantzis (community) | Approve | ||
Brandon Schaefer (community) | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Review via email: mp+306480@code.launchpad.net |
Commit message
mir_presentatio
fix situation where where the server would not notify a client of a buffers return, following the destruction of the MirPresentation
fixes: LP: #1626503
Description of the change
mir_presentatio
fix situation where where the server would not notify a client of a buffers return, following the destruction of the MirPresentation
fixes: LP: #1626503
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3720
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
It's worth noting MultiMonitorArbiter will get deprecated and possibly removed soon enough (hopefully). As swap interval 1 throttling moves out of libmirserver and into libmirclient (using high-precision frame sync timing), it won't be needed any more.
Brandon Schaefer (brandontschaefer) wrote : | # |
Im not super familiar with the context but the code looks good to me.
Kevin DuBois (kdub) wrote : | # |
> It's worth noting MultiMonitorArbiter will get deprecated and possibly removed
> soon enough (hopefully). As swap interval 1 throttling moves out of
> libmirserver and into libmirclient (using high-precision frame sync timing),
> it won't be needed any more.
Hmm, news to me. I suppose some logic in there won't be needed, but some system of handing the buffers out will still be present, we might to need to sync on the plans.
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
Nit:
+ for(auto it = onscreen_
+ {
+ if (it->use_count == 0)
+ map->send_
+ }
Why not use a range-based for loop?
Preview Diff
1 | === modified file 'src/client/buffer_vault.cpp' | |||
2 | --- src/client/buffer_vault.cpp 2016-07-05 12:40:56 +0000 | |||
3 | +++ src/client/buffer_vault.cpp 2016-09-22 19:03:27 +0000 | |||
4 | @@ -45,6 +45,9 @@ | |||
5 | 45 | 45 | ||
6 | 46 | namespace | 46 | namespace |
7 | 47 | { | 47 | { |
8 | 48 | void ignore_buffer(MirBuffer*, void*) | ||
9 | 49 | { | ||
10 | 50 | } | ||
11 | 48 | void incoming_buffer(MirBuffer* buffer, void* context) | 51 | void incoming_buffer(MirBuffer* buffer, void* context) |
12 | 49 | { | 52 | { |
13 | 50 | auto vault = static_cast<mcl::BufferVault*>(context); | 53 | auto vault = static_cast<mcl::BufferVault*>(context); |
14 | @@ -80,9 +83,15 @@ | |||
15 | 80 | return; | 83 | return; |
16 | 81 | 84 | ||
17 | 82 | buffer_factory->cancel_requests_with_context(this); | 85 | buffer_factory->cancel_requests_with_context(this); |
18 | 86 | std::unique_lock<std::mutex> lk(mutex); | ||
19 | 83 | for (auto& it : buffers) | 87 | for (auto& it : buffers) |
20 | 84 | try | 88 | try |
21 | 85 | { | 89 | { |
22 | 90 | if (auto map = surface_map.lock()) | ||
23 | 91 | { | ||
24 | 92 | auto buffer = map->buffer(it.first); | ||
25 | 93 | buffer->set_callback(ignore_buffer, nullptr); | ||
26 | 94 | } | ||
27 | 86 | free_buffer(it.first); | 95 | free_buffer(it.first); |
28 | 87 | } | 96 | } |
29 | 88 | catch (...) | 97 | catch (...) |
30 | 89 | 98 | ||
31 | === modified file 'src/client/mir_connection.cpp' | |||
32 | --- src/client/mir_connection.cpp 2016-08-31 10:47:16 +0000 | |||
33 | +++ src/client/mir_connection.cpp 2016-09-22 19:03:27 +0000 | |||
34 | @@ -1223,7 +1223,7 @@ | |||
35 | 1223 | void MirConnection::release_presentation_chain(MirPresentationChain* chain) | 1223 | void MirConnection::release_presentation_chain(MirPresentationChain* chain) |
36 | 1224 | { | 1224 | { |
37 | 1225 | auto id = chain->rpc_id(); | 1225 | auto id = chain->rpc_id(); |
39 | 1226 | if (id > 0) | 1226 | if (id >= 0) |
40 | 1227 | { | 1227 | { |
41 | 1228 | StreamRelease stream_release{nullptr, nullptr, nullptr, nullptr, chain->rpc_id()}; | 1228 | StreamRelease stream_release{nullptr, nullptr, nullptr, nullptr, chain->rpc_id()}; |
42 | 1229 | mp::BufferStreamId buffer_stream_id; | 1229 | mp::BufferStreamId buffer_stream_id; |
43 | 1230 | 1230 | ||
44 | === modified file 'src/client/surface_map.cpp' | |||
45 | --- src/client/surface_map.cpp 2016-06-06 11:51:31 +0000 | |||
46 | +++ src/client/surface_map.cpp 2016-09-22 19:03:27 +0000 | |||
47 | @@ -60,7 +60,7 @@ | |||
48 | 60 | void mcl::ConnectionSurfaceMap::with_stream_do( | 60 | void mcl::ConnectionSurfaceMap::with_stream_do( |
49 | 61 | mf::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const | 61 | mf::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const |
50 | 62 | { | 62 | { |
52 | 63 | std::shared_lock<decltype(guard)> lk(guard); | 63 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); |
53 | 64 | auto const it = streams.find(stream_id); | 64 | auto const it = streams.find(stream_id); |
54 | 65 | if (it != streams.end()) | 65 | if (it != streams.end()) |
55 | 66 | { | 66 | { |
56 | @@ -78,7 +78,7 @@ | |||
57 | 78 | 78 | ||
58 | 79 | void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(ClientBufferStream*)> const& fn) const | 79 | void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(ClientBufferStream*)> const& fn) const |
59 | 80 | { | 80 | { |
61 | 81 | std::shared_lock<decltype(guard)> lk(guard); | 81 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); |
62 | 82 | for(auto const& stream : streams) | 82 | for(auto const& stream : streams) |
63 | 83 | fn(stream.second.get()); | 83 | fn(stream.second.get()); |
64 | 84 | } | 84 | } |
65 | @@ -86,7 +86,7 @@ | |||
66 | 86 | void mcl::ConnectionSurfaceMap::insert( | 86 | void mcl::ConnectionSurfaceMap::insert( |
67 | 87 | mf::BufferStreamId stream_id, std::shared_ptr<ClientBufferStream> const& stream) | 87 | mf::BufferStreamId stream_id, std::shared_ptr<ClientBufferStream> const& stream) |
68 | 88 | { | 88 | { |
70 | 89 | std::lock_guard<decltype(guard)> lk(guard); | 89 | std::lock_guard<decltype(stream_guard)> lk(stream_guard); |
71 | 90 | streams[stream_id] = stream; | 90 | streams[stream_id] = stream; |
72 | 91 | } | 91 | } |
73 | 92 | 92 | ||
74 | @@ -99,7 +99,7 @@ | |||
75 | 99 | 99 | ||
76 | 100 | void mcl::ConnectionSurfaceMap::erase(mf::BufferStreamId stream_id) | 100 | void mcl::ConnectionSurfaceMap::erase(mf::BufferStreamId stream_id) |
77 | 101 | { | 101 | { |
79 | 102 | std::lock_guard<decltype(guard)> lk(guard); | 102 | std::lock_guard<decltype(stream_guard)> lk(stream_guard); |
80 | 103 | auto stream_it = streams.find(stream_id); | 103 | auto stream_it = streams.find(stream_id); |
81 | 104 | auto chain_it = chains.find(stream_id); | 104 | auto chain_it = chains.find(stream_id); |
82 | 105 | if (stream_it != streams.end()) | 105 | if (stream_it != streams.end()) |
83 | @@ -110,19 +110,19 @@ | |||
84 | 110 | 110 | ||
85 | 111 | void mcl::ConnectionSurfaceMap::insert(int buffer_id, std::shared_ptr<mcl::MirBuffer> const& buffer) | 111 | void mcl::ConnectionSurfaceMap::insert(int buffer_id, std::shared_ptr<mcl::MirBuffer> const& buffer) |
86 | 112 | { | 112 | { |
88 | 113 | std::lock_guard<decltype(guard)> lk(guard); | 113 | std::lock_guard<decltype(buffer_guard)> lk(buffer_guard); |
89 | 114 | buffers[buffer_id] = buffer; | 114 | buffers[buffer_id] = buffer; |
90 | 115 | } | 115 | } |
91 | 116 | 116 | ||
92 | 117 | void mcl::ConnectionSurfaceMap::erase(int buffer_id) | 117 | void mcl::ConnectionSurfaceMap::erase(int buffer_id) |
93 | 118 | { | 118 | { |
95 | 119 | std::lock_guard<decltype(guard)> lk(guard); | 119 | std::lock_guard<decltype(buffer_guard)> lk(buffer_guard); |
96 | 120 | buffers.erase(buffer_id); | 120 | buffers.erase(buffer_id); |
97 | 121 | } | 121 | } |
98 | 122 | 122 | ||
99 | 123 | std::shared_ptr<mcl::MirBuffer> mcl::ConnectionSurfaceMap::buffer(int buffer_id) const | 123 | std::shared_ptr<mcl::MirBuffer> mcl::ConnectionSurfaceMap::buffer(int buffer_id) const |
100 | 124 | { | 124 | { |
102 | 125 | std::shared_lock<decltype(guard)> lk(guard); | 125 | std::shared_lock<decltype(buffer_guard)> lk(buffer_guard); |
103 | 126 | auto const it = buffers.find(buffer_id); | 126 | auto const it = buffers.find(buffer_id); |
104 | 127 | if (it != buffers.end()) | 127 | if (it != buffers.end()) |
105 | 128 | return it->second; | 128 | return it->second; |
106 | 129 | 129 | ||
107 | === modified file 'src/server/compositor/multi_monitor_arbiter.cpp' | |||
108 | --- src/server/compositor/multi_monitor_arbiter.cpp 2016-05-03 06:55:25 +0000 | |||
109 | +++ src/server/compositor/multi_monitor_arbiter.cpp 2016-09-22 19:03:27 +0000 | |||
110 | @@ -39,6 +39,17 @@ | |||
111 | 39 | { | 39 | { |
112 | 40 | } | 40 | } |
113 | 41 | 41 | ||
114 | 42 | mc::MultiMonitorArbiter::~MultiMonitorArbiter() | ||
115 | 43 | { | ||
116 | 44 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
117 | 45 | for(auto it = onscreen_buffers.begin(); it != onscreen_buffers.end(); it++) | ||
118 | 46 | { | ||
119 | 47 | if (it->use_count == 0) | ||
120 | 48 | map->send_buffer(it->buffer->id()); | ||
121 | 49 | } | ||
122 | 50 | |||
123 | 51 | } | ||
124 | 52 | |||
125 | 42 | std::shared_ptr<mg::Buffer> mc::MultiMonitorArbiter::compositor_acquire(compositor::CompositorID id) | 53 | std::shared_ptr<mg::Buffer> mc::MultiMonitorArbiter::compositor_acquire(compositor::CompositorID id) |
126 | 43 | { | 54 | { |
127 | 44 | std::lock_guard<decltype(mutex)> lk(mutex); | 55 | std::lock_guard<decltype(mutex)> lk(mutex); |
128 | 45 | 56 | ||
129 | === modified file 'src/server/compositor/multi_monitor_arbiter.h' | |||
130 | --- src/server/compositor/multi_monitor_arbiter.h 2016-05-03 06:55:25 +0000 | |||
131 | +++ src/server/compositor/multi_monitor_arbiter.h 2016-09-22 19:03:27 +0000 | |||
132 | @@ -41,6 +41,7 @@ | |||
133 | 41 | MultiMonitorMode mode, | 41 | MultiMonitorMode mode, |
134 | 42 | std::shared_ptr<frontend::ClientBuffers> const& map, | 42 | std::shared_ptr<frontend::ClientBuffers> const& map, |
135 | 43 | std::shared_ptr<Schedule> const& schedule); | 43 | std::shared_ptr<Schedule> const& schedule); |
136 | 44 | ~MultiMonitorArbiter(); | ||
137 | 44 | 45 | ||
138 | 45 | std::shared_ptr<graphics::Buffer> compositor_acquire(compositor::CompositorID id) override; | 46 | std::shared_ptr<graphics::Buffer> compositor_acquire(compositor::CompositorID id) override; |
139 | 46 | void compositor_release(std::shared_ptr<graphics::Buffer> const&) override; | 47 | void compositor_release(std::shared_ptr<graphics::Buffer> const&) override; |
140 | 47 | 48 | ||
141 | === modified file 'src/server/compositor/stream.cpp' | |||
142 | --- src/server/compositor/stream.cpp 2016-06-02 05:33:50 +0000 | |||
143 | +++ src/server/compositor/stream.cpp 2016-09-22 19:03:27 +0000 | |||
144 | @@ -73,6 +73,12 @@ | |||
145 | 73 | { | 73 | { |
146 | 74 | } | 74 | } |
147 | 75 | 75 | ||
148 | 76 | mc::Stream::~Stream() | ||
149 | 77 | { | ||
150 | 78 | while(schedule->num_scheduled()) | ||
151 | 79 | buffers->send_buffer(schedule->next_buffer()->id()); | ||
152 | 80 | } | ||
153 | 81 | |||
154 | 76 | unsigned int mc::Stream::client_owned_buffer_count(std::lock_guard<decltype(mutex)> const&) const | 82 | unsigned int mc::Stream::client_owned_buffer_count(std::lock_guard<decltype(mutex)> const&) const |
155 | 77 | { | 83 | { |
156 | 78 | auto server_count = schedule->num_scheduled(); | 84 | auto server_count = schedule->num_scheduled(); |
157 | 79 | 85 | ||
158 | === modified file 'src/server/compositor/stream.h' | |||
159 | --- src/server/compositor/stream.h 2016-05-04 01:48:16 +0000 | |||
160 | +++ src/server/compositor/stream.h 2016-09-22 19:03:27 +0000 | |||
161 | @@ -44,6 +44,7 @@ | |||
162 | 44 | Stream( | 44 | Stream( |
163 | 45 | FrameDroppingPolicyFactory const& policy_factory, | 45 | FrameDroppingPolicyFactory const& policy_factory, |
164 | 46 | std::shared_ptr<frontend::ClientBuffers>, geometry::Size sz, MirPixelFormat format); | 46 | std::shared_ptr<frontend::ClientBuffers>, geometry::Size sz, MirPixelFormat format); |
165 | 47 | ~Stream(); | ||
166 | 47 | 48 | ||
167 | 48 | void swap_buffers( | 49 | void swap_buffers( |
168 | 49 | graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete) override; | 50 | graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete) override; |
169 | 50 | 51 | ||
170 | === modified file 'tests/acceptance-tests/throwback/test_presentation_chain.cpp' | |||
171 | --- tests/acceptance-tests/throwback/test_presentation_chain.cpp 2016-08-23 16:18:08 +0000 | |||
172 | +++ tests/acceptance-tests/throwback/test_presentation_chain.cpp 2016-09-22 19:03:27 +0000 | |||
173 | @@ -188,6 +188,10 @@ | |||
174 | 188 | unsigned int callback_count = 0; | 188 | unsigned int callback_count = 0; |
175 | 189 | }; | 189 | }; |
176 | 190 | 190 | ||
177 | 191 | void ignore_callback(MirBuffer*, void*) | ||
178 | 192 | { | ||
179 | 193 | } | ||
180 | 194 | |||
181 | 191 | void buffer_callback(MirBuffer* buffer, void* context) | 195 | void buffer_callback(MirBuffer* buffer, void* context) |
182 | 192 | { | 196 | { |
183 | 193 | auto sync = reinterpret_cast<MirBufferSync*>(context); | 197 | auto sync = reinterpret_cast<MirBufferSync*>(context); |
184 | @@ -292,6 +296,9 @@ | |||
185 | 292 | if (i != 0) | 296 | if (i != 0) |
186 | 293 | ASSERT_TRUE(contexts[(i-1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i; | 297 | ASSERT_TRUE(contexts[(i-1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i; |
187 | 294 | } | 298 | } |
188 | 299 | |||
189 | 300 | for (auto& context : contexts) | ||
190 | 301 | mir_buffer_set_callback(context.buffer(), ignore_callback, nullptr); | ||
191 | 295 | } | 302 | } |
192 | 296 | 303 | ||
193 | 297 | TEST_F(PresentationChain, submission_will_eventually_call_callback_reassociated) | 304 | TEST_F(PresentationChain, submission_will_eventually_call_callback_reassociated) |
194 | @@ -318,6 +325,8 @@ | |||
195 | 318 | if (i != 0) | 325 | if (i != 0) |
196 | 319 | ASSERT_TRUE(contexts[(i-1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i; | 326 | ASSERT_TRUE(contexts[(i-1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i; |
197 | 320 | } | 327 | } |
198 | 328 | for (auto& context : contexts) | ||
199 | 329 | mir_buffer_set_callback(context.buffer(), ignore_callback, nullptr); | ||
200 | 321 | } | 330 | } |
201 | 322 | 331 | ||
202 | 323 | TEST_F(PresentationChain, buffers_can_be_destroyed_before_theyre_returned) | 332 | TEST_F(PresentationChain, buffers_can_be_destroyed_before_theyre_returned) |
203 | @@ -336,6 +345,45 @@ | |||
204 | 336 | mir_buffer_release(context.buffer()); | 345 | mir_buffer_release(context.buffer()); |
205 | 337 | } | 346 | } |
206 | 338 | 347 | ||
207 | 348 | TEST_F(PresentationChain, destroying_a_chain_will_return_buffers_associated_with_chain) | ||
208 | 349 | { | ||
209 | 350 | auto chain = mir_connection_create_presentation_chain_sync(connection); | ||
210 | 351 | auto stream = mir_connection_create_buffer_stream_sync(connection, 25, 12, mir_pixel_format_abgr_8888, mir_buffer_usage_hardware); | ||
211 | 352 | ASSERT_TRUE(mir_presentation_chain_is_valid(chain)); | ||
212 | 353 | |||
213 | 354 | auto spec = mir_connection_create_spec_for_normal_surface( | ||
214 | 355 | connection, size.width.as_int(), size.height.as_int(), pf); | ||
215 | 356 | auto surface = mir_surface_create_sync(spec); | ||
216 | 357 | mir_surface_spec_release(spec); | ||
217 | 358 | |||
218 | 359 | spec = mir_connection_create_spec_for_changes(connection); | ||
219 | 360 | mir_surface_spec_add_presentation_chain( | ||
220 | 361 | spec, size.width.as_int(), size.height.as_int(), 0, 0, chain); | ||
221 | 362 | mir_surface_apply_spec(surface, spec); | ||
222 | 363 | mir_surface_spec_release(spec); | ||
223 | 364 | |||
224 | 365 | MirBufferSync context; | ||
225 | 366 | mir_connection_allocate_buffer( | ||
226 | 367 | connection, | ||
227 | 368 | size.width.as_int(), size.height.as_int(), pf, usage, | ||
228 | 369 | buffer_callback, &context); | ||
229 | 370 | ASSERT_TRUE(context.wait_for_buffer(10s)); | ||
230 | 371 | context.unavailable(); | ||
231 | 372 | mir_presentation_chain_submit_buffer(chain, context.buffer()); | ||
232 | 373 | |||
233 | 374 | spec = mir_connection_create_spec_for_changes(connection); | ||
234 | 375 | mir_surface_spec_add_buffer_stream(spec, 0, 0, stream); | ||
235 | 376 | mir_surface_apply_spec(surface, spec); | ||
236 | 377 | mir_surface_spec_release(spec); | ||
237 | 378 | mir_presentation_chain_release(chain); | ||
238 | 379 | mir_buffer_stream_swap_buffers_sync(stream); | ||
239 | 380 | |||
240 | 381 | ASSERT_TRUE(context.wait_for_buffer(10s)); | ||
241 | 382 | |||
242 | 383 | mir_buffer_stream_release_sync(stream); | ||
243 | 384 | mir_surface_release_sync(surface); | ||
244 | 385 | } | ||
245 | 386 | |||
246 | 339 | TEST_F(PresentationChain, can_access_basic_buffer_properties) | 387 | TEST_F(PresentationChain, can_access_basic_buffer_properties) |
247 | 340 | { | 388 | { |
248 | 341 | MirBufferSync context; | 389 | MirBufferSync context; |
249 | @@ -417,4 +465,7 @@ | |||
250 | 417 | 465 | ||
251 | 418 | ASSERT_TRUE(another_context.wait_for_buffer(10s)); | 466 | ASSERT_TRUE(another_context.wait_for_buffer(10s)); |
252 | 419 | ASSERT_THAT(another_context.buffer(), Ne(nullptr)); | 467 | ASSERT_THAT(another_context.buffer(), Ne(nullptr)); |
253 | 468 | |||
254 | 469 | mir_buffer_set_callback(context.buffer(), ignore_callback, nullptr); | ||
255 | 470 | mir_buffer_set_callback(second_buffer_context.buffer(), ignore_callback, nullptr); | ||
256 | 420 | } | 471 | } |
257 | 421 | 472 | ||
258 | === modified file 'tests/integration-tests/test_buffer_scheduling.cpp' | |||
259 | --- tests/integration-tests/test_buffer_scheduling.cpp 2016-08-16 19:34:28 +0000 | |||
260 | +++ tests/integration-tests/test_buffer_scheduling.cpp 2016-09-22 19:03:27 +0000 | |||
261 | @@ -453,6 +453,10 @@ | |||
262 | 453 | vault.set_size(sz); | 453 | vault.set_size(sz); |
263 | 454 | }); | 454 | }); |
264 | 455 | } | 455 | } |
265 | 456 | ~ScheduledProducer() | ||
266 | 457 | { | ||
267 | 458 | ipc->on_client_bound_transfer([this](mp::BufferRequest&){}); | ||
268 | 459 | } | ||
269 | 456 | 460 | ||
270 | 457 | bool can_produce() | 461 | bool can_produce() |
271 | 458 | { | 462 | { |
272 | 459 | 463 | ||
273 | === modified file 'tests/unit-tests/client/test_mir_connection.cpp' | |||
274 | --- tests/unit-tests/client/test_mir_connection.cpp 2016-06-28 12:18:18 +0000 | |||
275 | +++ tests/unit-tests/client/test_mir_connection.cpp 2016-09-22 19:03:27 +0000 | |||
276 | @@ -820,7 +820,7 @@ | |||
277 | 820 | static_cast<MirPresentationChain*>(callback.resulting_chain)->rpc_id()); | 820 | static_cast<MirPresentationChain*>(callback.resulting_chain)->rpc_id()); |
278 | 821 | 821 | ||
279 | 822 | EXPECT_CALL(*mock_channel, buffer_stream_release(ReleaseRequestHasId(expected_request))) | 822 | EXPECT_CALL(*mock_channel, buffer_stream_release(ReleaseRequestHasId(expected_request))) |
281 | 823 | .Times(0); | 823 | .Times(1); |
282 | 824 | 824 | ||
283 | 825 | connection->release_presentation_chain(callback.resulting_chain); | 825 | connection->release_presentation_chain(callback.resulting_chain); |
284 | 826 | } | 826 | } |
285 | 827 | 827 | ||
286 | === modified file 'tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp' | |||
287 | --- tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp 2016-06-02 05:33:50 +0000 | |||
288 | +++ tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp 2016-09-22 19:03:27 +0000 | |||
289 | @@ -142,6 +142,7 @@ | |||
290 | 142 | EXPECT_THAT(cbuffer1, Ne(cbuffer2)); | 142 | EXPECT_THAT(cbuffer1, Ne(cbuffer2)); |
291 | 143 | arbiter.compositor_release(cbuffer2); | 143 | arbiter.compositor_release(cbuffer2); |
292 | 144 | arbiter.compositor_release(cbuffer1); | 144 | arbiter.compositor_release(cbuffer1); |
293 | 145 | Mock::VerifyAndClearExpectations(&mock_map); | ||
294 | 145 | } | 146 | } |
295 | 146 | 147 | ||
296 | 147 | TEST_F(MultiMonitorArbiterWithAnyFrameGuarantee, compositor_buffer_syncs_to_fastest_compositor) | 148 | TEST_F(MultiMonitorArbiterWithAnyFrameGuarantee, compositor_buffer_syncs_to_fastest_compositor) |
297 | @@ -394,6 +395,8 @@ | |||
298 | 394 | arbiter.compositor_release(b4); | 395 | arbiter.compositor_release(b4); |
299 | 395 | auto b6 = arbiter.compositor_acquire(&comp_id1); | 396 | auto b6 = arbiter.compositor_acquire(&comp_id1); |
300 | 396 | arbiter.compositor_release(b6); | 397 | arbiter.compositor_release(b6); |
301 | 398 | |||
302 | 399 | Mock::VerifyAndClearExpectations(&mock_map); | ||
303 | 397 | } | 400 | } |
304 | 398 | 401 | ||
305 | 399 | TEST_F(MultiMonitorArbiter, can_check_if_buffers_are_ready) | 402 | TEST_F(MultiMonitorArbiter, can_check_if_buffers_are_ready) |
306 | @@ -458,6 +461,7 @@ | |||
307 | 458 | EXPECT_THAT(b2, Eq(buffers[1])); | 461 | EXPECT_THAT(b2, Eq(buffers[1])); |
308 | 459 | arbiter.compositor_release(b1); | 462 | arbiter.compositor_release(b1); |
309 | 460 | arbiter.compositor_release(b2); | 463 | arbiter.compositor_release(b2); |
310 | 464 | Mock::VerifyAndClearExpectations(&mock_map); | ||
311 | 461 | } | 465 | } |
312 | 462 | 466 | ||
313 | 463 | TEST_F(MultiMonitorArbiter, will_release_buffer_in_nbuffers_2_starvation_scenario) | 467 | TEST_F(MultiMonitorArbiter, will_release_buffer_in_nbuffers_2_starvation_scenario) |
314 | @@ -513,6 +517,7 @@ | |||
315 | 513 | EXPECT_THAT(b3, Eq(buffers[1])); | 517 | EXPECT_THAT(b3, Eq(buffers[1])); |
316 | 514 | EXPECT_THAT(b4, Eq(buffers[1])); | 518 | EXPECT_THAT(b4, Eq(buffers[1])); |
317 | 515 | EXPECT_THAT(b5, Eq(buffers[2])); | 519 | EXPECT_THAT(b5, Eq(buffers[2])); |
318 | 520 | Mock::VerifyAndClearExpectations(&mock_map); | ||
319 | 516 | } | 521 | } |
320 | 517 | 522 | ||
321 | 518 | TEST_F(MultiMonitorArbiter, can_advance_buffer_manually) | 523 | TEST_F(MultiMonitorArbiter, can_advance_buffer_manually) |
322 | @@ -532,3 +537,11 @@ | |||
323 | 532 | auto b3 = arbiter.compositor_acquire(&comp_id1); | 537 | auto b3 = arbiter.compositor_acquire(&comp_id1); |
324 | 533 | EXPECT_THAT(b3->id(), Eq(buffers[2]->id())); | 538 | EXPECT_THAT(b3->id(), Eq(buffers[2]->id())); |
325 | 534 | } | 539 | } |
326 | 540 | |||
327 | 541 | TEST_F(MultiMonitorArbiter, releases_buffer_on_destruction) | ||
328 | 542 | { | ||
329 | 543 | mc::MultiMonitorArbiter arbiter{guarantee, mt::fake_shared(mock_map), mt::fake_shared(schedule)}; | ||
330 | 544 | EXPECT_CALL(mock_map, send_buffer(buffers[0]->id())); | ||
331 | 545 | schedule.set_schedule({buffers[0]}); | ||
332 | 546 | arbiter.advance_schedule(); | ||
333 | 547 | } | ||
334 | 535 | 548 | ||
335 | === modified file 'tests/unit-tests/compositor/test_stream.cpp' | |||
336 | --- tests/unit-tests/compositor/test_stream.cpp 2016-05-04 01:48:16 +0000 | |||
337 | +++ tests/unit-tests/compositor/test_stream.cpp 2016-09-22 19:03:27 +0000 | |||
338 | @@ -123,6 +123,7 @@ | |||
339 | 123 | cbuffers.push_back(stream.lock_compositor_buffer(this)); | 123 | cbuffers.push_back(stream.lock_compositor_buffer(this)); |
340 | 124 | ASSERT_THAT(cbuffers, SizeIs(1)); | 124 | ASSERT_THAT(cbuffers, SizeIs(1)); |
341 | 125 | EXPECT_THAT(cbuffers[0]->id(), Eq(buffers.back()->id())); | 125 | EXPECT_THAT(cbuffers[0]->id(), Eq(buffers.back()->id())); |
342 | 126 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
343 | 126 | } | 127 | } |
344 | 127 | 128 | ||
345 | 128 | TEST_F(Stream, transitions_from_framedropping_to_queuing) | 129 | TEST_F(Stream, transitions_from_framedropping_to_queuing) |
346 | @@ -325,6 +326,7 @@ | |||
347 | 325 | Mock::VerifyAndClearExpectations(&mock_sink); | 326 | Mock::VerifyAndClearExpectations(&mock_sink); |
348 | 326 | EXPECT_CALL(mock_sink, send_buffer(_,_,_)); | 327 | EXPECT_CALL(mock_sink, send_buffer(_,_,_)); |
349 | 327 | framedrop_factory.trigger_policies(); | 328 | framedrop_factory.trigger_policies(); |
350 | 329 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
351 | 328 | } | 330 | } |
352 | 329 | 331 | ||
353 | 330 | TEST_F(Stream, doesnt_drop_the_only_frame_when_arbiter_has_none) | 332 | TEST_F(Stream, doesnt_drop_the_only_frame_when_arbiter_has_none) |
354 | @@ -334,6 +336,7 @@ | |||
355 | 334 | EXPECT_CALL(mock_sink, send_buffer(_,_,_)) | 336 | EXPECT_CALL(mock_sink, send_buffer(_,_,_)) |
356 | 335 | .Times(0); | 337 | .Times(0); |
357 | 336 | framedrop_factory.trigger_policies(); | 338 | framedrop_factory.trigger_policies(); |
358 | 339 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
359 | 337 | } | 340 | } |
360 | 338 | 341 | ||
361 | 339 | TEST_F(Stream, doesnt_drop_the_latest_frame_with_a_longer_queue) | 342 | TEST_F(Stream, doesnt_drop_the_latest_frame_with_a_longer_queue) |
362 | @@ -347,6 +350,7 @@ | |||
363 | 347 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)) | 350 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)) |
364 | 348 | .Times(1); | 351 | .Times(1); |
365 | 349 | framedrop_factory.trigger_policies(); | 352 | framedrop_factory.trigger_policies(); |
366 | 353 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
367 | 350 | } | 354 | } |
368 | 351 | 355 | ||
369 | 352 | TEST_F(Stream, doesnt_drop_the_latest_frame_with_a_2_buffer_queue) | 356 | TEST_F(Stream, doesnt_drop_the_latest_frame_with_a_2_buffer_queue) |
370 | @@ -359,6 +363,7 @@ | |||
371 | 359 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)) | 363 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)) |
372 | 360 | .Times(0); | 364 | .Times(0); |
373 | 361 | framedrop_factory.trigger_policies(); | 365 | framedrop_factory.trigger_policies(); |
374 | 366 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
375 | 362 | } | 367 | } |
376 | 363 | 368 | ||
377 | 364 | TEST_F(Stream, returns_buffers_to_client_when_told_to_bring_queue_up_to_date) | 369 | TEST_F(Stream, returns_buffers_to_client_when_told_to_bring_queue_up_to_date) |
378 | @@ -371,4 +376,5 @@ | |||
379 | 371 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[0]),_)); | 376 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[0]),_)); |
380 | 372 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)); | 377 | EXPECT_CALL(mock_sink, send_buffer(_,Ref(*buffers[1]),_)); |
381 | 373 | stream.drop_old_buffers(); | 378 | stream.drop_old_buffers(); |
382 | 379 | Mock::VerifyAndClearExpectations(&mock_sink); | ||
383 | 374 | } | 380 | } |
FAILED: Continuous integration, rev:3718 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1784/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2234/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/2297 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2288 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2288 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2288 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2262/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2262 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2262/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2262 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2262/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2262 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2262/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2262/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1784/rebuild
https:/