Status: | Merged |
---|---|
Approved by: | Cemil Azizoglu |
Approved revision: | 3328 |
Merged at revision: | 1265 |
Proposed branch: | lp:mir/0.20 |
Merge into: | lp:mir/ubuntu |
Diff against target: |
922 lines (+231/-136) 23 files modified
CMakeLists.txt (+1/-1) debian/changelog (+15/-1) include/client/mir_toolkit/events/input/pointer_event.h (+4/-1) src/client/input/android/event_conversion_helpers.cpp (+11/-26) src/client/input/input_event.cpp (+1/-15) src/platforms/android/server/cmdstream_sync_factory.h (+6/-0) src/platforms/android/server/device_quirks.cpp (+29/-7) src/platforms/android/server/device_quirks.h (+1/-0) src/platforms/android/server/display_component_factory.h (+2/-0) src/platforms/android/server/egl_sync_factory.cpp (+5/-0) src/platforms/android/server/hal_component_factory.cpp (+22/-10) src/platforms/android/server/hal_component_factory.h (+9/-3) src/platforms/android/server/platform.cpp (+12/-8) src/platforms/android/server/platform.h (+0/-2) src/platforms/evdev/button_utils.cpp (+3/-0) src/platforms/evdev/libinput_device.cpp (+45/-35) tests/include/mir/test/doubles/stub_display_builder.h (+5/-0) tests/unit-tests/graphics/android/test_device_detection.cpp (+7/-7) tests/unit-tests/graphics/android/test_display_hotplug.cpp (+5/-0) tests/unit-tests/graphics/android/test_output_builder.cpp (+7/-10) tests/unit-tests/graphics/android/test_platform.cpp (+4/-8) tests/unit-tests/graphics/android/test_server_interpreter.cpp (+2/-2) tests/unit-tests/input/evdev/test_libinput_device.cpp (+35/-0) |
To merge this branch: | bzr merge lp:mir/0.20 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Approve | ||
Cemil Azizoglu (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+287128@code.launchpad.net |
Commit message
Bug fix release 0.20.1
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
- 3328. By Andreas Pokorny
-
Add support for a wider range of mouse buttons, and ignore joystick buttons
Libinput currently only differs between keys and buttons. Buttons are always
treated as mouse buttons so we receive pointer button events in unexpected
cases. With this change the pointer events with outside of the common mouse
range are ignored. Changes in libinput are required to get proper gamepad or
joystick support.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3328
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
Don't see anything wrong
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-02-12 10:51:29 +0000 |
3 | +++ CMakeLists.txt 2016-02-25 11:58:41 +0000 |
4 | @@ -29,7 +29,7 @@ |
5 | |
6 | set(MIR_VERSION_MAJOR 0) |
7 | set(MIR_VERSION_MINOR 20) |
8 | -set(MIR_VERSION_PATCH 0) |
9 | +set(MIR_VERSION_PATCH 1) |
10 | |
11 | add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR}) |
12 | add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR}) |
13 | |
14 | === modified file 'debian/changelog' |
15 | --- debian/changelog 2016-02-19 10:41:00 +0000 |
16 | +++ debian/changelog 2016-02-25 11:58:41 +0000 |
17 | @@ -1,3 +1,17 @@ |
18 | +mir (0.20.1-0ubuntu1) UNRELEASED; urgency=medium |
19 | + |
20 | + [ Kevin DuBois ] |
21 | + * New upstream release 0.20.1 (https://launchpad.net/mir/+milestone/0.20.1) |
22 | + - ABI summary: |
23 | + . No ABI changes in any libraries. Bugfix release only. |
24 | + - Bugs fixed: |
25 | + . On arale; top panel drop down menu is semi-transparent and items are |
26 | + unreadable. Accommodate system image device name change for arale |
27 | + device that broke android quirk detection (LP: #1549226) |
28 | + . Crash when side mouse buttons are pressed (LP: #1544878) |
29 | + |
30 | + -- Kevin DuBois <kevin.dubois@canonical.com> Wed, 24 Feb 2016 08:33:20 -0500 |
31 | + |
32 | mir (0.20.0+16.04.20160219-0ubuntu1) xenial; urgency=medium |
33 | |
34 | [ Alan Griffiths ] |
35 | @@ -56,7 +70,7 @@ |
36 | . mouse pointer support on emulator is broken (LP: #1517597). |
37 | [Cherrypicked from 0.21] |
38 | . move an android-only test that ended up in tests/unit-tests/graphics. |
39 | - (LP: ##1546676) [Cherrypicked from 0.21] |
40 | + (LP: #1546676) [Cherrypicked from 0.21] |
41 | |
42 | [ CI Train Bot ] |
43 | * No-change rebuild. |
44 | |
45 | === modified file 'include/client/mir_toolkit/events/input/pointer_event.h' |
46 | --- include/client/mir_toolkit/events/input/pointer_event.h 2016-01-29 08:18:22 +0000 |
47 | +++ include/client/mir_toolkit/events/input/pointer_event.h 2016-02-25 11:58:41 +0000 |
48 | @@ -77,7 +77,10 @@ |
49 | mir_pointer_button_secondary = 1 << 1, |
50 | mir_pointer_button_tertiary = 1 << 2, |
51 | mir_pointer_button_back = 1 << 3, |
52 | - mir_pointer_button_forward = 1 << 4 |
53 | + mir_pointer_button_forward = 1 << 4, |
54 | + mir_pointer_button_side = 1 << 5, |
55 | + mir_pointer_button_extra = 1 << 6, |
56 | + mir_pointer_button_task = 1 << 7 |
57 | } MirPointerButton; |
58 | typedef unsigned int MirPointerButtons; |
59 | |
60 | |
61 | === modified file 'src/client/input/android/event_conversion_helpers.cpp' |
62 | --- src/client/input/android/event_conversion_helpers.cpp 2015-06-18 02:46:16 +0000 |
63 | +++ src/client/input/android/event_conversion_helpers.cpp 2016-02-25 11:58:41 +0000 |
64 | @@ -108,36 +108,18 @@ |
65 | |
66 | MirPointerButtons mia::mir_pointer_buttons_from_android(int32_t android_state) |
67 | { |
68 | - MirPointerButtons buttons = 0; |
69 | - |
70 | - if (android_state & AMOTION_EVENT_BUTTON_PRIMARY) |
71 | - buttons |= mir_pointer_button_primary; |
72 | - if (android_state & AMOTION_EVENT_BUTTON_SECONDARY) |
73 | - buttons |= mir_pointer_button_secondary; |
74 | - if (android_state & AMOTION_EVENT_BUTTON_TERTIARY) |
75 | - buttons |= mir_pointer_button_tertiary; |
76 | - if (android_state & AMOTION_EVENT_BUTTON_BACK) |
77 | - buttons |= mir_pointer_button_back; |
78 | - if (android_state & AMOTION_EVENT_BUTTON_FORWARD) |
79 | - buttons |= mir_pointer_button_forward; |
80 | - |
81 | - return buttons; |
82 | + static_assert(int32_t(mir_pointer_button_primary) == AMOTION_EVENT_BUTTON_PRIMARY && |
83 | + int32_t(mir_pointer_button_secondary) == AMOTION_EVENT_BUTTON_SECONDARY && |
84 | + int32_t(mir_pointer_button_tertiary) == AMOTION_EVENT_BUTTON_TERTIARY && |
85 | + int32_t(mir_pointer_button_back) == AMOTION_EVENT_BUTTON_BACK && |
86 | + int32_t(mir_pointer_button_forward) == AMOTION_EVENT_BUTTON_FORWARD, |
87 | + "pointer button enumeration out of sync with android definition"); |
88 | + return static_cast<MirPointerButtons>(android_state); |
89 | } |
90 | |
91 | int32_t mia::android_pointer_buttons_from_mir(MirPointerButtons buttons) |
92 | { |
93 | - int32_t android_state = 0; |
94 | - if (buttons & mir_pointer_button_primary) |
95 | - android_state |= AMOTION_EVENT_BUTTON_PRIMARY; |
96 | - if (buttons & mir_pointer_button_secondary) |
97 | - android_state |= AMOTION_EVENT_BUTTON_SECONDARY; |
98 | - if (buttons & mir_pointer_button_tertiary) |
99 | - android_state |= AMOTION_EVENT_BUTTON_TERTIARY; |
100 | - if (buttons & mir_pointer_button_back) |
101 | - android_state |= AMOTION_EVENT_BUTTON_BACK; |
102 | - if (buttons & mir_pointer_button_forward) |
103 | - android_state |= AMOTION_EVENT_BUTTON_FORWARD; |
104 | - return android_state; |
105 | + return static_cast<int32_t>(buttons); |
106 | } |
107 | |
108 | MirTouchTooltype mia::mir_tool_type_from_android(int32_t android_tooltype) |
109 | @@ -263,6 +245,9 @@ |
110 | if (buttons & mir_pointer_button_tertiary) ret++; |
111 | if (buttons & mir_pointer_button_forward) ret++; |
112 | if (buttons & mir_pointer_button_back) ret++; |
113 | + if (buttons & mir_pointer_button_side) ret++; |
114 | + if (buttons & mir_pointer_button_extra) ret++; |
115 | + if (buttons & mir_pointer_button_task) ret++; |
116 | |
117 | return ret; |
118 | } |
119 | |
120 | === modified file 'src/client/input/input_event.cpp' |
121 | --- src/client/input/input_event.cpp 2016-01-29 08:18:22 +0000 |
122 | +++ src/client/input/input_event.cpp 2016-02-25 11:58:41 +0000 |
123 | @@ -357,21 +357,7 @@ |
124 | MirPointerButton button) |
125 | { |
126 | auto const& old_mev = old_mev_from_new(pev); |
127 | - switch (button) |
128 | - { |
129 | - case mir_pointer_button_primary: |
130 | - return old_mev.buttons & mir_pointer_button_primary; |
131 | - case mir_pointer_button_secondary: |
132 | - return old_mev.buttons & mir_pointer_button_secondary; |
133 | - case mir_pointer_button_tertiary: |
134 | - return old_mev.buttons & mir_pointer_button_tertiary; |
135 | - case mir_pointer_button_back: |
136 | - return old_mev.buttons & mir_pointer_button_back; |
137 | - case mir_pointer_button_forward: |
138 | - return old_mev.buttons & mir_pointer_button_forward; |
139 | - default: |
140 | - return false; |
141 | - } |
142 | + return old_mev.buttons & button; |
143 | } |
144 | |
145 | MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* pev) |
146 | |
147 | === modified file 'src/platforms/android/server/cmdstream_sync_factory.h' |
148 | --- src/platforms/android/server/cmdstream_sync_factory.h 2016-01-26 14:02:44 +0000 |
149 | +++ src/platforms/android/server/cmdstream_sync_factory.h 2016-02-25 11:58:41 +0000 |
150 | @@ -42,6 +42,12 @@ |
151 | { |
152 | std::unique_ptr<CommandStreamSync> create_command_stream_sync() override; |
153 | }; |
154 | + |
155 | +class NullCommandStreamSyncFactory : public CommandStreamSyncFactory |
156 | +{ |
157 | + std::unique_ptr<CommandStreamSync> create_command_stream_sync() override; |
158 | +}; |
159 | + |
160 | } |
161 | } |
162 | } |
163 | |
164 | === modified file 'src/platforms/android/server/device_quirks.cpp' |
165 | --- src/platforms/android/server/device_quirks.cpp 2016-02-12 10:51:29 +0000 |
166 | +++ src/platforms/android/server/device_quirks.cpp 2016-02-25 11:58:41 +0000 |
167 | @@ -39,6 +39,12 @@ |
168 | char const* const gralloc_cannot_be_closed_safely_opt = "enable-gralloc-cannot-be-closed-safely-quirk"; |
169 | char const* const width_alignment_opt = "enable-width-alignment-quirk"; |
170 | char const* const fb_ion_heap_opt = "fb-ion-heap"; |
171 | +char const* const working_egl_sync_opt = "use-eglsync-quirk"; |
172 | +std::string const egl_sync_default = "default"; |
173 | +std::string const egl_sync_force_on = "force_on"; |
174 | +std::string const egl_sync_force_off = "force_off"; |
175 | + |
176 | + |
177 | std::string determine_device_name(mga::PropertiesWrapper const& properties) |
178 | { |
179 | char const default_value[] = ""; |
180 | @@ -63,7 +69,7 @@ |
181 | |
182 | bool clear_fb_context_fence_for(std::string const& device_name) |
183 | { |
184 | - return device_name == "krillin" || device_name == "mx4" || device_name == "manta"; |
185 | + return device_name == "krillin" || device_name == "arale" || device_name == "manta"; |
186 | } |
187 | |
188 | bool device_has_fb_ion_heap(std::string const& device_name, bool quirk_enabled) |
189 | @@ -71,6 +77,18 @@ |
190 | return quirk_enabled && (device_name != "Aquaris_M10_FHD"); |
191 | } |
192 | |
193 | +bool device_has_working_egl_sync(std::string const& device_name, std::string const& option) |
194 | +{ |
195 | + if (option == egl_sync_force_on) |
196 | + return true; |
197 | + if (option == egl_sync_force_off) |
198 | + return false; |
199 | + |
200 | + if (device_name == "arale") |
201 | + return false; |
202 | + return true; |
203 | +} |
204 | + |
205 | } |
206 | |
207 | mga::DeviceQuirks::DeviceQuirks(PropertiesWrapper const& properties) |
208 | @@ -79,7 +97,8 @@ |
209 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)), |
210 | enable_width_alignment_quirk{true}, |
211 | clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}, |
212 | - fb_ion_heap_{device_has_fb_ion_heap(device_name, true)} |
213 | + fb_ion_heap_{device_has_fb_ion_heap(device_name, true)}, |
214 | + working_egl_sync_{device_has_working_egl_sync(device_name, egl_sync_default)} |
215 | { |
216 | } |
217 | |
218 | @@ -89,7 +108,9 @@ |
219 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, options.get(gralloc_cannot_be_closed_safely_opt, true))), |
220 | enable_width_alignment_quirk(options.get(width_alignment_opt, true)), |
221 | clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}, |
222 | - fb_ion_heap_{device_has_fb_ion_heap(device_name, options.get(fb_ion_heap_opt, true))} |
223 | + fb_ion_heap_{device_has_fb_ion_heap(device_name, options.get(fb_ion_heap_opt, true))}, |
224 | + working_egl_sync_{device_has_working_egl_sync( |
225 | + device_name, options.get(working_egl_sync_opt, egl_sync_default.c_str()))} |
226 | { |
227 | } |
228 | |
229 | @@ -125,8 +146,7 @@ |
230 | |
231 | bool mga::DeviceQuirks::working_egl_sync() const |
232 | { |
233 | - //FIXME: this really should be all powervr devices. |
234 | - return device_name != "mx4"; |
235 | + return working_egl_sync_; |
236 | } |
237 | |
238 | void mga::DeviceQuirks::add_options(boost::program_options::options_description& config) |
239 | @@ -143,6 +163,8 @@ |
240 | "[platform-specific] Enable width alignment (vegetahd quirk) [{true,false}]") |
241 | (fb_ion_heap_opt, |
242 | boost::program_options::value<bool>()->default_value(true), |
243 | - "[platform-specific] device has ion heap for framebuffer allocation available [{true, false}]"); |
244 | - |
245 | + "[platform-specific] device has ion heap for framebuffer allocation available [{true, false}]") |
246 | + (working_egl_sync_opt, |
247 | + boost::program_options::value<std::string>()->default_value(egl_sync_default), |
248 | + "[platform-specific] use KHR_reusable_sync extension [{default, force_on, force_off}]"); |
249 | } |
250 | |
251 | === modified file 'src/platforms/android/server/device_quirks.h' |
252 | --- src/platforms/android/server/device_quirks.h 2016-02-02 20:22:57 +0000 |
253 | +++ src/platforms/android/server/device_quirks.h 2016-02-25 11:58:41 +0000 |
254 | @@ -78,6 +78,7 @@ |
255 | bool const enable_width_alignment_quirk; |
256 | bool const clear_fb_context_fence_; |
257 | bool const fb_ion_heap_; |
258 | + bool const working_egl_sync_; |
259 | }; |
260 | } |
261 | } |
262 | |
263 | === modified file 'src/platforms/android/server/display_component_factory.h' |
264 | --- src/platforms/android/server/display_component_factory.h 2016-02-02 20:22:57 +0000 |
265 | +++ src/platforms/android/server/display_component_factory.h 2016-02-25 11:58:41 +0000 |
266 | @@ -30,6 +30,7 @@ |
267 | { |
268 | class DisplayConfigurationOutput; |
269 | class CommandStreamSync; |
270 | +class GraphicBufferAllocator; |
271 | namespace android |
272 | { |
273 | class HwcConfiguration; |
274 | @@ -45,6 +46,7 @@ |
275 | virtual std::unique_ptr<HwcConfiguration> create_hwc_configuration() = 0; |
276 | virtual std::unique_ptr<LayerList> create_layer_list() = 0; |
277 | |
278 | + virtual std::shared_ptr<graphics::GraphicBufferAllocator> the_buffer_allocator() = 0; |
279 | protected: |
280 | DisplayComponentFactory() = default; |
281 | DisplayComponentFactory(DisplayComponentFactory const&) = delete; |
282 | |
283 | === modified file 'src/platforms/android/server/egl_sync_factory.cpp' |
284 | --- src/platforms/android/server/egl_sync_factory.cpp 2016-01-28 17:46:29 +0000 |
285 | +++ src/platforms/android/server/egl_sync_factory.cpp 2016-02-25 11:58:41 +0000 |
286 | @@ -33,3 +33,8 @@ |
287 | return std::make_unique<NullCommandSync>(); |
288 | } |
289 | } |
290 | + |
291 | +std::unique_ptr<mg::CommandStreamSync> mga::NullCommandStreamSyncFactory::create_command_stream_sync() |
292 | +{ |
293 | + return std::make_unique<NullCommandSync>(); |
294 | +} |
295 | |
296 | === modified file 'src/platforms/android/server/hal_component_factory.cpp' |
297 | --- src/platforms/android/server/hal_component_factory.cpp 2016-02-02 20:22:57 +0000 |
298 | +++ src/platforms/android/server/hal_component_factory.cpp 2016-02-25 11:58:41 +0000 |
299 | @@ -29,6 +29,8 @@ |
300 | #include "hwc_layers.h" |
301 | #include "hwc_device.h" |
302 | #include "hwc_fb_device.h" |
303 | +#include "android_graphic_buffer_allocator.h" |
304 | +#include "cmdstream_sync_factory.h" |
305 | |
306 | #include <boost/throw_exception.hpp> |
307 | #include <stdexcept> |
308 | @@ -38,16 +40,15 @@ |
309 | namespace geom = mir::geometry; |
310 | |
311 | mga::HalComponentFactory::HalComponentFactory( |
312 | - std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator, |
313 | std::shared_ptr<mga::DisplayResourceFactory> const& res_factory, |
314 | std::shared_ptr<HwcReport> const& hwc_report, |
315 | std::shared_ptr<mga::DeviceQuirks> const& quirks) |
316 | - : buffer_allocator(buffer_allocator), |
317 | - res_factory(res_factory), |
318 | + : res_factory(res_factory), |
319 | hwc_report(hwc_report), |
320 | force_backup_display(false), |
321 | num_framebuffers{quirks->num_framebuffers()}, |
322 | - working_egl_sync(quirks->working_egl_sync()) |
323 | + working_egl_sync(quirks->working_egl_sync()), |
324 | + hwc_version{mga::HwcVersion::unknown} |
325 | { |
326 | try |
327 | { |
328 | @@ -64,23 +65,29 @@ |
329 | //guarantee always 2 fb's allocated |
330 | num_framebuffers = std::max(2u, static_cast<unsigned int>(fb_native->numFramebuffers)); |
331 | } |
332 | + |
333 | + command_stream_sync_factory = create_command_stream_sync_factory(); |
334 | + buffer_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>( |
335 | + command_stream_sync_factory, quirks); |
336 | } |
337 | |
338 | std::unique_ptr<mg::CommandStreamSync> mga::HalComponentFactory::create_command_stream_sync() |
339 | { |
340 | - if (hwc_version == mga::HwcVersion::hwc10) |
341 | - return std::make_unique<NullCommandSync>(); |
342 | + return command_stream_sync_factory->create_command_stream_sync(); |
343 | +} |
344 | |
345 | - if (!working_egl_sync) |
346 | - return std::make_unique<NullCommandSync>(); |
347 | +std::unique_ptr<mga::CommandStreamSyncFactory> mga::HalComponentFactory::create_command_stream_sync_factory() |
348 | +{ |
349 | + if ((hwc_version == mga::HwcVersion::hwc10) || !working_egl_sync) |
350 | + return std::make_unique<mga::NullCommandStreamSyncFactory>(); |
351 | |
352 | try |
353 | { |
354 | - return std::make_unique<EGLSyncFence>(std::make_shared<mg::EGLSyncExtensions>()); |
355 | + return std::make_unique<mga::EGLSyncFactory>(); |
356 | } |
357 | catch (std::runtime_error&) |
358 | { |
359 | - return std::make_unique<NullCommandSync>(); |
360 | + return std::make_unique<mga::NullCommandStreamSyncFactory>(); |
361 | } |
362 | } |
363 | |
364 | @@ -157,3 +164,8 @@ |
365 | else |
366 | return std::unique_ptr<mga::HwcConfiguration>(new mga::HwcPowerModeControl(hwc_wrapper)); |
367 | } |
368 | + |
369 | +std::shared_ptr<mg::GraphicBufferAllocator> mga::HalComponentFactory::the_buffer_allocator() |
370 | +{ |
371 | + return buffer_allocator; |
372 | +} |
373 | |
374 | === modified file 'src/platforms/android/server/hal_component_factory.h' |
375 | --- src/platforms/android/server/hal_component_factory.h 2016-02-02 20:22:57 +0000 |
376 | +++ src/platforms/android/server/hal_component_factory.h 2016-02-25 11:58:41 +0000 |
377 | @@ -32,11 +32,13 @@ |
378 | { |
379 | class FramebufferBundle; |
380 | class DisplayResourceFactory; |
381 | -class GraphicBufferAllocator; |
382 | class DisplayDevice; |
383 | class HwcWrapper; |
384 | class HwcReport; |
385 | class DeviceQuirks; |
386 | +class CommandStreamSyncFactory; |
387 | +class AndroidGraphicBufferAllocator; |
388 | + |
389 | |
390 | //NOTE: this should be the only class that inspects the HWC version and assembles |
391 | //the components accordingly |
392 | @@ -44,7 +46,6 @@ |
393 | { |
394 | public: |
395 | HalComponentFactory( |
396 | - std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator, |
397 | std::shared_ptr<DisplayResourceFactory> const& res_factory, |
398 | std::shared_ptr<HwcReport> const& hwc_report, |
399 | std::shared_ptr<DeviceQuirks> const& quirks); |
400 | @@ -54,9 +55,11 @@ |
401 | std::unique_ptr<DisplayDevice> create_display_device() override; |
402 | std::unique_ptr<HwcConfiguration> create_hwc_configuration() override; |
403 | std::unique_ptr<LayerList> create_layer_list() override; |
404 | + std::shared_ptr<graphics::GraphicBufferAllocator> the_buffer_allocator() override; |
405 | |
406 | private: |
407 | - std::shared_ptr<GraphicBufferAllocator> const buffer_allocator; |
408 | + std::unique_ptr<CommandStreamSyncFactory> create_command_stream_sync_factory(); |
409 | + |
410 | std::shared_ptr<DisplayResourceFactory> const res_factory; |
411 | std::shared_ptr<HwcReport> const hwc_report; |
412 | |
413 | @@ -68,6 +71,9 @@ |
414 | std::shared_ptr<HwcWrapper> hwc_wrapper; |
415 | std::shared_ptr<framebuffer_device_t> fb_native; |
416 | HwcVersion hwc_version; |
417 | + |
418 | + std::shared_ptr<graphics::android::AndroidGraphicBufferAllocator> buffer_allocator; |
419 | + std::shared_ptr<CommandStreamSyncFactory> command_stream_sync_factory; |
420 | }; |
421 | |
422 | } |
423 | |
424 | === modified file 'src/platforms/android/server/platform.cpp' |
425 | --- src/platforms/android/server/platform.cpp 2016-02-02 20:22:57 +0000 |
426 | +++ src/platforms/android/server/platform.cpp 2016-02-25 11:58:41 +0000 |
427 | @@ -86,13 +86,11 @@ |
428 | mga::Platform::Platform( |
429 | std::shared_ptr<graphics::GraphicBufferAllocator> const& buffer_allocator, |
430 | std::shared_ptr<mga::DisplayComponentFactory> const& display_buffer_builder, |
431 | - std::shared_ptr<CommandStreamSyncFactory> const& sync_factory, |
432 | std::shared_ptr<mg::DisplayReport> const& display_report, |
433 | mga::OverlayOptimization overlay_option, |
434 | std::shared_ptr<mga::DeviceQuirks> const& quirks) : |
435 | buffer_allocator(buffer_allocator), |
436 | display_buffer_builder(display_buffer_builder), |
437 | - sync_factory(sync_factory), |
438 | display_report(display_report), |
439 | quirks(quirks), |
440 | overlay_option(overlay_option) |
441 | @@ -156,13 +154,13 @@ |
442 | auto overlay_option = should_use_overlay_optimization(*options); |
443 | hwc_report->report_overlay_optimization(overlay_option); |
444 | auto display_resource_factory = std::make_shared<mga::ResourceFactory>(); |
445 | - auto sync_factory = std::make_shared<mga::EGLSyncFactory>(); |
446 | - auto buffer_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>(sync_factory, quirks); |
447 | + |
448 | auto component_factory = std::make_shared<mga::HalComponentFactory>( |
449 | - buffer_allocator, display_resource_factory, hwc_report, quirks); |
450 | + display_resource_factory, hwc_report, quirks); |
451 | |
452 | return mir::make_module_ptr<mga::Platform>( |
453 | - buffer_allocator, component_factory, component_factory, display_report, overlay_option, quirks); |
454 | + component_factory->the_buffer_allocator(), |
455 | + component_factory, display_report, overlay_option, quirks); |
456 | } |
457 | |
458 | mir::UniqueModulePtr<mg::Platform> create_guest_platform( |
459 | @@ -172,11 +170,17 @@ |
460 | mir::assert_entry_point_signature<mg::CreateGuestPlatform>(&create_guest_platform); |
461 | //TODO: actually allow disabling quirks for guest platform |
462 | auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}); |
463 | - auto sync_factory = std::make_shared<mga::EGLSyncFactory>(); |
464 | + |
465 | + std::shared_ptr<mga::CommandStreamSyncFactory> sync_factory; |
466 | + if (quirks->working_egl_sync()) |
467 | + sync_factory = std::make_shared<mga::EGLSyncFactory>(); |
468 | + else |
469 | + sync_factory = std::make_shared<mga::NullCommandStreamSyncFactory>(); |
470 | + |
471 | //TODO: remove nullptr parameter once platform classes are sorted. |
472 | // mg::NativePlatform cannot create a display anyways, so it doesnt need a display builder |
473 | auto const buffer_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>(sync_factory, quirks); |
474 | - return mir::make_module_ptr<mga::Platform>(buffer_allocator, nullptr, sync_factory, display_report, mga::OverlayOptimization::disabled, quirks); |
475 | + return mir::make_module_ptr<mga::Platform>(buffer_allocator, nullptr, display_report, mga::OverlayOptimization::disabled, quirks); |
476 | } |
477 | |
478 | void add_graphics_platform_options( |
479 | |
480 | === modified file 'src/platforms/android/server/platform.h' |
481 | --- src/platforms/android/server/platform.h 2016-02-02 20:22:57 +0000 |
482 | +++ src/platforms/android/server/platform.h 2016-02-25 11:58:41 +0000 |
483 | @@ -41,7 +41,6 @@ |
484 | Platform( |
485 | std::shared_ptr<graphics::GraphicBufferAllocator> const& buffer_allocator, |
486 | std::shared_ptr<DisplayComponentFactory> const& display_buffer_builder, |
487 | - std::shared_ptr<CommandStreamSyncFactory> const& sync_factory, |
488 | std::shared_ptr<DisplayReport> const& display_report, |
489 | OverlayOptimization overlay_option, |
490 | std::shared_ptr<DeviceQuirks> const& quirks); |
491 | @@ -57,7 +56,6 @@ |
492 | private: |
493 | std::shared_ptr<graphics::GraphicBufferAllocator> const buffer_allocator; |
494 | std::shared_ptr<DisplayComponentFactory> const display_buffer_builder; |
495 | - std::shared_ptr<CommandStreamSyncFactory> const sync_factory; |
496 | std::shared_ptr<DisplayReport> const display_report; |
497 | std::shared_ptr<PlatformIpcOperations> const ipc_operations; |
498 | std::shared_ptr<DeviceQuirks> const quirks; |
499 | |
500 | === modified file 'src/platforms/evdev/button_utils.cpp' |
501 | --- src/platforms/evdev/button_utils.cpp 2015-10-20 05:34:31 +0000 |
502 | +++ src/platforms/evdev/button_utils.cpp 2016-02-25 11:58:41 +0000 |
503 | @@ -38,6 +38,9 @@ |
504 | case BTN_MIDDLE: return mir_pointer_button_tertiary; |
505 | case BTN_BACK: return mir_pointer_button_back; |
506 | case BTN_FORWARD: return mir_pointer_button_forward; |
507 | + case BTN_SIDE: return mir_pointer_button_side; |
508 | + case BTN_EXTRA: return mir_pointer_button_extra; |
509 | + case BTN_TASK: return mir_pointer_button_task; |
510 | } |
511 | BOOST_THROW_EXCEPTION(std::runtime_error("Invalid mouse button")); |
512 | } |
513 | |
514 | === modified file 'src/platforms/evdev/libinput_device.cpp' |
515 | --- src/platforms/evdev/libinput_device.cpp 2016-01-29 08:18:22 +0000 |
516 | +++ src/platforms/evdev/libinput_device.cpp 2016-02-25 11:58:41 +0000 |
517 | @@ -32,10 +32,13 @@ |
518 | #include "mir/geometry/displacement.h" |
519 | #include "mir/dispatch/dispatchable.h" |
520 | #include "mir/fd.h" |
521 | +#define MIR_LOG_COMPONENT "evdev" |
522 | +#include "mir/log.h" |
523 | |
524 | #include <libinput.h> |
525 | #include <linux/input.h> // only used to get constants for input reports |
526 | |
527 | +#include <boost/exception/diagnostic_information.hpp> |
528 | #include <cstring> |
529 | #include <chrono> |
530 | #include <sstream> |
531 | @@ -84,41 +87,48 @@ |
532 | if (!sink) |
533 | return; |
534 | |
535 | - switch(libinput_event_get_type(event)) |
536 | - { |
537 | - case LIBINPUT_EVENT_KEYBOARD_KEY: |
538 | - sink->handle_input(*convert_event(libinput_event_get_keyboard_event(event))); |
539 | - break; |
540 | - case LIBINPUT_EVENT_POINTER_MOTION: |
541 | - sink->handle_input(*convert_motion_event(libinput_event_get_pointer_event(event))); |
542 | - break; |
543 | - case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: |
544 | - sink->handle_input(*convert_absolute_motion_event(libinput_event_get_pointer_event(event))); |
545 | - break; |
546 | - case LIBINPUT_EVENT_POINTER_BUTTON: |
547 | - sink->handle_input(*convert_button_event(libinput_event_get_pointer_event(event))); |
548 | - break; |
549 | - case LIBINPUT_EVENT_POINTER_AXIS: |
550 | - sink->handle_input(*convert_axis_event(libinput_event_get_pointer_event(event))); |
551 | - break; |
552 | - // touch events are processed as a batch of changes over all touch pointts |
553 | - case LIBINPUT_EVENT_TOUCH_DOWN: |
554 | - handle_touch_down(libinput_event_get_touch_event(event)); |
555 | - break; |
556 | - case LIBINPUT_EVENT_TOUCH_UP: |
557 | - handle_touch_up(libinput_event_get_touch_event(event)); |
558 | - break; |
559 | - case LIBINPUT_EVENT_TOUCH_MOTION: |
560 | - handle_touch_motion(libinput_event_get_touch_event(event)); |
561 | - break; |
562 | - case LIBINPUT_EVENT_TOUCH_CANCEL: |
563 | - // Not yet provided by libinput. |
564 | - break; |
565 | - case LIBINPUT_EVENT_TOUCH_FRAME: |
566 | - sink->handle_input(*convert_touch_frame(libinput_event_get_touch_event(event))); |
567 | - break; |
568 | - default: |
569 | - break; |
570 | + try |
571 | + { |
572 | + switch(libinput_event_get_type(event)) |
573 | + { |
574 | + case LIBINPUT_EVENT_KEYBOARD_KEY: |
575 | + sink->handle_input(*convert_event(libinput_event_get_keyboard_event(event))); |
576 | + break; |
577 | + case LIBINPUT_EVENT_POINTER_MOTION: |
578 | + sink->handle_input(*convert_motion_event(libinput_event_get_pointer_event(event))); |
579 | + break; |
580 | + case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: |
581 | + sink->handle_input(*convert_absolute_motion_event(libinput_event_get_pointer_event(event))); |
582 | + break; |
583 | + case LIBINPUT_EVENT_POINTER_BUTTON: |
584 | + sink->handle_input(*convert_button_event(libinput_event_get_pointer_event(event))); |
585 | + break; |
586 | + case LIBINPUT_EVENT_POINTER_AXIS: |
587 | + sink->handle_input(*convert_axis_event(libinput_event_get_pointer_event(event))); |
588 | + break; |
589 | + // touch events are processed as a batch of changes over all touch pointts |
590 | + case LIBINPUT_EVENT_TOUCH_DOWN: |
591 | + handle_touch_down(libinput_event_get_touch_event(event)); |
592 | + break; |
593 | + case LIBINPUT_EVENT_TOUCH_UP: |
594 | + handle_touch_up(libinput_event_get_touch_event(event)); |
595 | + break; |
596 | + case LIBINPUT_EVENT_TOUCH_MOTION: |
597 | + handle_touch_motion(libinput_event_get_touch_event(event)); |
598 | + break; |
599 | + case LIBINPUT_EVENT_TOUCH_CANCEL: |
600 | + // Not yet provided by libinput. |
601 | + break; |
602 | + case LIBINPUT_EVENT_TOUCH_FRAME: |
603 | + sink->handle_input(*convert_touch_frame(libinput_event_get_touch_event(event))); |
604 | + break; |
605 | + default: |
606 | + break; |
607 | + } |
608 | + } |
609 | + catch(std::exception const& error) |
610 | + { |
611 | + mir::log_error("Failure processing input event received from libinput: " + boost::diagnostic_information(error)); |
612 | } |
613 | } |
614 | |
615 | |
616 | === modified file 'tests/include/mir/test/doubles/stub_display_builder.h' |
617 | --- tests/include/mir/test/doubles/stub_display_builder.h 2016-02-02 20:22:57 +0000 |
618 | +++ tests/include/mir/test/doubles/stub_display_builder.h 2016-02-25 11:58:41 +0000 |
619 | @@ -94,6 +94,11 @@ |
620 | { |
621 | } |
622 | |
623 | + std::shared_ptr<graphics::GraphicBufferAllocator> the_buffer_allocator() |
624 | + { |
625 | + return nullptr; |
626 | + } |
627 | + |
628 | std::unique_ptr<graphics::android::LayerList> create_layer_list() |
629 | { |
630 | return std::unique_ptr<graphics::android::LayerList>( |
631 | |
632 | === modified file 'tests/unit-tests/graphics/android/test_device_detection.cpp' |
633 | --- tests/unit-tests/graphics/android/test_device_detection.cpp 2016-02-12 10:51:29 +0000 |
634 | +++ tests/unit-tests/graphics/android/test_device_detection.cpp 2016-02-25 11:58:41 +0000 |
635 | @@ -136,14 +136,14 @@ |
636 | { |
637 | using namespace testing; |
638 | char const default_str[] = ""; |
639 | - char const mx4_name_str[] = "manta"; |
640 | + char const manta_name_str[] = "manta"; |
641 | |
642 | MockOps mock_ops; |
643 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) |
644 | .Times(1) |
645 | .WillOnce(Invoke([&](char const*, char* value, char const*) |
646 | { |
647 | - strncpy(value, mx4_name_str, PROP_VALUE_MAX); |
648 | + strncpy(value, manta_name_str, PROP_VALUE_MAX); |
649 | return 0; |
650 | })); |
651 | |
652 | @@ -151,18 +151,18 @@ |
653 | EXPECT_TRUE(quirks.clear_fb_context_fence()); |
654 | } |
655 | |
656 | -TEST(DeviceDetection, clears_gl_context_fence_on_mx4) |
657 | +TEST(DeviceDetection, clears_gl_context_fence_on_arale) |
658 | { |
659 | using namespace testing; |
660 | char const default_str[] = ""; |
661 | - char const mx4_name_str[] = "mx4"; |
662 | + char const arale_name_str[] = "arale"; |
663 | |
664 | MockOps mock_ops; |
665 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) |
666 | .Times(1) |
667 | .WillOnce(Invoke([&](char const*, char* value, char const*) |
668 | { |
669 | - strncpy(value, mx4_name_str, PROP_VALUE_MAX); |
670 | + strncpy(value, arale_name_str, PROP_VALUE_MAX); |
671 | return 0; |
672 | })); |
673 | |
674 | @@ -193,14 +193,14 @@ |
675 | { |
676 | using namespace testing; |
677 | char const default_str[] = ""; |
678 | - char const mx4_name_str[] = "others"; |
679 | + char const other_name_str[] = "others"; |
680 | |
681 | MockOps mock_ops; |
682 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) |
683 | .Times(1) |
684 | .WillOnce(Invoke([&](char const*, char* value, char const*) |
685 | { |
686 | - strncpy(value, mx4_name_str, PROP_VALUE_MAX); |
687 | + strncpy(value, other_name_str, PROP_VALUE_MAX); |
688 | return 0; |
689 | })); |
690 | |
691 | |
692 | === modified file 'tests/unit-tests/graphics/android/test_display_hotplug.cpp' |
693 | --- tests/unit-tests/graphics/android/test_display_hotplug.cpp 2016-02-02 20:22:57 +0000 |
694 | +++ tests/unit-tests/graphics/android/test_display_hotplug.cpp 2016-02-25 11:58:41 +0000 |
695 | @@ -108,6 +108,11 @@ |
696 | return nullptr; |
697 | } |
698 | |
699 | + std::shared_ptr<mg::GraphicBufferAllocator> the_buffer_allocator() |
700 | + { |
701 | + return nullptr; |
702 | + } |
703 | + |
704 | StubHwcConfig stub_config; |
705 | }; |
706 | |
707 | |
708 | === modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp' |
709 | --- tests/unit-tests/graphics/android/test_output_builder.cpp 2016-02-15 11:57:49 +0000 |
710 | +++ tests/unit-tests/graphics/android/test_output_builder.cpp 2016-02-25 11:58:41 +0000 |
711 | @@ -97,7 +97,6 @@ |
712 | testing::NiceMock<mtd::MockFBHalDevice> fb_hal_mock; |
713 | std::shared_ptr<MockResourceFactory> mock_resource_factory; |
714 | testing::NiceMock<mtd::MockDisplayReport> mock_display_report; |
715 | - testing::NiceMock<MockGraphicBufferAllocator> mock_buffer_allocator; |
716 | std::shared_ptr<mtd::MockHwcReport> mock_hwc_report{ |
717 | std::make_shared<testing::NiceMock<mtd::MockHwcReport>>()}; |
718 | std::shared_ptr<mtd::MockHWCDeviceWrapper> mock_wrapper; |
719 | @@ -114,7 +113,6 @@ |
720 | EXPECT_CALL(*mock_hwc_report, report_hwc_version(mga::HwcVersion::hwc10)); |
721 | |
722 | mga::HalComponentFactory factory( |
723 | - mt::fake_shared(mock_buffer_allocator), |
724 | mock_resource_factory, |
725 | mock_hwc_report, |
726 | quirks); |
727 | @@ -129,7 +127,6 @@ |
728 | EXPECT_CALL(*mock_hwc_report, report_hwc_version(mga::HwcVersion::hwc11)); |
729 | |
730 | mga::HalComponentFactory factory( |
731 | - mt::fake_shared(mock_buffer_allocator), |
732 | mock_resource_factory, |
733 | mock_hwc_report, |
734 | quirks); |
735 | @@ -143,7 +140,6 @@ |
736 | .WillOnce(Return(std::make_tuple(mock_wrapper, mga::HwcVersion::hwc14))); |
737 | |
738 | mga::HalComponentFactory factory( |
739 | - mt::fake_shared(mock_buffer_allocator), |
740 | mock_resource_factory, |
741 | mock_hwc_report, |
742 | quirks); |
743 | @@ -160,7 +156,6 @@ |
744 | EXPECT_CALL(*mock_hwc_report, report_legacy_fb_module()); |
745 | |
746 | mga::HalComponentFactory factory( |
747 | - mt::fake_shared(mock_buffer_allocator), |
748 | mock_resource_factory, |
749 | mock_hwc_report, |
750 | quirks); |
751 | @@ -177,7 +172,6 @@ |
752 | |
753 | EXPECT_THROW({ |
754 | mga::HalComponentFactory factory( |
755 | - mt::fake_shared(mock_buffer_allocator), |
756 | mock_resource_factory, |
757 | mock_hwc_report, |
758 | quirks); |
759 | @@ -193,13 +187,16 @@ |
760 | EXPECT_CALL(*mock_resource_factory, create_fb_native_device()) |
761 | .WillOnce(Return(std::make_shared<mtd::MockFBHalDevice>( |
762 | 0, 0, mir_pixel_format_abgr_8888, 0, 0.0, 0.0))); |
763 | - EXPECT_CALL(mock_buffer_allocator, alloc_buffer_platform(_,_,_)) |
764 | - .Times(2); |
765 | |
766 | mga::HalComponentFactory factory( |
767 | - mt::fake_shared(mock_buffer_allocator), |
768 | mock_resource_factory, |
769 | mock_hwc_report, |
770 | quirks); |
771 | - factory.create_framebuffers(mtd::StubDisplayConfig(1).outputs[0]); |
772 | + auto fbs = factory.create_framebuffers(mtd::StubDisplayConfig(1).outputs[0]); |
773 | + std::vector<mg::BufferID> buffer_list; |
774 | + for(auto i = 0u; i < 10u; i++) |
775 | + buffer_list.push_back(fbs->buffer_for_render()->id()); |
776 | + std::sort(buffer_list.begin(), buffer_list.end()); |
777 | + buffer_list.erase(std::unique(buffer_list.begin(), buffer_list.end()), buffer_list.end()); |
778 | + EXPECT_THAT(buffer_list.size(), Eq(2)); |
779 | } |
780 | |
781 | === modified file 'tests/unit-tests/graphics/android/test_platform.cpp' |
782 | --- tests/unit-tests/graphics/android/test_platform.cpp 2016-02-02 20:22:57 +0000 |
783 | +++ tests/unit-tests/graphics/android/test_platform.cpp 2016-02-25 11:58:41 +0000 |
784 | @@ -26,7 +26,6 @@ |
785 | #include "mir/test/doubles/mock_display_report.h" |
786 | #include "mir/test/doubles/mock_egl.h" |
787 | #include "mir/test/doubles/stub_display_builder.h" |
788 | -#include "mir/test/doubles/stub_cmdstream_sync_factory.h" |
789 | #include "mir/test/doubles/fd_matcher.h" |
790 | #include "mir/test/fake_shared.h" |
791 | #include "mir/test/doubles/mock_android_native_buffer.h" |
792 | @@ -55,7 +54,6 @@ |
793 | using namespace testing; |
794 | |
795 | stub_display_builder = std::make_shared<mtd::StubDisplayBuilder>(); |
796 | - stub_sync_factory = std::make_shared<mtd::StubCmdStreamSyncFactory>(); |
797 | stub_display_report = mr::null_display_report(); |
798 | stride = geom::Stride(300*4); |
799 | |
800 | @@ -88,7 +86,6 @@ |
801 | std::shared_ptr<mtd::MockAndroidNativeBuffer> native_buffer; |
802 | std::shared_ptr<mtd::StubBufferAllocator> stub_buffer_allocator; |
803 | std::shared_ptr<mtd::StubDisplayBuilder> stub_display_builder; |
804 | - std::shared_ptr<mtd::StubCmdStreamSyncFactory> stub_sync_factory; |
805 | std::shared_ptr<mtd::MockBuffer> mock_buffer; |
806 | std::shared_ptr<native_handle_t> native_buffer_handle; |
807 | std::shared_ptr<mg::DisplayReport> stub_display_report; |
808 | @@ -107,7 +104,7 @@ |
809 | .WillOnce(Return(fake_fence)); |
810 | |
811 | mga::Platform platform(stub_buffer_allocator, stub_display_builder, |
812 | - stub_sync_factory, stub_display_report, mga::OverlayOptimization::enabled, quirks); |
813 | + stub_display_report, mga::OverlayOptimization::enabled, quirks); |
814 | |
815 | mtd::MockBufferIpcMessage mock_ipc_msg; |
816 | int offset = 0; |
817 | @@ -140,7 +137,7 @@ |
818 | .WillOnce(Return(-1)); |
819 | |
820 | mga::Platform platform(stub_buffer_allocator, stub_display_builder, |
821 | - stub_sync_factory, stub_display_report, mga::OverlayOptimization::enabled, quirks); |
822 | + stub_display_report, mga::OverlayOptimization::enabled, quirks); |
823 | |
824 | mtd::MockBufferIpcMessage mock_ipc_msg; |
825 | int offset = 0; |
826 | @@ -181,7 +178,7 @@ |
827 | .WillOnce(Return(-1)); |
828 | |
829 | mga::Platform platform(stub_buffer_allocator, stub_display_builder, |
830 | - stub_sync_factory, stub_display_report, mga::OverlayOptimization::enabled, quirks); |
831 | + stub_display_report, mga::OverlayOptimization::enabled, quirks); |
832 | |
833 | mtd::MockBufferIpcMessage mock_ipc_msg; |
834 | int offset = 0; |
835 | @@ -217,7 +214,7 @@ |
836 | |
837 | int fake_fence{33}; |
838 | mga::Platform platform(stub_buffer_allocator, stub_display_builder, |
839 | - stub_sync_factory, stub_display_report, mga::OverlayOptimization::enabled, quirks); |
840 | + stub_display_report, mga::OverlayOptimization::enabled, quirks); |
841 | auto ipc_ops = platform.make_ipc_operations(); |
842 | |
843 | mtd::MockBufferIpcMessage mock_ipc_msg; |
844 | @@ -244,7 +241,6 @@ |
845 | mga::Platform platform( |
846 | std::make_shared<mtd::StubBufferAllocator>(), |
847 | std::make_shared<mtd::StubDisplayBuilder>(), |
848 | - std::make_shared<mtd::StubCmdStreamSyncFactory>(), |
849 | mr::null_display_report(), |
850 | mga::OverlayOptimization::enabled, |
851 | std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{})); |
852 | |
853 | === modified file 'tests/unit-tests/graphics/android/test_server_interpreter.cpp' |
854 | --- tests/unit-tests/graphics/android/test_server_interpreter.cpp 2016-01-29 08:18:22 +0000 |
855 | +++ tests/unit-tests/graphics/android/test_server_interpreter.cpp 2016-02-25 11:58:41 +0000 |
856 | @@ -39,11 +39,11 @@ |
857 | |
858 | namespace |
859 | { |
860 | -//krillin and mx4 need to clear their fences before hwc commit. |
861 | +//krillin and arale need to clear their fences before hwc commit. |
862 | struct StubPropertiesWrapper : mga::PropertiesWrapper |
863 | { |
864 | StubPropertiesWrapper(bool should_clear_fence) : |
865 | - name(should_clear_fence ? "mx4" : "otherdevice") |
866 | + name(should_clear_fence ? "arale" : "otherdevice") |
867 | { |
868 | } |
869 | |
870 | |
871 | === modified file 'tests/unit-tests/input/evdev/test_libinput_device.cpp' |
872 | --- tests/unit-tests/input/evdev/test_libinput_device.cpp 2016-01-29 08:18:22 +0000 |
873 | +++ tests/unit-tests/input/evdev/test_libinput_device.cpp 2016-02-25 11:58:41 +0000 |
874 | @@ -17,6 +17,7 @@ |
875 | */ |
876 | |
877 | #include "src/platforms/evdev/libinput_device.h" |
878 | +#include "src/platforms/evdev/button_utils.h" |
879 | #include "src/server/report/null_report_factory.h" |
880 | #include "src/server/input/default_event_builder.h" |
881 | |
882 | @@ -636,6 +637,40 @@ |
883 | mouse.process_event(fake_event_4); |
884 | } |
885 | |
886 | +TEST_F(LibInputDeviceOnMouse, process_event_handles_exotic_mouse_buttons) |
887 | +{ |
888 | + float const x = 0; |
889 | + float const y = 0; |
890 | + geom::Point const pos{x, y}; |
891 | + |
892 | + InSequence seq; |
893 | + EXPECT_CALL(mock_sink, handle_input(mt::ButtonDownEventWithButton(pos, mir_pointer_button_side))); |
894 | + EXPECT_CALL(mock_sink, handle_input(mt::ButtonDownEventWithButton(pos, mir_pointer_button_extra))); |
895 | + EXPECT_CALL(mock_sink, handle_input(mt::ButtonDownEventWithButton(pos, mir_pointer_button_task))); |
896 | + |
897 | + setup_button_event(fake_event_1, event_time_1, BTN_SIDE, LIBINPUT_BUTTON_STATE_PRESSED); |
898 | + setup_button_event(fake_event_2, event_time_2, BTN_EXTRA, LIBINPUT_BUTTON_STATE_PRESSED); |
899 | + setup_button_event(fake_event_3, event_time_3, BTN_TASK, LIBINPUT_BUTTON_STATE_PRESSED); |
900 | + |
901 | + mouse.start(&mock_sink, &mock_builder); |
902 | + mouse.process_event(fake_event_1); |
903 | + mouse.process_event(fake_event_2); |
904 | + mouse.process_event(fake_event_3); |
905 | +} |
906 | + |
907 | +TEST_F(LibInputDeviceOnMouse, process_ignores_events_when_button_conversion_fails) |
908 | +{ |
909 | + EXPECT_THROW({mir::input::evdev::to_pointer_button(BTN_JOYSTICK, mir_pointer_handedness_right);}, |
910 | + std::runtime_error); |
911 | + |
912 | + InSequence seq; |
913 | + EXPECT_CALL(mock_sink, handle_input(_)).Times(0); |
914 | + |
915 | + setup_button_event(fake_event_1, event_time_3, BTN_JOYSTICK, LIBINPUT_BUTTON_STATE_PRESSED); |
916 | + mouse.start(&mock_sink, &mock_builder); |
917 | + mouse.process_event(fake_event_1); |
918 | +} |
919 | + |
920 | TEST_F(LibInputDeviceOnMouse, process_event_handles_scroll) |
921 | { |
922 | setup_axis_event(fake_event_1, event_time_1, 0.0, 20.0); |
PASSED: Continuous integration, rev:3327 jenkins. qa.ubuntu. com/job/ mir-ubuntu- ci/151/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/6039 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/4946 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/5995 jenkins. qa.ubuntu. com/job/ mir-mediumtests -xenial- touch/481 jenkins. qa.ubuntu. com/job/ mir-ubuntu- xenial- amd64-ci/ 39 jenkins. qa.ubuntu. com/job/ mir-ubuntu- xenial- amd64-ci/ 39/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-ubuntu- xenial- i386-ci/ 39 jenkins. qa.ubuntu. com/job/ mir-ubuntu- xenial- i386-ci/ 39/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 5992 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 5992/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- touch/8358 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 27876 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- xenial- armhf/477 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- xenial- armhf/477/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- xenial- touch/330 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 27877
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ubuntu- ci/151/ rebuild
http://