Mir

Merge lp:~alan-griffiths/mir/bump-client-ABI into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 2610
Proposed branch: lp:~alan-griffiths/mir/bump-client-ABI
Merge into: lp:mir
Diff against target: 1190 lines (+87/-807)
17 files modified
debian/control (+2/-2)
debian/libmirclient9.install (+1/-1)
include/client/mir_toolkit/mir_client_library_drm.h (+0/-59)
include/client/mir_toolkit/mir_connection.h (+0/-6)
include/client/mir_toolkit/mir_screencast.h (+0/-7)
include/client/mir_toolkit/mir_surface.h (+0/-107)
src/client/CMakeLists.txt (+1/-1)
src/client/mir_connection.h (+0/-1)
src/client/mir_connection_api.cpp (+1/-175)
src/client/mir_screencast_api.cpp (+0/-5)
src/client/mir_surface_api.cpp (+1/-114)
src/client/symbols-debug.map (+1/-1)
src/client/symbols.map (+80/-129)
tests/acceptance-tests/test_client_library.cpp (+0/-45)
tests/client-language/c99.c (+0/-1)
tests/integration-tests/CMakeLists.txt (+0/-1)
tests/integration-tests/test_drm_auth_magic.cpp (+0/-152)
To merge this branch: bzr merge lp:~alan-griffiths/mir/bump-client-ABI
Reviewer Review Type Date Requested Status
Alexandros Frantzis (community) Approve
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+258769@code.launchpad.net

Commit message

Bump client ABI and delete ABI maintenance legacy

Description of the change

Bump client ABI and delete ABI maintenance legacy

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

That's the trouble with ABI breaks...

glmark2-es2-mir: symbol lookup error: glmark2-es2-mir: undefined symbol: mir_connection_create_surface_sync

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Testing locally the archive glmark2-es2-mir correctly picks up the archive libmirclient.so.8 & libmircommon.so.3 and works with the built mir_performance_tests (which picks up the local ones).

So at least the code isn't broken.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Err http://ports.ubuntu.com/ubuntu-ports/ vivid/universe glmark2-data all 2014.03-0ubuntu3
  Temporary failure resolving 'ports.ubuntu.com'

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Managed to reproduce locally!!

Will investigate tomorrow

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Intermediate result of local investigations. It has something to do with the version of libmirclient.so.8 being picked up. If this comes from 0.13 everything is fine, if it comes from 0.12 then we see an error.

It is tempting to wait for 0.13 to hit achive and resubmit - but these problems tend to come back and bite.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

With a 0.12.1 version of libmirclient.so.8 the failure is:

Core was generated by `glmark2-es2-mir --fullscreen'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fe8b318de26 in std::string::assign(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007fe8b318de26 in std::string::assign(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007fe8b3822871 in MirConnection::MirConnection(mir::client::ConnectionConfiguration&) () from /usr/lib/x86_64-linux-gnu/libmirclient.so.8
#2 0x00007fe8b3827679 in mir_connect () from /usr/lib/x86_64-linux-gnu/libmirclient.so.8
#3 0x00007fe8b38279fb in mir_connect_sync () from /usr/lib/x86_64-linux-gnu/libmirclient.so.8
#4 0x000000000050c402 in ?? ()
#5 0x000000000050aab3 in ?? ()
#6 0x0000000000406bf0 in ?? ()
#7 0x00007fe8b25e4a40 in __libc_start_main (main=0x406520, argc=2, argv=0x7fff42b48018, init=<optimised out>, fini=<optimised out>,
    rtld_fini=<optimised out>, stack_end=0x7fff42b48008) at libc-start.c:289
#8 0x000000000040842f in ?? ()
(gdb) f 2
#2 0x00007fe8b3827679 in mir_connect () from /usr/lib/x86_64-linux-gnu/libmirclient.so.8

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> That's bug 1341490

Well, maybe.

In this case it isn't directly bumping the client API that causes the failure.

What seems to be happening is that glmark2-es2-mir depends on libmirclient8 and the version of that in archive (0.12.1) depends on libmircommon3. As does libmirplatform6 and the corresponding drivers.

The version of libmirclient8 in 0.13.1 depends on libmircommon4 as does libmirplatform7 and the corresponding drivers.

When the libmirclient8 from 0.12.1 tries to load drivers that use libmircommon4 we get a segfault (I haven't quite traced the full mechanism yet - but loading libmircommon3 and libmircommon4 into the same process clearly "needs care" at best).

There are several ways to produce this crash:

  o Having 0.12.1 mir-platform-graphics-mesa2 installed alongside libmircommon3 is one.
    (That's what I believe happens in CI)

  o Building this branch and running mir_performance_tests via the wrapper link.
    (Ensure you don't have a recent libmirclient.so.8 in the libs directory)

Hacking test_glmark2-es2-mir.cpp to unsetenv("MIR_CLIENT_PLATFORM_PATH") actually "fixes" the second case, but is probably a bad idea (and doesn't fix CI which doesn't set that variable in the wrapper).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Text conflict in src/client/symbols.map
1 conflicts encountered.

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Might be related to bug 1415321 then. Unfortunately you need 0.13 in archive (and all downstreams like glmark2 rebuilt against it) to resolve that too :P

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Wow such diff, for a single ABI bump.

Not totally confident but it seems about right.

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2015-05-19 21:34:34 +0000
+++ debian/control 2015-06-01 09:48:29 +0000
@@ -138,7 +138,7 @@
138 .138 .
139 Contains header files required to build Mir servers.139 Contains header files required to build Mir servers.
140140
141Package: libmirclient8141Package: libmirclient9
142Section: libs142Section: libs
143Architecture: i386 amd64 armhf arm64143Architecture: i386 amd64 armhf arm64
144Multi-Arch: same144Multi-Arch: same
@@ -156,7 +156,7 @@
156Architecture: i386 amd64 armhf arm64156Architecture: i386 amd64 armhf arm64
157Multi-Arch: same157Multi-Arch: same
158Pre-Depends: ${misc:Pre-Depends}158Pre-Depends: ${misc:Pre-Depends}
159Depends: libmirclient8 (= ${binary:Version}),159Depends: libmirclient9 (= ${binary:Version}),
160 libmircommon-dev (= ${binary:Version}),160 libmircommon-dev (= ${binary:Version}),
161 libprotobuf-dev (>= 2.4.1),161 libprotobuf-dev (>= 2.4.1),
162 ${misc:Depends},162 ${misc:Depends},
163163
=== renamed file 'debian/libmirclient8.install' => 'debian/libmirclient9.install'
--- debian/libmirclient8.install 2015-03-31 02:35:42 +0000
+++ debian/libmirclient9.install 2015-06-01 09:48:29 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/libmirclient.so.81usr/lib/*/libmirclient.so.9
22
=== removed file 'include/client/mir_toolkit/mir_client_library_drm.h'
--- include/client/mir_toolkit/mir_client_library_drm.h 2015-05-19 21:34:34 +0000
+++ include/client/mir_toolkit/mir_client_library_drm.h 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright © 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef MIR_CLIENT_LIBRARY_DRM_H_
18#define MIR_CLIENT_LIBRARY_DRM_H_
19
20#include "mir_toolkit/mir_client_library.h"
21
22#ifdef __cplusplus
23/**
24 * \addtogroup mir_toolkit
25 * @{
26 */
27extern "C" {
28#endif
29
30struct gbm_device;
31
32typedef void (*mir_drm_auth_magic_callback)(int status, void *context);
33
34/* Authenticates a DRM magic cookie */
35MirWaitHandle *mir_connection_drm_auth_magic(MirConnection *connection,
36 unsigned int magic,
37 mir_drm_auth_magic_callback callback,
38 void *context)
39 __attribute__((__deprecated__("Use mir_connection_platform_operation() with operations from mir_toolkit/mesa/platform_operation.h")));
40
41/**
42 * Set the gbm_device to be used by the EGL implementation.
43 * This is required if the application needs to create EGLImages from
44 * gbm buffers objects created on that gbm device.
45 * \param [in] connection The connection
46 * \param [in] dev The gbm_device to set
47 * \return A non-zero value if the operation was successful,
48 * 0 otherwise
49 */
50int mir_connection_drm_set_gbm_device(MirConnection* connection,
51 struct gbm_device* dev)
52 __attribute__((__deprecated__("Use mir_connection_platform_operation() with operations from mir_toolkit/mesa/platform_operation.h")));
53
54#ifdef __cplusplus
55}
56/**@}*/
57#endif
58
59#endif /* MIR_CLIENT_LIBRARY_DRM_H_ */
600
=== modified file 'include/client/mir_toolkit/mir_connection.h'
--- include/client/mir_toolkit/mir_connection.h 2015-03-31 02:35:42 +0000
+++ include/client/mir_toolkit/mir_connection.h 2015-06-01 09:48:29 +0000
@@ -104,12 +104,6 @@
104 mir_lifecycle_event_callback callback, void* context);104 mir_lifecycle_event_callback callback, void* context);
105105
106/**106/**
107 * \deprecated Use mir_connection_create_display_config
108 */
109__attribute__((__deprecated__("Use mir_connection_create_display_config()")))
110void mir_connection_get_display_info(MirConnection *connection, MirDisplayInfo *display_info);
111
112/**
113 * Query the display107 * Query the display
114 * \warning return value must be destroyed via mir_display_config_destroy()108 * \warning return value must be destroyed via mir_display_config_destroy()
115 * \warning may return null if connection is invalid109 * \warning may return null if connection is invalid
116110
=== modified file 'include/client/mir_toolkit/mir_screencast.h'
--- include/client/mir_toolkit/mir_screencast.h 2015-03-31 02:35:42 +0000
+++ include/client/mir_toolkit/mir_screencast.h 2015-06-01 09:48:29 +0000
@@ -56,13 +56,6 @@
56 */56 */
57MirBufferStream* mir_screencast_get_buffer_stream(MirScreencast *screencast);57MirBufferStream* mir_screencast_get_buffer_stream(MirScreencast *screencast);
5858
59/**
60 * Get a window type that can be used by EGL.
61 * \param [in] screencast The screencast
62 * \return An EGLNativeWindowType that the client can use
63 */
64MirEGLNativeWindowType mir_screencast_egl_native_window(MirScreencast *screencast) __attribute__((__deprecated__("Use mir_screencast_get_buffer_stream and the corresponding mir_buffer_stream* function")));
65
66#ifdef __cplusplus59#ifdef __cplusplus
67}60}
68/**@}*/61/**@}*/
6962
=== modified file 'include/client/mir_toolkit/mir_surface.h'
--- include/client/mir_toolkit/mir_surface.h 2015-05-19 21:34:34 +0000
+++ include/client/mir_toolkit/mir_surface.h 2015-06-01 09:48:29 +0000
@@ -383,42 +383,6 @@
383void mir_surface_spec_release(MirSurfaceSpec* spec);383void mir_surface_spec_release(MirSurfaceSpec* spec);
384384
385/**385/**
386 * Request a new Mir surface on the supplied connection with the supplied
387 * parameters. The returned handle remains valid until the surface has been
388 * released.
389 * \warning callback could be called from another thread. You must do any
390 * locking appropriate to protect your data accessed in the
391 * callback.
392 * \note This will soon be deprecated. Use the *_spec_for_* / mir_surface_create()
393 * two-stage process instead.
394 * \param [in] connection The connection
395 * \param [in] surface_parameters Request surface parameters
396 * \param [in] callback Callback function to be invoked when
397 * request completes
398 * \param [in,out] context User data passed to the callback function
399 * \return A handle that can be passed to
400 * mir_wait_for
401 */
402MirWaitHandle *mir_connection_create_surface(
403 MirConnection *connection,
404 MirSurfaceParameters const *surface_parameters,
405 mir_surface_callback callback,
406 void *context) __attribute__((__deprecated__("Use mir_surface_create()")));
407
408/**
409 * Create a surface like in mir_connection_create_surface(), but also wait for
410 * creation to complete and return the resulting surface.
411 * \note This will soon be deprecated. Use the create_spec_for/mir_surface_create()
412 * two-stage process instead.
413 * \param [in] connection The connection
414 * \param [in] params Parameters describing the desired surface
415 * \return The resulting surface
416 */
417MirSurface *mir_connection_create_surface_sync(
418 MirConnection *connection,
419 MirSurfaceParameters const *params) __attribute__((__deprecated__("Use mir_surface_create_sync()")));
420
421/**
422 * Set the event handler to be called when events arrive for a surface.386 * Set the event handler to be called when events arrive for a surface.
423 * \warning event_handler could be called from another thread. You must do387 * \warning event_handler could be called from another thread. You must do
424 * any locking appropriate to protect your data accessed in the388 * any locking appropriate to protect your data accessed in the
@@ -442,13 +406,6 @@
442MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface);406MirBufferStream* mir_surface_get_buffer_stream(MirSurface *surface);
443407
444/**408/**
445 * Get a window type that can be used for OpenGL ES 2.0 acceleration.
446 * \param [in] surface The surface
447 * \return An EGLNativeWindowType that the client can use
448 */
449MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface *surface) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
450
451/**
452 * Test for a valid surface409 * Test for a valid surface
453 * \param [in] surface The surface410 * \param [in] surface The surface
454 * \return True if the supplied surface is valid, or411 * \return True if the supplied surface is valid, or
@@ -476,58 +433,6 @@
476void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters);433void mir_surface_get_parameters(MirSurface *surface, MirSurfaceParameters *parameters);
477434
478/**435/**
479 * Get the underlying platform type so the buffer obtained in "raw" representation
480 * in mir_surface_get_current_buffer() can be understood
481 * \pre The surface is valid
482 * \param [in] surface The surface
483 * \return One of mir_platform_type_android or mir_platform_type_gbm
484 */
485MirPlatformType mir_surface_get_platform_type(MirSurface *surface) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
486
487/**
488 * Get a surface's buffer in "raw" representation.
489 * \pre The surface is valid
490 * \param [in] surface The surface
491 * \param [out] buffer_package Structure to be populated
492 */
493void mir_surface_get_current_buffer(MirSurface *surface, MirNativeBuffer **buffer_package) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
494
495/**
496 * Get a surface's graphics_region, i.e., map the graphics buffer to main
497 * memory.
498 * \pre The surface is valid
499 * \param [in] surface The surface
500 * \param [out] graphics_region Structure to be populated
501 */
502void mir_surface_get_graphics_region(
503 MirSurface *surface,
504 MirGraphicsRegion *graphics_region) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
505 /**
506 * Advance a surface's buffer. The returned handle remains valid until the next
507 * call to mir_surface_swap_buffers, until the surface has been released or the
508 * connection to the server has been released.
509 * \warning callback could be called from another thread. You must do any
510 * locking appropriate to protect your data accessed in the
511 * callback.
512 * \param [in] surface The surface
513 * \param [in] callback Callback function to be invoked when the request
514 * completes
515 * \param [in,out] context User data passed to the callback function
516 * \return A handle that can be passed to mir_wait_for
517 */
518MirWaitHandle *mir_surface_swap_buffers(
519 MirSurface *surface,
520 mir_surface_callback callback,
521 void *context) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
522
523/**
524 * Advance a surface's buffer as in mir_surface_swap_buffers(), but also wait
525 * for the operation to complete.
526 * \param [in] surface The surface whose buffer to advance
527 */
528void mir_surface_swap_buffers_sync(MirSurface *surface) __attribute__((__deprecated__("Use mir_surface_get_buffer_stream and the corresponding mir_buffer_stream* function")));
529
530/**
531 * Release the supplied surface and any associated buffer. The returned wait436 * Release the supplied surface and any associated buffer. The returned wait
532 * handle remains valid until the connection to the server is released.437 * handle remains valid until the connection to the server is released.
533 * \warning callback could be called from another thread. You must do any438 * \warning callback could be called from another thread. You must do any
@@ -552,18 +457,6 @@
552void mir_surface_release_sync(MirSurface *surface);457void mir_surface_release_sync(MirSurface *surface);
553458
554/**459/**
555 * \deprecated Use mir_debug_surface_id()
556 */
557__attribute__((__deprecated__("Use mir_debug_surface_id()")))
558int mir_surface_get_id(MirSurface *surface);
559
560/**
561 * \deprecated Use the mir_connection_create_spec_for_xxx family of APIs
562 */
563__attribute__((__deprecated__("Use mir_connection_create_spec_for_xxx()")))
564MirWaitHandle* mir_surface_set_type(MirSurface *surface, MirSurfaceType type);
565
566/**
567 * Get the type (purpose) of a surface.460 * Get the type (purpose) of a surface.
568 * \param [in] surface The surface to query461 * \param [in] surface The surface to query
569 * \return The type of the surface462 * \return The type of the surface
570463
=== modified file 'src/client/CMakeLists.txt'
--- src/client/CMakeLists.txt 2015-05-19 21:34:34 +0000
+++ src/client/CMakeLists.txt 2015-06-01 09:48:29 +0000
@@ -23,7 +23,7 @@
23 ${DRM_INCLUDE_DIRS}23 ${DRM_INCLUDE_DIRS}
24)24)
2525
26set(MIRCLIENT_ABI 8)26set(MIRCLIENT_ABI 9)
27set(symbol_map ${CMAKE_SOURCE_DIR}/src/client/symbols.map)27set(symbol_map ${CMAKE_SOURCE_DIR}/src/client/symbols.map)
2828
29add_definitions(-DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}/")29add_definitions(-DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}/")
3030
=== modified file 'src/client/mir_connection.h'
--- src/client/mir_connection.h 2015-05-15 07:32:33 +0000
+++ src/client/mir_connection.h 2015-06-01 09:48:29 +0000
@@ -29,7 +29,6 @@
29#include "mir_protobuf.pb.h"29#include "mir_protobuf.pb.h"
3030
31#include "mir_toolkit/mir_client_library.h"31#include "mir_toolkit/mir_client_library.h"
32#include "mir_toolkit/mir_client_library_drm.h"
3332
34#include "mir/client_platform.h"33#include "mir/client_platform.h"
35#include "mir/client_context.h"34#include "mir/client_context.h"
3635
=== modified file 'src/client/mir_connection_api.cpp'
--- src/client/mir_connection_api.cpp 2015-03-31 02:35:42 +0000
+++ src/client/mir_connection_api.cpp 2015-06-01 09:48:29 +0000
@@ -20,7 +20,6 @@
2020
21#include "mir_connection_api.h"21#include "mir_connection_api.h"
22#include "mir_toolkit/mir_connection.h"22#include "mir_toolkit/mir_connection.h"
23#include "mir_toolkit/mir_client_library_drm.h"
24#include "mir/default_configuration.h"23#include "mir/default_configuration.h"
25#include "mir/raii.h"24#include "mir/raii.h"
2625
@@ -203,55 +202,6 @@
203 connection->register_lifecycle_event_callback(callback, context);202 connection->register_lifecycle_event_callback(callback, context);
204}203}
205204
206//TODO: DEPRECATED: remove this function
207void mir_connection_get_display_info(
208 MirConnection* connection,
209 MirDisplayInfo* display_info)
210{
211 auto const config = mir::raii::deleter_for(
212 mir_connection_create_display_config(connection),
213 &mir_display_config_destroy);
214
215 if (config->num_outputs < 1)
216 return;
217
218 MirDisplayOutput* state = nullptr;
219 // We can't handle more than one display, so just populate based on the first
220 // active display we find.
221 for (unsigned int i = 0; i < config->num_outputs; ++i)
222 {
223 if (config->outputs[i].used && config->outputs[i].connected &&
224 config->outputs[i].current_mode < config->outputs[i].num_modes)
225 {
226 state = &config->outputs[i];
227 break;
228 }
229 }
230 // Oh, oh! No connected outputs?!
231 if (state == nullptr)
232 {
233 memset(display_info, 0, sizeof(*display_info));
234 return;
235 }
236
237 MirDisplayMode mode = state->modes[state->current_mode];
238
239 display_info->width = mode.horizontal_resolution;
240 display_info->height = mode.vertical_resolution;
241
242 unsigned int format_items;
243 if (state->num_output_formats > mir_supported_pixel_format_max)
244 format_items = mir_supported_pixel_format_max;
245 else
246 format_items = state->num_output_formats;
247
248 display_info->supported_pixel_format_items = format_items;
249 for(auto i=0u; i < format_items; i++)
250 {
251 display_info->supported_pixel_format[i] = state->output_formats[i];
252 }
253}
254
255MirDisplayConfiguration* mir_connection_create_display_config(205MirDisplayConfiguration* mir_connection_create_display_config(
256 MirConnection* connection)206 MirConnection* connection)
257{207{
@@ -305,20 +255,7 @@
305 connection->available_surface_formats(formats, format_size, *num_valid_formats);255 connection->available_surface_formats(formats, format_size, *num_valid_formats);
306}256}
307257
308extern "C"258MirWaitHandle* mir_connection_platform_operation(
309{
310MirWaitHandle* new_mir_connection_platform_operation(
311 MirConnection* connection,
312 MirPlatformMessage const* request,
313 mir_platform_operation_callback callback, void* context);
314MirWaitHandle* old_mir_connection_platform_operation(
315 MirConnection* connection, int /* opcode */,
316 MirPlatformMessage const* request,
317 mir_platform_operation_callback callback, void* context);
318}
319
320__asm__(".symver new_mir_connection_platform_operation,mir_connection_platform_operation@@MIR_CLIENT_8.3");
321MirWaitHandle* new_mir_connection_platform_operation(
322 MirConnection* connection,259 MirConnection* connection,
323 MirPlatformMessage const* request,260 MirPlatformMessage const* request,
324 mir_platform_operation_callback callback, void* context)261 mir_platform_operation_callback callback, void* context)
@@ -332,115 +269,4 @@
332 MIR_LOG_UNCAUGHT_EXCEPTION(ex);269 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
333 return nullptr;270 return nullptr;
334 }271 }
335
336}
337
338// TODO: Remove when we bump so name
339__asm__(".symver old_mir_connection_platform_operation,mir_connection_platform_operation@MIR_CLIENT_8");
340MirWaitHandle* old_mir_connection_platform_operation(
341 MirConnection* connection, int /* opcode */,
342 MirPlatformMessage const* request,
343 mir_platform_operation_callback callback, void* context)
344{
345 return new_mir_connection_platform_operation(connection, request, callback, context);
346}
347
348/**************************
349 * DRM specific functions *
350 **************************/
351
352namespace
353{
354
355struct AuthMagicPlatformOperationContext
356{
357 mir_drm_auth_magic_callback callback;
358 void* context;
359};
360
361void platform_operation_to_auth_magic_callback(
362 MirConnection*, MirPlatformMessage* response, void* context)
363{
364 auto const response_msg = mir::raii::deleter_for(
365 response,
366 &mir_platform_message_release);
367 auto const auth_magic_context =
368 std::unique_ptr<AuthMagicPlatformOperationContext>{
369 static_cast<AuthMagicPlatformOperationContext*>(context)};
370
371 auto response_data = mir_platform_message_get_data(response_msg.get());
372 MirMesaAuthMagicResponse auth_response{-1};
373
374 if (response_data.size == sizeof(auth_response))
375 std::memcpy(&auth_response, response_data.data, response_data.size);
376
377 auth_magic_context->callback(auth_response.status, auth_magic_context->context);
378}
379
380void assign_set_gbm_device_status(
381 MirConnection*, MirPlatformMessage* response, void* context)
382{
383 auto const response_msg = mir::raii::deleter_for(
384 response,
385 &mir_platform_message_release);
386
387 auto const response_data = mir_platform_message_get_data(response_msg.get());
388 MirMesaSetGBMDeviceResponse set_gbm_device_response{-1};
389
390 if (response_data.size == sizeof(set_gbm_device_response))
391 std::memcpy(&set_gbm_device_response, response_data.data, response_data.size);
392
393 auto status_ptr = static_cast<int*>(context);
394 *status_ptr = set_gbm_device_response.status;
395}
396
397}
398
399MirWaitHandle* mir_connection_drm_auth_magic(MirConnection* connection,
400 unsigned int magic,
401 mir_drm_auth_magic_callback callback,
402 void* context)
403{
404 auto const msg = mir::raii::deleter_for(
405 mir_platform_message_create(MirMesaPlatformOperation::auth_magic),
406 &mir_platform_message_release);
407
408 auto const auth_magic_op_context =
409 new AuthMagicPlatformOperationContext{callback, context};
410
411 MirMesaAuthMagicRequest request;
412 request.magic = magic;
413
414 mir_platform_message_set_data(msg.get(), &request, sizeof(request));
415
416 return new_mir_connection_platform_operation(
417 connection,
418 msg.get(),
419 platform_operation_to_auth_magic_callback,
420 auth_magic_op_context);
421}
422
423int mir_connection_drm_set_gbm_device(MirConnection* connection,
424 struct gbm_device* gbm_dev)
425{
426 MirMesaSetGBMDeviceRequest const request{gbm_dev};
427
428 auto const msg = mir::raii::deleter_for(
429 mir_platform_message_create(MirMesaPlatformOperation::set_gbm_device),
430 &mir_platform_message_release);
431
432 mir_platform_message_set_data(msg.get(), &request, sizeof(request));
433
434 static int const success{0};
435 int status{-1};
436
437 auto wh = new_mir_connection_platform_operation(
438 connection,
439 msg.get(),
440 assign_set_gbm_device_status,
441 &status);
442
443 mir_wait_for(wh);
444
445 return status == success;
446}272}
447273
=== modified file 'src/client/mir_screencast_api.cpp'
--- src/client/mir_screencast_api.cpp 2015-03-31 02:35:42 +0000
+++ src/client/mir_screencast_api.cpp 2015-06-01 09:48:29 +0000
@@ -86,11 +86,6 @@
86 delete screencast;86 delete screencast;
87}87}
8888
89MirEGLNativeWindowType mir_screencast_egl_native_window(MirScreencast* screencast)
90{
91 return reinterpret_cast<MirEGLNativeWindowType>(mir_buffer_stream_get_egl_native_window(mir_screencast_get_buffer_stream(screencast)));
92}
93
94MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast)89MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast)
95try90try
96{91{
9792
=== modified file 'src/client/mir_surface_api.cpp'
--- src/client/mir_surface_api.cpp 2015-05-19 21:34:34 +0000
+++ src/client/mir_surface_api.cpp 2015-06-01 09:48:29 +0000
@@ -229,57 +229,14 @@
229 delete spec;229 delete spec;
230}230}
231231
232MirWaitHandle* mir_connection_create_surface(
233 MirConnection* connection,
234 MirSurfaceParameters const* params,
235 mir_surface_callback callback,
236 void* context)
237{
238 MirSurfaceSpec spec{connection, *params};
239 return mir_surface_create(&spec, callback, context);
240}
241
242MirSurface* mir_connection_create_surface_sync(
243 MirConnection* connection,
244 MirSurfaceParameters const* params)
245{
246 MirSurfaceSpec spec{connection, *params};
247 return mir_surface_create_sync(&spec);
248}
249
250__asm__(".symver new_mir_surface_set_event_handler,mir_surface_set_event_handler@@MIR_CLIENT_8.4");
251extern "C"232extern "C"
252void new_mir_surface_set_event_handler(MirSurface* surface,233void mir_surface_set_event_handler(MirSurface* surface,
253 mir_surface_event_callback callback,234 mir_surface_event_callback callback,
254 void* context)235 void* context)
255{236{
256 surface->set_event_handler(callback, context);237 surface->set_event_handler(callback, context);
257}238}
258239
259// Deprecated but ABI backward compatible --->
260typedef struct MirEventDelegate
261{
262 mir_surface_event_callback callback;
263 void *context;
264} MirEventDelegate;
265
266__asm__(".symver old_mir_surface_set_event_handler,mir_surface_set_event_handler@MIR_CLIENT_8");
267extern "C"
268void old_mir_surface_set_event_handler(MirSurface* surface,
269 MirEventDelegate const* delegate)
270{
271 if (delegate)
272 surface->set_event_handler(delegate->callback, delegate->context);
273 else
274 surface->set_event_handler(nullptr, nullptr);
275}
276// <--- Deprecated
277
278MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface* surface)
279{
280 return mir_buffer_stream_get_egl_native_window(
281 mir_surface_get_buffer_stream(surface));
282}
283240
284bool mir_surface_is_valid(MirSurface* surface)241bool mir_surface_is_valid(MirSurface* surface)
285{242{
@@ -296,57 +253,6 @@
296 *parameters = surface->get_parameters();253 *parameters = surface->get_parameters();
297}254}
298255
299MirPlatformType mir_surface_get_platform_type(MirSurface* surface)
300{
301 return mir_buffer_stream_get_platform_type(mir_surface_get_buffer_stream(surface));
302}
303
304void mir_surface_get_current_buffer(MirSurface* surface, MirNativeBuffer** buffer_package_out)
305{
306 mir_buffer_stream_get_current_buffer(mir_surface_get_buffer_stream(surface), buffer_package_out);
307}
308
309void mir_surface_get_graphics_region(MirSurface* surface, MirGraphicsRegion* graphics_region)
310{
311 mir_buffer_stream_get_graphics_region(mir_surface_get_buffer_stream(surface), graphics_region);
312}
313
314namespace
315{
316void buffer_to_surface_thunk(MirBufferStream* /* stream */, void* context)
317{
318 auto cb = static_cast<std::function<void()>*>(context);
319 (*cb)();
320}
321}
322
323MirWaitHandle* mir_surface_swap_buffers(
324 MirSurface* surface,
325 mir_surface_callback callback,
326 void* context)
327try
328{
329 auto shim_callback = new std::function<void()>;
330 *shim_callback = [surface, callback, context, shim_callback] ()
331 {
332 if (callback)
333 callback(surface, context);
334 delete shim_callback;
335 };
336 return mir_buffer_stream_swap_buffers(mir_surface_get_buffer_stream(surface), buffer_to_surface_thunk, shim_callback);
337}
338catch (std::exception const& ex)
339{
340 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
341 return nullptr;
342}
343
344void mir_surface_swap_buffers_sync(MirSurface* surface)
345{
346 mir_buffer_stream_swap_buffers_sync(
347 mir_surface_get_buffer_stream(surface));
348}
349
350MirWaitHandle* mir_surface_release(256MirWaitHandle* mir_surface_release(
351 MirSurface* surface,257 MirSurface* surface,
352 mir_surface_callback callback, void* context)258 mir_surface_callback callback, void* context)
@@ -369,25 +275,6 @@
369 nullptr));275 nullptr));
370}276}
371277
372int mir_surface_get_id(MirSurface* /*surface*/)
373{
374 return 0;
375}
376
377MirWaitHandle* mir_surface_set_type(MirSurface* surf,
378 MirSurfaceType type)
379{
380 try
381 {
382 return surf ? surf->configure(mir_surface_attrib_type, type) : nullptr;
383 }
384 catch (std::exception const& ex)
385 {
386 MIR_LOG_UNCAUGHT_EXCEPTION(ex);
387 return nullptr;
388 }
389}
390
391MirSurfaceType mir_surface_get_type(MirSurface* surf)278MirSurfaceType mir_surface_get_type(MirSurface* surf)
392{279{
393 MirSurfaceType type = mir_surface_type_normal;280 MirSurfaceType type = mir_surface_type_normal;
394281
=== modified file 'src/client/symbols-debug.map'
--- src/client/symbols-debug.map 2015-03-31 02:35:42 +0000
+++ src/client/symbols-debug.map 2015-06-01 09:48:29 +0000
@@ -1,4 +1,4 @@
1MIR_CLIENT_DEBUG_8 {1MIR_CLIENT_DEBUG_9 {
2 global: 2 global:
3 mir_debug_*;3 mir_debug_*;
4 local: *;4 local: *;
55
=== modified file 'src/client/symbols.map'
--- src/client/symbols.map 2015-05-21 19:25:51 +0000
+++ src/client/symbols.map 2015-06-01 09:48:29 +0000
@@ -1,23 +1,34 @@
1MIR_CLIENT_8 {1MIR_CLIENT_9 {
2 global:2 global:
3 mir_arrow_cursor_name;3 mir_arrow_cursor_name;
4 mir_buffer_stream_get_current_buffer;
5 mir_buffer_stream_get_egl_native_window;
6 mir_buffer_stream_get_graphics_region;
7 mir_buffer_stream_get_platform_type;
8 mir_buffer_stream_is_valid;
9 mir_buffer_stream_release;
10 mir_buffer_stream_release_sync;
11 mir_buffer_stream_swap_buffers;
12 mir_buffer_stream_swap_buffers_sync;
4 mir_busy_cursor_name;13 mir_busy_cursor_name;
5 mir_caret_cursor_name;14 mir_caret_cursor_name;
6 mir_closed_hand_cursor_name;15 mir_closed_hand_cursor_name;
7 mir_connect;16 mir_connect;
8 mir_connection_api_impl;17 mir_connection_api_impl;
9 mir_connection_apply_display_config;18 mir_connection_apply_display_config;
19 mir_connection_create_buffer_stream;
20 mir_connection_create_buffer_stream_sync;
10 mir_connection_create_display_config;21 mir_connection_create_display_config;
11 mir_connection_create_prompt_session_sync;22 mir_connection_create_prompt_session_sync;
12 mir_connection_create_screencast_sync;23 mir_connection_create_screencast_sync;
24 mir_connection_create_spec_for_changes;
25 mir_connection_create_spec_for_dialog;
13 mir_connection_create_spec_for_input_method;26 mir_connection_create_spec_for_input_method;
27 mir_connection_create_spec_for_menu;
14 mir_connection_create_spec_for_modal_dialog;28 mir_connection_create_spec_for_modal_dialog;
15 mir_connection_create_surface;29 mir_connection_create_spec_for_normal_surface;
16 mir_connection_create_surface_sync;30 mir_connection_create_spec_for_tooltip;
17 mir_connection_drm_auth_magic;
18 mir_connection_drm_set_gbm_device;
19 mir_connection_get_available_surface_formats;31 mir_connection_get_available_surface_formats;
20 mir_connection_get_display_info;
21 mir_connection_get_egl_native_display;32 mir_connection_get_egl_native_display;
22 mir_connection_get_error_message;33 mir_connection_get_error_message;
23 mir_connection_get_platform;34 mir_connection_get_platform;
@@ -28,123 +39,29 @@
28 mir_connection_set_lifecycle_event_callback;39 mir_connection_set_lifecycle_event_callback;
29 mir_connect_sync;40 mir_connect_sync;
30 mir_cursor_configuration_destroy;41 mir_cursor_configuration_destroy;
42 mir_cursor_configuration_from_buffer_stream;
31 mir_cursor_configuration_from_name;43 mir_cursor_configuration_from_name;
32 mir_default_cursor_name;44 mir_default_cursor_name;
33 mir_diagonal_resize_bottom_to_top_cursor_name;45 mir_diagonal_resize_bottom_to_top_cursor_name;
34 mir_diagonal_resize_top_to_bottom_cursor_name;46 mir_diagonal_resize_top_to_bottom_cursor_name;
35 mir_disabled_cursor_name;47 mir_disabled_cursor_name;
36 mir_display_config_destroy;48 mir_display_config_destroy;
37 mir_horizontal_resize_cursor_name;
38 mir_hsplit_resize_cursor_name;
39 mir_omnidirectional_resize_cursor_name;
40 mir_open_hand_cursor_name;
41 mir_platform_message_create;
42 mir_platform_message_get_data;
43 mir_platform_message_get_fds;
44 mir_platform_message_get_opcode;
45 mir_platform_message_release;
46 mir_platform_message_set_data;
47 mir_platform_message_set_fds;
48 mir_pointing_hand_cursor_name;
49 mir_prompt_session_error_message;
50 mir_prompt_session_is_valid;
51 mir_prompt_session_new_fds_for_prompt_providers;
52 mir_prompt_session_release_sync;
53 mir_screencast_egl_native_window;
54 mir_screencast_release_sync;
55 mir_surface_configure_cursor;
56 mir_surface_get_current_buffer;
57 mir_surface_get_dpi;
58 mir_surface_get_egl_native_window;
59 mir_surface_get_error_message;
60 mir_surface_get_focus;
61 mir_surface_get_graphics_region;
62 mir_surface_get_id;
63 mir_surface_get_orientation;
64 mir_surface_get_parameters;
65 mir_surface_get_platform_type;
66 mir_surface_get_state;
67 mir_surface_get_swapinterval;
68 mir_surface_get_type;
69 mir_surface_get_visibility;
70 mir_surface_is_valid;
71 mir_surface_release;
72 mir_surface_release_sync;
73 mir_surface_set_event_handler;
74 mir_surface_set_state;
75 mir_surface_set_swapinterval;
76 mir_surface_set_type;
77 mir_surface_spec_release;
78 mir_surface_swap_buffers;
79 mir_surface_swap_buffers_sync;
80 mir_vertical_resize_cursor_name;
81 mir_vsplit_resize_cursor_name;
82 mir_wait_for;
83 mir_wait_for_one;
84 local: *;
85};
86MIR_CLIENT_8.1 {
87 global:
88 mir_connection_create_spec_for_normal_surface;
89 mir_surface_create;
90 mir_surface_create_sync;
91 mir_surface_spec_set_buffer_usage;
92 mir_surface_spec_set_fullscreen_on_output;
93 mir_surface_spec_set_height;
94 mir_surface_spec_set_name;
95 mir_surface_spec_set_pixel_format;
96 mir_surface_spec_set_width;
97} MIR_CLIENT_8;
98
99MIR_CLIENT_8.2 {
100 global:
101 mir_surface_get_preferred_orientation;
102 mir_surface_set_preferred_orientation;
103 mir_surface_spec_set_preferred_orientation;
104} MIR_CLIENT_8.1;
105
106MIR_CLIENT_8.3 { # New in Mir 0.11
107 global:
108 mir_connection_create_spec_for_dialog;
109 mir_connection_create_spec_for_menu;
110 mir_connection_create_spec_for_tooltip;
111 mir_connection_platform_operation;
112} MIR_CLIENT_8.2;
113
114MIR_CLIENT_8.4 { # New in Mir 0.13
115 global:
116 mir_connection_create_spec_for_changes;
117 mir_surface_apply_spec;
118 mir_surface_set_event_handler;
119 mir_default_cursor_name;
120 mir_disabled_cursor_name;
121 mir_arrow_cursor_name;
122 mir_busy_cursor_name;
123 mir_caret_cursor_name;
124 mir_pointing_hand_cursor_name;
125 mir_open_hand_cursor_name;
126 mir_closed_hand_cursor_name;
127 mir_horizontal_resize_cursor_name;
128 mir_vertical_resize_cursor_name;
129 mir_diagonal_resize_bottom_to_top_cursor_name;
130 mir_diagonal_resize_top_to_bottom_cursor_name;
131 mir_omnidirectional_resize_cursor_name;
132 mir_vsplit_resize_cursor_name;
133 mir_hsplit_resize_cursor_name;
134 mir_event_get_close_surface_event;49 mir_event_get_close_surface_event;
50 mir_event_get_input_configuration_event;
135 mir_event_get_input_event;51 mir_event_get_input_event;
136 mir_event_get_keymap_event;52 mir_event_get_keymap_event;
137 mir_event_get_orientation_event;53 mir_event_get_orientation_event;
138 mir_event_get_prompt_session_event;54 mir_event_get_prompt_session_event;
139 mir_event_get_resize_event;55 mir_event_get_resize_event;
140 mir_event_get_surface_event;56 mir_event_get_surface_event;
141 mir_event_get_input_configuration_event;
142 mir_event_get_type;57 mir_event_get_type;
58 mir_event_ref;
59 mir_event_unref;
60 mir_horizontal_resize_cursor_name;
61 mir_hsplit_resize_cursor_name;
143 mir_input_configuration_event_get_action;62 mir_input_configuration_event_get_action;
63 mir_input_configuration_event_get_device_id;
144 mir_input_configuration_event_get_time;64 mir_input_configuration_event_get_time;
145 mir_input_configuration_event_get_device_id;
146 mir_event_ref;
147 mir_event_unref;
148 mir_input_event_get_device_id;65 mir_input_event_get_device_id;
149 mir_input_event_get_event_time;66 mir_input_event_get_event_time;
150 mir_input_event_get_keyboard_event;67 mir_input_event_get_keyboard_event;
@@ -156,50 +73,84 @@
156 mir_keyboard_event_modifiers;73 mir_keyboard_event_modifiers;
157 mir_keyboard_event_scan_code;74 mir_keyboard_event_scan_code;
158 mir_keymap_event_get_rules;75 mir_keymap_event_get_rules;
76 mir_omnidirectional_resize_cursor_name;
77 mir_open_hand_cursor_name;
159 mir_orientation_event_get_direction;78 mir_orientation_event_get_direction;
79 mir_platform_message_create;
80 mir_platform_message_get_data;
81 mir_platform_message_get_fds;
82 mir_platform_message_get_opcode;
83 mir_platform_message_release;
84 mir_platform_message_set_data;
85 mir_platform_message_set_fds;
160 mir_pointer_event_action;86 mir_pointer_event_action;
161 mir_pointer_event_axis_value;87 mir_pointer_event_axis_value;
88 mir_pointer_event_buttons;
162 mir_pointer_event_button_state;89 mir_pointer_event_button_state;
163 mir_pointer_event_modifiers;90 mir_pointer_event_modifiers;
91 mir_pointing_hand_cursor_name;
92 mir_prompt_session_error_message;
164 mir_prompt_session_event_get_state;93 mir_prompt_session_event_get_state;
94 mir_prompt_session_is_valid;
95 mir_prompt_session_new_fds_for_prompt_providers;
96 mir_prompt_session_release_sync;
165 mir_resize_event_get_height;97 mir_resize_event_get_height;
166 mir_resize_event_get_width;98 mir_resize_event_get_width;
99 mir_screencast_get_buffer_stream;
100 mir_screencast_release_sync;
101 mir_surface_apply_spec;
102 mir_surface_configure_cursor;
103 mir_surface_create;
104 mir_surface_create_sync;
167 mir_surface_event_get_attribute;105 mir_surface_event_get_attribute;
168 mir_surface_event_get_attribute_value;106 mir_surface_event_get_attribute_value;
107 mir_surface_get_buffer_stream;
108 mir_surface_get_dpi;
109 mir_surface_get_error_message;
110 mir_surface_get_focus;
111 mir_surface_get_orientation;
112 mir_surface_get_parameters;
113 mir_surface_get_preferred_orientation;
114 mir_surface_get_state;
115 mir_surface_get_swapinterval;
116 mir_surface_get_type;
117 mir_surface_get_visibility;
118 mir_surface_is_valid;
119 mir_surface_release;
120 mir_surface_release_sync;
121 mir_surface_set_event_handler;
122 mir_surface_set_preferred_orientation;
123 mir_surface_set_state;
169 mir_surface_set_swapinterval;124 mir_surface_set_swapinterval;
125 mir_surface_spec_release;
126 mir_surface_spec_set_buffer_usage;
127 mir_surface_spec_set_fullscreen_on_output;
128 mir_surface_spec_set_height;
170 mir_surface_spec_set_height_increment;129 mir_surface_spec_set_height_increment;
171 mir_surface_spec_set_max_aspect_ratio;130 mir_surface_spec_set_max_aspect_ratio;
131 mir_surface_spec_set_max_height;
172 mir_surface_spec_set_max_width;132 mir_surface_spec_set_max_width;
173 mir_surface_spec_set_max_height;
174 mir_surface_spec_set_min_aspect_ratio;133 mir_surface_spec_set_min_aspect_ratio;
134 mir_surface_spec_set_min_height;
175 mir_surface_spec_set_min_width;135 mir_surface_spec_set_min_width;
176 mir_surface_spec_set_min_height;136 mir_surface_spec_set_name;
137 mir_surface_spec_set_pixel_format;
138 mir_surface_spec_set_preferred_orientation;
139 mir_surface_spec_set_width;
177 mir_surface_spec_set_width_increment;140 mir_surface_spec_set_width_increment;
178 mir_surface_swap_buffers;
179 mir_surface_swap_buffers_sync;
180 mir_touch_event_modifiers;
181 mir_touch_event_action;141 mir_touch_event_action;
182 mir_touch_event_axis_value;142 mir_touch_event_axis_value;
143 mir_touch_event_id;
144 mir_touch_event_modifiers;
183 mir_touch_event_point_count;145 mir_touch_event_point_count;
184 mir_touch_event_id;
185 mir_touch_event_tooltype;146 mir_touch_event_tooltype;
186 mir_surface_get_buffer_stream;147 mir_vertical_resize_cursor_name;
187 mir_buffer_stream_get_current_buffer;148 mir_vsplit_resize_cursor_name;
188 mir_buffer_stream_get_platform_type;149 mir_wait_for;
189 mir_buffer_stream_swap_buffers;150 mir_wait_for_one;
190 mir_buffer_stream_swap_buffers_sync;151};
191 mir_screencast_get_buffer_stream;
192 mir_buffer_stream_get_egl_native_window;
193 mir_buffer_stream_get_graphics_region;
194 mir_connection_create_buffer_stream_sync;
195 mir_cursor_configuration_from_buffer_stream;
196 mir_buffer_stream_release;
197 mir_buffer_stream_release_sync;
198 mir_buffer_stream_is_valid;
199 mir_pointer_event_buttons; # Move to 8.5
200} MIR_CLIENT_8.3;
201152
202MIR_CLIENT_DETAIL_8 {153MIR_CLIENT_DETAIL_9 {
203 global:154 global:
204 extern "C++" { 155 extern "C++" {
205 mir::events::make_event*;156 mir::events::make_event*;
206157
=== modified file 'tests/acceptance-tests/test_client_library.cpp'
--- tests/acceptance-tests/test_client_library.cpp 2015-05-19 21:34:34 +0000
+++ tests/acceptance-tests/test_client_library.cpp 2015-06-01 09:48:29 +0000
@@ -192,51 +192,6 @@
192 mir_connection_release(connection);192 mir_connection_release(connection);
193}193}
194194
195#pragma GCC diagnostic push
196#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
197
198TEST_F(ClientLibrary, can_set_surface_types)
199{
200 mir_wait_for(mir_connect(new_connection().c_str(), __PRETTY_FUNCTION__, connection_callback, this));
201
202 auto const spec =
203 mir_connection_create_spec_for_normal_surface(
204 connection, 640, 480, mir_pixel_format_abgr_8888);
205
206 mir_wait_for(mir_surface_create(spec, create_surface_callback, this));
207 mir_surface_spec_release(spec);
208
209 EXPECT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_normal));
210
211 mir_wait_for(mir_surface_set_type(surface, mir_surface_type_freestyle));
212 EXPECT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_freestyle));
213
214 mir_wait_for(mir_surface_set_type(surface, static_cast<MirSurfaceType>(999)));
215 EXPECT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_freestyle));
216
217 mir_wait_for(mir_surface_set_type(surface, mir_surface_type_dialog));
218 EXPECT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_dialog));
219
220 mir_wait_for(mir_surface_set_type(surface, static_cast<MirSurfaceType>(888)));
221 EXPECT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_dialog));
222
223 // Stress-test synchronization logic with some flooding
224 for (int i = 0; i < 100; i++)
225 {
226 mir_surface_set_type(surface, mir_surface_type_normal);
227 mir_surface_set_type(surface, mir_surface_type_utility);
228 mir_surface_set_type(surface, mir_surface_type_dialog);
229 mir_surface_set_type(surface, mir_surface_type_gloss);
230 mir_surface_set_type(surface, mir_surface_type_freestyle);
231 mir_wait_for(mir_surface_set_type(surface, mir_surface_type_menu));
232 ASSERT_THAT(mir_surface_get_type(surface), Eq(mir_surface_type_menu));
233 }
234
235 mir_wait_for(mir_surface_release(surface, release_surface_callback, this));
236 mir_connection_release(connection);
237}
238#pragma GCC diagnostic pop
239
240TEST_F(ClientLibrary, can_set_surface_state)195TEST_F(ClientLibrary, can_set_surface_state)
241{196{
242 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);197 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
243198
=== modified file 'tests/client-language/c99.c'
--- tests/client-language/c99.c 2015-01-21 07:34:50 +0000
+++ tests/client-language/c99.c 2015-06-01 09:48:29 +0000
@@ -21,7 +21,6 @@
21 */21 */
2222
23#include "mir_toolkit/mir_client_library.h"23#include "mir_toolkit/mir_client_library.h"
24#include "mir_toolkit/mir_client_library_drm.h"
25#include "mir_toolkit/debug/surface.h"24#include "mir_toolkit/debug/surface.h"
26#include "mir_toolkit/event.h"25#include "mir_toolkit/event.h"
2726
2827
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2015-05-19 21:34:34 +0000
+++ tests/integration-tests/CMakeLists.txt 2015-06-01 09:48:29 +0000
@@ -61,7 +61,6 @@
61 ${CMAKE_SOURCE_DIR}61 ${CMAKE_SOURCE_DIR}
62 )62 )
63 add_subdirectory(graphics/mesa)63 add_subdirectory(graphics/mesa)
64 list(APPEND INTEGRATION_TESTS_SRCS test_drm_auth_magic.cpp)
65endif()64endif()
6665
67link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})66link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
6867
=== removed file 'tests/integration-tests/test_drm_auth_magic.cpp'
--- tests/integration-tests/test_drm_auth_magic.cpp 2015-05-19 21:34:34 +0000
+++ tests/integration-tests/test_drm_auth_magic.cpp 1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
1/*
2 * Copyright © 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#include "mir/graphics/display.h"
20#include "mir/graphics/platform_ipc_package.h"
21#include "mir/graphics/buffer_ipc_message.h"
22#include "mir/graphics/buffer_basic.h"
23
24#include <boost/exception/errinfo_errno.hpp>
25#include <boost/throw_exception.hpp>
26
27#include "mir_test_doubles/stub_buffer_allocator.h"
28#include "mir_test_doubles/null_platform.h"
29#include "mir_test_framework/display_server_test_fixture.h"
30
31#include "mir_toolkit/mir_client_library.h"
32#include "mir_toolkit/mir_client_library_drm.h"
33#include "mir_toolkit/mesa/platform_operation.h"
34
35#include <gmock/gmock.h>
36#include <gtest/gtest.h>
37
38#include <cstring>
39
40namespace mg = mir::graphics;
41namespace mc = mir::compositor;
42namespace geom = mir::geometry;
43namespace mtf = mir_test_framework;
44namespace mtd = mir::test::doubles;
45namespace
46{
47
48char const* const mir_test_socket = mtf::test_socket_file().c_str();
49
50struct MockAuthenticatingIpcOps : public mg::PlatformIpcOperations
51{
52 MOCK_CONST_METHOD3(pack_buffer, void(mg::BufferIpcMessage&, mg::Buffer const&, mg::BufferIpcMsgType));
53 MOCK_CONST_METHOD2(unpack_buffer, void(mg::BufferIpcMessage&, mg::Buffer const&));
54 MOCK_METHOD0(connection_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());
55 MOCK_METHOD2(platform_operation, mg::PlatformOperationMessage(
56 unsigned int const, mg::PlatformOperationMessage const&));
57};
58
59class StubAuthenticatingPlatform : public mtd::NullPlatform
60{
61public:
62 StubAuthenticatingPlatform(std::shared_ptr<mg::PlatformIpcOperations> const& ops) :
63 ops{ops}
64 {
65 }
66
67 std::shared_ptr<mg::GraphicBufferAllocator> create_buffer_allocator() override
68 {
69 return std::make_shared<mtd::StubBufferAllocator>();
70 }
71 std::shared_ptr<mg::PlatformIpcOperations> make_ipc_operations() const override
72 {
73 return ops;
74 }
75
76private:
77 std::shared_ptr<mg::PlatformIpcOperations> const ops;
78};
79
80void connection_callback(MirConnection* connection, void* context)
81{
82 auto connection_ptr = static_cast<MirConnection**>(context);
83 *connection_ptr = connection;
84}
85
86void drm_auth_magic_callback(int status, void* client_context)
87{
88 auto status_ptr = static_cast<int*>(client_context);
89 *status_ptr = status;
90}
91
92}
93
94#pragma GCC diagnostic warning "-Wdeprecated-declarations"
95
96TEST_F(BespokeDisplayServerTestFixture, client_drm_auth_magic_calls_platform)
97{
98 static unsigned int const magic{0x10111213};
99 static MirMesaAuthMagicResponse const auth_magic_response{123};
100
101 struct ServerConfig : TestingServerConfiguration
102 {
103 std::shared_ptr<mg::Platform> the_graphics_platform()
104 {
105 using namespace testing;
106 if (!platform)
107 {
108 mg::PlatformOperationMessage pkg;
109 pkg.data.resize(sizeof(auth_magic_response));
110 std::memcpy(pkg.data.data(), &auth_magic_response,
111 sizeof(auth_magic_response));
112
113 auto ipc_ops = std::make_shared<NiceMock<MockAuthenticatingIpcOps>>();
114 EXPECT_CALL(*ipc_ops, platform_operation(_,_))
115 .Times(1)
116 .WillRepeatedly(Return(pkg));
117 ON_CALL(*ipc_ops, connection_ipc_package())
118 .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>()));
119 platform = std::make_shared<StubAuthenticatingPlatform>(ipc_ops);
120 }
121
122 return platform;
123 }
124
125 std::shared_ptr<StubAuthenticatingPlatform> platform;
126 } server_config;
127
128 launch_server_process(server_config);
129
130 struct Client : TestingClientConfiguration
131 {
132 void exec()
133 {
134 MirConnection* connection{nullptr};
135 mir_wait_for(mir_connect(mir_test_socket, __PRETTY_FUNCTION__,
136 connection_callback, &connection));
137
138 int status{67};
139
140 ASSERT_TRUE(mir_connection_is_valid(connection));
141
142 mir_wait_for(mir_connection_drm_auth_magic(connection, magic,
143 drm_auth_magic_callback,
144 &status));
145 EXPECT_EQ(auth_magic_response.status, status);
146
147 mir_connection_release(connection);
148 }
149 } client_config;
150
151 launch_client_process(client_config);
152}

Subscribers

People subscribed via source and target branches