Mir

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

Proposed by Alan Griffiths
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 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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-05-08 03:04:26 +0000
+++ CMakeLists.txt 2017-05-26 09:20:21 +0000
@@ -28,8 +28,13 @@
28set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)28set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
2929
30set(MIR_VERSION_MAJOR 0)30set(MIR_VERSION_MAJOR 0)
31<<<<<<< TREE
31set(MIR_VERSION_MINOR 27)32set(MIR_VERSION_MINOR 27)
32set(MIR_VERSION_PATCH 0)33set(MIR_VERSION_PATCH 0)
34=======
35set(MIR_VERSION_MINOR 26)
36set(MIR_VERSION_PATCH 3)
37>>>>>>> MERGE-SOURCE
3338
34add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})39add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
35add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})40add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
3641
=== modified file 'debian/changelog'
--- debian/changelog 2017-05-08 03:04:26 +0000
+++ debian/changelog 2017-05-26 09:20:21 +0000
@@ -1,3 +1,57 @@
1mir (0.26.3-0ubuntu1) UNRELEASED; urgency=medium
2
3 * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
4 - Enhancements:
5 . Make deprecations optional (and default to off for builds on 16.04 LTS)
6 . Added support for building on Ubuntu 17.10 artful.
7 - Bugs fixed:
8 . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
9 . unity-system-compositor crashed with SIGSEGV in
10 libinput_device_config_accel_is_available() from
11 libinput_device_config_accel_set_speed() from
12 mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
13 . Please transition to Boost 1.62 (LP: #1675138)
14 . Mir sending key repeat events continually to nested shell after VT
15 switch (causes Unity8 lockup for a while) (LP: #1675357)
16 . mir_demo_standalone_render_overlays fails to link (LP: #1677239)
17
18 -- Daniel van Vugt <daniel.van.vugt@canonical.com> Thu, 30 Mar 2017 11:43:28 +0800
19
20mir (0.26.2+17.04.20170322.1-0ubuntu2) zesty; urgency=medium
21
22 [ Mattia Rizzolo ]
23 * Patch the code to use unversioned runtime boost libraries (LP: #1675138).
24
25 -- Gianfranco Costamagna <locutusofborg@debian.org> Fri, 24 Mar 2017 22:58:36 +0100
26
27mir (0.26.2+17.04.20170322.1-0ubuntu1) zesty; urgency=medium
28
29 [ Daniel van Vugt ]
30 * New upstream release 0.26.2 (https://launchpad.net/mir/+milestone/0.26.2)
31 - Bugs fixed:
32 . EDID does not change when hotplugging a monitor (LP: #1660017)
33 . [regression] mirout crashes when connecting to unity8 or any nested
34 server: [libprotobuf FATAL /usr/include/google/protobuf/repeated_field.
35 h:1408] CHECK failed: (index) < (current_size_) (LP: #1661163)
36 . Mir server crashed with SIGSEGV in
37 mir::compositor::TemporaryBuffer::size() called from
38 mir::gl::tessellate_renderable_into_rectangle() (LP: #1664760)
39 . Nested servers (Unity8) periodically stutter (half frame rate) with
40 Mir 0.26.1 (LP: #1666372)
41 . Don't dereference the end iterator in ms::ApplicationSession::
42 surface_after() (LP: #1667645)
43 . [regression] OSK input shaping no longer works correctly (LP: #1669444)
44 . Setting MirWindowSpec parameters always causes window's input_region
45 to be reset (LP: #1670876)
46 . Subpixel order not included in Mir display information (LP: #1393578)
47 . Presentation chains should support various swap interval modes
48 (LP: #1673533)
49 . Need an extension for GBM buffers to replace
50 mir_buffer_get_buffer_package() (LP: #1673534)
51 . Seg fault on detect_fd_leaks (LP: #1661498)
52
53 -- Cemil Azizoglu <cemil.azizoglu@canonical.com> Wed, 22 Mar 2017 04:54:19 +0000
54
1mir (0.26.1+17.04.20170209.1-0ubuntu1) zesty; urgency=medium55mir (0.26.1+17.04.20170209.1-0ubuntu1) zesty; urgency=medium
256
3 * New upstream release 0.26.1 (https://launchpad.net/mir/+milestone/0.26.1)57 * New upstream release 0.26.1 (https://launchpad.net/mir/+milestone/0.26.1)
458
=== modified file 'debian/control'
--- debian/control 2017-05-08 03:04:26 +0000
+++ debian/control 2017-05-26 09:20:21 +0000
@@ -292,6 +292,21 @@
292 .292 .
293 Contains a tool for stress testing the Mir display server293 Contains a tool for stress testing the Mir display server
294294
295<<<<<<< TREE
296=======
297Package: mir-android-diagnostics
298Architecture: i386 amd64 armhf
299Pre-Depends: ${misc:Pre-Depends}
300Depends: ${misc:Depends},
301 ${shlibs:Depends},
302Recommends: mir-demos,
303Description: Display Server for Ubuntu - android platform diagnostics utility
304 Mir is a display server running on linux systems, with a focus on efficiency,
305 robust operation and a well-defined driver model.
306 .
307 Contains a tool for checking the graphics components of android devices.
308
309>>>>>>> MERGE-SOURCE
295Package: libmircore1310Package: libmircore1
296Section: libs311Section: libs
297Architecture: linux-any312Architecture: linux-any
@@ -347,7 +362,25 @@
347 Contains the shared libraries required for the Mir server to interact with362 Contains the shared libraries required for the Mir server to interact with
348 the hardware platform using the Mesa drivers.363 the hardware platform using the Mesa drivers.
349364
365<<<<<<< TREE
350Package: mir-platform-input-evdev7366Package: mir-platform-input-evdev7
367=======
368Package: mir-platform-graphics-android12
369Section: libs
370Architecture: i386 amd64 armhf
371Multi-Arch: same
372Pre-Depends: ${misc:Pre-Depends}
373Depends: ${misc:Depends},
374 ${shlibs:Depends},
375Description: Display server for Ubuntu - platform library for Android
376 Mir is a display server running on linux systems, with a focus on efficiency,
377 robust operation and a well-defined driver model.
378 .
379 Contains the shared libraries required for the Mir server to interact with
380 the hardware platform using the Android drivers.
381
382Package: mir-platform-input-evdev6
383>>>>>>> MERGE-SOURCE
351Section: libs384Section: libs
352Architecture: linux-any385Architecture: linux-any
353Multi-Arch: same386Multi-Arch: same
@@ -389,6 +422,23 @@
389 Contains header files required to use the platform specific capabilities of422 Contains header files required to use the platform specific capabilities of
390 the Mir Mesa backend.423 the Mir Mesa backend.
391424
425<<<<<<< TREE
426=======
427Package: mir-client-platform-android5
428Section: libs
429Architecture: i386 amd64 armhf
430Multi-Arch: same
431Pre-Depends: ${misc:Pre-Depends}
432Depends: ${misc:Depends},
433 ${shlibs:Depends}
434Description: Display server for Ubuntu - client platform library for Android
435 Mir is a display server running on linux systems, with a focus on efficiency,
436 robust operation and a well-defined driver model.
437 .
438 Contains the shared libraries required for the Mir clients to interact with
439 the underlying hardware platform using the Android drivers.
440
441>>>>>>> MERGE-SOURCE
392Package: mir-graphics-drivers-desktop442Package: mir-graphics-drivers-desktop
393Section: libs443Section: libs
394Architecture: linux-any444Architecture: linux-any
@@ -406,6 +456,25 @@
406 This package depends on a full set of graphics drivers for traditional desktop456 This package depends on a full set of graphics drivers for traditional desktop
407 systems.457 systems.
408458
459<<<<<<< TREE
460=======
461Package: mir-graphics-drivers-android
462Section: libs
463Architecture: i386 amd64 armhf
464Multi-Arch: same
465Pre-Depends: ${misc:Pre-Depends}
466Depends: ${misc:Depends},
467 mir-platform-graphics-android12,
468 mir-client-platform-android5,
469 mir-platform-input-evdev6,
470Description: Display server for Ubuntu - android driver metapackage
471 Mir is a display server running on linux systems, with a focus on efficiency,
472 robust operation and a well-defined driver model.
473 .
474 This package depends on a full set of graphics drivers for running Mir on top
475 of an existing Android driver stack.
476
477>>>>>>> MERGE-SOURCE
409Package: libmircookie2478Package: libmircookie2
410Section: libs479Section: libs
411Architecture: any480Architecture: any
412481
=== modified file 'include/client/mir/event_printer.h'
=== modified file 'include/client/mir/events/event_builders.h'
=== modified file 'include/client/mir_toolkit/client_types.h'
--- include/client/mir_toolkit/client_types.h 2017-05-23 00:22:04 +0000
+++ include/client/mir_toolkit/client_types.h 2017-05-26 09:20:21 +0000
@@ -54,6 +54,7 @@
54typedef struct MirError MirError;54typedef struct MirError MirError;
55typedef struct MirPresentationChain MirPresentationChain;55typedef struct MirPresentationChain MirPresentationChain;
56typedef struct MirBuffer MirBuffer;56typedef struct MirBuffer MirBuffer;
57<<<<<<< TREE
57typedef struct MirRenderSurface MirRenderSurface;58typedef struct MirRenderSurface MirRenderSurface;
5859
59/**60/**
@@ -62,6 +63,9 @@
62 */63 */
63typedef struct MirCursorConfiguration MirCursorConfiguration64typedef struct MirCursorConfiguration MirCursorConfiguration
64MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name/mir_window_spec_set_cursor_render_surface instead");65MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name/mir_window_spec_set_cursor_render_surface instead");
66=======
67typedef struct MirRenderSurface MirRenderSurface;
68>>>>>>> MERGE-SOURCE
6569
66/**70/**
67 * Descriptor for an output connection.71 * Descriptor for an output connection.
@@ -576,10 +580,16 @@
576580
577typedef void (*mir_surface_id_callback)(581typedef void (*mir_surface_id_callback)(
578 MirSurface* surface, MirPersistentId* id, void* context)582 MirSurface* surface, MirPersistentId* id, void* context)
583<<<<<<< TREE
579MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");584MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
580585
581typedef MirSurfaceParameters MirWindowParameters586typedef MirSurfaceParameters MirWindowParameters
582MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen for attribute events instead");587MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen for attribute events instead");
588=======
589MIR_FOR_REMOVAL_IN_VERSION_1("Use MirWindowIdCallback instead");
590
591typedef MirSurfaceParameters MirWindowParameters;
592>>>>>>> MERGE-SOURCE
583593
584#pragma GCC diagnostic pop594#pragma GCC diagnostic pop
585595
586596
=== modified file 'include/client/mir_toolkit/events/event.h'
=== modified file 'include/client/mir_toolkit/extensions/gbm_buffer.h'
--- include/client/mir_toolkit/extensions/gbm_buffer.h 2017-05-08 03:04:26 +0000
+++ include/client/mir_toolkit/extensions/gbm_buffer.h 2017-05-26 09:20:21 +0000
@@ -76,6 +76,7 @@
76 connection, "mir_extension_gbm_buffer", 1);76 connection, "mir_extension_gbm_buffer", 1);
77}77}
7878
79<<<<<<< TREE
79/** Allocate a MirBuffer via gbm and wait for the allocation.80/** Allocate a MirBuffer via gbm and wait for the allocation.
80 * available in V2.81 * available in V2.
81 * The buffer can be destroyed via mir_buffer_release().82 * The buffer can be destroyed via mir_buffer_release().
@@ -155,6 +156,87 @@
155 connection, "mir_extension_gbm_buffer", 2);156 connection, "mir_extension_gbm_buffer", 2);
156}157}
157158
159=======
160/** Allocate a MirBuffer via gbm and wait for the allocation.
161 * available in V2.
162 * The buffer can be destroyed via mir_buffer_release().
163 *
164 * \param [in] connection The connection
165 * \param [in] width Requested buffer width
166 * \param [in] height Requested buffer height
167 * \param [in] gbm_pixel_format The pixel format, one of the GBM_FORMATs
168 * \param [in] gbm_bo_flags The gbm_bo_flags for the buffer.
169 * \return The buffer
170 **/
171typedef MirBuffer* (*MirConnectionAllocateBufferGbmSync)(
172 MirConnection* connection,
173 uint32_t width, uint32_t height,
174 uint32_t gbm_pixel_format,
175 uint32_t gbm_bo_flags);
176
177/** Check if a MirBuffer is suitable for import via GBM_BO_IMPORT_FD
178 *
179 * \param [in] buffer The buffer
180 * \return True if suitable, false if unsuitable
181 */
182typedef bool (*MirBufferIsGbmImportable)(MirBuffer* buffer);
183
184/** Access the fd a MirBuffer suitable for gbm import
185 * \pre The buffer is suitable for GBM_BO_IMPORT_FD
186 * \warning The fd is owned by the buffer. Do not close() it.
187 * \param [in] buffer The buffer
188 * \return The fd
189 */
190typedef int (*MirBufferGbmFd)(MirBuffer* buffer);
191
192/** Get the stride of a MirBuffer
193 * \pre The buffer is suitable for GBM_BO_IMPORT_FD
194 * \param [in] buffer The buffer
195 * \return The stride of the buffer
196 */
197typedef uint32_t (*MirBufferGbmStride)(MirBuffer* buffer);
198
199/** Get the GBM_FORMAT of a MirBuffer
200 * \pre The buffer is suitable for GBM_BO_IMPORT_FD
201 * \param [in] buffer The buffer
202 * \return The GBM_FORMAT of the buffer
203 */
204typedef uint32_t (*MirBufferGbmFormat)(MirBuffer* buffer);
205
206/** Get the gbm_bo_flags of a MirBuffer
207 * \pre The buffer is suitable for GBM_BO_IMPORT_FD
208 * \param [in] buffer The buffer
209 * \return The gbm_bo_flags of the buffer
210 */
211typedef uint32_t (*MirBufferGbmFlags)(MirBuffer* buffer);
212
213/** Get the age of a MirBuffer
214 * \pre The buffer is suitable for GBM_BO_IMPORT_FD
215 * \param [in] buffer The buffer
216 * \return The age of the buffer
217 */
218typedef unsigned int (*MirBufferGbmAge)(MirBuffer* buffer);
219
220typedef struct MirExtensionGbmBufferV2
221{
222 MirConnectionAllocateBufferGbm allocate_buffer_gbm;
223 MirConnectionAllocateBufferGbmSync allocate_buffer_gbm_sync;
224 MirBufferIsGbmImportable is_gbm_importable;
225 MirBufferGbmFd fd;
226 MirBufferGbmStride stride;
227 MirBufferGbmFormat format;
228 MirBufferGbmFlags flags;
229 MirBufferGbmAge age;
230} MirExtensionGbmBufferV2;
231
232static inline MirExtensionGbmBufferV2 const* mir_extension_gbm_buffer_v2(
233 MirConnection* connection)
234{
235 return (MirExtensionGbmBufferV2 const*) mir_connection_request_extension(
236 connection, "mir_extension_gbm_buffer", 2);
237}
238
239>>>>>>> MERGE-SOURCE
158#ifdef __cplusplus240#ifdef __cplusplus
159}241}
160#endif242#endif
161243
=== modified file 'include/client/mir_toolkit/mir_buffer_stream.h'
--- include/client/mir_toolkit/mir_buffer_stream.h 2017-05-23 00:22:04 +0000
+++ include/client/mir_toolkit/mir_buffer_stream.h 2017-05-26 09:20:21 +0000
@@ -155,9 +155,17 @@
155 * \return One of mir_platform_type_android or 155 * \return One of mir_platform_type_android or
156 * mir_platform_type_gbm156 * mir_platform_type_gbm
157 */157 */
158<<<<<<< TREE
158MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream)159MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream)
159MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"160MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"
160 "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()");161 "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()");
162=======
163/// @cond
164MIR_FOR_REMOVAL_IN_VERSION_1("To identify the graphics platform use mir_connection_get_graphics_module(). \n"
165 "To safely interpret the buffer contents use mir_buffer_stream_get_graphics_region()")
166/// @endcond
167MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream *stream);
168>>>>>>> MERGE-SOURCE
161169
162/**170/**
163 * Retrieve the current buffer in "raw" representation.171 * Retrieve the current buffer in "raw" representation.
164172
=== modified file 'include/client/mir_toolkit/mir_connection.h'
=== modified file 'include/client/mir_toolkit/mir_cursor_configuration.h'
--- include/client/mir_toolkit/mir_cursor_configuration.h 2017-05-23 00:22:04 +0000
+++ include/client/mir_toolkit/mir_cursor_configuration.h 2017-05-26 09:20:21 +0000
@@ -20,7 +20,17 @@
2020
21#include <mir_toolkit/common.h>21#include <mir_toolkit/common.h>
22#include <mir_toolkit/client_types.h>22#include <mir_toolkit/client_types.h>
23#include <mir_toolkit/deprecations.h>23<<<<<<< TREE
24#include <mir_toolkit/deprecations.h>
25=======
26#include <mir_toolkit/deprecations.h>
27
28/**
29 * Opaque structure containing cursor parameterization. Create with mir_cursor* family.
30 * Used with mir_window_configure_cursor.
31 */
32typedef struct MirCursorConfiguration MirCursorConfiguration;
33>>>>>>> MERGE-SOURCE
2434
25#ifdef __cplusplus35#ifdef __cplusplus
26/**36/**
@@ -51,8 +61,15 @@
51 * \return A cursor parameters object which must be passed61 * \return A cursor parameters object which must be passed
52 * to_mir_cursor_configuration_destroy62 * to_mir_cursor_configuration_destroy
53 */63 */
64<<<<<<< TREE
54MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name)65MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name)
55MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name() instead");66MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name() instead");
67=======
68/// @cond
69MIR_FOR_REMOVAL_IN_VERSION_1("use mir_window_spec_set_cursor_name()")
70/// @endcond
71MirCursorConfiguration *mir_cursor_configuration_from_name(char const* name);
72>>>>>>> MERGE-SOURCE
5673
57/**74/**
58 * Returns a new cursor configuration tied to a given buffer stream.75 * Returns a new cursor configuration tied to a given buffer stream.
5976
=== modified file 'include/client/mir_toolkit/mir_display_configuration.h'
=== modified file 'include/client/mir_toolkit/mir_window.h'
--- include/client/mir_toolkit/mir_window.h 2017-05-23 00:22:04 +0000
+++ include/client/mir_toolkit/mir_window.h 2017-05-26 09:20:21 +0000
@@ -585,8 +585,37 @@
585 */585 */
586void mir_window_spec_set_streams(MirWindowSpec* spec,586void mir_window_spec_set_streams(MirWindowSpec* spec,
587 MirBufferStreamInfo* streams,587 MirBufferStreamInfo* streams,
588<<<<<<< TREE
588 unsigned int num_streams)589 unsigned int num_streams)
589MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface instead");590MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface instead");
591=======
592 unsigned int num_streams);
593
594/**
595 * Set the MirWindowSpec to display content contained in a render surface
596 *
597 * \warning: The initial call to mir_window_spec_add_render_surface will set
598 * the bottom-most content, and subsequent calls will stack the
599 * content on top.
600 *
601 * \param spec The window_spec to be updated
602 * \param render_surface The render surface containing the content to be displayed
603 * \param logical_width The width that the content will be displayed at
604 * (Ignored for buffer streams)
605 * \param logical_height The height that the content will be displayed at
606 * (Ignored for buffer streams)
607 * \param displacement_x The x displacement from the top-left corner of the MirWindow
608 * \param displacement_y The y displacement from the top-left corner of the MirWindow
609 */
610#pragma GCC diagnostic push
611#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
612void mir_window_spec_add_render_surface(MirWindowSpec* spec,
613 MirRenderSurface* render_surface,
614 int logical_width, int logical_height,
615 int displacement_x, int displacement_y)
616MIR_FOR_REMOVAL_IN_VERSION_1("This function is slated for rename due to MirRenderSurface-->MirSurface transition");
617#pragma GCC diagnostic pop
618>>>>>>> MERGE-SOURCE
590619
591/**620/**
592 * Release the resources held by a MirWindowSpec.621 * Release the resources held by a MirWindowSpec.
593622
=== modified file 'include/client/mir_toolkit/rs/mir_render_surface.h'
--- include/client/mir_toolkit/rs/mir_render_surface.h 2017-05-23 00:22:04 +0000
+++ include/client/mir_toolkit/rs/mir_render_surface.h 2017-05-26 09:20:21 +0000
@@ -21,6 +21,7 @@
21#define MIR_TOOLKIT_MIR_RENDER_SURFACE_H_21#define MIR_TOOLKIT_MIR_RENDER_SURFACE_H_
2222
23#include <mir_toolkit/client_types.h>23#include <mir_toolkit/client_types.h>
24<<<<<<< TREE
24#include <mir_toolkit/deprecations.h>25#include <mir_toolkit/deprecations.h>
2526
26#ifndef MIR_DEPRECATE_RENDERSURFACES27#ifndef MIR_DEPRECATE_RENDERSURFACES
@@ -33,6 +34,20 @@
33#else34#else
34 #define MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_135 #define MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1
35#endif36#endif
37=======
38#include <mir_toolkit/deprecations.h>
39
40#ifndef MIR_DEPRECATE_RENDERSURFACES
41 #define MIR_DEPRECATE_RENDERSURFACES 0
42#endif
43
44#if MIR_ENABLE_DEPRECATIONS > 0 && MIR_DEPRECATE_RENDERSURFACES > 0
45 #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME\
46 __attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")))
47#else
48 #define MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME
49#endif
50>>>>>>> MERGE-SOURCE
3651
37#ifdef __cplusplus52#ifdef __cplusplus
38/**53/**
@@ -42,9 +57,15 @@
42extern "C" {57extern "C" {
43#endif58#endif
4459
60<<<<<<< TREE
45typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)61typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
46MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;62MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
4763
64=======
65typedef void (*MirRenderSurfaceCallback)(MirRenderSurface*, void* context)
66MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
67
68>>>>>>> MERGE-SOURCE
48#pragma GCC diagnostic push69#pragma GCC diagnostic push
49#pragma GCC diagnostic ignored "-Wdeprecated-declarations"70#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
50/**71/**
@@ -64,7 +85,11 @@
64 int width, int height,85 int width, int height,
65 MirRenderSurfaceCallback callback,86 MirRenderSurfaceCallback callback,
66 void* context)87 void* context)
88<<<<<<< TREE
67MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;89MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
90=======
91MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
92>>>>>>> MERGE-SOURCE
6893
69/**94/**
70 * Create a render surface and wait for the result95 * Create a render surface and wait for the result
@@ -79,7 +104,11 @@
79MirRenderSurface* mir_connection_create_render_surface_sync(104MirRenderSurface* mir_connection_create_render_surface_sync(
80 MirConnection* connection,105 MirConnection* connection,
81 int width, int height)106 int width, int height)
107<<<<<<< TREE
82MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;108MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
109=======
110MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
111>>>>>>> MERGE-SOURCE
83112
84/**113/**
85 * Get the size of the MirRenderSurface114 * Get the size of the MirRenderSurface
@@ -91,7 +120,11 @@
91void mir_render_surface_get_size(120void mir_render_surface_get_size(
92 MirRenderSurface* render_surface,121 MirRenderSurface* render_surface,
93 int* width, int* height)122 int* width, int* height)
123<<<<<<< TREE
94MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;124MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
125=======
126MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
127>>>>>>> MERGE-SOURCE
95128
96/**129/**
97 * Set the size of the MirRenderSurface130 * Set the size of the MirRenderSurface
@@ -103,7 +136,11 @@
103void mir_render_surface_set_size(136void mir_render_surface_set_size(
104 MirRenderSurface* render_surface,137 MirRenderSurface* render_surface,
105 int width, int height)138 int width, int height)
139<<<<<<< TREE
106MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;140MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
141=======
142MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
143>>>>>>> MERGE-SOURCE
107144
108/**145/**
109 * Test for a valid render surface146 * Test for a valid render surface
@@ -115,8 +152,12 @@
115 */152 */
116bool mir_render_surface_is_valid(153bool mir_render_surface_is_valid(
117 MirRenderSurface* render_surface)154 MirRenderSurface* render_surface)
155<<<<<<< TREE
118MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;156MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
119157
158=======
159MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
160>>>>>>> MERGE-SOURCE
120/**161/**
121 * Retrieve a text description of the error. The returned string is owned by162 * Retrieve a text description of the error. The returned string is owned by
122 * the library and remains valid until the render surface or the associated163 * the library and remains valid until the render surface or the associated
@@ -128,7 +169,11 @@
128 */169 */
129char const *mir_render_surface_get_error_message(170char const *mir_render_surface_get_error_message(
130 MirRenderSurface* render_surface)171 MirRenderSurface* render_surface)
172<<<<<<< TREE
131MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;173MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
174=======
175MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
176>>>>>>> MERGE-SOURCE
132177
133/**178/**
134 * Release the specified render surface179 * Release the specified render surface
@@ -137,7 +182,11 @@
137 */182 */
138void mir_render_surface_release(183void mir_render_surface_release(
139 MirRenderSurface* render_surface)184 MirRenderSurface* render_surface)
185<<<<<<< TREE
140MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;186MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
187=======
188MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
189>>>>>>> MERGE-SOURCE
141190
142/**191/**
143 * Obtain the buffer stream backing a given render surface.192 * Obtain the buffer stream backing a given render surface.
@@ -157,7 +206,11 @@
157 MirRenderSurface* render_surface,206 MirRenderSurface* render_surface,
158 int width, int height,207 int width, int height,
159 MirPixelFormat format)208 MirPixelFormat format)
209<<<<<<< TREE
160MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;210MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
211=======
212MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
213>>>>>>> MERGE-SOURCE
161214
162/**215/**
163 * Obtain the presentation chain backing a given render surface.216 * Obtain the presentation chain backing a given render surface.
@@ -170,6 +223,7 @@
170 */223 */
171MirPresentationChain* mir_render_surface_get_presentation_chain(224MirPresentationChain* mir_render_surface_get_presentation_chain(
172 MirRenderSurface* render_surface)225 MirRenderSurface* render_surface)
226<<<<<<< TREE
173MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;227MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
174228
175/** Query whether the server supports a given presentation mode.229/** Query whether the server supports a given presentation mode.
@@ -191,6 +245,29 @@
191 */245 */
192void mir_presentation_chain_set_mode(246void mir_presentation_chain_set_mode(
193 MirPresentationChain* chain, MirPresentMode mode);247 MirPresentationChain* chain, MirPresentMode mode);
248=======
249MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
250
251/** Query whether the server supports a given presentation mode.
252 *
253 * \param [in] connection The connection
254 * \param [in] mode The MirPresentMode
255 * \return True if supported, false if not
256 */
257bool mir_connection_present_mode_supported(
258 MirConnection* connection, MirPresentMode mode);
259
260/** Respecify the submission mode that the MirPresentationChain is operating with.
261 * The buffers currently queued will immediately be requeued according
262 * to the new mode.
263 *
264 * \pre mir_connection_present_mode_supported must indicate that the mode is supported
265 * \param [in] chain The chain
266 * \param [in] mode The mode to change to
267 */
268void mir_presentation_chain_set_mode(
269 MirPresentationChain* chain, MirPresentMode mode);
270>>>>>>> MERGE-SOURCE
194271
195/**272/**
196 * Set the MirWindowSpec to contain a specific cursor.273 * Set the MirWindowSpec to contain a specific cursor.
@@ -204,6 +281,7 @@
204 MirWindowSpec* spec,281 MirWindowSpec* spec,
205 MirRenderSurface* render_surface,282 MirRenderSurface* render_surface,
206 int hotspot_x, int hotspot_y)283 int hotspot_x, int hotspot_y)
284<<<<<<< TREE
207MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;285MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
208286
209/**287/**
@@ -243,6 +321,31 @@
243 int logical_width, int logical_height,321 int logical_width, int logical_height,
244 int displacement_x, int displacement_y)322 int displacement_x, int displacement_y)
245MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;323MIR_RENDERSURFACES_FOR_RENAME_IN_VERSION_1;
324=======
325MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
326
327/**
328 * Set the MirWindowSpec to display content contained in a render surface
329 *
330 * \warning: The initial call to mir_window_spec_add_render_surface will set
331 * the bottom-most content, and subsequent calls will stack the
332 * content on top.
333 *
334 * \param spec The window_spec to be updated
335 * \param render_surface The render surface containing the content to be displayed
336 * \param logical_width The width that the content will be displayed at
337 * (Ignored for buffer streams)
338 * \param logical_height The height that the content will be displayed at
339 * (Ignored for buffer streams)
340 * \param displacement_x The x displacement from the top-left corner of the MirWindow
341 * \param displacement_y The y displacement from the top-left corner of the MirWindow
342 */
343void mir_window_spec_add_render_surface(MirWindowSpec* spec,
344 MirRenderSurface* render_surface,
345 int logical_width, int logical_height,
346 int displacement_x, int displacement_y)
347MIR_DEPRECATE_RENDERSURFACES_FOR_RENAME;
348>>>>>>> MERGE-SOURCE
246349
247#pragma GCC diagnostic pop350#pragma GCC diagnostic pop
248351
249352
=== modified file 'include/core/mir_toolkit/deprecations.h'
--- include/core/mir_toolkit/deprecations.h 2017-05-16 16:10:46 +0000
+++ include/core/mir_toolkit/deprecations.h 2017-05-26 09:20:21 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1/*2/*
2 * Copyright © 2017 Canonical Ltd.3 * Copyright © 2017 Canonical Ltd.
3 *4 *
@@ -34,3 +35,41 @@
34#endif35#endif
3536
36#endif //MIR_DEPRECATIONS_H_37#endif //MIR_DEPRECATIONS_H_
38=======
39/*
40 * Copyright © 2017 Canonical Ltd.
41 *
42 * This program is free software: you can redistribute it and/or modify it
43 * under the terms of the GNU Lesser General Public License version 3,
44 * as published by the Free Software Foundation.
45 *
46 * This program is distributed in the hope that it will be useful,
47 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 * GNU Lesser General Public License for more details.
50 *
51 * You should have received a copy of the GNU Lesser General Public License
52 * along with this program. If not, see <http://www.gnu.org/licenses/>.
53 */
54
55#ifndef MIR_DEPRECATIONS_H_
56#define MIR_DEPRECATIONS_H_
57
58#ifndef MIR_ENABLE_DEPRECATIONS
59 // use g++ version < 6.2 as a proxy for building on Ubunutu 16.04LTS ("Xenial") or 16.10 (Yakkety)
60 #if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ > 6) || ((__GNUC__ == 6) && (__GNUC_MINOR__ >= 2))
61 #define MIR_ENABLE_DEPRECATIONS 1
62 #else
63 #define MIR_ENABLE_DEPRECATIONS 0
64 #endif
65#endif
66
67#if MIR_ENABLE_DEPRECATIONS > 0
68 #define MIR_FOR_REMOVAL_IN_VERSION_1(message)\
69 __attribute__((deprecated(message)))
70#else
71 #define MIR_FOR_REMOVAL_IN_VERSION_1(message)
72#endif
73
74#endif //MIR_DEPRECATIONS_H_
75>>>>>>> MERGE-SOURCE
3776
=== modified file 'src/client/display_configuration_api.cpp'
=== modified file 'src/client/mir_render_surface_api.cpp'
=== modified file 'src/client/symbols.map'
=== modified file 'src/platform/options/default_configuration.cpp'
=== added directory 'src/platforms/android'
=== added directory 'src/platforms/android/utils'
=== added file 'src/platforms/android/utils/CMakeLists.txt.OTHER'
--- src/platforms/android/utils/CMakeLists.txt.OTHER 1970-01-01 00:00:00 +0000
+++ src/platforms/android/utils/CMakeLists.txt.OTHER 2017-05-26 09:20:21 +0000
@@ -0,0 +1,46 @@
1list(
2 APPEND ANDROID_DIAGNOSTICS_SRCS
3 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_hardware_sanity.cpp
4 ${CMAKE_CURRENT_SOURCE_DIR}/patterns.cpp
5)
6
7add_definitions(-DMIR_SERVER_GRAPHICS_PLATFORM_VERSION="${MIR_SERVER_GRAPHICS_PLATFORM_VERSION}")
8
9include_directories(
10 ${PROJECT_SOURCE_DIR}/include/server
11 ${PROJECT_SOURCE_DIR}/include/client
12 ${PROJECT_SOURCE_DIR}/include/platform
13 ${PROJECT_SOURCE_DIR}/src/include/common
14 ${PROJECT_SOURCE_DIR}/include/test
15 ${PROJECT_SOURCE_DIR}/tests/include
16 ${PROJECT_SOURCE_DIR}/src/include/server
17 ${PROJECT_SOURCE_DIR}/examples
18 ${PROJECT_SOURCE_DIR}/src/platforms/android/include
19)
20
21add_executable(
22 mir_android_diagnostics
23 ${ANDROID_DIAGNOSTICS_SRCS})
24
25target_link_libraries(
26 mir_android_diagnostics
27 mirserver
28 mirdraw
29 mir-test-static
30 mir-test-framework-static
31 ${LIBHARDWARE_LIBRARIES}
32)
33
34mir_add_wrapped_executable(mir_demo_standalone_render_overlays
35 render_overlays.cpp
36)
37
38target_link_libraries(mir_demo_standalone_render_overlays
39 mirclient
40 mircommon
41 mirplatform
42)
43
44install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mir_android_diagnostics
45 DESTINATION ${CMAKE_INSTALL_BINDIR}
46)
047
=== modified file 'src/platforms/mesa/client/client_platform.cpp'
--- src/platforms/mesa/client/client_platform.cpp 2017-05-17 04:48:46 +0000
+++ src/platforms/mesa/client/client_platform.cpp 2017-05-26 09:20:21 +0000
@@ -21,9 +21,15 @@
21#include "client_buffer_factory.h"21#include "client_buffer_factory.h"
22#include "mesa_native_display_container.h"22#include "mesa_native_display_container.h"
23#include "native_surface.h"23#include "native_surface.h"
24<<<<<<< TREE
24#include "mir/client/client_buffer_factory.h"25#include "mir/client/client_buffer_factory.h"
25#include "mir/client/client_context.h"26#include "mir/client/client_context.h"
26#include "mir/client/client_buffer.h"27#include "mir/client/client_buffer.h"
28=======
29#include "mir/client_buffer_factory.h"
30#include "mir/client_context.h"
31#include "mir/client_buffer.h"
32>>>>>>> MERGE-SOURCE
27#include "mir/mir_render_surface.h"33#include "mir/mir_render_surface.h"
28#include "mir/mir_buffer.h"34#include "mir/mir_buffer.h"
29#include "mir/weak_egl.h"35#include "mir/weak_egl.h"
@@ -138,6 +144,7 @@
138 available_callback, available_context); 144 available_callback, available_context);
139}145}
140146
147<<<<<<< TREE
141void allocate_buffer_gbm_legacy(148void allocate_buffer_gbm_legacy(
142 MirConnection* connection,149 MirConnection* connection,
143 int width, int height,150 int width, int height,
@@ -283,6 +290,144 @@
283{290{
284 return 0;291 return 0;
285}292}
293=======
294void allocate_buffer_gbm_legacy(
295 MirConnection* connection,
296 int width, int height,
297 unsigned int gbm_pixel_format,
298 unsigned int gbm_bo_flags,
299 MirBufferCallback available_callback, void* available_context)
300{
301 allocate_buffer_gbm(
302 connection, static_cast<uint32_t>(width), static_cast<uint32_t>(height),
303 static_cast<uint32_t>(gbm_pixel_format), static_cast<uint32_t>(gbm_bo_flags),
304 available_callback, available_context);
305}
306
307MirBuffer* allocate_buffer_gbm_sync(
308 MirConnection* connection,
309 uint32_t width, uint32_t height,
310 uint32_t gbm_pixel_format,
311 uint32_t gbm_bo_flags)
312try
313{
314 struct BufferSync
315 {
316 void set_buffer(MirBuffer* b)
317 {
318 std::unique_lock<decltype(mutex)> lk(mutex);
319 buffer = b;
320 cv.notify_all();
321 }
322
323 MirBuffer* wait_for_buffer()
324 {
325 std::unique_lock<decltype(mutex)> lk(mutex);
326 cv.wait(lk, [this]{ return buffer; });
327 return buffer;
328 }
329 private:
330 std::mutex mutex;
331 std::condition_variable cv;
332 MirBuffer* buffer = nullptr;
333 } sync;
334
335 allocate_buffer_gbm(
336 connection, width, height, gbm_pixel_format, gbm_bo_flags,
337 [](auto* b, auto* context){ reinterpret_cast<BufferSync*>(context)->set_buffer(b); }, &sync);
338 return sync.wait_for_buffer();
339}
340catch (...)
341{
342 return nullptr;
343}
344
345bool is_gbm_importable(MirBuffer* b)
346try
347{
348 if (!b)
349 return false;
350 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
351 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
352 if (!native)
353 return false;
354 return native->is_gbm_buffer;
355}
356catch (...)
357{
358 return false;
359}
360
361int import_fd(MirBuffer* b)
362try
363{
364 if (!is_gbm_importable(b))
365 return -1;
366 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
367 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
368 return native->fd[0];
369}
370catch (...)
371{
372 return -1;
373}
374
375uint32_t buffer_stride(MirBuffer* b)
376try
377{
378 if (!is_gbm_importable(b))
379 return 0;
380 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
381 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
382 return native->stride;
383}
384catch (...)
385{
386 return 0;
387}
388
389uint32_t buffer_format(MirBuffer* b)
390try
391{
392 if (!is_gbm_importable(b))
393 return 0;
394 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
395 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
396 return native->native_format;
397}
398catch (...)
399{
400 return 0;
401}
402
403uint32_t buffer_flags(MirBuffer* b)
404try
405{
406 if (!is_gbm_importable(b))
407 return 0;
408 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
409 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
410 return native->native_flags;
411}
412catch (...)
413{
414 return 0;
415}
416
417unsigned int buffer_age(MirBuffer* b)
418try
419{
420 if (!is_gbm_importable(b))
421 return 0;
422 auto buffer = reinterpret_cast<mcl::MirBuffer*>(b);
423 auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get());
424 return native->age;
425}
426catch (...)
427{
428 return 0;
429}
430>>>>>>> MERGE-SOURCE
286#pragma GCC diagnostic push431#pragma GCC diagnostic push
287#pragma GCC diagnostic ignored "-Wdeprecated-declarations"432#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
288MirBufferStream* get_hw_stream(433MirBufferStream* get_hw_stream(
289434
=== modified file 'src/platforms/mesa/client/client_platform.h'
=== modified file 'src/platforms/mesa/server/kms/real_kms_display_configuration.cpp'
--- src/platforms/mesa/server/kms/real_kms_display_configuration.cpp 2017-05-08 03:04:26 +0000
+++ src/platforms/mesa/server/kms/real_kms_display_configuration.cpp 2017-05-26 09:20:21 +0000
@@ -142,6 +142,7 @@
142142
143void mgm::RealKMSDisplayConfiguration::update()143void mgm::RealKMSDisplayConfiguration::update()
144{144{
145<<<<<<< TREE
145 decltype(outputs) new_outputs;146 decltype(outputs) new_outputs;
146147
147 displays->update_from_hardware_state();148 displays->update_from_hardware_state();
@@ -180,6 +181,219 @@
180 * to provide a max_simultaneous_outputs value that is useful to clients.181 * to provide a max_simultaneous_outputs value that is useful to clients.
181 */182 */
182 card.max_simultaneous_outputs = outputs.size();183 card.max_simultaneous_outputs = outputs.size();
184=======
185 kms::DRMModeResources resources{drm_fd};
186
187 size_t max_outputs = std::min(resources.num_crtcs(), resources.num_connectors());
188 card = {DisplayConfigurationCardId{0}, max_outputs};
189
190 resources.for_each_connector([&](kms::DRMModeConnectorUPtr connector)
191 {
192 add_or_update_output(resources, *connector);
193 });
194}
195
196namespace
197{
198std::vector<uint8_t> edid_for_connector(int drm_fd, uint32_t connector_id)
199{
200 std::vector<uint8_t> edid;
201
202 mgk::ObjectProperties connector_props{
203 drm_fd, connector_id, DRM_MODE_OBJECT_CONNECTOR};
204
205 if (connector_props.has_property("EDID"))
206 {
207 /*
208 * We don't technically need the property information here, but query it
209 * anyway so we can detect if our assumptions about DRM behaviour
210 * become invalid.
211 */
212 auto property = mgk::DRMModePropertyUPtr{
213 drmModeGetProperty(drm_fd, connector_props.id_for("EDID")),
214 &drmModeFreeProperty};
215
216 if (!property)
217 {
218 mir::log_warning(
219 "Failed to get EDID property for connector %u: %i (%s)",
220 connector_id,
221 errno,
222 ::strerror(errno));
223 return edid;
224 }
225
226 if (!drm_property_type_is(property.get(), DRM_MODE_PROP_BLOB))
227 {
228 mir::log_warning(
229 "EDID property on connector %u has unexpected type %u",
230 connector_id,
231 property->flags);
232 return edid;
233 }
234
235 // A property ID of 0 means invalid.
236 if (connector_props["EDID"] == 0)
237 {
238 /*
239 * Log a debug message only. This will trigger for broken monitors which
240 * don't provide an EDID, which is not as unusual as you might think...
241 */
242 mir::log_debug("No EDID data available on connector %u", connector_id);
243 return edid;
244 }
245
246 auto blob = drmModeGetPropertyBlob(drm_fd, connector_props["EDID"]);
247
248 if (!blob)
249 {
250 mir::log_warning(
251 "Failed to get EDID property blob for connector %u: %i (%s)",
252 connector_id,
253 errno,
254 ::strerror(errno));
255
256 return edid;
257 }
258
259 edid.reserve(blob->length);
260 edid.insert(edid.begin(),
261 reinterpret_cast<uint8_t*>(blob->data),
262 reinterpret_cast<uint8_t*>(blob->data) + blob->length);
263
264 drmModeFreePropertyBlob(blob);
265
266 edid.shrink_to_fit();
267 }
268
269 return edid;
270}
271}
272
273void mgm::RealKMSDisplayConfiguration::add_or_update_output(
274 kms::DRMModeResources const& resources,
275 drmModeConnector const& connector)
276{
277 DisplayConfigurationOutputId id{static_cast<int>(connector.connector_id)};
278 DisplayConfigurationCardId card_id{0};
279 DisplayConfigurationOutputType const type{
280 kms_connector_type_to_output_type(connector.connector_type)};
281 geom::Size physical_size{connector.mmWidth, connector.mmHeight};
282 bool connected{connector.connection == DRM_MODE_CONNECTED};
283 uint32_t const invalid_mode_index = std::numeric_limits<uint32_t>::max();
284 uint32_t current_mode_index{invalid_mode_index};
285 uint32_t preferred_mode_index{invalid_mode_index};
286 std::vector<DisplayConfigurationMode> modes;
287 std::vector<MirPixelFormat> formats {mir_pixel_format_argb_8888,
288 mir_pixel_format_xrgb_8888};
289
290 std::vector<uint8_t> edid;
291 if (connected)
292 {
293 /* Only ask for the EDID on connected outputs. There's obviously no monitor EDID
294 * when there is no monitor connected!
295 */
296 edid = edid_for_connector(drm_fd, connector.connector_id);
297 }
298
299 drmModeModeInfo current_mode_info = drmModeModeInfo();
300 GammaCurves gamma;
301
302 /* Get information about the current mode */
303 if (connector.encoder_id)
304 {
305 auto encoder = resources.encoder(connector.encoder_id);
306 if (encoder->crtc_id)
307 {
308 current_mode_info = resources.crtc(encoder->crtc_id)->mode;
309
310 auto crtc = resources.crtc(encoder->crtc_id);
311 if (crtc->gamma_size > 0)
312 gamma = mg::LinearGammaLUTs(crtc->gamma_size);
313 }
314 }
315
316 /* Add all the available modes and find the current and preferred one */
317 for (int m = 0; m < connector.count_modes; m++)
318 {
319 drmModeModeInfo& mode_info = connector.modes[m];
320
321 geom::Size size{mode_info.hdisplay, mode_info.vdisplay};
322
323 double vrefresh_hz = calculate_vrefresh_hz(mode_info);
324
325 modes.push_back({size, vrefresh_hz});
326
327 if (kms_modes_are_equal(mode_info, current_mode_info))
328 current_mode_index = m;
329
330 if ((mode_info.type & DRM_MODE_TYPE_PREFERRED) == DRM_MODE_TYPE_PREFERRED)
331 preferred_mode_index = m;
332 }
333
334 /* Add or update the output */
335 auto iter = find_output_with_id(id);
336
337 if (iter == outputs.end())
338 {
339 outputs.push_back({id, card_id, type, formats, modes, preferred_mode_index,
340 physical_size, connected, false, geom::Point(),
341 current_mode_index, mir_pixel_format_xrgb_8888,
342 mir_power_mode_on, mir_orientation_normal,
343 1.0f, mir_form_factor_monitor,
344 kms_subpixel_to_mir_subpixel(connector.subpixel),
345 gamma, mir_output_gamma_supported, std::move(edid)});
346 }
347 else
348 {
349 auto& output = *iter;
350
351 if (current_mode_index != invalid_mode_index)
352 {
353 output.current_mode_index = current_mode_index;
354 }
355 else if (!modes.empty() && // If empty retain old current_mode_index!
356 ( output.current_mode_index >= modes.size() ||
357 output.modes[output.current_mode_index] !=
358 modes[output.current_mode_index]))
359 {
360 // current_mode_index is invalid and the definition of the old
361 // current mode has also changed (different display plugged in)
362 // so fall back to the preferred mode...
363 output.current_mode_index = preferred_mode_index;
364 }
365 // else output.current_mode_index is correct and unchanged.
366
367 output.modes = modes;
368 output.preferred_mode_index = preferred_mode_index;
369 output.physical_size_mm = physical_size;
370 output.connected = connected;
371 output.current_format = mir_pixel_format_xrgb_8888;
372 output.subpixel_arrangement = kms_subpixel_to_mir_subpixel(connector.subpixel);
373 output.gamma = gamma;
374 output.edid = edid;
375 }
376}
377
378std::vector<mg::DisplayConfigurationOutput>::iterator
379mgm::RealKMSDisplayConfiguration::find_output_with_id(mg::DisplayConfigurationOutputId id)
380{
381 return std::find_if(outputs.begin(), outputs.end(),
382 [id](DisplayConfigurationOutput const& output)
383 {
384 return output.id == id;
385 });
386}
387
388std::vector<mg::DisplayConfigurationOutput>::const_iterator
389mgm::RealKMSDisplayConfiguration::find_output_with_id(mg::DisplayConfigurationOutputId id) const
390{
391 return std::find_if(outputs.begin(), outputs.end(),
392 [id](DisplayConfigurationOutput const& output)
393 {
394 return output.id == id;
395 });
396>>>>>>> MERGE-SOURCE
183}397}
184398
185// Compatibility means conf1 can be attained from conf2 (and vice versa)399// Compatibility means conf1 can be attained from conf2 (and vice versa)
186400
=== modified file 'src/server/compositor/multi_monitor_arbiter.cpp'
--- src/server/compositor/multi_monitor_arbiter.cpp 2017-05-25 05:49:36 +0000
+++ src/server/compositor/multi_monitor_arbiter.cpp 2017-05-26 09:20:21 +0000
@@ -65,9 +65,16 @@
6565
66 auto& last_entry = onscreen_buffers.front();66 auto& last_entry = onscreen_buffers.front();
67 last_entry.use_count++;67 last_entry.use_count++;
68<<<<<<< TREE
68 auto last_entry_buffer = last_entry.buffer;69 auto last_entry_buffer = last_entry.buffer;
69 clean_onscreen_buffers(lk);70 clean_onscreen_buffers(lk);
70 return last_entry_buffer;71 return last_entry_buffer;
72=======
73 auto last_entry_buffer = last_entry.buffer;
74 if (mode == mc::MultiMonitorMode::multi_monitor_sync)
75 clean_onscreen_buffers(lk);
76 return last_entry_buffer;
77>>>>>>> MERGE-SOURCE
71}78}
7279
73void mc::MultiMonitorArbiter::compositor_release(std::shared_ptr<mg::Buffer> const& buffer)80void mc::MultiMonitorArbiter::compositor_release(std::shared_ptr<mg::Buffer> const& buffer)
7481
=== modified file 'src/server/frontend/session_mediator.cpp'
=== modified file 'src/server/graphics/nested/nested_display_configuration.cpp'
=== modified file 'src/server/input/default_configuration.cpp'
=== modified file 'src/server/input/default_device.cpp'
--- src/server/input/default_device.cpp 2017-05-08 03:04:26 +0000
+++ src/server/input/default_device.cpp 2017-05-26 09:20:21 +0000
@@ -32,6 +32,7 @@
3232
33namespace mi = mir::input;33namespace mi = mir::input;
3434
35<<<<<<< TREE
35mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,36mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
36 std::shared_ptr<dispatch::ActionQueue> const& actions,37 std::shared_ptr<dispatch::ActionQueue> const& actions,
37 InputDevice& device,38 InputDevice& device,
@@ -46,6 +47,19 @@
46 actions{actions},47 actions{actions},
47 key_mapper{key_mapper},48 key_mapper{key_mapper},
48 device_changed_callback{callback}49 device_changed_callback{callback}
50=======
51mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
52 std::shared_ptr<dispatch::ActionQueue> const& actions,
53 InputDevice& device,
54 std::shared_ptr<KeyMapper> const& key_mapper)
55 : device_id{id},
56 device{device},
57 info(device.get_device_info()),
58 pointer{device.get_pointer_settings()},
59 touchpad{device.get_touchpad_settings()},
60 actions{actions},
61 key_mapper{key_mapper}
62>>>>>>> MERGE-SOURCE
49{63{
50 if (contains(info.capabilities, mi::DeviceCapability::keyboard))64 if (contains(info.capabilities, mi::DeviceCapability::keyboard))
51 {65 {
@@ -188,6 +202,7 @@
188 settings.tap_to_click = conf.tap_to_click();202 settings.tap_to_click = conf.tap_to_click();
189 settings.middle_mouse_button_emulation = conf.middle_mouse_button_emulation();203 settings.middle_mouse_button_emulation = conf.middle_mouse_button_emulation();
190204
205<<<<<<< TREE
191 {206 {
192 std::lock_guard<std::mutex> lock(config_mutex);207 std::lock_guard<std::mutex> lock(config_mutex);
193 touchpad = settings;208 touchpad = settings;
@@ -198,6 +213,19 @@
198 dev->apply_settings(settings);213 dev->apply_settings(settings);
199 });214 });
200 }215 }
216=======
217 {
218 std::lock_guard<std::mutex> lock(config_mutex);
219 touchpad = settings;
220
221 if (!actions) // device is disabled
222 return;
223 actions->enqueue([settings = std::move(settings), dev=&device]
224 {
225 dev->apply_settings(settings);
226 });
227 }
228>>>>>>> MERGE-SOURCE
201}229}
202230
203mir::optional_value<MirKeyboardConfig> mi::DefaultDevice::keyboard_configuration() const231mir::optional_value<MirKeyboardConfig> mi::DefaultDevice::keyboard_configuration() const
@@ -211,6 +239,7 @@
211 if (!contains(info.capabilities, mi::DeviceCapability::keyboard))239 if (!contains(info.capabilities, mi::DeviceCapability::keyboard))
212 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a keyboard configuration"));240 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot apply a keyboard configuration"));
213241
242<<<<<<< TREE
214 set_keyboard_configuration(conf);243 set_keyboard_configuration(conf);
215 device_changed_callback(this);244 device_changed_callback(this);
216}245}
@@ -220,8 +249,14 @@
220 std::lock_guard<std::mutex> lock(config_mutex);249 std::lock_guard<std::mutex> lock(config_mutex);
221 if (!actions) // device is disabled250 if (!actions) // device is disabled
222 return;251 return;
252=======
253 std::lock_guard<std::mutex> lock(config_mutex);
254 if (!actions) // device is disabled
255 return;
256>>>>>>> MERGE-SOURCE
223 if (keyboard.value().device_keymap() != conf.device_keymap())257 if (keyboard.value().device_keymap() != conf.device_keymap())
224 keyboard = conf;258 keyboard = conf;
259<<<<<<< TREE
225 else260 else
226 return;261 return;
227 key_mapper->set_keymap_for_device(device_id, conf.device_keymap());262 key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
@@ -263,6 +298,17 @@
263 dev->apply_settings(settings);298 dev->apply_settings(settings);
264 });299 });
265 }300 }
301=======
302 else
303 return;
304 key_mapper->set_keymap_for_device(device_id, conf.device_keymap());
305}
306
307void mi::DefaultDevice::disable_queue()
308{
309 std::lock_guard<std::mutex> lock(config_mutex);
310 actions.reset();
311>>>>>>> MERGE-SOURCE
266}312}
267313
268MirInputDevice mi::DefaultDevice::config() const314MirInputDevice mi::DefaultDevice::config() const
269315
=== modified file 'src/server/input/default_device.h'
--- src/server/input/default_device.h 2017-05-08 03:04:26 +0000
+++ src/server/input/default_device.h 2017-05-26 09:20:21 +0000
@@ -30,8 +30,12 @@
30#include "mir/optional_value.h"30#include "mir/optional_value.h"
3131
32#include <memory>32#include <memory>
33<<<<<<< TREE
33#include <functional>34#include <functional>
34#include <mutex>35#include <mutex>
36=======
37#include <mutex>
38>>>>>>> MERGE-SOURCE
3539
36namespace mir40namespace mir
37{41{
@@ -74,11 +78,15 @@
74 void apply_touchpad_configuration(MirTouchpadConfig const&) override;78 void apply_touchpad_configuration(MirTouchpadConfig const&) override;
75 optional_value<MirKeyboardConfig> keyboard_configuration() const override;79 optional_value<MirKeyboardConfig> keyboard_configuration() const override;
76 void apply_keyboard_configuration(MirKeyboardConfig const&) override;80 void apply_keyboard_configuration(MirKeyboardConfig const&) override;
81<<<<<<< TREE
77 optional_value<MirTouchscreenConfig> touchscreen_configuration() const override;82 optional_value<MirTouchscreenConfig> touchscreen_configuration() const override;
78 void apply_touchscreen_configuration(MirTouchscreenConfig const&) override;83 void apply_touchscreen_configuration(MirTouchscreenConfig const&) override;
7984
80 MirInputDevice config() const;85 MirInputDevice config() const;
81 void disable_queue();86 void disable_queue();
87=======
88 void disable_queue();
89>>>>>>> MERGE-SOURCE
82private:90private:
83 void set_pointer_configuration(MirPointerConfig const&);91 void set_pointer_configuration(MirPointerConfig const&);
84 void set_touchpad_configuration(MirTouchpadConfig const&);92 void set_touchpad_configuration(MirTouchpadConfig const&);
@@ -92,11 +100,19 @@
92 optional_value<PointerSettings> pointer;100 optional_value<PointerSettings> pointer;
93 optional_value<TouchpadSettings> touchpad;101 optional_value<TouchpadSettings> touchpad;
94 optional_value<MirKeyboardConfig> keyboard;102 optional_value<MirKeyboardConfig> keyboard;
103<<<<<<< TREE
95 optional_value<TouchscreenSettings> touchscreen;104 optional_value<TouchscreenSettings> touchscreen;
96 std::shared_ptr<dispatch::ActionQueue> actions;105 std::shared_ptr<dispatch::ActionQueue> actions;
106=======
107 std::shared_ptr<dispatch::ActionQueue> actions;
108>>>>>>> MERGE-SOURCE
97 std::shared_ptr<KeyMapper> const key_mapper;109 std::shared_ptr<KeyMapper> const key_mapper;
110<<<<<<< TREE
98 std::function<void(Device*)> device_changed_callback;111 std::function<void(Device*)> device_changed_callback;
99 std::mutex mutable config_mutex;112 std::mutex mutable config_mutex;
113=======
114 std::mutex mutable config_mutex;
115>>>>>>> MERGE-SOURCE
100};116};
101117
102}118}
103119
=== modified file 'src/server/input/default_input_device_hub.cpp'
--- src/server/input/default_input_device_hub.cpp 2017-05-08 03:04:26 +0000
+++ src/server/input/default_input_device_hub.cpp 2017-05-26 09:20:21 +0000
@@ -200,8 +200,14 @@
200200
201 if (it == end(devices))201 if (it == end(devices))
202 {202 {
203<<<<<<< TREE
203 auto queue = std::make_shared<dispatch::ActionQueue>();204 auto queue = std::make_shared<dispatch::ActionQueue>();
204 auto handle = restore_or_create_device(*device, queue);205 auto handle = restore_or_create_device(*device, queue);
206=======
207 auto id = create_new_device_id();
208 auto queue = std::make_shared<dispatch::ActionQueue>();
209 auto handle = std::make_shared<DefaultDevice>(id, queue, *device, key_mapper);
210>>>>>>> MERGE-SOURCE
205 // send input device info to observer loop..211 // send input device info to observer loop..
206 devices.push_back(std::make_unique<RegisteredDevice>(212 devices.push_back(std::make_unique<RegisteredDevice>(
207 device, handle->id(), queue, cookie_authority, handle));213 device, handle->id(), queue, cookie_authority, handle));
@@ -210,7 +216,18 @@
210 add_device_handle(handle);216 add_device_handle(handle);
211217
212 seat->add_device(*handle);218 seat->add_device(*handle);
213 dev->start(seat, input_dispatchable);219<<<<<<< TREE
220 dev->start(seat, input_dispatchable);
221=======
222 dev->start(seat, input_dispatchable);
223
224 // pass input device handle to observer loop..
225 observer_queue->enqueue(this,
226 [this, handle]()
227 {
228 add_device_handle(handle);
229 });
230>>>>>>> MERGE-SOURCE
214 }231 }
215 else232 else
216 {233 {
217234
=== modified file 'src/server/input/default_input_device_hub.h'
--- src/server/input/default_input_device_hub.h 2017-05-08 03:04:26 +0000
+++ src/server/input/default_input_device_hub.h 2017-05-26 09:20:21 +0000
@@ -104,11 +104,15 @@
104 void device_changed(Device* dev);104 void device_changed(Device* dev);
105 void emit_changed_devices();105 void emit_changed_devices();
106 MirInputDeviceId create_new_device_id();106 MirInputDeviceId create_new_device_id();
107<<<<<<< TREE
107 void store_device_config(DefaultDevice const& dev);108 void store_device_config(DefaultDevice const& dev);
108 std::shared_ptr<DefaultDevice> restore_or_create_device(InputDevice& dev,109 std::shared_ptr<DefaultDevice> restore_or_create_device(InputDevice& dev,
109 std::shared_ptr<dispatch::ActionQueue> const& queue);110 std::shared_ptr<dispatch::ActionQueue> const& queue);
110 mir::optional_value<MirInputDevice> get_stored_device_config(std::string const& id);111 mir::optional_value<MirInputDevice> get_stored_device_config(std::string const& id);
111112
113=======
114
115>>>>>>> MERGE-SOURCE
112 std::shared_ptr<Seat> const seat;116 std::shared_ptr<Seat> const seat;
113 std::shared_ptr<dispatch::MultiplexingDispatchable> const input_dispatchable;117 std::shared_ptr<dispatch::MultiplexingDispatchable> const input_dispatchable;
114 std::mutex mutable handles_guard;118 std::mutex mutable handles_guard;
115119
=== modified file 'src/server/scene/application_session.cpp'
=== modified file 'src/utils/out.c'
=== modified file 'tests/acceptance-tests/test_custom_window_management.cpp'
--- tests/acceptance-tests/test_custom_window_management.cpp 2017-05-25 04:43:29 +0000
+++ tests/acceptance-tests/test_custom_window_management.cpp 2017-05-26 09:20:21 +0000
@@ -371,6 +371,7 @@
371 mir_connection_release(connection);371 mir_connection_release(connection);
372}372}
373373
374<<<<<<< TREE
374TEST_F(CustomWindowManagement, apply_input_shape_to_surface)375TEST_F(CustomWindowManagement, apply_input_shape_to_surface)
375{376{
376 start_server();377 start_server();
@@ -420,6 +421,55 @@
420 mir_connection_release(connection);421 mir_connection_release(connection);
421}422}
422423
424=======
425TEST_F(CustomWindowManagement, apply_input_shape_to_surface)
426{
427 start_server();
428
429 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
430
431 int const width{800}, height{600};
432 MirPixelFormat const format{mir_pixel_format_bgr_888};
433 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
434 mir_window_spec_set_pixel_format(surface_spec, format);
435
436 auto window = mir_create_window_sync(surface_spec);
437 mir_window_spec_release(surface_spec);
438
439 surface_spec = mir_create_window_spec(connection);
440
441 mt::Signal received;
442
443 MirRectangle rect{ 0, 0, 100, 101 };
444 mir_window_spec_set_input_shape(surface_spec, &rect, 1);
445
446 auto const check_apply_surface = [&received](
447 std::shared_ptr<ms::Session> const&,
448 std::shared_ptr<ms::Surface> const&,
449 msh::SurfaceSpecification const& spec)
450 {
451 EXPECT_TRUE(spec.input_shape.is_set());
452 received.raise();
453 };
454 EXPECT_CALL(window_manager, modify_surface(_,_,_)).WillOnce(Invoke(check_apply_surface));
455
456 mir_window_apply_spec(window, surface_spec);
457 mir_window_spec_release(surface_spec);
458
459 EXPECT_TRUE(received.wait_for(400ms));
460
461 surface_spec = mir_create_window_spec(connection);
462 mir_window_spec_set_input_shape(surface_spec, nullptr, 0);
463
464 mir_window_apply_spec(window, surface_spec);
465 mir_window_spec_release(surface_spec);
466 EXPECT_TRUE(received.wait_for(400ms));
467
468 mir_window_release_sync(window);
469 mir_connection_release(connection);
470}
471
472>>>>>>> MERGE-SOURCE
423TEST_F(CustomWindowManagement, when_the_client_places_a_new_surface_the_request_reaches_the_window_manager)473TEST_F(CustomWindowManagement, when_the_client_places_a_new_surface_the_request_reaches_the_window_manager)
424{474{
425 int const width{800};475 int const width{800};
426476
=== modified file 'tests/acceptance-tests/test_new_display_configuration.cpp'
=== modified file 'tests/acceptance-tests/test_presentation_chain.cpp'
--- tests/acceptance-tests/test_presentation_chain.cpp 2017-05-25 04:43:29 +0000
+++ tests/acceptance-tests/test_presentation_chain.cpp 2017-05-26 09:20:21 +0000
@@ -133,18 +133,33 @@
133 {133 {
134 auto spec = mir_create_normal_window_spec(134 auto spec = mir_create_normal_window_spec(
135 connection, size.width.as_int(), size.height.as_int());135 connection, size.width.as_int(), size.height.as_int());
136#pragma GCC diagnostic push136<<<<<<< TREE
137#pragma GCC diagnostic ignored "-Wdeprecated-declarations"137#pragma GCC diagnostic push
138 mir_window_spec_set_pixel_format(spec, pf);138#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
139 mir_window_spec_add_render_surface(139 mir_window_spec_set_pixel_format(spec, pf);
140 spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);140 mir_window_spec_add_render_surface(
141#pragma GCC diagnostic pop141 spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);
142 auto window = mir_create_window_sync(spec);142#pragma GCC diagnostic pop
143 mir_window_spec_release(spec);143 auto window = mir_create_window_sync(spec);
144 return window;144 mir_window_spec_release(spec);
145 }145 return window;
146};146 }
147147};
148
149=======
150 mir_window_spec_set_pixel_format(spec, pf);
151#pragma GCC diagnostic push
152#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
153 mir_window_spec_add_render_surface(
154 spec, chain.content(), size.width.as_int(), size.height.as_int(), 0, 0);
155#pragma GCC diagnostic pop
156 auto window = mir_create_window_sync(spec);
157 mir_window_spec_release(spec);
158 return window;
159 }
160};
161
162>>>>>>> MERGE-SOURCE
148struct PresentationChain : mtf::ConnectedClientHeadlessServer163struct PresentationChain : mtf::ConnectedClientHeadlessServer
149{164{
150 bool stall_compositor = false;165 bool stall_compositor = false;
@@ -467,6 +482,7 @@
467 EXPECT_THAT(mir_buffer_get_error_message(buffer), Not(StrEq("")));482 EXPECT_THAT(mir_buffer_get_error_message(buffer), Not(StrEq("")));
468 mir_buffer_release(buffer);483 mir_buffer_release(buffer);
469}484}
485<<<<<<< TREE
470486
471namespace487namespace
472{488{
@@ -623,3 +639,159 @@
623 for (auto i = 0u; i < buffers.size() - 1; i++)639 for (auto i = 0u; i < buffers.size() - 1; i++)
624 EXPECT_TRUE(buffers[i]->wait_ready(5s));640 EXPECT_TRUE(buffers[i]->wait_ready(5s));
625}641}
642=======
643
644namespace
645{
646 struct TrackedBuffer
647 {
648 TrackedBuffer(MirConnection* connection, std::atomic<unsigned int>& counter) :
649 buffer(mir_connection_allocate_buffer_sync(connection, 100, 100, pf)),
650 counter(counter)
651 {
652 }
653 ~TrackedBuffer()
654 {
655 mir_buffer_release(buffer);
656 }
657
658 void submit_to(MirPresentationChain* chain)
659 {
660 std::unique_lock<std::mutex> lk(mutex);
661 if (!avail)
662 throw std::runtime_error("test problem");
663 avail = false;
664 mir_presentation_chain_submit_buffer(chain, buffer, tavailable, this);
665 }
666
667 static void tavailable(MirBuffer*, void* ctxt)
668 {
669 TrackedBuffer* buf = reinterpret_cast<TrackedBuffer*>(ctxt);
670 buf->ready();
671 }
672
673 void ready()
674 {
675 last_count_ = counter.fetch_add(1);
676 std::unique_lock<std::mutex> lk(mutex);
677 avail = true;
678 cv.notify_all();
679 }
680
681 bool wait_ready(std::chrono::milliseconds ms)
682 {
683 std::unique_lock<std::mutex> lk(mutex);
684 return cv.wait_for(lk, ms, [this] { return avail; });
685 }
686
687 bool is_ready() { return avail; }
688 unsigned int last_count() const
689 {
690 return last_count_;
691 }
692
693 MirPixelFormat pf = mir_pixel_format_abgr_8888;
694 MirBuffer* buffer;
695 std::atomic<unsigned int>& counter;
696 unsigned int last_count_ = 0u;
697 bool avail = true;
698 std::condition_variable cv;
699 std::mutex mutex;
700 };
701}
702
703TEST_F(PresentationChain, fifo_looks_correct_from_client_perspective)
704{
705 SurfaceWithChainFromStart window(
706 connection, mir_present_mode_fifo, size, pf);
707
708 int const num_buffers = 5;
709
710 std::atomic<unsigned int> counter{ 0u };
711 std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
712 for (auto& buffer : buffers)
713 buffer = std::make_unique<TrackedBuffer>(connection, counter);
714 for(auto& b : buffers)
715 b->submit_to(window.chain());
716
717 //the last one that will return;
718 EXPECT_TRUE(buffers[3]->wait_ready(5s));
719 EXPECT_THAT(buffers[0]->last_count(), Lt(buffers[1]->last_count()));
720 EXPECT_THAT(buffers[1]->last_count(), Lt(buffers[2]->last_count()));
721 EXPECT_THAT(buffers[2]->last_count(), Lt(buffers[3]->last_count()));
722 EXPECT_FALSE(buffers[4]->is_ready());
723}
724
725TEST_F(PresentationChain, fifo_queues_when_compositor_isnt_consuming)
726{
727 SurfaceWithChainFromStart window(
728 connection, mir_present_mode_fifo, size, pf);
729 int const num_buffers = 5;
730 std::atomic<unsigned int> counter{ 0u };
731 std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
732 for (auto& buffer : buffers)
733 buffer = std::make_unique<TrackedBuffer>(connection, counter);
734 {
735 auto const stall = mir::raii::paired_calls(
736 [this] { stall_compositor = true; },
737 [this] { stall_compositor = false; });
738 for (auto& b : buffers)
739 b->submit_to(window.chain());
740 for (auto &b : buffers)
741 EXPECT_FALSE(b->is_ready());
742 }
743 for (auto i = 0u; i < buffers.size() - 1; i++)
744 EXPECT_TRUE(buffers[i]->wait_ready(5s));
745}
746
747TEST_F(PresentationChain, mailbox_looks_correct_from_client_perspective)
748{
749 auto const stall = mir::raii::paired_calls(
750 [this] { stall_compositor = true; },
751 [this] { stall_compositor = false; });
752 SurfaceWithChainFromStart window(
753 connection, mir_present_mode_mailbox, size, pf);
754
755 int const num_buffers = 5;
756
757 std::atomic<unsigned int> counter{ 0u };
758 std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
759 for (auto& buffer : buffers)
760 buffer = std::make_unique<TrackedBuffer>(connection, counter);
761
762 for(auto i = 0u; i < buffers.size(); i++)
763 {
764 buffers[i]->submit_to(window.chain());
765 if (i > 0)
766 EXPECT_TRUE(buffers[i-1]->wait_ready(5s));
767 }
768
769 for(auto i = 0u; i < num_buffers - 1; i++)
770 EXPECT_TRUE(buffers[i]->is_ready());
771 EXPECT_FALSE(buffers[4]->is_ready());
772}
773
774TEST_F(PresentationChain, fifo_queues_clears_out_on_transition_to_mailbox)
775{
776 SurfaceWithChainFromStart window(
777 connection, mir_present_mode_fifo, size, pf);
778 int const num_buffers = 5;
779 std::atomic<unsigned int> counter{ 0u };
780 std::array<std::unique_ptr<TrackedBuffer>, num_buffers> buffers;
781 for (auto& buffer : buffers)
782 buffer = std::make_unique<TrackedBuffer>(connection, counter);
783
784 auto const stall = mir::raii::paired_calls(
785 [this] { stall_compositor = true; },
786 [this] { stall_compositor = false; });
787 for (auto& b : buffers)
788 b->submit_to(window.chain());
789 for (auto &b : buffers)
790 EXPECT_FALSE(b->is_ready());
791
792 mir_presentation_chain_set_mode(window.chain(), mir_present_mode_mailbox);
793
794 for (auto i = 0u; i < buffers.size() - 1; i++)
795 EXPECT_TRUE(buffers[i]->wait_ready(5s));
796}
797>>>>>>> MERGE-SOURCE
626798
=== modified file 'tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp'
=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
=== modified file 'tests/unit-tests/input/test_default_device.cpp'
--- tests/unit-tests/input/test_default_device.cpp 2017-05-08 03:04:26 +0000
+++ tests/unit-tests/input/test_default_device.cpp 2017-05-26 09:20:21 +0000
@@ -183,6 +183,7 @@
183183
184 queue->dispatch(md::FdEvent::readable);184 queue->dispatch(md::FdEvent::readable);
185}185}
186<<<<<<< TREE
186187
187TEST_F(DefaultDevice, touchpad_device_can_be_constructed_from_input_config)188TEST_F(DefaultDevice, touchpad_device_can_be_constructed_from_input_config)
188{189{
@@ -339,3 +340,28 @@
339 conf.set_keyboard_config(kbd_config);340 conf.set_keyboard_config(kbd_config);
340 EXPECT_NO_THROW(mi::DefaultDevice dev(conf, queue, keyboard, mt::fake_shared(key_mapper), change_callback));341 EXPECT_NO_THROW(mi::DefaultDevice dev(conf, queue, keyboard, mt::fake_shared(key_mapper), change_callback));
341}342}
343=======
344
345TEST_F(DefaultDevice, disable_queue_ends_config_processing)
346{
347 mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
348
349 dev.disable_queue();
350 MirPointerConfig pointer_conf;
351 pointer_conf.cursor_acceleration_bias(1.0);
352
353 EXPECT_CALL(touchpad, apply_settings(Matcher<mi::TouchpadSettings const&>(_))).Times(0);
354 dev.apply_pointer_configuration(pointer_conf);
355}
356
357TEST_F(DefaultDevice, disable_queue_removes_reference_to_queue)
358{
359 std::weak_ptr<md::ActionQueue> ref = queue;
360 mi::DefaultDevice dev(MirInputDeviceId{17}, queue, touchpad, mt::fake_shared(key_mapper));
361 queue.reset();
362
363 EXPECT_THAT(ref.lock(), Ne(nullptr));
364 dev.disable_queue();
365 EXPECT_THAT(ref.lock(), Eq(nullptr));
366}
367>>>>>>> MERGE-SOURCE
342368
=== modified file 'tests/unit-tests/input/test_default_input_device_hub.cpp'
--- tests/unit-tests/input/test_default_input_device_hub.cpp 2017-05-08 03:04:26 +0000
+++ tests/unit-tests/input/test_default_input_device_hub.cpp 2017-05-26 09:20:21 +0000
@@ -238,6 +238,7 @@
238238
239 hub.remove_device(mt::fake_shared(device));239 hub.remove_device(mt::fake_shared(device));
240 hub.remove_device(mt::fake_shared(another_device));240 hub.remove_device(mt::fake_shared(another_device));
241<<<<<<< TREE
241}242}
242243
243TEST_F(InputDeviceHubTest, when_pointer_configuration_is_applied_successfully_observer_is_triggerd)244TEST_F(InputDeviceHubTest, when_pointer_configuration_is_applied_successfully_observer_is_triggerd)
@@ -359,3 +360,26 @@
359 hub.remove_device(mt::fake_shared(mouse));360 hub.remove_device(mt::fake_shared(mouse));
360 expect_and_execute_multiplexer();361 expect_and_execute_multiplexer();
361}362}
363=======
364 observer_loop.trigger_server_actions();
365}
366
367TEST_F(InputDeviceHubTest, no_device_config_action_after_device_removal)
368{
369 std::shared_ptr<mi::Device> dev_ptr;
370 MirPointerConfig ptr_config;
371 ptr_config.cursor_acceleration_bias(0.5);
372
373 ON_CALL(mock_observer, device_added(WithName("mouse"))).WillByDefault(SaveArg<0>(&dev_ptr));
374
375 hub.add_device(mt::fake_shared(mouse));
376 hub.add_observer(mt::fake_shared(mock_observer));
377 observer_loop.trigger_server_actions();
378
379 EXPECT_CALL(mouse, apply_settings(Matcher<mi::PointerSettings const&>(_))).Times(0);
380
381 dev_ptr->apply_pointer_configuration(ptr_config);
382 hub.remove_device(mt::fake_shared(mouse));
383 observer_loop.trigger_server_actions();
384}
385>>>>>>> MERGE-SOURCE
362386
=== modified file 'tests/unit-tests/platforms/mesa/client/test_client_platform.cpp'
=== modified file 'tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp'
--- tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-05-08 03:04:26 +0000
+++ tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-05-26 09:20:21 +0000
@@ -81,11 +81,15 @@
81 output->set_power_mode(mir_power_mode_on);81 output->set_power_mode(mir_power_mode_on);
82 output->set_orientation(mir_orientation_normal);82 output->set_orientation(mir_orientation_normal);
83 output->set_edid(valid_edid, sizeof(valid_edid));83 output->set_edid(valid_edid, sizeof(valid_edid));
84<<<<<<< TREE
84 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);85 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
8586
86 auto const& current_mode = output->mode(output->current_mode());87 auto const& current_mode = output->mode(output->current_mode());
87 output->set_logical_width(current_mode.horizontal_resolution());88 output->set_logical_width(current_mode.horizontal_resolution());
88 output->set_logical_height(current_mode.vertical_resolution());89 output->set_logical_height(current_mode.vertical_resolution());
90=======
91 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
92>>>>>>> MERGE-SOURCE
8993
90 return std::make_shared<MirDisplayConfig>(conf);94 return std::make_shared<MirDisplayConfig>(conf);
91}95}
@@ -126,11 +130,15 @@
126 output->set_power_mode(mir_power_mode_on);130 output->set_power_mode(mir_power_mode_on);
127 output->set_orientation(mir_orientation_normal);131 output->set_orientation(mir_orientation_normal);
128 output->set_edid(valid_edid, sizeof(valid_edid));132 output->set_edid(valid_edid, sizeof(valid_edid));
133<<<<<<< TREE
129 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);134 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
130135
131 auto const& current_mode = output->mode(output->current_mode());136 auto const& current_mode = output->mode(output->current_mode());
132 output->set_logical_width(current_mode.horizontal_resolution());137 output->set_logical_width(current_mode.horizontal_resolution());
133 output->set_logical_height(current_mode.vertical_resolution());138 output->set_logical_height(current_mode.vertical_resolution());
139=======
140 output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb);
141>>>>>>> MERGE-SOURCE
134 }142 }
135143
136 return std::make_shared<MirDisplayConfig>(conf);144 return std::make_shared<MirDisplayConfig>(conf);

Subscribers

People subscribed via source and target branches