Mir

Merge lp:~alan-griffiths/mir/reboot-0.26.3-release into lp:mir

Proposed by Alan Griffiths on 2017-05-26
Status: Superseded
Proposed branch: lp:~alan-griffiths/mir/reboot-0.26.3-release
Merge into: lp:mir
Diff against target: 1811 lines (+1205/-14) (has conflicts)
23 files modified
CMakeLists.txt (+5/-0)
debian/changelog (+54/-0)
debian/control (+69/-0)
include/client/mir_toolkit/client_types.h (+10/-0)
include/client/mir_toolkit/extensions/gbm_buffer.h (+82/-0)
include/client/mir_toolkit/mir_buffer_stream.h (+8/-0)
include/client/mir_toolkit/mir_cursor_configuration.h (+18/-1)
include/client/mir_toolkit/mir_window.h (+29/-0)
include/client/mir_toolkit/rs/mir_render_surface.h (+103/-0)
include/core/mir_toolkit/deprecations.h (+39/-0)
src/platforms/android/utils/CMakeLists.txt.OTHER (+46/-0)
src/platforms/mesa/client/client_platform.cpp (+145/-0)
src/platforms/mesa/server/kms/real_kms_display_configuration.cpp (+214/-0)
src/server/compositor/multi_monitor_arbiter.cpp (+7/-0)
src/server/input/default_device.cpp (+46/-0)
src/server/input/default_device.h (+16/-0)
src/server/input/default_input_device_hub.cpp (+18/-1)
src/server/input/default_input_device_hub.h (+4/-0)
tests/acceptance-tests/test_custom_window_management.cpp (+50/-0)
tests/acceptance-tests/test_presentation_chain.cpp (+184/-12)
tests/unit-tests/input/test_default_device.cpp (+26/-0)
tests/unit-tests/input/test_default_input_device_hub.cpp (+24/-0)
tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp (+8/-0)
Text conflict in CMakeLists.txt
Text conflict in debian/control
Text conflict in include/client/mir_toolkit/client_types.h
Text conflict in include/client/mir_toolkit/extensions/gbm_buffer.h
Text conflict in include/client/mir_toolkit/mir_buffer_stream.h
Text conflict in include/client/mir_toolkit/mir_cursor_configuration.h
Text conflict in include/client/mir_toolkit/mir_window.h
Text conflict in include/client/mir_toolkit/rs/mir_render_surface.h
Text conflict in include/core/mir_toolkit/deprecations.h
Conflict adding files to src/platforms/android.  Created directory.
Conflict because src/platforms/android is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to src/platforms/android/utils.  Created directory.
Conflict because src/platforms/android/utils is not versioned, but has versioned children.  Versioned directory.
Contents conflict in src/platforms/android/utils/CMakeLists.txt
Text conflict in src/platforms/mesa/client/client_platform.cpp
Text conflict in src/platforms/mesa/server/kms/real_kms_display_configuration.cpp
Text conflict in src/server/compositor/multi_monitor_arbiter.cpp
Text conflict in src/server/input/default_device.cpp
Text conflict in src/server/input/default_device.h
Text conflict in src/server/input/default_input_device_hub.cpp
Text conflict in src/server/input/default_input_device_hub.h
Text conflict in tests/acceptance-tests/test_custom_window_management.cpp
Text conflict in tests/acceptance-tests/test_presentation_chain.cpp
Text conflict in tests/unit-tests/input/test_default_device.cpp
Text conflict in tests/unit-tests/input/test_default_input_device_hub.cpp
Text conflict in tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp
To merge this branch: bzr merge lp:~alan-griffiths/mir/reboot-0.26.3-release
Reviewer Review Type Date Requested Status
Mir development team 2017-05-26 Pending
Review via email: mp+324661@code.launchpad.net

This proposal has been superseded by a proposal from 2017-05-26.

Commit message

Restore platforms that are unsupported in xenial, add support for building downstreams on, and re-sync deprecation macros with current development.

To post a comment you must log in.

Unmerged revisions

4069. By Alan Griffiths on 2017-05-26

Don't deprecate RenderSurfaces (yet)

4068. By Alan Griffiths on 2017-05-26

Merge better deprecation macros from lp:mir

4067. By Alan Griffiths on 2017-05-26

Disable deprecations on Yakkety

4066. By Alan Griffiths on 2017-05-26

Revert debian changes made for xenial backport

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-05-08 03:04:26 +0000
3+++ CMakeLists.txt 2017-05-26 09:20:21 +0000
4@@ -28,8 +28,13 @@
5 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
6
7 set(MIR_VERSION_MAJOR 0)
8+<<<<<<< TREE
9 set(MIR_VERSION_MINOR 27)
10 set(MIR_VERSION_PATCH 0)
11+=======
12+set(MIR_VERSION_MINOR 26)
13+set(MIR_VERSION_PATCH 3)
14+>>>>>>> MERGE-SOURCE
15
16 add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
17 add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
18
19=== modified file 'debian/changelog'
20--- debian/changelog 2017-05-08 03:04:26 +0000
21+++ debian/changelog 2017-05-26 09:20:21 +0000
22@@ -1,3 +1,57 @@
23+mir (0.26.3-0ubuntu1) UNRELEASED; urgency=medium
24+
25+ * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
26+ - Enhancements:
27+ . Make deprecations optional (and default to off for builds on 16.04 LTS)
28+ . Added support for building on Ubuntu 17.10 artful.
29+ - Bugs fixed:
30+ . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
31+ . unity-system-compositor crashed with SIGSEGV in
32+ libinput_device_config_accel_is_available() from
33+ libinput_device_config_accel_set_speed() from
34+ mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
35+ . Please transition to Boost 1.62 (LP: #1675138)
36+ . Mir sending key repeat events continually to nested shell after VT
37+ switch (causes Unity8 lockup for a while) (LP: #1675357)
38+ . mir_demo_standalone_render_overlays fails to link (LP: #1677239)
39+
40+ -- Daniel van Vugt <daniel.van.vugt@canonical.com> Thu, 30 Mar 2017 11:43:28 +0800
41+
42+mir (0.26.2+17.04.20170322.1-0ubuntu2) zesty; urgency=medium
43+
44+ [ Mattia Rizzolo ]
45+ * Patch the code to use unversioned runtime boost libraries (LP: #1675138).
46+
47+ -- Gianfranco Costamagna <locutusofborg@debian.org> Fri, 24 Mar 2017 22:58:36 +0100
48+
49+mir (0.26.2+17.04.20170322.1-0ubuntu1) zesty; urgency=medium
50+
51+ [ Daniel van Vugt ]
52+ * New upstream release 0.26.2 (https://launchpad.net/mir/+milestone/0.26.2)
53+ - Bugs fixed:
54+ . EDID does not change when hotplugging a monitor (LP: #1660017)
55+ . [regression] mirout crashes when connecting to unity8 or any nested
56+ server: [libprotobuf FATAL /usr/include/google/protobuf/repeated_field.
57+ h:1408] CHECK failed: (index) < (current_size_) (LP: #1661163)
58+ . Mir server crashed with SIGSEGV in
59+ mir::compositor::TemporaryBuffer::size() called from
60+ mir::gl::tessellate_renderable_into_rectangle() (LP: #1664760)
61+ . Nested servers (Unity8) periodically stutter (half frame rate) with
62+ Mir 0.26.1 (LP: #1666372)
63+ . Don't dereference the end iterator in ms::ApplicationSession::
64+ surface_after() (LP: #1667645)
65+ . [regression] OSK input shaping no longer works correctly (LP: #1669444)
66+ . Setting MirWindowSpec parameters always causes window's input_region
67+ to be reset (LP: #1670876)
68+ . Subpixel order not included in Mir display information (LP: #1393578)
69+ . Presentation chains should support various swap interval modes
70+ (LP: #1673533)
71+ . Need an extension for GBM buffers to replace
72+ mir_buffer_get_buffer_package() (LP: #1673534)
73+ . Seg fault on detect_fd_leaks (LP: #1661498)
74+
75+ -- Cemil Azizoglu <cemil.azizoglu@canonical.com> Wed, 22 Mar 2017 04:54:19 +0000
76+
77 mir (0.26.1+17.04.20170209.1-0ubuntu1) zesty; urgency=medium
78
79 * New upstream release 0.26.1 (https://launchpad.net/mir/+milestone/0.26.1)
80
81=== modified file 'debian/control'
82--- debian/control 2017-05-08 03:04:26 +0000
83+++ debian/control 2017-05-26 09:20:21 +0000
84@@ -292,6 +292,21 @@
85 .
86 Contains a tool for stress testing the Mir display server
87
88+<<<<<<< TREE
89+=======
90+Package: mir-android-diagnostics
91+Architecture: i386 amd64 armhf
92+Pre-Depends: ${misc:Pre-Depends}
93+Depends: ${misc:Depends},
94+ ${shlibs:Depends},
95+Recommends: mir-demos,
96+Description: Display Server for Ubuntu - android platform diagnostics utility
97+ Mir is a display server running on linux systems, with a focus on efficiency,
98+ robust operation and a well-defined driver model.
99+ .
100+ Contains a tool for checking the graphics components of android devices.
101+
102+>>>>>>> MERGE-SOURCE
103 Package: libmircore1
104 Section: libs
105 Architecture: linux-any
106@@ -347,7 +362,25 @@
107 Contains the shared libraries required for the Mir server to interact with
108 the hardware platform using the Mesa drivers.
109
110+<<<<<<< TREE
111 Package: mir-platform-input-evdev7
112+=======
113+Package: mir-platform-graphics-android12
114+Section: libs
115+Architecture: i386 amd64 armhf
116+Multi-Arch: same
117+Pre-Depends: ${misc:Pre-Depends}
118+Depends: ${misc:Depends},
119+ ${shlibs:Depends},
120+Description: Display server for Ubuntu - platform library for Android
121+ Mir is a display server running on linux systems, with a focus on efficiency,
122+ robust operation and a well-defined driver model.
123+ .
124+ Contains the shared libraries required for the Mir server to interact with
125+ the hardware platform using the Android drivers.
126+
127+Package: mir-platform-input-evdev6
128+>>>>>>> MERGE-SOURCE
129 Section: libs
130 Architecture: linux-any
131 Multi-Arch: same
132@@ -389,6 +422,23 @@
133 Contains header files required to use the platform specific capabilities of
134 the Mir Mesa backend.
135
136+<<<<<<< TREE
137+=======
138+Package: mir-client-platform-android5
139+Section: libs
140+Architecture: i386 amd64 armhf
141+Multi-Arch: same
142+Pre-Depends: ${misc:Pre-Depends}
143+Depends: ${misc:Depends},
144+ ${shlibs:Depends}
145+Description: Display server for Ubuntu - client platform library for Android
146+ Mir is a display server running on linux systems, with a focus on efficiency,
147+ robust operation and a well-defined driver model.
148+ .
149+ Contains the shared libraries required for the Mir clients to interact with
150+ the underlying hardware platform using the Android drivers.
151+
152+>>>>>>> MERGE-SOURCE
153 Package: mir-graphics-drivers-desktop
154 Section: libs
155 Architecture: linux-any
156@@ -406,6 +456,25 @@
157 This package depends on a full set of graphics drivers for traditional desktop
158 systems.
159
160+<<<<<<< TREE
161+=======
162+Package: mir-graphics-drivers-android
163+Section: libs
164+Architecture: i386 amd64 armhf
165+Multi-Arch: same
166+Pre-Depends: ${misc:Pre-Depends}
167+Depends: ${misc:Depends},
168+ mir-platform-graphics-android12,
169+ mir-client-platform-android5,
170+ mir-platform-input-evdev6,
171+Description: Display server for Ubuntu - android driver metapackage
172+ Mir is a display server running on linux systems, with a focus on efficiency,
173+ robust operation and a well-defined driver model.
174+ .
175+ This package depends on a full set of graphics drivers for running Mir on top
176+ of an existing Android driver stack.
177+
178+>>>>>>> MERGE-SOURCE
179 Package: libmircookie2
180 Section: libs
181 Architecture: any
182
183=== modified file 'include/client/mir/event_printer.h'
184=== modified file 'include/client/mir/events/event_builders.h'
185=== modified file 'include/client/mir_toolkit/client_types.h'
186--- include/client/mir_toolkit/client_types.h 2017-05-23 00:22:04 +0000
187+++ include/client/mir_toolkit/client_types.h 2017-05-26 09:20:21 +0000
188@@ -54,6 +54,7 @@
189 typedef struct MirError MirError;
190 typedef struct MirPresentationChain MirPresentationChain;
191 typedef struct MirBuffer MirBuffer;
192+<<<<<<< TREE
193 typedef struct MirRenderSurface MirRenderSurface;
194
195 /**
196@@ -62,6 +63,9 @@
197 */
198 typedef struct MirCursorConfiguration MirCursorConfiguration
199 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name/mir_window_spec_set_cursor_render_surface instead");
200+=======
201+typedef struct MirRenderSurface MirRenderSurface;
202+>>>>>>> MERGE-SOURCE
203
204 /**
205 * Descriptor for an output connection.
206@@ -576,10 +580,16 @@
207
208 typedef void (*mir_surface_id_callback)(
209 MirSurface* surface, MirPersistentId* id, void* context)
210+<<<<<<< TREE
211 MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
212
213 typedef MirSurfaceParameters MirWindowParameters
214 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen for attribute events instead");
215+=======
216+MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
217+
218+typedef MirSurfaceParameters MirWindowParameters;
219+>>>>>>> MERGE-SOURCE
220
221 #pragma GCC diagnostic pop
222
223
224=== modified file 'include/client/mir_toolkit/events/event.h'
225=== modified file 'include/client/mir_toolkit/extensions/gbm_buffer.h'
226--- include/client/mir_toolkit/extensions/gbm_buffer.h 2017-05-08 03:04:26 +0000
227+++ include/client/mir_toolkit/extensions/gbm_buffer.h 2017-05-26 09:20:21 +0000
228@@ -76,6 +76,7 @@
229 connection, "mir_extension_gbm_buffer", 1);
230 }
231
232+<<<<<<< TREE
233 /** Allocate a MirBuffer via gbm and wait for the allocation.
234 * available in V2.
235 * The buffer can be destroyed via mir_buffer_release().
236@@ -155,6 +156,87 @@
237 connection, "mir_extension_gbm_buffer", 2);
238 }
239
240+=======
241+/** Allocate a MirBuffer via gbm and wait for the allocation.
242+ * available in V2.
243+ * The buffer can be destroyed via mir_buffer_release().
244+ *
245+ * \param [in] connection The connection
246+ * \param [in] width Requested buffer width
247+ * \param [in] height Requested buffer height
248+ * \param [in] gbm_pixel_format The pixel format, one of the GBM_FORMATs
249+ * \param [in] gbm_bo_flags The gbm_bo_flags for the buffer.
250+ * \return The buffer
251+ **/
252+typedef MirBuffer* (*MirConnectionAllocateBufferGbmSync)(
253+ MirConnection* connection,
254+ uint32_t width, uint32_t height,
255+ uint32_t gbm_pixel_format,
256+ uint32_t gbm_bo_flags);
257+
258+/** Check if a MirBuffer is suitable for import via GBM_BO_IMPORT_FD
259+ *
260+ * \param [in] buffer The buffer
261+ * \return True if suitable, false if unsuitable
262+ */
263+typedef bool (*MirBufferIsGbmImportable)(MirBuffer* buffer);
264+
265+/** Access the fd a MirBuffer suitable for gbm import
266+ * \pre The buffer is suitable for GBM_BO_IMPORT_FD
267+ * \warning The fd is owned by the buffer. Do not close() it.
268+ * \param [in] buffer The buffer
269+ * \return The fd
270+ */
271+typedef int (*MirBufferGbmFd)(MirBuffer* buffer);
272+
273+/** Get the stride of a MirBuffer
274+ * \pre The buffer is suitable for GBM_BO_IMPORT_FD
275+ * \param [in] buffer The buffer
276+ * \return The stride of the buffer
277+ */
278+typedef uint32_t (*MirBufferGbmStride)(MirBuffer* buffer);
279+
280+/** Get the GBM_FORMAT of a MirBuffer
281+ * \pre The buffer is suitable for GBM_BO_IMPORT_FD
282+ * \param [in] buffer The buffer
283+ * \return The GBM_FORMAT of the buffer
284+ */
285+typedef uint32_t (*MirBufferGbmFormat)(MirBuffer* buffer);
286+
287+/** Get the gbm_bo_flags of a MirBuffer
288+ * \pre The buffer is suitable for GBM_BO_IMPORT_FD
289+ * \param [in] buffer The buffer
290+ * \return The gbm_bo_flags of the buffer
291+ */
292+typedef uint32_t (*MirBufferGbmFlags)(MirBuffer* buffer);
293+
294+/** Get the age of a MirBuffer
295+ * \pre The buffer is suitable for GBM_BO_IMPORT_FD
296+ * \param [in] buffer The buffer
297+ * \return The age of the buffer
298+ */
299+typedef unsigned int (*MirBufferGbmAge)(MirBuffer* buffer);
300+
301+typedef struct MirExtensionGbmBufferV2
302+{
303+ MirConnectionAllocateBufferGbm allocate_buffer_gbm;
304+ MirConnectionAllocateBufferGbmSync allocate_buffer_gbm_sync;
305+ MirBufferIsGbmImportable is_gbm_importable;
306+ MirBufferGbmFd fd;
307+ MirBufferGbmStride stride;
308+ MirBufferGbmFormat format;
309+ MirBufferGbmFlags flags;
310+ MirBufferGbmAge age;
311+} MirExtensionGbmBufferV2;
312+
313+static inline MirExtensionGbmBufferV2 const* mir_extension_gbm_buffer_v2(
314+ MirConnection* connection)
315+{
316+ return (MirExtensionGbmBufferV2 const*) mir_connection_request_extension(
317+ connection, "mir_extension_gbm_buffer", 2);
318+}
319+
320+>>>>>>> MERGE-SOURCE
321 #ifdef __cplusplus
322 }
323 #endif
324
325=== modified file 'include/client/mir_toolkit/mir_buffer_stream.h'
326--- include/client/mir_toolkit/mir_buffer_stream.h 2017-05-23 00:22:04 +0000
327+++ include/client/mir_toolkit/mir_buffer_stream.h 2017-05-26 09:20:21 +0000
328@@ -155,9 +155,17 @@
329 * \return One of mir_platform_type_android or
330 * mir_platform_type_gbm
331 */
332+<<<<<<< TREE
333 MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream)
334 MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"
335 "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()");
336+=======
337+/// @cond
338+MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"
339+ "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()")
340+/// @endcond
341+MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream);
342+>>>>>>> MERGE-SOURCE
343
344 /**
345 * Retrieve the current buffer in "raw" representation.
346
347=== modified file 'include/client/mir_toolkit/mir_connection.h'
348=== modified file 'include/client/mir_toolkit/mir_cursor_configuration.h'
349--- include/client/mir_toolkit/mir_cursor_configuration.h 2017-05-23 00:22:04 +0000
350+++ include/client/mir_toolkit/mir_cursor_configuration.h 2017-05-26 09:20:21 +0000
351@@ -20,7 +20,17 @@
352
353 #include <mir_toolkit/common.h>
354 #include <mir_toolkit/client_types.h>
355-#include <mir_toolkit/deprecations.h>
356+<<<<<<< TREE
357+#include <mir_toolkit/deprecations.h>
358+=======
359+#include <mir_toolkit/deprecations.h>
360+
361+/**
362+ * Opaque structure containing cursor parameterization. Create with mir_cursor* family.
363+ * Used with mir_window_configure_cursor.
364+ */
365+typedef struct MirCursorConfiguration MirCursorConfiguration;
366+>>>>>>> MERGE-SOURCE
367
368 #ifdef __cplusplus
369 /**
370@@ -51,8 +61,15 @@
371 * \return A cursor parameters object which must be passed
372 * to_mir_cursor_configuration_destroy
373 */
374+<<<<<<< TREE
375 MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name)
376 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name() instead");
377+=======
378+/// @cond
379+MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_cursor_name()")
380+/// @endcond
381+MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name);
382+>>>>>>> MERGE-SOURCE
383
384 /**
385 * Returns a new cursor configuration tied to a given buffer stream.
386
387=== modified file 'include/client/mir_toolkit/mir_display_configuration.h'
388=== modified file 'include/client/mir_toolkit/mir_window.h'
389--- include/client/mir_toolkit/mir_window.h 2017-05-23 00:22:04 +0000
390+++ include/client/mir_toolkit/mir_window.h 2017-05-26 09:20:21 +0000
391@@ -585,8 +585,37 @@
392 */
393 void mir_window_spec_set_streams(MirWindowSpec* spec,
394 MirBufferStreamInfo* streams,
395+<<<<<<< TREE
396 unsigned int num_streams)
397 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface instead");
398+=======
399+ unsigned int num_streams);
400+
401+/**
402+ * Set the MirWindowSpec to display content contained in a render surface
403+ *
404+ * \warning: The initial call to mir_window_spec_add_render_surface will set
405+ * the bottom-most content, and subsequent calls will stack the
406+ * content on top.
407+ *
408+ * \param spec The window_spec to be updated
409+ * \param render_surface The render surface containing the content to be displayed
410+ * \param logical_width The width that the content will be displayed at
411+ * (Ignored for buffer streams)
412+ * \param logical_height The height that the content will be displayed at
413+ * (Ignored for buffer streams)
414+ * \param displacement_x The x displacement from the top-left corner of the MirWindow
415+ * \param displacement_y The y displacement from the top-left corner of the MirWindow
416+ */
417+#pragma GCC diagnostic push
418+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
419+void mir_window_spec_add_render_surface(MirWindowSpec* spec,
420+ MirRenderSurface* render_surface,
421+ int logical_width, int logical_height,
422+ int displacement_x, int displacement_y)
423+MIR_FOR_REMOVAL_IN_VERSION_1("This function is slated for rename due to MirRenderSurface-->MirSurface transition");
424+#pragma GCC diagnostic pop
425+>>>>>>> MERGE-SOURCE
426
427 /**
428 * Release the resources held by a MirWindowSpec.
429
430=== modified file 'include/client/mir_toolkit/rs/mir_render_surface.h'
431--- include/client/mir_toolkit/rs/mir_render_surface.h 2017-05-23 00:22:04 +0000
432+++ include/client/mir_toolkit/rs/mir_render_surface.h 2017-05-26 09:20:21 +0000
433@@ -21,6 +21,7 @@
434 #define MIR_TOOLKIT_MIR_RENDER_SURFACE_H_
435
436 #include <mir_toolkit/client_types.h>
437+<<<<<<< TREE
438 #include <mir_toolkit/deprecations.h>
439
440 #ifndef MIR_DEPRECATE_RENDERSURFACES
441@@ -33,6 +34,20 @@
442 #else
443 #define MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1
444 #endif
445+=======
446+#include <mir_toolkit/deprecations.h>
447+
448+#ifndef MIR_DEPRECATE_RENDERSURFACES
449+ #define MIR_DEPRECATE_RENDERSURFACES 0
450+#endif
451+
452+#if MIR_ENABLE_DEPRECATIONS > 0 && MIR_DEPRECATE_RENDERSURFACES > 0
453+ #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME\
454+ __attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")))
455+#else
456+ #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME
457+#endif
458+>>>>>>> MERGE-SOURCE
459
460 #ifdef __cplusplus
461 /**
462@@ -42,9 +57,15 @@
463 extern "C" {
464 #endif
465
466+<<<<<<< TREE
467 typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
468 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
469
470+=======
471+typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
472+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
473+
474+>>>>>>> MERGE-SOURCE
475 #pragma GCC diagnostic push
476 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
477 /**
478@@ -64,7 +85,11 @@
479 int width, int height,
480 MirRenderSurfaceCallback callback,
481 void* context)
482+<<<<<<< TREE
483 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
484+=======
485+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
486+>>>>>>> MERGE-SOURCE
487
488 /**
489 * Create a render surface and wait for the result
490@@ -79,7 +104,11 @@
491 MirRenderSurface* mir_connection_create_render_surface_sync(
492 MirConnection* connection,
493 int width, int height)
494+<<<<<<< TREE
495 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
496+=======
497+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
498+>>>>>>> MERGE-SOURCE
499
500 /**
501 * Get the size of the MirRenderSurface
502@@ -91,7 +120,11 @@
503 void mir_render_surface_get_size(
504 MirRenderSurface* render_surface,
505 int* width, int* height)
506+<<<<<<< TREE
507 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
508+=======
509+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
510+>>>>>>> MERGE-SOURCE
511
512 /**
513 * Set the size of the MirRenderSurface
514@@ -103,7 +136,11 @@
515 void mir_render_surface_set_size(
516 MirRenderSurface* render_surface,
517 int width, int height)
518+<<<<<<< TREE
519 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
520+=======
521+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
522+>>>>>>> MERGE-SOURCE
523
524 /**
525 * Test for a valid render surface
526@@ -115,8 +152,12 @@
527 */
528 bool mir_render_surface_is_valid(
529 MirRenderSurface* render_surface)
530+<<<<<<< TREE
531 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
532
533+=======
534+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
535+>>>>>>> MERGE-SOURCE
536 /**
537 * Retrieve a text description of the error. The returned string is owned by
538 * the library and remains valid until the render surface or the associated
539@@ -128,7 +169,11 @@
540 */
541 char const *mir_render_surface_get_error_message(
542 MirRenderSurface* render_surface)
543+<<<<<<< TREE
544 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
545+=======
546+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
547+>>>>>>> MERGE-SOURCE
548
549 /**
550 * Release the specified render surface
551@@ -137,7 +182,11 @@
552 */
553 void mir_render_surface_release(
554 MirRenderSurface* render_surface)
555+<<<<<<< TREE
556 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
557+=======
558+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
559+>>>>>>> MERGE-SOURCE
560
561 /**
562 * Obtain the buffer stream backing a given render surface.
563@@ -157,7 +206,11 @@
564 MirRenderSurface* render_surface,
565 int width, int height,
566 MirPixelFormat format)
567+<<<<<<< TREE
568 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
569+=======
570+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
571+>>>>>>> MERGE-SOURCE
572
573 /**
574 * Obtain the presentation chain backing a given render surface.
575@@ -170,6 +223,7 @@
576 */
577 MirPresentationChain* mir_render_surface_get_presentation_chain(
578 MirRenderSurface* render_surface)
579+<<<<<<< TREE
580 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
581
582 /** Query whether the server supports a given presentation mode.
583@@ -191,6 +245,29 @@
584 */
585 void mir_presentation_chain_set_mode(
586 MirPresentationChain* chain, MirPresentMode mode);
587+=======
588+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
589+
590+/** Query whether the server supports a given presentation mode.
591+ *
592+ * \param [in] connection The connection
593+ * \param [in] mode The MirPresentMode
594+ * \return True if supported, false if not
595+ */
596+bool mir_connection_present_mode_supported(
597+ MirConnection* connection, MirPresentMode mode);
598+
599+/** Respecify the submission mode that the MirPresentationChain is operating with.
600+ * The buffers currently queued will immediately be requeued according
601+ * to the new mode.
602+ *
603+ * \pre mir_connection_present_mode_supported must indicate that the mode is supported
604+ * \param [in] chain The chain
605+ * \param [in] mode The mode to change to
606+ */
607+void mir_presentation_chain_set_mode(
608+ MirPresentationChain* chain, MirPresentMode mode);
609+>>>>>>> MERGE-SOURCE
610
611 /**
612 * Set the MirWindowSpec to contain a specific cursor.
613@@ -204,6 +281,7 @@
614 MirWindowSpec* spec,
615 MirRenderSurface* render_surface,
616 int hotspot_x, int hotspot_y)
617+<<<<<<< TREE
618 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
619
620 /**
621@@ -243,6 +321,31 @@
622 int logical_width, int logical_height,
623 int displacement_x, int displacement_y)
624 MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
625+=======
626+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
627+
628+/**
629+ * Set the MirWindowSpec to display content contained in a render surface
630+ *
631+ * \warning: The initial call to mir_window_spec_add_render_surface will set
632+ * the bottom-most content, and subsequent calls will stack the
633+ * content on top.
634+ *
635+ * \param spec The window_spec to be updated
636+ * \param render_surface The render surface containing the content to be displayed
637+ * \param logical_width The width that the content will be displayed at
638+ * (Ignored for buffer streams)
639+ * \param logical_height The height that the content will be displayed at
640+ * (Ignored for buffer streams)
641+ * \param displacement_x The x displacement from the top-left corner of the MirWindow
642+ * \param displacement_y The y displacement from the top-left corner of the MirWindow
643+ */
644+void mir_window_spec_add_render_surface(MirWindowSpec* spec,
645+ MirRenderSurface* render_surface,
646+ int logical_width, int logical_height,
647+ int displacement_x, int displacement_y)
648+MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
649+>>>>>>> MERGE-SOURCE
650
651 #pragma GCC diagnostic pop
652
653
654=== modified file 'include/core/mir_toolkit/deprecations.h'
655--- include/core/mir_toolkit/deprecations.h 2017-05-16 16:10:46 +0000
656+++ include/core/mir_toolkit/deprecations.h 2017-05-26 09:20:21 +0000
657@@ -1,3 +1,4 @@
658+<<<<<<< TREE
659 /*
660 * Copyright © 2017 Canonical Ltd.
661 *
662@@ -34,3 +35,41 @@
663 #endif
664
665 #endif //MIR_DEPRECATIONS_H_
666+=======
667+/*
668+ * Copyright © 2017 Canonical Ltd.
669+ *
670+ * This program is free software: you can redistribute it and/or modify it
671+ * under the terms of the GNU Lesser General Public License version 3,
672+ * as published by the Free Software Foundation.
673+ *
674+ * This program is distributed in the hope that it will be useful,
675+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
676+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
677+ * GNU Lesser General Public License for more details.
678+ *
679+ * You should have received a copy of the GNU Lesser General Public License
680+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
681+ */
682+
683+#ifndef MIR_DEPRECATIONS_H_
684+#define MIR_DEPRECATIONS_H_
685+
686+#ifndef MIR_ENABLE_DEPRECATIONS
687+ // use g++ version < 6.2 as a proxy for building on Ubunutu 16.04LTS ("Xenial") or 16.10 (Yakkety)
688+ #if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ > 6) || ((__GNUC__ == 6) && (__GNUC_MINOR__ >= 2))
689+ #define MIR_ENABLE_DEPRECATIONS 1
690+ #else
691+ #define MIR_ENABLE_DEPRECATIONS 0
692+ #endif
693+#endif
694+
695+#if MIR_ENABLE_DEPRECATIONS > 0
696+ #define MIR_FOR_REMOVAL_IN_VERSION_1(message)\
697+ __attribute__((deprecated(message)))
698+#else
699+ #define MIR_FOR_REMOVAL_IN_VERSION_1(message)
700+#endif
701+
702+#endif //MIR_DEPRECATIONS_H_
703+>>>>>>> MERGE-SOURCE
704
705=== modified file 'src/client/display_configuration_api.cpp'
706=== modified file 'src/client/mir_render_surface_api.cpp'
707=== modified file 'src/client/symbols.map'
708=== modified file 'src/platform/options/default_configuration.cpp'
709=== added directory 'src/platforms/android'
710=== added directory 'src/platforms/android/utils'
711=== added file 'src/platforms/android/utils/CMakeLists.txt.OTHER'
712--- src/platforms/android/utils/CMakeLists.txt.OTHER 1970-01-01 00:00:00 +0000
713+++ src/platforms/android/utils/CMakeLists.txt.OTHER 2017-05-26 09:20:21 +0000
714@@ -0,0 +1,46 @@
715+list(
716+ APPEND ANDROID_DIAGNOSTICS_SRCS
717+ ${CMAKE_CURRENT_SOURCE_DIR}/test_android_hardware_sanity.cpp
718+ ${CMAKE_CURRENT_SOURCE_DIR}/patterns.cpp
719+)
720+
721+add_definitions(-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION="${MIR_SERVER_GRAPHICS_PLATFORM_VERSION}")
722+
723+include_directories(
724+ ${PROJECT_SOURCE_DIR}/include/server
725+ ${PROJECT_SOURCE_DIR}/include/client
726+ ${PROJECT_SOURCE_DIR}/include/platform
727+ ${PROJECT_SOURCE_DIR}/src/include/common
728+ ${PROJECT_SOURCE_DIR}/include/test
729+ ${PROJECT_SOURCE_DIR}/tests/include
730+ ${PROJECT_SOURCE_DIR}/src/include/server
731+ ${PROJECT_SOURCE_DIR}/examples
732+ ${PROJECT_SOURCE_DIR}/src/platforms/android/include
733+)
734+
735+add_executable(
736+ mir_android_diagnostics
737+ ${ANDROID_DIAGNOSTICS_SRCS})
738+
739+target_link_libraries(
740+ mir_android_diagnostics
741+ mirserver
742+ mirdraw
743+ mir-test-static
744+ mir-test-framework-static
745+ ${LIBHARDWARE_LIBRARIES}
746+)
747+
748+mir_add_wrapped_executable(mir_demo_standalone_render_overlays
749+ render_overlays.cpp
750+)
751+
752+target_link_libraries(mir_demo_standalone_render_overlays
753+ mirclient
754+ mircommon
755+ mirplatform
756+)
757+
758+install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mir_android_diagnostics
759+ DESTINATION ${CMAKE_INSTALL_BINDIR}
760+)
761
762=== modified file 'src/platforms/mesa/client/client_platform.cpp'
763--- src/platforms/mesa/client/client_platform.cpp 2017-05-17 04:48:46 +0000
764+++ src/platforms/mesa/client/client_platform.cpp 2017-05-26 09:20:21 +0000
765@@ -21,9 +21,15 @@
766 #include "client_buffer_factory.h"
767 #include "mesa_native_display_container.h"
768 #include "native_surface.h"
769+<<<<<<< TREE
770 #include "mir/client/client_buffer_factory.h"
771 #include "mir/client/client_context.h"
772 #include "mir/client/client_buffer.h"
773+=======
774+#include "mir/client_buffer_factory.h"
775+#include "mir/client_context.h"
776+#include "mir/client_buffer.h"
777+>>>>>>> MERGE-SOURCE
778 #include "mir/mir_render_surface.h"
779 #include "mir/mir_buffer.h"
780 #include "mir/weak_egl.h"
781@@ -138,6 +144,7 @@
782 available_callback, available_context);
783 }
784
785+<<<<<<< TREE
786 void allocate_buffer_gbm_legacy(
787 MirConnection* connection,
788 int width, int height,
789@@ -283,6 +290,144 @@
790 {
791 return 0;
792 }
793+=======
794+void allocate_buffer_gbm_legacy(
795+ MirConnection* connection,
796+ int width, int height,
797+ unsigned int gbm_pixel_format,
798+ unsigned int gbm_bo_flags,
799+ MirBufferCallback available_callback, void* available_context)
800+{
801+ allocate_buffer_gbm(
802+ connection, static_cast<uint32_t>(width), static_cast<uint32_t>(height),
803+ static_cast<uint32_t>(gbm_pixel_format), static_cast<uint32_t>(gbm_bo_flags),
804+ available_callback, available_context);
805+}
806+
807+MirBuffer* allocate_buffer_gbm_sync(
808+ MirConnection* connection,
809+ uint32_t width, uint32_t height,
810+ uint32_t gbm_pixel_format,
811+ uint32_t gbm_bo_flags)
812+try
813+{
814+ struct BufferSync
815+ {
816+ void set_buffer(MirBuffer* b)
817+ {
818+ std::unique_lock<decltype(mutex)> lk(mutex);
819+ buffer = b;
820+ cv.notify_all();
821+ }
822+
823+ MirBuffer* wait_for_buffer()
824+ {
825+ std::unique_lock<decltype(mutex)> lk(mutex);
826+ cv.wait(lk, [this]{ return buffer; });
827+ return buffer;
828+ }
829+ private:
830+ std::mutex mutex;
831+ std::condition_variable cv;
832+ MirBuffer* buffer = nullptr;
833+ } sync;
834+
835+ allocate_buffer_gbm(
836+ connection, width, height, gbm_pixel_format, gbm_bo_flags,
837+ [](auto* b, auto* context){ reinterpret_cast<BufferSync*>(context)->set_buffer(b); }, &sync);
838+ return sync.wait_for_buffer();
839+}
840+catch (...)
841+{
842+ return nullptr;
843+}
844+
845+bool is_gbm_importable(MirBuffer* b)
846+try
847+{
848+ if (!b)
849+ return false;
850+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
851+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
852+ if (!native)
853+ return false;
854+ return native->is_gbm_buffer;
855+}
856+catch (...)
857+{
858+ return false;
859+}
860+
861+int import_fd(MirBuffer* b)
862+try
863+{
864+ if (!is_gbm_importable(b))
865+ return -1;
866+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
867+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
868+ return native->fd[0];
869+}
870+catch (...)
871+{
872+ return -1;
873+}
874+
875+uint32_t buffer_stride(MirBuffer* b)
876+try
877+{
878+ if (!is_gbm_importable(b))
879+ return 0;
880+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
881+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
882+ return native->stride;
883+}
884+catch (...)
885+{
886+ return 0;
887+}
888+
889+uint32_t buffer_format(MirBuffer* b)
890+try
891+{
892+ if (!is_gbm_importable(b))
893+ return 0;
894+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
895+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
896+ return native->native_format;
897+}
898+catch (...)
899+{
900+ return 0;
901+}
902+
903+uint32_t buffer_flags(MirBuffer* b)
904+try
905+{
906+ if (!is_gbm_importable(b))
907+ return 0;
908+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
909+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
910+ return native->native_flags;
911+}
912+catch (...)
913+{
914+ return 0;
915+}
916+
917+unsigned int buffer_age(MirBuffer* b)
918+try
919+{
920+ if (!is_gbm_importable(b))
921+ return 0;
922+ auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
923+ auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
924+ return native->age;
925+}
926+catch (...)
927+{
928+ return 0;
929+}
930+>>>>>>> MERGE-SOURCE
931 #pragma GCC diagnostic push
932 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
933 MirBufferStream* get_hw_stream(
934
935=== modified file 'src/platforms/mesa/client/client_platform.h'
936=== modified file 'src/platforms/mesa/server/kms/real_kms_display_configuration.cpp'
937--- src/platforms/mesa/server/kms/real_kms_display_configuration.cpp 2017-05-08 03:04:26 +0000
938+++ src/platforms/mesa/server/kms/real_kms_display_configuration.cpp 2017-05-26 09:20:21 +0000
939@@ -142,6 +142,7 @@
940
941 void mgm::RealKMSDisplayConfiguration::update()
942 {
943+<<<<<<< TREE
944 decltype(outputs) new_outputs;
945
946 displays->update_from_hardware_state();
947@@ -180,6 +181,219 @@
948 * to provide a max_simultaneous_outputs value that is useful to clients.
949 */
950 card.max_simultaneous_outputs = outputs.size();
951+=======
952+ kms::DRMModeResources resources{drm_fd};
953+
954+ size_t max_outputs = std::min(resources.num_crtcs(), resources.num_connectors());
955+ card = {DisplayConfigurationCardId{0}, max_outputs};
956+
957+ resources.for_each_connector([&](kms::DRMModeConnectorUPtr connector)
958+ {
959+ add_or_update_output(resources, *connector);
960+ });
961+}
962+
963+namespace
964+{
965+std::vector<uint8_t> edid_for_connector(int drm_fd, uint32_t connector_id)
966+{
967+ std::vector<uint8_t> edid;
968+
969+ mgk::ObjectProperties connector_props{
970+ drm_fd, connector_id, DRM_MODE_OBJECT_CONNECTOR};
971+
972+ if (connector_props.has_property("EDID"))
973+ {
974+ /*
975+ * We don't technically need the property information here, but query it
976+ * anyway so we can detect if our assumptions about DRM behaviour
977+ * become invalid.
978+ */
979+ auto property = mgk::DRMModePropertyUPtr{
980+ drmModeGetProperty(drm_fd, connector_props.id_for("EDID")),
981+ &drmModeFreeProperty};
982+
983+ if (!property)
984+ {
985+ mir::log_warning(
986+ "Failed to get EDID property for connector %u: %i (%s)",
987+ connector_id,
988+ errno,
989+ ::strerror(errno));
990+ return edid;
991+ }
992+
993+ if (!drm_property_type_is(property.get(), DRM_MODE_PROP_BLOB))
994+ {
995+ mir::log_warning(
996+ "EDID property on connector %u has unexpected type %u",
997+ connector_id,
998+ property->flags);
999+ return edid;
1000+ }
1001+
1002+ // A property ID of 0 means invalid.
1003+ if (connector_props["EDID"] == 0)
1004+ {
1005+ /*
1006+ * Log a debug message only. This will trigger for broken monitors which
1007+ * don't provide an EDID, which is not as unusual as you might think...
1008+ */
1009+ mir::log_debug("No EDID data available on connector %u", connector_id);
1010+ return edid;
1011+ }
1012+
1013+ auto blob = drmModeGetPropertyBlob(drm_fd, connector_props["EDID"]);
1014+
1015+ if (!blob)
1016+ {
1017+ mir::log_warning(
1018+ "Failed to get EDID property blob for connector %u: %i (%s)",
1019+ connector_id,
1020+ errno,
1021+ ::strerror(errno));
1022+
1023+ return edid;
1024+ }
1025+
1026+ edid.reserve(blob->length);
1027+ edid.insert(edid.begin(),
1028+ reinterpret_cast<uint8_t*>(blob->data),
1029+ reinterpret_cast<uint8_t*>(blob->data) + blob->length);
1030+
1031+ drmModeFreePropertyBlob(blob);
1032+
1033+ edid.shrink_to_fit();
1034+ }
1035+
1036+ return edid;
1037+}
1038+}
1039+
1040+void mgm::RealKMSDisplayConfiguration::add_or_update_output(
1041+ kms::DRMModeResources const& resources,
1042+ drmModeConnector const& connector)
1043+{
1044+ DisplayConfigurationOutputId id{static_cast<int>(connector.connector_id)};
1045+ DisplayConfigurationCardId card_id{0};
1046+ DisplayConfigurationOutputType const type{
1047+ kms_connector_type_to_output_type(connector.connector_type)};
1048+ geom::Size physical_size{connector.mmWidth, connector.mmHeight};
1049+ bool connected{connector.connection == DRM_MODE_CONNECTED};
1050+ uint32_t const invalid_mode_index = std::numeric_limits<uint32_t>::max();
1051+ uint32_t current_mode_index{invalid_mode_index};
1052+ uint32_t preferred_mode_index{invalid_mode_index};
1053+ std::vector<DisplayConfigurationMode> modes;
1054+ std::vector<MirPixelFormat> formats {mir_pixel_format_argb_8888,
1055+ mir_pixel_format_xrgb_8888};
1056+
1057+ std::vector<uint8_t> edid;
1058+ if (connected)
1059+ {
1060+ /* Only ask for the EDID on connected outputs. There's obviously no monitor EDID
1061+ * when there is no monitor connected!
1062+ */
1063+ edid = edid_for_connector(drm_fd, connector.connector_id);
1064+ }
1065+
1066+ drmModeModeInfo current_mode_info = drmModeModeInfo();
1067+ GammaCurves gamma;
1068+
1069+ /* Get information about the current mode */
1070+ if (connector.encoder_id)
1071+ {
1072+ auto encoder = resources.encoder(connector.encoder_id);
1073+ if (encoder->crtc_id)
1074+ {
1075+ current_mode_info = resources.crtc(encoder->crtc_id)->mode;
1076+
1077+ auto crtc = resources.crtc(encoder->crtc_id);
1078+ if (crtc->gamma_size > 0)
1079+ gamma = mg::LinearGammaLUTs(crtc->gamma_size);
1080+ }
1081+ }
1082+
1083+ /* Add all the available modes and find the current and preferred one */
1084+ for (int m = 0; m < connector.count_modes; m++)
1085+ {
1086+ drmModeModeInfo& mode_info = connector.modes[m];
1087+
1088+ geom::Size size{mode_info.hdisplay, mode_info.vdisplay};
1089+
1090+ double vrefresh_hz = calculate_vrefresh_hz(mode_info);
1091+
1092+ modes.push_back({size, vrefresh_hz});
1093+
1094+ if (kms_modes_are_equal(mode_info, current_mode_info))
1095+ current_mode_index = m;
1096+
1097+ if ((mode_info.type & DRM_MODE_TYPE_PREFERRED) == DRM_MODE_TYPE_PREFERRED)
1098+ preferred_mode_index = m;
1099+ }
1100+
1101+ /* Add or update the output */
1102+ auto iter = find_output_with_id(id);
1103+
1104+ if (iter == outputs.end())
1105+ {
1106+ outputs.push_back({id, card_id, type, formats, modes, preferred_mode_index,
1107+ physical_size, connected, false, geom::Point(),
1108+ current_mode_index, mir_pixel_format_xrgb_8888,
1109+ mir_power_mode_on, mir_orientation_normal,
1110+ 1.0f, mir_form_factor_monitor,
1111+ kms_subpixel_to_mir_subpixel(connector.subpixel),
1112+ gamma, mir_output_gamma_supported, std::move(edid)});
1113+ }
1114+ else
1115+ {
1116+ auto& output = *iter;
1117+
1118+ if (current_mode_index != invalid_mode_index)
1119+ {
1120+ output.current_mode_index = current_mode_index;
1121+ }
1122+ else if (!modes.empty() && // If empty retain old current_mode_index!
1123+ ( output.current_mode_index >= modes.size() ||
1124+ output.modes[output.current_mode_index] !=
1125+ modes[output.current_mode_index]))
1126+ {
1127+ // current_mode_index is invalid and the definition of the old
1128+ // current mode has also changed (different display plugged in)
1129+ // so fall back to the preferred mode...
1130+ output.current_mode_index = preferred_mode_index;
1131+ }
1132+ // else output.current_mode_index is correct and unchanged.
1133+
1134+ output.modes = modes;
1135+ output.preferred_mode_index = preferred_mode_index;
1136+ output.physical_size_mm = physical_size;
1137+ output.connected = connected;
1138+ output.current_format = mir_pixel_format_xrgb_8888;
1139+ output.subpixel_arrangement = kms_subpixel_to_mir_subpixel(connector.subpixel);
1140+ output.gamma = gamma;
1141+ output.edid = edid;
1142+ }
1143+}
1144+
1145+std::vector<mg::DisplayConfigurationOutput>::iterator
1146+mgm::RealKMSDisplayConfiguration::find_output_with_id(mg::DisplayConfigurationOutputId id)
1147+{
1148+ return std::find_if(outputs.begin(), outputs.end(),
1149+ [id](DisplayConfigurationOutput const& output)
1150+ {
1151+ return output.id == id;
1152+ });
1153+}
1154+
1155+std::vector<mg::DisplayConfigurationOutput>::const_iterator
1156+mgm::RealKMSDisplayConfiguration::find_output_with_id(mg::DisplayConfigurationOutputId id) const
1157+{
1158+ return std::find_if(outputs.begin(), outputs.end(),
1159+ [id](DisplayConfigurationOutput const& output)
1160+ {
1161+ return output.id == id;
1162+ });
1163+>>>>>>> MERGE-SOURCE
1164 }
1165
1166 // Compatibility means conf1 can be attained from conf2 (and vice versa)
1167
1168=== modified file 'src/server/compositor/multi_monitor_arbiter.cpp'
1169--- src/server/compositor/multi_monitor_arbiter.cpp 2017-05-25 05:49:36 +0000
1170+++ src/server/compositor/multi_monitor_arbiter.cpp 2017-05-26 09:20:21 +0000
1171@@ -65,9 +65,16 @@
1172
1173 auto& last_entry = onscreen_buffers.front();
1174 last_entry.use_count++;
1175+<<<<<<< TREE
1176 auto last_entry_buffer = last_entry.buffer;
1177 clean_onscreen_buffers(lk);
1178 return last_entry_buffer;
1179+=======
1180+ auto last_entry_buffer = last_entry.buffer;
1181+ if (mode == mc::MultiMonitorMode::multi_monitor_sync)
1182+ clean_onscreen_buffers(lk);
1183+ return last_entry_buffer;
1184+>>>>>>> MERGE-SOURCE
1185 }
1186
1187 void mc::MultiMonitorArbiter::compositor_release(std::shared_ptr<mg::Buffer> const& buffer)
1188
1189=== modified file 'src/server/frontend/session_mediator.cpp'
1190=== modified file 'src/server/graphics/nested/nested_display_configuration.cpp'
1191=== modified file 'src/server/input/default_configuration.cpp'
1192=== modified file 'src/server/input/default_device.cpp'
1193--- src/server/input/default_device.cpp 2017-05-08 03:04:26 +0000
1194+++ src/server/input/default_device.cpp 2017-05-26 09:20:21 +0000
1195@@ -32,6 +32,7 @@
1196
1197 namespace mi = mir::input;
1198
1199+<<<<<<< TREE
1200 mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
1201 std::shared_ptr<dispatch::ActionQueue> const& actions,
1202 InputDevice& device,
1203@@ -46,6 +47,19 @@
1204 actions{actions},
1205 key_mapper{key_mapper},
1206 device_changed_callback{callback}
1207+=======
1208+mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
1209+ std::shared_ptr<dispatch::ActionQueue> const& actions,
1210+ InputDevice& device,
1211+ std::shared_ptr<KeyMapper> const& key_mapper)
1212+ : device_id{id},
1213+ device{device},
1214+ info(device.get_device_info()),
1215+ pointer{device.get_pointer_settings()},
1216+ touchpad{device.get_touchpad_settings()},
1217+ actions{actions},
1218+ key_mapper{key_mapper}
1219+>>>>>>> MERGE-SOURCE
1220 {
1221 if (contains(info.capabilities, mi::DeviceCapability::keyboard))
1222 {
1223@@ -188,6 +202,7 @@
1224 settings.tap_to_click = conf.tap_to_click();
1225 settings.middle_mouse_button_emulation = conf.middle_mouse_button_emulation();
1226
1227+<<<<<<< TREE
1228 {
1229 std::lock_guard<std::mutex> lock(config_mutex);
1230 touchpad = settings;
1231@@ -198,6 +213,19 @@
1232 dev->apply_settings(settings);
1233 });
1234 }
1235+=======
1236+ {
1237+ std::lock_guard<std::mutex> lock(config_mutex);
1238+ touchpad = settings;
1239+
1240+ if (!actions) // device is disabled
1241+ return;
1242+ actions->enqueue([settings = std::move(settings), dev=&device]
1243+ {
1244+ dev->apply_settings(settings);
1245+ });
1246+ }
1247+>>>>>>> MERGE-SOURCE
1248 }
1249
1250 mir::optional_value<MirKeyboardConfig> mi::DefaultDevice::keyboard_configuration() const
1251@@ -211,6 +239,7 @@
1252 if (!contains(info.capabilities, mi::DeviceCapability::keyboard))
1253 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a keyboard configuration"));
1254
1255+<<<<<<< TREE
1256 set_keyboard_configuration(conf);
1257 device_changed_callback(this);
1258 }
1259@@ -220,8 +249,14 @@
1260 std::lock_guard<std::mutex> lock(config_mutex);
1261 if (!actions) // device is disabled
1262 return;
1263+=======
1264+ std::lock_guard<std::mutex> lock(config_mutex);
1265+ if (!actions) // device is disabled
1266+ return;
1267+>>>>>>> MERGE-SOURCE
1268 if (keyboard.value().device_keymap() != conf.device_keymap())
1269 keyboard = conf;
1270+<<<<<<< TREE
1271 else
1272 return;
1273 key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
1274@@ -263,6 +298,17 @@
1275 dev->apply_settings(settings);
1276 });
1277 }
1278+=======
1279+ else
1280+ return;
1281+ key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
1282+}
1283+
1284+void mi::DefaultDevice::disable_queue()
1285+{
1286+ std::lock_guard<std::mutex> lock(config_mutex);
1287+ actions.reset();
1288+>>>>>>> MERGE-SOURCE
1289 }
1290
1291 MirInputDevice mi::DefaultDevice::config() const
1292
1293=== modified file 'src/server/input/default_device.h'
1294--- src/server/input/default_device.h 2017-05-08 03:04:26 +0000
1295+++ src/server/input/default_device.h 2017-05-26 09:20:21 +0000
1296@@ -30,8 +30,12 @@
1297 #include "mir/optional_value.h"
1298
1299 #include <memory>
1300+<<<<<<< TREE
1301 #include <functional>
1302 #include <mutex>
1303+=======
1304+#include <mutex>
1305+>>>>>>> MERGE-SOURCE
1306
1307 namespace mir
1308 {
1309@@ -74,11 +78,15 @@
1310 void apply_touchpad_configuration(MirTouchpadConfig const&) override;
1311 optional_value<MirKeyboardConfig> keyboard_configuration() const override;
1312 void apply_keyboard_configuration(MirKeyboardConfig const&) override;
1313+<<<<<<< TREE
1314 optional_value<MirTouchscreenConfig> touchscreen_configuration() const override;
1315 void apply_touchscreen_configuration(MirTouchscreenConfig const&) override;
1316
1317 MirInputDevice config() const;
1318 void disable_queue();
1319+=======
1320+ void disable_queue();
1321+>>>>>>> MERGE-SOURCE
1322 private:
1323 void set_pointer_configuration(MirPointerConfig const&);
1324 void set_touchpad_configuration(MirTouchpadConfig const&);
1325@@ -92,11 +100,19 @@
1326 optional_value<PointerSettings> pointer;
1327 optional_value<TouchpadSettings> touchpad;
1328 optional_value<MirKeyboardConfig> keyboard;
1329+<<<<<<< TREE
1330 optional_value<TouchscreenSettings> touchscreen;
1331 std::shared_ptr<dispatch::ActionQueue> actions;
1332+=======
1333+ std::shared_ptr<dispatch::ActionQueue> actions;
1334+>>>>>>> MERGE-SOURCE
1335 std::shared_ptr<KeyMapper> const key_mapper;
1336+<<<<<<< TREE
1337 std::function<void(Device*)> device_changed_callback;
1338 std::mutex mutable config_mutex;
1339+=======
1340+ std::mutex mutable config_mutex;
1341+>>>>>>> MERGE-SOURCE
1342 };
1343
1344 }
1345
1346=== modified file 'src/server/input/default_input_device_hub.cpp'
1347--- src/server/input/default_input_device_hub.cpp 2017-05-08 03:04:26 +0000
1348+++ src/server/input/default_input_device_hub.cpp 2017-05-26 09:20:21 +0000
1349@@ -200,8 +200,14 @@
1350
1351 if (it == end(devices))
1352 {
1353+<<<<<<< TREE
1354 auto queue = std::make_shared<dispatch::ActionQueue>();
1355 auto handle = restore_or_create_device(*device, queue);
1356+=======
1357+ auto id = create_new_device_id();
1358+ auto queue = std::make_shared<dispatch::ActionQueue>();
1359+ auto handle = std::make_shared<DefaultDevice>(id, queue, *device, key_mapper);
1360+>>>>>>> MERGE-SOURCE
1361 // send input device info to observer loop..
1362 devices.push_back(std::make_unique<RegisteredDevice>(
1363 device, handle->id(), queue, cookie_authority, handle));
1364@@ -210,7 +216,18 @@
1365 add_device_handle(handle);
1366
1367 seat->add_device(*handle);
1368- dev->start(seat, input_dispatchable);
1369+<<<<<<< TREE
1370+ dev->start(seat, input_dispatchable);
1371+=======
1372+ dev->start(seat, input_dispatchable);
1373+
1374+ // pass input device handle to observer loop..
1375+ observer_queue->enqueue(this,
1376+ [this, handle]()
1377+ {
1378+ add_device_handle(handle);
1379+ });
1380+>>>>>>> MERGE-SOURCE
1381 }
1382 else
1383 {
1384
1385=== modified file 'src/server/input/default_input_device_hub.h'
1386--- src/server/input/default_input_device_hub.h 2017-05-08 03:04:26 +0000
1387+++ src/server/input/default_input_device_hub.h 2017-05-26 09:20:21 +0000
1388@@ -104,11 +104,15 @@
1389 void device_changed(Device* dev);
1390 void emit_changed_devices();
1391 MirInputDeviceId create_new_device_id();
1392+<<<<<<< TREE
1393 void store_device_config(DefaultDevice const& dev);
1394 std::shared_ptr<DefaultDevice> restore_or_create_device(InputDevice& dev,
1395 std::shared_ptr<dispatch::ActionQueue> const& queue);
1396 mir::optional_value<MirInputDevice> get_stored_device_config(std::string const& id);
1397
1398+=======
1399+
1400+>>>>>>> MERGE-SOURCE
1401 std::shared_ptr<Seat> const seat;
1402 std::shared_ptr<dispatch::MultiplexingDispatchable> const input_dispatchable;
1403 std::mutex mutable handles_guard;
1404
1405=== modified file 'src/server/scene/application_session.cpp'
1406=== modified file 'src/utils/out.c'
1407=== modified file 'tests/acceptance-tests/test_custom_window_management.cpp'
1408--- tests/acceptance-tests/test_custom_window_management.cpp 2017-05-25 04:43:29 +0000
1409+++ tests/acceptance-tests/test_custom_window_management.cpp 2017-05-26 09:20:21 +0000
1410@@ -371,6 +371,7 @@
1411 mir_connection_release(connection);
1412 }
1413
1414+<<<<<<< TREE
1415 TEST_F(CustomWindowManagement, apply_input_shape_to_surface)
1416 {
1417 start_server();
1418@@ -420,6 +421,55 @@
1419 mir_connection_release(connection);
1420 }
1421
1422+=======
1423+TEST_F(CustomWindowManagement, apply_input_shape_to_surface)
1424+{
1425+ start_server();
1426+
1427+ auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
1428+
1429+ int const width{800}, height{600};
1430+ MirPixelFormat const format{mir_pixel_format_bgr_888};
1431+ auto surface_spec = mir_create_normal_window_spec(connection, width, height);
1432+ mir_window_spec_set_pixel_format(surface_spec, format);
1433+
1434+ auto window = mir_create_window_sync(surface_spec);
1435+ mir_window_spec_release(surface_spec);
1436+
1437+ surface_spec = mir_create_window_spec(connection);
1438+
1439+ mt::Signal received;
1440+
1441+ MirRectangle rect{ 0, 0, 100, 101 };
1442+ mir_window_spec_set_input_shape(surface_spec, &rect, 1);
1443+
1444+ auto const check_apply_surface = [&received](
1445+ std::shared_ptr<ms::Session> const&,
1446+ std::shared_ptr<ms::Surface> const&,
1447+ msh::SurfaceSpecification const& spec)
1448+ {
1449+ EXPECT_TRUE(spec.input_shape.is_set());
1450+ received.raise();
1451+ };
1452+ EXPECT_CALL(window_manager, modify_surface(_,_,_)).WillOnce(Invoke(check_apply_surface));
1453+
1454+ mir_window_apply_spec(window, surface_spec);
1455+ mir_window_spec_release(surface_spec);
1456+
1457+ EXPECT_TRUE(received.wait_for(400ms));
1458+
1459+ surface_spec = mir_create_window_spec(connection);
1460+ mir_window_spec_set_input_shape(surface_spec, nullptr, 0);
1461+
1462+ mir_window_apply_spec(window, surface_spec);
1463+ mir_window_spec_release(surface_spec);
1464+ EXPECT_TRUE(received.wait_for(400ms));
1465+
1466+ mir_window_release_sync(window);
1467+ mir_connection_release(connection);
1468+}
1469+
1470+>>>>>>> MERGE-SOURCE
1471 TEST_F(CustomWindowManagement, when_the_client_places_a_new_surface_the_request_reaches_the_window_manager)
1472 {
1473 int const width{800};
1474
1475=== modified file 'tests/acceptance-tests/test_new_display_configuration.cpp'
1476=== modified file 'tests/acceptance-tests/test_presentation_chain.cpp'
1477--- tests/acceptance-tests/test_presentation_chain.cpp 2017-05-25 04:43:29 +0000
1478+++ tests/acceptance-tests/test_presentation_chain.cpp 2017-05-26 09:20:21 +0000
1479@@ -133,18 +133,33 @@
1480 {
1481 auto spec = mir_create_normal_window_spec(
1482 connection, size.width.as_int(), size.height.as_int());
1483-#pragma GCC diagnostic push
1484-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1485- mir_window_spec_set_pixel_format(spec, pf);
1486- mir_window_spec_add_render_surface(
1487- spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);
1488-#pragma GCC diagnostic pop
1489- auto window = mir_create_window_sync(spec);
1490- mir_window_spec_release(spec);
1491- return window;
1492- }
1493-};
1494-
1495+<<<<<<< TREE
1496+#pragma GCC diagnostic push
1497+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1498+ mir_window_spec_set_pixel_format(spec, pf);
1499+ mir_window_spec_add_render_surface(
1500+ spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);
1501+#pragma GCC diagnostic pop
1502+ auto window = mir_create_window_sync(spec);
1503+ mir_window_spec_release(spec);
1504+ return window;
1505+ }
1506+};
1507+
1508+=======
1509+ mir_window_spec_set_pixel_format(spec, pf);
1510+#pragma GCC diagnostic push
1511+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1512+ mir_window_spec_add_render_surface(
1513+ spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);
1514+#pragma GCC diagnostic pop
1515+ auto window = mir_create_window_sync(spec);
1516+ mir_window_spec_release(spec);
1517+ return window;
1518+ }
1519+};
1520+
1521+>>>>>>> MERGE-SOURCE
1522 struct PresentationChain : mtf::ConnectedClientHeadlessServer
1523 {
1524 bool stall_compositor = false;
1525@@ -467,6 +482,7 @@
1526 EXPECT_THAT(mir_buffer_get_error_message(buffer), Not(StrEq("")));
1527 mir_buffer_release(buffer);
1528 }
1529+<<<<<<< TREE
1530
1531 namespace
1532 {
1533@@ -623,3 +639,159 @@
1534 for (auto i = 0u; i < buffers.size() - 1; i++)
1535 EXPECT_TRUE(buffers[i]->wait_ready(5s));
1536 }
1537+=======
1538+
1539+namespace
1540+{
1541+ struct TrackedBuffer
1542+ {
1543+ TrackedBuffer(MirConnection* connection, std::atomic<unsigned int>& counter) :
1544+ buffer(mir_connection_allocate_buffer_sync(connection, 100, 100, pf)),
1545+ counter(counter)
1546+ {
1547+ }
1548+ ~TrackedBuffer()
1549+ {
1550+ mir_buffer_release(buffer);
1551+ }
1552+
1553+ void submit_to(MirPresentationChain* chain)
1554+ {
1555+ std::unique_lock<std::mutex> lk(mutex);
1556+ if (!avail)
1557+ throw std::runtime_error("test problem");
1558+ avail = false;
1559+ mir_presentation_chain_submit_buffer(chain, buffer, tavailable, this);
1560+ }
1561+
1562+ static void tavailable(MirBuffer*, void* ctxt)
1563+ {
1564+ TrackedBuffer* buf = reinterpret_cast<TrackedBuffer*>(ctxt);
1565+ buf->ready();
1566+ }
1567+
1568+ void ready()
1569+ {
1570+ last_count_ = counter.fetch_add(1);
1571+ std::unique_lock<std::mutex> lk(mutex);
1572+ avail = true;
1573+ cv.notify_all();
1574+ }
1575+
1576+ bool wait_ready(std::chrono::milliseconds ms)
1577+ {
1578+ std::unique_lock<std::mutex> lk(mutex);
1579+ return cv.wait_for(lk, ms, [this] { return avail; });
1580+ }
1581+
1582+ bool is_ready() { return avail; }
1583+ unsigned int last_count() const
1584+ {
1585+ return last_count_;
1586+ }
1587+
1588+ MirPixelFormat pf = mir_pixel_format_abgr_8888;
1589+ MirBuffer* buffer;
1590+ std::atomic<unsigned int>& counter;
1591+ unsigned int last_count_ = 0u;
1592+ bool avail = true;
1593+ std::condition_variable cv;
1594+ std::mutex mutex;
1595+ };
1596+}
1597+
1598+TEST_F(PresentationChain, fifo_looks_correct_from_client_perspective)
1599+{
1600+ SurfaceWithChainFromStart window(
1601+ connection, mir_present_mode_fifo, size, pf);
1602+
1603+ int const num_buffers = 5;
1604+
1605+ std::atomic<unsigned int> counter{ 0u };
1606+ std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
1607+ for (auto& buffer : buffers)
1608+ buffer = std::make_unique<TrackedBuffer>(connection, counter);
1609+ for(auto& b : buffers)
1610+ b->submit_to(window.chain());
1611+
1612+ //the last one that will return;
1613+ EXPECT_TRUE(buffers[3]->wait_ready(5s));
1614+ EXPECT_THAT(buffers[0]->last_count(), Lt(buffers[1]->last_count()));
1615+ EXPECT_THAT(buffers[1]->last_count(), Lt(buffers[2]->last_count()));
1616+ EXPECT_THAT(buffers[2]->last_count(), Lt(buffers[3]->last_count()));
1617+ EXPECT_FALSE(buffers[4]->is_ready());
1618+}
1619+
1620+TEST_F(PresentationChain, fifo_queues_when_compositor_isnt_consuming)
1621+{
1622+ SurfaceWithChainFromStart window(
1623+ connection, mir_present_mode_fifo, size, pf);
1624+ int const num_buffers = 5;
1625+ std::atomic<unsigned int> counter{ 0u };
1626+ std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
1627+ for (auto& buffer : buffers)
1628+ buffer = std::make_unique<TrackedBuffer>(connection, counter);
1629+ {
1630+ auto const stall = mir::raii::paired_calls(
1631+ [this] { stall_compositor = true; },
1632+ [this] { stall_compositor = false; });
1633+ for (auto& b : buffers)
1634+ b->submit_to(window.chain());
1635+ for (auto &b : buffers)
1636+ EXPECT_FALSE(b->is_ready());
1637+ }
1638+ for (auto i = 0u; i < buffers.size() - 1; i++)
1639+ EXPECT_TRUE(buffers[i]->wait_ready(5s));
1640+}
1641+
1642+TEST_F(PresentationChain, mailbox_looks_correct_from_client_perspective)
1643+{
1644+ auto const stall = mir::raii::paired_calls(
1645+ [this] { stall_compositor = true; },
1646+ [this] { stall_compositor = false; });
1647+ SurfaceWithChainFromStart window(
1648+ connection, mir_present_mode_mailbox, size, pf);
1649+
1650+ int const num_buffers = 5;
1651+
1652+ std::atomic<unsigned int> counter{ 0u };
1653+ std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
1654+ for (auto& buffer : buffers)
1655+ buffer = std::make_unique<TrackedBuffer>(connection, counter);
1656+
1657+ for(auto i = 0u; i < buffers.size(); i++)
1658+ {
1659+ buffers[i]->submit_to(window.chain());
1660+ if (i > 0)
1661+ EXPECT_TRUE(buffers[i-1]->wait_ready(5s));
1662+ }
1663+
1664+ for(auto i = 0u; i < num_buffers - 1; i++)
1665+ EXPECT_TRUE(buffers[i]->is_ready());
1666+ EXPECT_FALSE(buffers[4]->is_ready());
1667+}
1668+
1669+TEST_F(PresentationChain, fifo_queues_clears_out_on_transition_to_mailbox)
1670+{
1671+ SurfaceWithChainFromStart window(
1672+ connection, mir_present_mode_fifo, size, pf);
1673+ int const num_buffers = 5;
1674+ std::atomic<unsigned int> counter{ 0u };
1675+ std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
1676+ for (auto& buffer : buffers)
1677+ buffer = std::make_unique<TrackedBuffer>(connection, counter);
1678+
1679+ auto const stall = mir::raii::paired_calls(
1680+ [this] { stall_compositor = true; },
1681+ [this] { stall_compositor = false; });
1682+ for (auto& b : buffers)
1683+ b->submit_to(window.chain());
1684+ for (auto &b : buffers)
1685+ EXPECT_FALSE(b->is_ready());
1686+
1687+ mir_presentation_chain_set_mode(window.chain(), mir_present_mode_mailbox);
1688+
1689+ for (auto i = 0u; i < buffers.size() - 1; i++)
1690+ EXPECT_TRUE(buffers[i]->wait_ready(5s));
1691+}
1692+>>>>>>> MERGE-SOURCE
1693
1694=== modified file 'tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp'
1695=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
1696=== modified file 'tests/unit-tests/input/test_default_device.cpp'
1697--- tests/unit-tests/input/test_default_device.cpp 2017-05-08 03:04:26 +0000
1698+++ tests/unit-tests/input/test_default_device.cpp 2017-05-26 09:20:21 +0000
1699@@ -183,6 +183,7 @@
1700
1701 queue->dispatch(md::FdEvent::readable);
1702 }
1703+<<<<<<< TREE
1704
1705 TEST_F(DefaultDevice, touchpad_device_can_be_constructed_from_input_config)
1706 {
1707@@ -339,3 +340,28 @@
1708 conf.set_keyboard_config(kbd_config);
1709 EXPECT_NO_THROW(mi::DefaultDevice dev(conf, queue, keyboard, mt::fake_shared(key_mapper), change_callback));
1710 }
1711+=======
1712+
1713+TEST_F(DefaultDevice, disable_queue_ends_config_processing)
1714+{
1715+ mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
1716+
1717+ dev.disable_queue();
1718+ MirPointerConfig pointer_conf;
1719+ pointer_conf.cursor_acceleration_bias(1.0);
1720+
1721+ EXPECT_CALL(touchpad, apply_settings(Matcher<mi::TouchpadSettings const&>(_))).Times(0);
1722+ dev.apply_pointer_configuration(pointer_conf);
1723+}
1724+
1725+TEST_F(DefaultDevice, disable_queue_removes_reference_to_queue)
1726+{
1727+ std::weak_ptr<md::ActionQueue> ref = queue;
1728+ mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
1729+ queue.reset();
1730+
1731+ EXPECT_THAT(ref.lock(), Ne(nullptr));
1732+ dev.disable_queue();
1733+ EXPECT_THAT(ref.lock(), Eq(nullptr));
1734+}
1735+>>>>>>> MERGE-SOURCE
1736
1737=== modified file 'tests/unit-tests/input/test_default_input_device_hub.cpp'
1738--- tests/unit-tests/input/test_default_input_device_hub.cpp 2017-05-08 03:04:26 +0000
1739+++ tests/unit-tests/input/test_default_input_device_hub.cpp 2017-05-26 09:20:21 +0000
1740@@ -238,6 +238,7 @@
1741
1742 hub.remove_device(mt::fake_shared(device));
1743 hub.remove_device(mt::fake_shared(another_device));
1744+<<<<<<< TREE
1745 }
1746
1747 TEST_F(InputDeviceHubTest, when_pointer_configuration_is_applied_successfully_observer_is_triggerd)
1748@@ -359,3 +360,26 @@
1749 hub.remove_device(mt::fake_shared(mouse));
1750 expect_and_execute_multiplexer();
1751 }
1752+=======
1753+ observer_loop.trigger_server_actions();
1754+}
1755+
1756+TEST_F(InputDeviceHubTest, no_device_config_action_after_device_removal)
1757+{
1758+ std::shared_ptr<mi::Device> dev_ptr;
1759+ MirPointerConfig ptr_config;
1760+ ptr_config.cursor_acceleration_bias(0.5);
1761+
1762+ ON_CALL(mock_observer, device_added(WithName("mouse"))).WillByDefault(SaveArg<0>(&dev_ptr));
1763+
1764+ hub.add_device(mt::fake_shared(mouse));
1765+ hub.add_observer(mt::fake_shared(mock_observer));
1766+ observer_loop.trigger_server_actions();
1767+
1768+ EXPECT_CALL(mouse, apply_settings(Matcher<mi::PointerSettings const&>(_))).Times(0);
1769+
1770+ dev_ptr->apply_pointer_configuration(ptr_config);
1771+ hub.remove_device(mt::fake_shared(mouse));
1772+ observer_loop.trigger_server_actions();
1773+}
1774+>>>>>>> MERGE-SOURCE
1775
1776=== modified file 'tests/unit-tests/platforms/mesa/client/test_client_platform.cpp'
1777=== modified file 'tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp'
1778--- tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-05-08 03:04:26 +0000
1779+++ tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-05-26 09:20:21 +0000
1780@@ -81,11 +81,15 @@
1781 output->set_power_mode(mir_power_mode_on);
1782 output->set_orientation(mir_orientation_normal);
1783 output->set_edid(valid_edid, sizeof(valid_edid));
1784+<<<<<<< TREE
1785 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
1786
1787 auto const& current_mode = output->mode(output->current_mode());
1788 output->set_logical_width(current_mode.horizontal_resolution());
1789 output->set_logical_height(current_mode.vertical_resolution());
1790+=======
1791+ output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
1792+>>>>>>> MERGE-SOURCE
1793
1794 return std::make_shared<MirDisplayConfig>(conf);
1795 }
1796@@ -126,11 +130,15 @@
1797 output->set_power_mode(mir_power_mode_on);
1798 output->set_orientation(mir_orientation_normal);
1799 output->set_edid(valid_edid, sizeof(valid_edid));
1800+<<<<<<< TREE
1801 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
1802
1803 auto const& current_mode = output->mode(output->current_mode());
1804 output->set_logical_width(current_mode.horizontal_resolution());
1805 output->set_logical_height(current_mode.vertical_resolution());
1806+=======
1807+ output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
1808+>>>>>>> MERGE-SOURCE
1809 }
1810
1811 return std::make_shared<MirDisplayConfig>(conf);

Subscribers

People subscribed via source and target branches