Mir

Merge lp:mir/0.21 into lp:mir/ubuntu

Proposed by Alberto Aguirre
Status: Merged
Approved by: Alberto Aguirre
Approved revision: 3425
Merged at revision: 1271
Proposed branch: lp:mir/0.21
Merge into: lp:mir/ubuntu
Diff against target: 24669 lines (+11600/-4029)
355 files modified
3rd_party/CMakeLists.txt (+0/-2)
3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h (+1/-0)
3rd_party/android-input/android/frameworks/base/services/input/Input.cpp (+19/-2)
CMakeLists.txt (+18/-5)
benchmarks/frame-uniformity/CMakeLists.txt (+6/-0)
cmake/ABICheck.cmake (+31/-62)
cmake/FindGtestGmock.cmake (+1/-1)
cmake/FindLibHardware.cmake (+1/-1)
cmake/MirCommon.cmake (+61/-14)
debian/changelog (+63/-0)
debian/control (+17/-5)
debian/mir-android-diagnostics.install (+1/-0)
debian/mir-client-platform-android5.install (+1/-1)
debian/mir-client-platform-mesa5.install (+1/-1)
debian/mir-demos.examples (+0/-7)
debian/mir-test-tools.install (+2/-1)
debian/mir-test-tools.lintian-overrides (+3/-0)
debian/mir-utils.install (+1/-0)
debian/rules (+16/-2)
deploy-and-test.sh (+0/-26)
doc/abi_compatibility_tools.md (+14/-70)
doc/android_new_device_bringup.md (+35/-21)
doc/avoid_deploy-and-test.md (+0/-29)
doc/snappy_appliances.md (+0/-76)
examples/CMakeLists.txt (+7/-23)
examples/animated_cursor_demo_client.c (+28/-15)
examples/camera.c (+541/-0)
examples/client_helpers.h (+2/-2)
examples/cursors_demo_client.c (+3/-2)
examples/flicker.c (+17/-1)
examples/mir_demo_server_loader.cpp (+14/-0)
examples/render_surfaces.cpp (+4/-0)
examples/render_to_fb.cpp (+7/-0)
examples/scroll.cpp (+13/-0)
examples/server_example.cpp (+24/-2)
examples/server_example_test_client.cpp (+15/-2)
examples/server_example_window_management.cpp (+20/-20)
examples/xcursor_loader.cpp (+1/-1)
include/client/mir_toolkit/client_types.h (+48/-0)
include/client/mir_toolkit/events/event.h (+11/-11)
include/client/mir_toolkit/events/input/input_event.h (+12/-10)
include/client/mir_toolkit/events/input/keyboard_event.h (+1/-1)
include/client/mir_toolkit/events/input/pointer_event.h (+1/-1)
include/client/mir_toolkit/events/input/touch_event.h (+1/-1)
include/client/mir_toolkit/events/input_configuration_event.h (+3/-3)
include/client/mir_toolkit/events/keymap_event.h (+3/-3)
include/client/mir_toolkit/events/orientation_event.h (+1/-1)
include/client/mir_toolkit/events/prompt_session_event.h (+1/-1)
include/client/mir_toolkit/events/resize_event.h (+2/-2)
include/client/mir_toolkit/events/surface_event.h (+2/-2)
include/client/mir_toolkit/mir_client_library.h (+2/-0)
include/client/mir_toolkit/mir_connection.h (+47/-1)
include/client/mir_toolkit/mir_cookie.h (+8/-4)
include/client/mir_toolkit/mir_display_configuration.h (+386/-0)
include/client/mir_toolkit/mir_input_device.h (+131/-1)
include/client/mir_toolkit/mir_surface.h (+18/-7)
include/client/mir_toolkit/version.h (+1/-1)
include/common/mir/logging/logger.h (+9/-1)
include/server/mir/input/input_device_hub.h (+2/-0)
include/server/mir/input/input_manager.h (+3/-1)
include/test/mir/test/display_config_matchers.h (+51/-22)
include/test/mir/test/doubles/mock_input_device_hub.h (+0/-43)
include/test/mir/test/doubles/stub_display_configuration.h (+4/-0)
include/test/mir/test/doubles/stub_input_device.h (+82/-0)
include/test/mir/test/wait_condition.h (+6/-0)
include/test/mir_test_framework/declarative_placement_window_manage_policy.h (+2/-2)
include/test/mir_test_framework/executable_path.h (+1/-1)
include/test/mir_test_framework/fake_input_device.h (+4/-2)
include/test/mir_test_framework/placement_applying_shell.h (+13/-0)
playground/CMakeLists.txt (+4/-3)
playground/mir_demo_client_prerendered_frames.c (+105/-36)
snappy/CMakeLists.txt (+0/-57)
snappy/copy-external-libs.sh (+0/-17)
snappy/mir-demos.package.yaml.in (+0/-5)
snappy/mir-run (+0/-14)
snappy/mir.framework.in (+0/-2)
snappy/mir.package.yaml.in (+0/-9)
snappy/readme.md (+0/-3)
src/CMakeLists.txt (+4/-4)
src/client/CMakeLists.txt (+6/-0)
src/client/buffer.cpp (+65/-3)
src/client/buffer.h (+25/-2)
src/client/buffer_factory.cpp (+79/-0)
src/client/buffer_factory.h (+91/-0)
src/client/buffer_stream.cpp (+36/-55)
src/client/buffer_stream.h (+1/-1)
src/client/buffer_vault.cpp (+17/-14)
src/client/client_buffer_stream.h (+25/-2)
src/client/connection_configuration.h (+2/-0)
src/client/connection_surface_map.h (+7/-0)
src/client/default_connection_configuration.cpp (+22/-6)
src/client/default_connection_configuration.h (+2/-0)
src/client/display_configuration.cpp (+31/-38)
src/client/display_configuration.h (+6/-2)
src/client/display_configuration_api.cpp (+327/-0)
src/client/error_chain.cpp (+73/-0)
src/client/error_chain.h (+54/-0)
src/client/input/input_devices.cpp (+26/-8)
src/client/lttng/CMakeLists.txt (+5/-0)
src/client/mir_buffer_api.cpp (+146/-41)
src/client/mir_connection.cpp (+186/-10)
src/client/mir_connection.h (+41/-1)
src/client/mir_connection_api.cpp (+42/-0)
src/client/mir_input_device_api.cpp (+134/-0)
src/client/mir_presentation_chain.h (+45/-0)
src/client/mir_presentation_chain_api.cpp (+102/-30)
src/client/mir_surface.cpp (+8/-4)
src/client/mir_surface.h (+9/-1)
src/client/mir_surface_api.cpp (+49/-2)
src/client/no_tls_future-inl.h (+5/-1)
src/client/presentation_chain.cpp (+12/-45)
src/client/presentation_chain.h (+14/-27)
src/client/protobuf_to_native_buffer.cpp (+50/-0)
src/client/protobuf_to_native_buffer.h (+34/-0)
src/client/rpc/make_rpc_channel.h (+11/-8)
src/client/rpc/make_socket_rpc_channel.cpp (+13/-9)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+23/-5)
src/client/rpc/mir_protobuf_rpc_channel.h (+3/-0)
src/client/screencast_stream.cpp (+4/-13)
src/client/screencast_stream.h (+1/-1)
src/client/surface_map.cpp (+21/-0)
src/client/surface_map.h (+4/-0)
src/client/symbols.map (+60/-2)
src/common/logging/logger.cpp (+3/-10)
src/common/sharedlibrary/module_deleter.cpp (+0/-3)
src/common/thread/thread_name.cpp (+0/-3)
src/include/client/mir/client_buffer.h (+7/-0)
src/include/client/mir/client_platform.h (+3/-1)
src/include/client/mir/input/input_devices.h (+6/-2)
src/include/client/mir_toolkit/mir_buffer.h (+41/-16)
src/include/client/mir_toolkit/mir_presentation_chain.h (+51/-5)
src/include/common/mir/protobuf/protocol_version.h (+1/-1)
src/include/server/mir/default_server_configuration.h (+10/-2)
src/include/server/mir/input/input_probe.h (+9/-3)
src/include/server/mir/input/seat.h (+3/-3)
src/include/server/mir/scene/surface_observers.h (+1/-0)
src/include/server/mir/shell/basic_window_manager.h (+147/-292)
src/include/server/mir/shell/canonical_window_manager.h (+30/-80)
src/include/server/mir/shell/window_management_info.h (+103/-0)
src/platform/options/default_configuration.cpp (+0/-7)
src/platform/symbols.map (+7/-0)
src/platforms/CMakeLists.txt (+2/-2)
src/platforms/android/CMakeLists.txt (+3/-0)
src/platforms/android/client/android_client_platform.cpp (+3/-6)
src/platforms/android/client/android_client_platform.h (+1/-1)
src/platforms/android/client/buffer.cpp (+19/-0)
src/platforms/android/client/buffer.h (+4/-0)
src/platforms/android/client/symbols.map (+1/-1)
src/platforms/android/server/CMakeLists.txt (+2/-2)
src/platforms/android/server/buffer.h (+0/-1)
src/platforms/android/server/buffer_usage.h (+0/-40)
src/platforms/android/server/framebuffers.cpp (+1/-1)
src/platforms/android/server/gl_context.cpp (+1/-0)
src/platforms/android/server/gralloc.h (+15/-13)
src/platforms/android/server/gralloc_module.cpp (+18/-9)
src/platforms/android/server/gralloc_module.h (+12/-10)
src/platforms/android/server/graphic_buffer_allocator.cpp (+27/-36)
src/platforms/android/server/graphic_buffer_allocator.h (+0/-55)
src/platforms/android/server/hal_component_factory.cpp (+2/-2)
src/platforms/android/server/hal_component_factory.h (+2/-2)
src/platforms/android/server/platform.cpp (+2/-2)
src/platforms/android/server/resource_factory.cpp (+0/-1)
src/platforms/android/utils/CMakeLists.txt (+39/-11)
src/platforms/android/utils/android_graphics_region_factory.cpp (+1/-1)
src/platforms/android/utils/render_overlays.cpp (+7/-0)
src/platforms/android/utils/test_android_hardware_sanity.cpp (+52/-19)
src/platforms/common/client/mir/CMakeLists.txt (+1/-0)
src/platforms/common/client/mir/aging_buffer.cpp (+0/-5)
src/platforms/common/client/mir/aging_buffer.h (+4/-6)
src/platforms/evdev/CMakeLists.txt (+8/-1)
src/platforms/evdev/libinput_device.cpp (+39/-13)
src/platforms/evdev/libinput_device.h (+2/-4)
src/platforms/evdev/libinput_device_ptr.cpp (+2/-2)
src/platforms/evdev/libinput_device_ptr.h (+1/-1)
src/platforms/evdev/libinput_ptr.cpp (+9/-2)
src/platforms/evdev/libinput_ptr.h (+2/-1)
src/platforms/evdev/platform.cpp (+44/-98)
src/platforms/evdev/platform.h (+6/-14)
src/platforms/evdev/platform_factory.cpp (+1/-3)
src/platforms/mesa/client/client_buffer.cpp (+20/-0)
src/platforms/mesa/client/client_buffer.h (+4/-0)
src/platforms/mesa/client/client_platform.cpp (+3/-6)
src/platforms/mesa/client/client_platform.h (+1/-1)
src/platforms/mesa/client/symbols.map (+1/-1)
src/platforms/mesa/server/common/anonymous_shm_file.cpp (+1/-1)
src/platforms/mesa/server/kms/display.cpp (+9/-3)
src/platforms/mesa/server/kms/display.h (+2/-1)
src/platforms/mesa/server/x11/input/input_device.cpp (+137/-1)
src/platforms/mesa/server/x11/input/input_device.h (+14/-1)
src/platforms/mesa/server/x11/input/input_platform.cpp (+164/-226)
src/protobuf/mir_protobuf.proto (+6/-0)
src/server/compositor/multi_monitor_arbiter.cpp (+1/-1)
src/server/compositor/stream.cpp (+2/-1)
src/server/default_server_configuration.cpp (+0/-5)
src/server/frontend/CMakeLists.txt (+1/-1)
src/server/frontend/authorizing_display_changer.cpp (+10/-17)
src/server/frontend/authorizing_display_changer.h (+18/-7)
src/server/frontend/default_configuration.cpp (+2/-1)
src/server/frontend/default_ipc_factory.cpp (+14/-10)
src/server/frontend/default_ipc_factory.h (+4/-1)
src/server/frontend/protobuf_buffer_packer.cpp (+2/-0)
src/server/frontend/session_mediator.cpp (+15/-1)
src/server/frontend/session_mediator.h (+5/-1)
src/server/graphics/default_configuration.cpp (+12/-2)
src/server/graphics/nested/mir_client_host_connection.cpp (+191/-4)
src/server/graphics/nested/mir_client_host_connection.h (+34/-3)
src/server/input/basic_seat.cpp (+9/-10)
src/server/input/basic_seat.h (+7/-6)
src/server/input/default_configuration.cpp (+97/-40)
src/server/input/default_device.cpp (+5/-4)
src/server/input/default_device.h (+2/-2)
src/server/input/default_input_device_hub.cpp (+21/-4)
src/server/input/default_input_device_hub.h (+11/-2)
src/server/input/default_input_manager.cpp (+8/-3)
src/server/input/default_input_manager.h (+10/-3)
src/server/input/input_probe.cpp (+68/-48)
src/server/input/key_repeat_dispatcher.cpp (+34/-15)
src/server/input/key_repeat_dispatcher.h (+7/-1)
src/server/input/seat_input_device_tracker.cpp (+1/-0)
src/server/report/lttng/CMakeLists.txt (+10/-1)
src/server/scene/application_session.cpp (+22/-19)
src/server/scene/application_session.h (+2/-0)
src/server/scene/basic_surface.cpp (+14/-7)
src/server/shell/CMakeLists.txt (+3/-1)
src/server/shell/basic_window_manager.cpp (+311/-0)
src/server/shell/canonical_window_manager.cpp (+90/-281)
src/server/shell/window_management_info.cpp (+301/-0)
src/server/symbols.map (+47/-0)
src/utils/CMakeLists.txt (+3/-1)
src/utils/in.cpp (+115/-0)
tests/acceptance-tests/CMakeLists.txt (+3/-0)
tests/acceptance-tests/test_client_cookie.cpp (+8/-5)
tests/acceptance-tests/test_client_input.cpp (+114/-17)
tests/acceptance-tests/test_client_logging.cpp (+102/-0)
tests/acceptance-tests/test_client_scaling.cpp (+10/-6)
tests/acceptance-tests/test_display_configuration.cpp (+15/-15)
tests/acceptance-tests/test_latency.cpp (+49/-5)
tests/acceptance-tests/test_nested_input.cpp (+58/-2)
tests/acceptance-tests/test_nested_mir.cpp (+1/-1)
tests/acceptance-tests/test_new_display_configuration.cpp (+766/-0)
tests/acceptance-tests/test_prompt_session_client_api.cpp (+65/-1)
tests/acceptance-tests/test_server_startup.cpp (+29/-0)
tests/acceptance-tests/throwback/CMakeLists.txt (+3/-0)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+2/-2)
tests/acceptance-tests/throwback/test_client_library_errors.cpp (+1/-1)
tests/acceptance-tests/throwback/test_presentation_chain.cpp (+358/-0)
tests/include/mir/test/doubles/fake_alarm_factory.h (+7/-30)
tests/include/mir/test/doubles/mock_alloc_adaptor.h (+0/-45)
tests/include/mir/test/doubles/mock_client_buffer.h (+56/-0)
tests/include/mir/test/doubles/mock_input_seat.h (+3/-4)
tests/include/mir/test/doubles/mock_libinput.h (+29/-1)
tests/include/mir/test/doubles/mock_udev.h (+46/-0)
tests/include/mir/test/doubles/mock_x11.h (+3/-0)
tests/include/mir/test/doubles/null_client_buffer.h (+5/-0)
tests/include/mir/test/doubles/stub_client_buffer.h (+5/-0)
tests/include/mir/test/input_devices_matcher.h (+58/-0)
tests/include/mir_test_framework/client_platform_factory.h (+20/-2)
tests/include/mir_test_framework/fake_input_server_configuration.h (+2/-1)
tests/include/mir_test_framework/libinput_environment.h (+91/-0)
tests/include/mir_test_framework/stub_client_platform_factory.h (+1/-1)
tests/include/mir_test_framework/stubbed_server_configuration.h (+1/-0)
tests/include/mir_test_framework/testing_server_configuration.h (+1/-0)
tests/integration-tests/CMakeLists.txt (+0/-4)
tests/integration-tests/input/test_single_seat_setup.cpp (+54/-2)
tests/integration-tests/test_buffer_scheduling.cpp (+28/-11)
tests/mir_test/current_thread_name.cpp (+0/-3)
tests/mir_test/display_config_matchers.cpp (+150/-62)
tests/mir_test_doubles/CMakeLists.txt (+6/-0)
tests/mir_test_doubles/fake_alarm_factory.cpp (+60/-15)
tests/mir_test_doubles/mock_libinput.cpp (+276/-6)
tests/mir_test_doubles/mock_udev.cpp (+53/-0)
tests/mir_test_doubles/mock_x11.cpp (+25/-1)
tests/mir_test_doubles/stub_display_configuration.cpp (+38/-9)
tests/mir_test_doubles/test_protobuf_client.cpp (+2/-0)
tests/mir_test_doubles/triggered_main_loop.cpp (+1/-0)
tests/mir_test_framework/CMakeLists.txt (+9/-4)
tests/mir_test_framework/declarative_placement_window_manage_policy.cpp (+1/-1)
tests/mir_test_framework/executable_path.cpp (+6/-6)
tests/mir_test_framework/fake_input_device_impl.cpp (+5/-0)
tests/mir_test_framework/fake_input_device_impl.h (+1/-0)
tests/mir_test_framework/fake_input_server_configuration.cpp (+4/-3)
tests/mir_test_framework/libinput_environment.cpp (+125/-0)
tests/mir_test_framework/placement_applying_shell.cpp (+20/-0)
tests/mir_test_framework/stub_client_platform_factory.cpp (+2/-3)
tests/mir_test_framework/stub_input_platform.cpp (+10/-1)
tests/mir_test_framework/stubbed_server_configuration.cpp (+2/-0)
tests/mir_test_framework/symbols-client.map (+1/-1)
tests/mir_test_framework/testing-cursor-theme/CMakeLists.txt (+2/-0)
tests/mir_test_framework/testing_server_options.cpp (+2/-0)
tests/mir_test_framework/udev-recordings/CMakeLists.txt (+1/-1)
tests/mir_test_framework/udev_environment.cpp (+1/-1)
tests/performance-tests/test_glmark2-es2-mir.cpp (+94/-10)
tests/umock-acceptance-tests/CMakeLists.txt (+1/-0)
tests/unit-tests/CMakeLists.txt (+70/-6)
tests/unit-tests/client/CMakeLists.txt (+1/-0)
tests/unit-tests/client/android/test_egl_native_surface_interpreter.cpp (+14/-33)
tests/unit-tests/client/mesa/test_native_surface.cpp (+2/-28)
tests/unit-tests/client/test_aging_buffer.cpp (+20/-0)
tests/unit-tests/client/test_buffer_vault.cpp (+36/-28)
tests/unit-tests/client/test_client_buffer_depository.cpp (+14/-23)
tests/unit-tests/client/test_client_buffer_stream.cpp (+18/-16)
tests/unit-tests/client/test_client_mir_surface.cpp (+2/-2)
tests/unit-tests/client/test_client_platform.cpp (+1/-1)
tests/unit-tests/client/test_connection_resource_map.cpp (+21/-1)
tests/unit-tests/client/test_mir_buffer.cpp (+200/-0)
tests/unit-tests/client/test_mir_connection.cpp (+202/-5)
tests/unit-tests/client/test_presentation_chain.cpp (+71/-16)
tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+16/-0)
tests/unit-tests/client/test_stream_transport.cpp (+1/-1)
tests/unit-tests/compositor/test_buffer_queue.cpp (+24/-8)
tests/unit-tests/compositor/test_multi_monitor_arbiter.cpp (+55/-0)
tests/unit-tests/dispatch/test_threaded_dispatcher.cpp (+1/-1)
tests/unit-tests/frontend/CMakeLists.txt (+1/-1)
tests/unit-tests/frontend/stress_protobuf_communicator.cpp (+2/-81)
tests/unit-tests/frontend/test_authorizing_display_changer.cpp (+78/-34)
tests/unit-tests/frontend/test_event_sender.cpp (+4/-25)
tests/unit-tests/frontend/test_session_mediator.cpp (+56/-11)
tests/unit-tests/graphics/CMakeLists.txt (+6/-1)
tests/unit-tests/graphics/android/CMakeLists.txt (+3/-4)
tests/unit-tests/graphics/android/test_buffer.cpp (+0/-2)
tests/unit-tests/graphics/android/test_framebuffers.cpp (+22/-46)
tests/unit-tests/graphics/android/test_gralloc.cpp (+51/-72)
tests/unit-tests/graphics/android/test_graphic_buffer_allocator.cpp (+17/-27)
tests/unit-tests/graphics/android/test_output_builder.cpp (+0/-14)
tests/unit-tests/graphics/mesa/CMakeLists.txt (+1/-0)
tests/unit-tests/graphics/mesa/common/CMakeLists.txt (+6/-1)
tests/unit-tests/graphics/mesa/kms/CMakeLists.txt (+2/-1)
tests/unit-tests/graphics/mesa/kms/test_display_configuration.cpp (+86/-5)
tests/unit-tests/graphics/mesa/x11/CMakeLists.txt (+2/-1)
tests/unit-tests/input/CMakeLists.txt (+9/-6)
tests/unit-tests/input/android/CMakeLists.txt (+1/-0)
tests/unit-tests/input/android/test_input_consumer.cpp (+253/-0)
tests/unit-tests/input/evdev/test_evdev_device_detection.cpp (+26/-27)
tests/unit-tests/input/evdev/test_evdev_input_platform.cpp (+36/-115)
tests/unit-tests/input/evdev/test_libinput_device.cpp (+170/-395)
tests/unit-tests/input/test_default_device.cpp (+5/-7)
tests/unit-tests/input/test_default_input_device_hub.cpp (+31/-16)
tests/unit-tests/input/test_default_input_manager.cpp (+2/-9)
tests/unit-tests/input/test_input_platform_probing.cpp (+29/-11)
tests/unit-tests/input/test_key_repeat_dispatcher.cpp (+60/-4)
tests/unit-tests/input/test_x11_platform.cpp (+37/-1)
tests/unit-tests/input/test_xcursor_loader.cpp (+1/-1)
tests/unit-tests/input_recordings/quanta_touchscreen/device.prop (+0/-30)
tests/unit-tests/scene/test_basic_surface.cpp (+96/-27)
tests/unit-tests/test_mir_cookie.cpp (+50/-0)
tests/unit-tests/test_module_deleter.cpp (+2/-2)
tests/unit-tests/test_shared_library_prober.cpp (+1/-1)
tools/abi-check-mirclient-skip-symbols (+0/-1)
tools/abi-check-mircommon-skip-symbols (+6/-0)
tools/abi-check-mirserver-skip-symbols (+9/-0)
tools/abi_check.sh (+273/-43)
tools/generate-abi-base-dump.sh (+0/-20)
tools/lib_descriptor.xml.skel (+1/-0)
tools/setup-partial-armhf-chroot.sh (+2/-1)
tools/ubsan-suppressions (+2/-0)
To merge this branch: bzr merge lp:mir/0.21
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Daniel van Vugt Approve
Mir CI Bot continuous-integration Needs Fixing
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+289443@code.launchpad.net

Commit message

Mir 0.21.0 release

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3410
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/7/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/527
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/557
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/549
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/549
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/537
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/537/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/537
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/537/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/537
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/537/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/537
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/537/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/537
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/537/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/7/rebuild

review: Approve (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 :

debian/changelog:
  - 17 fixes listed but there are 27 in https://launchpad.net/mir/+milestone/0.21.0
  - some enhancements not mentioned
  - "No ABIs changed" could be expressed more simply

review: Needs Fixing
lp:mir/0.21 updated
3411. By Daniel van Vugt

Fix up debian/changelog

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Are these not ABI breaks?

include/server/mir/scene/surface.h
include/server/mir/shell/surface_specification.h

review: Needs Information
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3411
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/8/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/533
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/563
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/555
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/555
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/543/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/543
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/543/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/8/rebuild

review: Approve (continuous-integration)
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 :

> Are these not ABI breaks?
>
> include/server/mir/scene/surface.h
> include/server/mir/shell/surface_specification.h

Looks like it to me.

We ought to have detected this earlier.

review: Needs Fixing
lp:mir/0.21 updated
3412. By Alberto Aguirre

merge lp:~kdub/mir/unbreak-abi-0.21

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3412
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/9/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/539
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/569
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/561
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/561
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/549
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/549/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/549
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/549/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/549
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/549/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/549
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/549/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/549
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/549/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/9/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Nice work on the 'unbreak' effort.

Unfortunately I just noticed another one. The changelog incorrectly states:

   mirclientplatform ABI unchanged at 4

but actually we did break it:

   CMakeLists.txt:set(MIR_CLIENT_PLATFORM_ABI 5)

So either it's a serious break and needs unbreaking, or it's a break we can live with and just the changelog needs correcting.

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

> but actually we did break it:
>
> CMakeLists.txt:set(MIR_CLIENT_PLATFORM_ABI 5)
>
> So either it's a serious break and needs unbreaking, or it's a break we can
> live with and just the changelog needs correcting.

That's not a client facing ABI, so we just need to update the changelog.

OTOH we clearly have a problem with our development process if we only spot this during the release.

lp:mir/0.21 updated
3413. By Alberto Aguirre

debian: mir-android-diagnostics arch list should match mir-platform-graphics-android8

Cherry picked from lp:mir r3410

3414. By Alberto Aguirre

changelog: mirclientplatform actually changed

3415. By Alberto Aguirre

fix ODR related build issues in xenial-armhf

Cherry picked from lp:mir r3413

3416. By Alberto Aguirre

disable tests that fail on silo builders due to kernel issue.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3416
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/10/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/549
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/579
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/571
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/571
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/559
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/559/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/559
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/559/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/559
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/559/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/559
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/559/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/559
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/559/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/10/rebuild

review: Approve (continuous-integration)
lp:mir/0.21 updated
3417. By Daniel van Vugt

debian/changelog: Can't say "no ABI breaks" any more.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Another weak, possibly unimportant ABI break. Although if this header is public it suggests some external project is using it (and will break):

include/test/mir_test_framework/fake_input_device.h :
> virtual void emit_device_removal() = 0;

It's near the start of the vtable too.

review: Needs Information
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3417
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/11/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/551/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/581
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/573
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/573
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/561
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/561/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/561
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/561
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/561
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/561/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/11/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Ignore that failure, it's happening on all branches right now.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also ignore my comment about mir_test_framework. That's just a bunch of OBJECT and STATIC libraries so no ABI concerns there.

review: Approve
lp:mir/0.21 updated
3418. By Daniel van Vugt

No change. Try again, Jenkins.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3418
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/13/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/567
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/603
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/595
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/595
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/577/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/577
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/577/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/13/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve
lp:mir/0.21 updated
3419. By Alberto Aguirre

Fix latest mirclient symbol stanza

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3419
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/14/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/581
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/617
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/609
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/609
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/591
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/591/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/591
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/591/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/591
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/591/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/591
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/591/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/591
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/591/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/14/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

r3419 has incorrectly renamed stanza 'MIR_CLIENT_9v20' to 'MIR_CLIENT_9v21'. It should only add a new stanza (new functions) or coalesce them all into a single one (on ABI break).

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, the preferred syntax (last time we discussed it anyway) for new stanzas is "MIR_CLIENT_0.21". The old stanzas need to stay unchanged of course.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, that first comment is moot in the overall diff to lp:mir/0.20 - only the second one needs fixing still. The new stanza should be called MIR_CLIENT_0.21 (which is also what doc/dso_versioning_guide.md says).

lp:mir/0.21 updated
3420. By Daniel van Vugt

Corrected src/client/symbols.map naming

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

And more errors found :S ...

src/platform/symbols.map: New symbol added to old stanza:

    mir::udev::Context::ctx*;

src/server/symbols.map: Many new symbols added to old stanzas:

+ mir::shell::BasicWindowManager::active_display*;
+ mir::shell::BasicWindowManager::add_display*;
+ mir::shell::BasicWindowManager::add_session*;
+ mir::shell::BasicWindowManager::add_surface*;
+ mir::shell::BasicWindowManager::BasicWindowManager*;
...

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is becoming a mess. Maybe we should fix up all the symbols.map mistakes on lp:mir first, and then port the corrections in here.

lp:mir/0.21 updated
3421. By Daniel van Vugt

Corrections to a couple of symbols.maps: New symbols go in new stanzas
when there is no ABI break.

The diff against lp:mir/0.20 is now cleaner and more obvious too.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed. But we should wait for the same corrections to land on lp:mir and ensure it's in sync with this one before proceeding.

review: Needs Information
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3420
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/15/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/587/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/623
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/615
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/615
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/597/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/597/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/597/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/597/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/597
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/597/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/597/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/15/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Just waiting on agreement from trunk now, so we don't diverge:
https://code.launchpad.net/~mir-team/mir/forward-port-0.21-symbols-corrections/+merge/290004

review: Needs Information
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3421
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/16/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/590/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/626
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/618
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/618
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/600/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/600/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/600/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/600/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/600/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/600
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/600/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/16/rebuild

review: Needs Fixing (continuous-integration)
lp:mir/0.21 updated
3422. By Alberto Aguirre

merge lp:mir/ubuntu

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3422
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/17/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/599/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/636
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/628
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/628
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/609
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/609/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/609
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/609/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/609/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/609/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/609
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/609/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/609
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/609/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/17/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3422
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/18/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/607/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/644
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/636
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/636
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/617/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/617/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/18/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks good now.

review: Approve
lp:mir/0.21 updated
3423. By Andreas Pokorny

disable key repeats on the mx4 touchscreen

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:mir/0.21 updated
3424. By Alberto Aguirre

Mention fix for lp:1549701 in changelog

3425. By Alberto Aguirre

"linux/input-event-codes.h" does not exist for older kernels

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3425
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/20/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/656/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/693
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/685
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/685
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/666/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/666/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/666
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/666/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/666
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/666/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/666/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/20/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Still seems OK although CI needs some TLC:

00:55:22 The following tests FAILED:
00:55:22 11 - mir_acceptance_tests (Failed)
00:55:22 13 - mir_acceptance_tests---MIR_SERVER_NBUFFERS=0--- (Failed)
00:55:22 17 - mir_integration_tests (Failed)

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Tested on krillin, good on this device!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '3rd_party/CMakeLists.txt'
--- 3rd_party/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ 3rd_party/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -8,8 +8,6 @@
8 )8 )
99
10set(MIR_3RD_PARTY_INCLUDE_DIRECTORIES ${MIR_3RD_PARTY_INCLUDE_DIRECTORIES} PARENT_SCOPE)10set(MIR_3RD_PARTY_INCLUDE_DIRECTORIES ${MIR_3RD_PARTY_INCLUDE_DIRECTORIES} PARENT_SCOPE)
11set(MIR_INPUT_ANDROID_COMPILE_FLAGS ${MIR_INPUT_ANDROID_COMPILE_FLAGS}
12 PARENT_SCOPE)
1311
14include_directories(${PROJECT_SOURCE_DIR}/src/include/cookie)12include_directories(${PROJECT_SOURCE_DIR}/src/include/cookie)
15include_directories(${PROJECT_SOURCE_DIR}/src/include/common)13include_directories(${PROJECT_SOURCE_DIR}/src/include/common)
1614
=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h'
--- 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2016-01-29 08:18:22 +0000
+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2016-03-30 00:11:41 +0000
@@ -554,6 +554,7 @@
554 }554 }
555555
556protected:556protected:
557 float getAccumulatedAxisValue(int32_t axis, size_t pointerIndex) const;
557 int32_t mAction;558 int32_t mAction;
558 int32_t mFlags;559 int32_t mFlags;
559 int32_t mEdgeFlags;560 int32_t mEdgeFlags;
560561
=== modified file '3rd_party/android-input/android/frameworks/base/services/input/Input.cpp'
--- 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2016-01-29 08:18:22 +0000
+++ 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2016-03-30 00:11:41 +0000
@@ -359,12 +359,29 @@
359 return &mSamplePointerCoords[getHistorySize() * getPointerCount() + pointerIndex];359 return &mSamplePointerCoords[getHistorySize() * getPointerCount() + pointerIndex];
360}360}
361361
362float MotionEvent::getAccumulatedAxisValue(int32_t axis, size_t pointerIndex) const {
363 float acc = 0;
364 auto const pointerCount = getPointerCount();
365 for (size_t i = 0, num_entries = getHistorySize() + 1; i != num_entries; ++i)
366 acc += mSamplePointerCoords[i * pointerCount + pointerIndex].getAxisValue(axis);
367 return acc;
368}
369
362float MotionEvent::getRawAxisValue(int32_t axis, size_t pointerIndex) const {370float MotionEvent::getRawAxisValue(int32_t axis, size_t pointerIndex) const {
363 return getRawPointerCoords(pointerIndex)->getAxisValue(axis);371 switch (axis)
372 {
373 case AMOTION_EVENT_AXIS_RX: // joystick rotation axis are abused as relative x and y
374 case AMOTION_EVENT_AXIS_RY:
375 case AMOTION_EVENT_AXIS_VSCROLL:
376 case AMOTION_EVENT_AXIS_HSCROLL:
377 return getAccumulatedAxisValue(axis, pointerIndex);
378 default:
379 return getRawPointerCoords(pointerIndex)->getAxisValue(axis);
380 }
364}381}
365382
366float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const {383float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const {
367 float value = getRawPointerCoords(pointerIndex)->getAxisValue(axis);384 float value = getRawAxisValue(axis, pointerIndex);
368 switch (axis) {385 switch (axis) {
369 case AMOTION_EVENT_AXIS_X:386 case AMOTION_EVENT_AXIS_X:
370 return value + mXOffset;387 return value + mXOffset;
371388
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-03-15 03:05:51 +0000
+++ CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -28,12 +28,14 @@
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)
31set(MIR_VERSION_MINOR 20)31set(MIR_VERSION_MINOR 21)
32set(MIR_VERSION_PATCH 3)32set(MIR_VERSION_PATCH 0)
3333
34add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})34add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
35add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})35add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
36add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH})36add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH})
37add_definitions(-D_GNU_SOURCE)
38add_definitions(-D_FILE_OFFSET_BITS=64)
3739
38set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH})40set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH})
3941
@@ -81,6 +83,11 @@
81if(MIR_LINK_TIME_OPTIMIZATION)83if(MIR_LINK_TIME_OPTIMIZATION)
82 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")84 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
83 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")85 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
86 if(${CMAKE_COMPILER_IS_GNUCXX})
87 set(CMAKE_NM "gcc-nm")
88 set(CMAKE_AR "gcc-ar")
89 set(CMAKE_RANLIB "gcc-ranlib")
90 endif()
84endif()91endif()
8592
86string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)93string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)
@@ -110,6 +117,7 @@
110 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")117 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
111 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread")118 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread")
112 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")119 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")
120 link_libraries(tsan) # Workaround for LP:1413474
113elseif(cmake_build_type_lower MATCHES "ubsanitizer")121elseif(cmake_build_type_lower MATCHES "ubsanitizer")
114 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")122 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")
115 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")123 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")
@@ -163,6 +171,8 @@
163171
164list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM)172list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM)
165173
174option(MIR_ENABLE_TESTS "Build tests" ON)
175
166foreach(platform IN LISTS MIR_PLATFORM)176foreach(platform IN LISTS MIR_PLATFORM)
167 if (platform STREQUAL "mesa-kms")177 if (platform STREQUAL "mesa-kms")
168 set(MIR_BUILD_PLATFORM_MESA_KMS TRUE)178 set(MIR_BUILD_PLATFORM_MESA_KMS TRUE)
@@ -214,7 +224,12 @@
214add_subdirectory(src/)224add_subdirectory(src/)
215include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})225include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
216226
217option(MIR_ENABLE_TESTS "Build tests" ON)227# This copy is used by users of mirplatforminputevdev
228if ("${LIBINPUT_VERSION}" VERSION_LESS "1.1")
229 add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=0)
230else ()
231 add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)
232endif ()
218233
219add_subdirectory(benchmarks/)234add_subdirectory(benchmarks/)
220add_subdirectory(examples/)235add_subdirectory(examples/)
@@ -244,8 +259,6 @@
244include (cmake/Doxygen.cmake)259include (cmake/Doxygen.cmake)
245include (cmake/ABICheck.cmake)260include (cmake/ABICheck.cmake)
246261
247add_subdirectory(snappy)
248
249add_custom_target(ptest262add_custom_target(ptest
250 COMMAND "${CMAKE_SOURCE_DIR}/tools/run_ctests.sh" "--cost-file" "${CMAKE_BINARY_DIR}/ptest_ctest_cost_data.txt" "sh ${CMAKE_BINARY_DIR}/discover_all_tests.sh" "--" "$$ARGS"263 COMMAND "${CMAKE_SOURCE_DIR}/tools/run_ctests.sh" "--cost-file" "${CMAKE_BINARY_DIR}/ptest_ctest_cost_data.txt" "sh ${CMAKE_BINARY_DIR}/discover_all_tests.sh" "--" "$$ARGS"
251 )264 )
252265
=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
--- benchmarks/frame-uniformity/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ benchmarks/frame-uniformity/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -15,6 +15,12 @@
15 ${PROJECT_SOURCE_DIR}/tests/include/15 ${PROJECT_SOURCE_DIR}/tests/include/
16)16)
1717
18# We use mir-test-{doubles,framework}, which builds differently based on
19# the primary test platform.
20if (MIR_TEST_PLATFORM STREQUAL "android")
21 add_definitions(-DANDROID)
22endif()
23
18mir_add_wrapped_executable(frame_uniformity_test_client NOINSTALL24mir_add_wrapped_executable(frame_uniformity_test_client NOINSTALL
19 touch_measuring_client.cpp25 touch_measuring_client.cpp
20 touch_producing_server.cpp26 touch_producing_server.cpp
2127
=== modified file 'cmake/ABICheck.cmake'
--- cmake/ABICheck.cmake 2016-01-29 08:18:22 +0000
+++ cmake/ABICheck.cmake 2016-03-30 00:11:41 +0000
@@ -1,33 +1,29 @@
1cmake_minimum_required (VERSION 2.6)1cmake_minimum_required (VERSION 2.6)
22
3find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker)3find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker)
4
5if (NOT ABI_COMPLIANCE_CHECKER)4if (NOT ABI_COMPLIANCE_CHECKER)
6 message(WARNING "no ABI checks possible: abi-compliance-checker was not found")5 message(WARNING "no ABI checks possible: abi-compliance-checker was not found")
7 return()6 return()
8endif()7endif()
98
9set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST})
10execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE)10execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE)
1111
12set(ABI_CHECK_BASE_DIR $ENV{MIR_ABI_CHECK_BASE_DIR})12set(ABI_DUMPS_DIR "${CMAKE_BINARY_DIR}/abi_dumps/${ABI_CHECK_TARGET_MACH}")
13set(ABI_DUMP_PREBUILT_LIBDIR $ENV{MIR_ABI_DUMP_PREBUILT_LIBDIR})13
14set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST})14# Given a list of key value pairs such as "key1 value1 key2 value2...keyN valueN"
1515# extract the value corresponding to the given key
16if ("${ABI_CHECK_BASE_DIR}" STREQUAL "")16function(get_value_for_key a_list key value)
17 set(ABI_CHECK_BASE_DIR ${CMAKE_BINARY_DIR}/mir-prev-release/obj-${ABI_CHECK_TARGET_MACH}/abi_dumps)17 list(FIND a_list ${key} idx)
18endif()
19
20set(ABI_DUMPS_DIR_PREFIX "abi_dumps/${ABI_CHECK_TARGET_MACH}")
21
22function(get_value_for_arg alist name output)
23 list(FIND alist ${name} idx)
24 if (idx GREATER -1)18 if (idx GREATER -1)
25 math(EXPR idx "${idx} + 1")19 math(EXPR idx "${idx} + 1")
26 list(GET alist ${idx} tmp_out)20 list(GET a_list ${idx} tmp_value)
27 set(${output} "${tmp_out}" PARENT_SCOPE)21 set(${value} "${tmp_value}" PARENT_SCOPE)
28 endif()22 endif()
29endfunction()23endfunction()
3024
25# Makes a one-entry per line list of all include paths used
26# to compile the given library target
31function(get_includes libname output)27function(get_includes libname output)
32 get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES)28 get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES)
33 list(REMOVE_DUPLICATES lib_includes)29 list(REMOVE_DUPLICATES lib_includes)
@@ -35,52 +31,44 @@
35 set(${output} "${tmp_out}" PARENT_SCOPE)31 set(${output} "${tmp_out}" PARENT_SCOPE)
36endfunction()32endfunction()
3733
34# Creates the XML descriptor file that describes the given library target
35# suitable for abi-compliance-checker
38function(make_lib_descriptor name)36function(make_lib_descriptor name)
39 set(libname "mir${name}")37 set(libname "mir${name}")
4038
41 list(FIND ARGN "INCLUDE_PRIVATE" include_private)39 # Optional argument LIBRARY_HEADER - use the given header to describe
42 if (include_private GREATER -1)40 # the binary library instead of assuming its described by include/<name>
43 set(private_headers "${CMAKE_SOURCE_DIR}/src/include/${name}")41 get_value_for_key("${ARGN}" "LIBRARY_HEADER" library_header)
44 endif()
45
46 get_value_for_arg("${ARGN}" "LIBRARY_HEADER" library_header)
47 if ("${library_header}" STREQUAL "")42 if ("${library_header}" STREQUAL "")
48 set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name}\n ${private_headers}")43 set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name}\n ${private_headers}")
49 else()44 else()
50 set(LIB_DESC_HEADERS ${library_header})45 set(LIB_DESC_HEADERS ${library_header})
51 endif()46 endif()
5247
48 # FIXME: Property "LOCATION" is now deprecated
53 if (NOT ${CMAKE_MAJOR_VERSION} LESS 3)49 if (NOT ${CMAKE_MAJOR_VERSION} LESS 3)
54 cmake_policy(SET CMP0026 OLD)50 cmake_policy(SET CMP0026 OLD)
55 endif()51 endif()
56 # TODO: Deprecate use of "LOCATION" (CMP0026) ...52 get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION)
57 if ("${ABI_DUMP_PREBUILT_LIBDIR}" STREQUAL "")53
58 get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION)
59 else()
60 get_property(liblocation TARGET ${libname} PROPERTY LOCATION)
61 get_filename_component(libfilename ${liblocation} NAME)
62 set(LIB_DESC_LIBS "${ABI_DUMP_PREBUILT_LIBDIR}/${libfilename}")
63 endif()
64
65 get_includes(${libname} LIB_DESC_INCLUDE_PATHS)54 get_includes(${libname} LIB_DESC_INCLUDE_PATHS)
66 set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}")55 set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}")
6756
68 get_value_for_arg("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS)57 # Optional EXCLUDE_HEADERS - a list
58 # while attempting an abi dump
59 get_value_for_key("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS)
6960
70 configure_file(${CMAKE_SOURCE_DIR}/tools/lib_descriptor.xml.skel ${libname}_desc.xml)61 configure_file(${CMAKE_SOURCE_DIR}/tools/lib_descriptor.xml.skel ${libname}_desc.xml)
71endfunction()62endfunction()
7263
73#These headers are not part of the libmircommon ABI
74set(mircommon-exclude-headers "${CMAKE_SOURCE_DIR}/src/include/common/mir/graphics/android\n ${CMAKE_SOURCE_DIR}/src/include/common/mir/input\n ${CMAKE_SOURCE_DIR}/src/include/common/mir/events")
75
76#These headers are not part of the libmirplatform ABI64#These headers are not part of the libmirplatform ABI
77set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input")65set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input")
7866
79make_lib_descriptor(client)67make_lib_descriptor(client)
80make_lib_descriptor(server)68make_lib_descriptor(server)
81make_lib_descriptor(common INCLUDE_PRIVATE EXCLUDE_HEADERS ${mircommon-exclude-headers})69make_lib_descriptor(common)
82make_lib_descriptor(cookie)70make_lib_descriptor(cookie)
83make_lib_descriptor(platform INCLUDE_PRIVATE EXCLUDE_HEADERS ${mirplatform-exclude-headers})71make_lib_descriptor(platform EXCLUDE_HEADERS ${mirplatform-exclude-headers})
84if(MIR_BUILD_PLATFORM_MESA_KMS)72if(MIR_BUILD_PLATFORM_MESA_KMS)
85make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h)73make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h)
86make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h)74make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h)
@@ -91,38 +79,21 @@
91endif()79endif()
92make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/)80make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/)
9381
94add_custom_target(abi-release-dump82
95 COMMAND /bin/sh -c '${CMAKE_SOURCE_DIR}/tools/generate-abi-base-dump.sh ${CMAKE_SOURCE_DIR}'83macro(_define_abi_dump_for libname)
96)84 set(ABI_DUMP_NAME ${ABI_DUMPS_DIR}/${libname}_next.abi.tar.gz)
97
98macro(_add_custom_abi_dump_command libname version)
99 set(ABI_DUMP_NAME ${ABI_DUMPS_DIR_PREFIX}/${libname}_${version}.abi.tar.gz)
100
101 if ("${ABI_DUMP_PREBUILT_LIBDIR}" STREQUAL "")
102 set(dump_depends ${libname})
103 else()
104 set(dump_depends "")
105 endif()
10685
107 add_custom_command(OUTPUT ${ABI_DUMP_NAME}86 add_custom_command(OUTPUT ${ABI_DUMP_NAME}
108 COMMAND abi-compliance-checker -gcc-path ${CMAKE_C_COMPILER} -l ${libname} -v1 ${version} -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml87 COMMAND abi-compliance-checker -gcc-path ${CMAKE_CXX_COMPILER} -l ${libname} -v1 next -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml
109 DEPENDS ${dump_depends}88 DEPENDS ${libname}
110 )89 )
111endmacro(_add_custom_abi_dump_command)
112
113macro(_define_abi_dump_for libname)
114 _add_custom_abi_dump_command(${libname} next)
115 add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME})90 add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME})
116 _add_custom_abi_dump_command(${libname} base)
117 add_custom_target(abi-dump-base-${libname} DEPENDS ${ABI_DUMP_NAME})
118endmacro(_define_abi_dump_for)91endmacro(_define_abi_dump_for)
11992
120macro(_define_abi_check_for libname) 93macro(_define_abi_check_for libname)
121 set(OLD_ABI_DUMP "${ABI_CHECK_BASE_DIR}/${ABI_CHECK_TARGET_MACH}/${libname}_base.abi.tar.gz")
122 set(NEW_ABI_DUMP ${ABI_DUMPS_DIR_PREFIX}/${libname}_next.abi.tar.gz)
123 add_custom_target(abi-check-${libname} 94 add_custom_target(abi-check-${libname}
124 COMMAND /bin/bash -c '${CMAKE_SOURCE_DIR}/tools/run_abi_compliance_checker.sh ${libname} ${CMAKE_BINARY_DIR}/mir-prev-release ${CMAKE_SOURCE_DIR} ${OLD_ABI_DUMP} ${NEW_ABI_DUMP}'95 COMMAND /bin/bash -c '${CMAKE_SOURCE_DIR}/tools/abi_check.sh ${libname} ${ABI_DUMPS_DIR} ${CMAKE_SOURCE_DIR}'
125 DEPENDS abi-dump-${libname} abi-release-dump96 DEPENDS abi-dump-${libname}
126 )97 )
127endmacro(_define_abi_check_for)98endmacro(_define_abi_check_for)
12899
@@ -138,12 +109,10 @@
138 _define_abi_dump_for(${libname})109 _define_abi_dump_for(${libname})
139 _define_abi_check_for(${libname})110 _define_abi_check_for(${libname})
140 list(APPEND abi-dump-list abi-dump-${libname})111 list(APPEND abi-dump-list abi-dump-${libname})
141 list(APPEND abi-dump-base-list abi-dump-base-${libname})
142 list(APPEND abi-check-list abi-check-${libname})112 list(APPEND abi-check-list abi-check-${libname})
143endforeach(libname)113endforeach(libname)
144114
145add_custom_target(abi-dump DEPENDS ${abi-dump-list})115add_custom_target(abi-dump DEPENDS ${abi-dump-list})
146add_custom_target(abi-dump-base DEPENDS ${abi-dump-base-list})
147add_custom_target(abi-check DEPENDS ${abi-check-list})116add_custom_target(abi-check DEPENDS ${abi-check-list})
148117
149if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST)118if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST)
150119
=== modified file 'cmake/FindGtestGmock.cmake'
--- cmake/FindGtestGmock.cmake 2016-01-29 08:18:22 +0000
+++ cmake/FindGtestGmock.cmake 2016-03-30 00:11:41 +0000
@@ -20,7 +20,7 @@
20set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)20set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
21set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)21set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
2222
23set(GTEST_CXX_FLAGS "-fPIC")23set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
24if (cmake_build_type_lower MATCHES "threadsanitizer")24if (cmake_build_type_lower MATCHES "threadsanitizer")
25 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")25 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")
26elseif (cmake_build_type_lower MATCHES "ubsanitizer")26elseif (cmake_build_type_lower MATCHES "ubsanitizer")
2727
=== modified file 'cmake/FindLibHardware.cmake'
--- cmake/FindLibHardware.cmake 2016-01-29 04:07:19 +0000
+++ cmake/FindLibHardware.cmake 2016-03-30 00:11:41 +0000
@@ -7,7 +7,7 @@
7INCLUDE(FindPackageHandleStandardArgs)7INCLUDE(FindPackageHandleStandardArgs)
88
9find_package( PkgConfig )9find_package( PkgConfig )
10pkg_search_module(ANDROID_HEADERS REQUIRED android-headers-19 android-headers)10pkg_search_module(ANDROID_HEADERS REQUIRED android-headers)
11set(LIBHARDWARE_INCLUDE_DIRS ${ANDROID_HEADERS_INCLUDE_DIRS})11set(LIBHARDWARE_INCLUDE_DIRS ${ANDROID_HEADERS_INCLUDE_DIRS})
1212
13find_library(LIBHARDWARE_LIBRARY13find_library(LIBHARDWARE_LIBRARY
1414
=== modified file 'cmake/MirCommon.cmake'
--- cmake/MirCommon.cmake 2016-02-12 04:02:11 +0000
+++ cmake/MirCommon.cmake 2016-03-30 00:11:41 +0000
@@ -52,12 +52,17 @@
52 set(${STR_VAR} "${tmp_str}" PARENT_SCOPE)52 set(${STR_VAR} "${tmp_str}" PARENT_SCOPE)
53endfunction()53endfunction()
5454
55function (mir_discover_tests_internal EXECUTABLE DETECT_FD_LEAKS)55function (mir_discover_tests_internal EXECUTABLE TEST_ENV_OPTIONS DETECT_FD_LEAKS )
56 # Set vars56 # Set vars
57 set(test_cmd_no_memcheck "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}")57 set(test_cmd_no_memcheck "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}")
58 set(test_cmd "${test_cmd_no_memcheck}")58 set(test_cmd "${test_cmd_no_memcheck}")
59 set(test_env ${ARGN})59 set(test_env ${ARGN} ${TEST_ENV_OPTIONS})
60 set(test_name ${EXECUTABLE})60
61 if (TEST_ENV_OPTIONS)
62 set(test_name ${EXECUTABLE}---${TEST_ENV_OPTIONS}---)
63 else()
64 set(test_name ${EXECUTABLE})
65 endif()
61 set(test_no_memcheck_filter)66 set(test_no_memcheck_filter)
62 set(test_exclusion_filter)67 set(test_exclusion_filter)
6368
@@ -82,6 +87,11 @@
82 set(test_exclusion_filter "${test_exclusion_filter}:ServerShutdown/OnSignalDeathTest.removes_endpoint/0")87 set(test_exclusion_filter "${test_exclusion_filter}:ServerShutdown/OnSignalDeathTest.removes_endpoint/0")
83 endif()88 endif()
8489
90 if(cmake_build_type_lower MATCHES "ubsanitizer")
91 list(APPEND test_env "UBSAN_OPTIONS=\"suppressions=${CMAKE_SOURCE_DIR}/tools/ubsan-suppressions print_stacktrace=1 die_after_fork=0\"")
92 set(test_exclusion_filter "${test_exclusion_filter}:*DeathTest*")
93 endif()
94
85 if(SYSTEM_SUPPORTS_O_TMPFILE EQUAL 1)95 if(SYSTEM_SUPPORTS_O_TMPFILE EQUAL 1)
86 set(test_exclusion_filter "${test_exclusion_filter}:AnonymousShmFile.*:MesaBufferAllocatorTest.software_buffers_dont_bypass:MesaBufferAllocatorTest.creates_software_rendering_buffer")96 set(test_exclusion_filter "${test_exclusion_filter}:AnonymousShmFile.*:MesaBufferAllocatorTest.software_buffers_dont_bypass:MesaBufferAllocatorTest.creates_software_rendering_buffer")
87 endif()97 endif()
@@ -115,11 +125,15 @@
115endfunction ()125endfunction ()
116126
117function (mir_discover_tests EXECUTABLE)127function (mir_discover_tests EXECUTABLE)
118 mir_discover_tests_internal(${EXECUTABLE} FALSE ${ARGN})128 mir_discover_tests_internal(${EXECUTABLE} "" FALSE ${ARGN})
119endfunction()129endfunction()
120130
121function (mir_discover_tests_with_fd_leak_detection EXECUTABLE)131function (mir_discover_tests_with_fd_leak_detection EXECUTABLE)
122 mir_discover_tests_internal(${EXECUTABLE} TRUE ${ARGN})132 mir_discover_tests_internal(${EXECUTABLE} "" TRUE ${ARGN})
133endfunction()
134
135function (mir_discover_tests_with_fd_leak_detection_and_env EXECUTABLE TEST_ENV_OPTION)
136 mir_discover_tests_internal(${EXECUTABLE} ${TEST_ENV_OPTION} TRUE ${ARGN})
123endfunction()137endfunction()
124138
125function (mir_add_memcheck_test)139function (mir_add_memcheck_test)
@@ -145,11 +159,15 @@
145 endif()159 endif()
146endfunction()160endfunction()
147161
148
149function (mir_precompiled_header TARGET HEADER)162function (mir_precompiled_header TARGET HEADER)
150 if (MIR_USE_PRECOMPILED_HEADERS)163 if (MIR_USE_PRECOMPILED_HEADERS)
151 get_property(TARGET_COMPILE_FLAGS TARGET ${TARGET} PROPERTY COMPILE_FLAGS)164 get_filename_component(HEADER_NAME ${HEADER} NAME)
165
152 get_property(TARGET_INCLUDE_DIRECTORIES TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES)166 get_property(TARGET_INCLUDE_DIRECTORIES TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES)
167
168 set(TARGET_COMPILE_DEFINITIONS "$<TARGET_PROPERTY:${TARGET},COMPILE_DEFINITIONS>")
169 set(TARGET_COMPILE_DEFINITIONS "$<$<BOOL:${TARGET_COMPILE_DEFINITIONS}>:-D$<JOIN:${TARGET_COMPILE_DEFINITIONS},\n-D>\n>")
170
153 foreach(dir ${TARGET_INCLUDE_DIRECTORIES})171 foreach(dir ${TARGET_INCLUDE_DIRECTORIES})
154 if (${dir} MATCHES "usr/include")172 if (${dir} MATCHES "usr/include")
155 set(TARGET_INCLUDE_DIRECTORIES_STRING "${TARGET_INCLUDE_DIRECTORIES_STRING} -isystem ${dir}")173 set(TARGET_INCLUDE_DIRECTORIES_STRING "${TARGET_INCLUDE_DIRECTORIES_STRING} -isystem ${dir}")
@@ -169,15 +187,44 @@
169 #187 #
170 # I'm unaware of a less roundabout method of getting the *actual* build flags for a target.188 # I'm unaware of a less roundabout method of getting the *actual* build flags for a target.
171 string(TOUPPER "${CMAKE_BUILD_TYPE}" UC_BUILD_TYPE)189 string(TOUPPER "${CMAKE_BUILD_TYPE}" UC_BUILD_TYPE)
172 separate_arguments(190
173 PCH_CXX_FLAGS UNIX_COMMAND191 # Lllloook at you, haaacker. A pa-pa-pathetic creature of meat and bone.
174 "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UC_BUILD_TYPE}} ${TARGET_COMPILE_FLAGS} ${TARGET_INCLUDE_DIRECTORIES_STRING}"192 #
175 )193 # It appears that we can *only* get the COMPILE_DEFINITIONS as a generator expression.
176194 # This wouldn't be so bad if http://www.kwwidgets.org/Bug/view.php?id=14353#c33712 didn't mean
195 # that you can't use generator expressions in custom commands.
196 #
197 # So!
198 # What we *can* do is generate a file with the contents of the generator expressions,
199 # then use gcc's @file mechanism...
200 set(FLAGS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_NAME}.compileflags")
201
202 file(
203 GENERATE
204 OUTPUT "${FLAGS_FILE}"
205 CONTENT "
206 ${CMAKE_CXX_FLAGS}
207 ${CMAKE_CXX_FLAGS_${UC_BUILD_TYPE}}
208 ${TARGET_INCLUDE_DIRECTORIES_STRING}
209 ${TARGET_COMPILE_DEFINITIONS}"
210 )
211
212 # HA HA!
213 #
214 # Of course, that has unescaped all the escaped \"s we have in the compile definitions.
215 # gcc treats the contents of @file exactly as if it came from the command line, so we need to
216 # re-escape them.
217 add_custom_command(
218 OUTPUT ${FLAGS_FILE}.processed
219 DEPENDS ${FLAGS_FILE}
220 # ESCAPE ALL THE THINGS!
221 COMMAND sh -c "sed s_\\\"_\\\\\\\\\\\"_g ${FLAGS_FILE} > ${FLAGS_FILE}.processed"
222 VERBATIM
223 )
177 add_custom_command(224 add_custom_command(
178 OUTPUT ${TARGET}_precompiled.hpp.gch225 OUTPUT ${TARGET}_precompiled.hpp.gch
179 DEPENDS ${HEADER}226 DEPENDS ${HEADER} ${FLAGS_FILE}.processed
180 COMMAND ${CMAKE_CXX_COMPILER} ${PCH_CXX_FLAGS} -x c++-header -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp.gch227 COMMAND ${CMAKE_CXX_COMPILER} @${FLAGS_FILE}.processed -x c++-header -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp.gch
181 )228 )
182229
183 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -include ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp -Winvalid-pch ")230 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -include ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp -Winvalid-pch ")
184231
=== modified file 'debian/changelog'
--- debian/changelog 2016-03-22 15:42:36 +0000
+++ debian/changelog 2016-03-30 00:11:41 +0000
@@ -1,3 +1,66 @@
1mir (0.21.0-0ubuntu1) UNRELEASED; urgency=medium
2
3 * New upstream release 0.21.0 (https://launchpad.net/mir/+milestone/0.21.0)
4 - ABI summary:
5 . mirclient ABI unchanged at 9
6 . mirserver ABI unchanged at 38
7 . mircommon ABI unchanged at 5
8 . mirplatform ABI unchanged at 11
9 . mirprotobuf ABI unchanged at 3
10 . mirplatformgraphics ABI unchaged at 8
11 . mirclientplatform ABI bumped to 5
12 . mirinputplatform ABI unchanged at 5
13 - Enhancements:
14 . New display enumeration API
15 . Added Android diagnostic tests to assist during porting to
16 new devices
17 . Added mir_demo_client_camera: a Video4Linux2 client
18 - Bugs fixed:
19 . Sometimes devices don't suspend - display turns back on
20 immediately (LP: #1549701)
21 . Mir crashed with exception 'failed to add sync point to command
22 buffer' (LP: #1554635)
23 . Mouse cursor is unusably slow in Unity 8 with a 1000Hz mouse
24 (LP: #1539009)
25 . Packaged mir_unit_tests binary is not suitable for general use
26 (LP: #1547015)
27 . [regression] Mir stops receiving input after a pause/resume
28 cycle (LP: #1548989)
29 . NBS (--nbuffers=0) causes software clients to crash with
30 std::exception::what: Failed to mmap buffer 13, "Permission denied")
31 (LP: #1550432)
32 . Fullscreen clients freeze when using NBS with multiple monitors
33 (LP: #1551536)
34 . [ FAILED ] DisplayConfigurationTest.output_position_is_independent_of_
35 orientation (LP: #1552065)
36 . The server-side use of MIR_SOCKET is confusing (LP: #1290345)
37 . [regression] FTBFS with -DMIR_LINK_TIME_OPTIMIZATION=on
38 -Duse_debflags=on (LP: #1350343)
39 . Mir On X (mesa-x11) keeps receiving mouse movement events even
40 when not focused (LP: #1528110)
41 . x11 platform: mouse cursor moves strange (LP: #1546324)
42 . Cross compiling to wily/vivid doesn't work (LP: #1549152)
43 . Rendering stutters when a new client establishes a connection
44 (LP: #1549359)
45 . 'mir_demo_server --test-client' crashes (SIGSEGV) when client
46 dies (LP: #1555620)
47 . [testfail] CI failure: TestClientInput.client_input_config_request_
48 receives_all_attached_devices (LP: #1555708)
49 . [regression] Mir FTBFS when MIR_ENABLE_TESTS=no (LP: #1556080)
50 . Mir-on-X11 doesn't exit (until it gets an event) (LP: #1556210)
51 . InputPlatformProbe.x11_platform_found_and_used_when_display_connection_
52 works breaks with old input drivers present (LP: #1543049)
53 . [regression] MIR_CLIENT_PERF_REPORT is missing window/surface
54 names (LP: #1546933)
55 . Installed binaries fail to run with mir_demo_server --test-client XXXX
56 (LP: #1556160)
57 . mir_demo_server --test-client [mir_demo_client_scroll|
58 mir_demo_client_flicker] fails (LP: #1556205)
59 . The contents of debian/mir-demos.examples are out of date and useless
60 (LP: #1557446)
61
62 -- Alberto Aguirre <alberto.aguirre@canonical.com> Thu, 17 Mar 2016 14:08:50 -0500
63
1mir (0.20.3+16.04.20160322-0ubuntu1) xenial; urgency=medium64mir (0.20.3+16.04.20160322-0ubuntu1) xenial; urgency=medium
265
3 [ Alberto Aguirre ]66 [ Alberto Aguirre ]
467
=== modified file 'debian/control'
--- debian/control 2016-02-08 17:31:22 +0000
+++ debian/control 2016-03-30 00:11:41 +0000
@@ -244,7 +244,7 @@
244 Mir is a display server running on linux systems, with a focus on efficiency,244 Mir is a display server running on linux systems, with a focus on efficiency,
245 robust operation and a well-defined driver model.245 robust operation and a well-defined driver model.
246 .246 .
247 Contains demo applications (with source) that use the Mir display server247 Contains demo applications that use the Mir display server
248248
249Package: mir-utils249Package: mir-utils
250Architecture: linux-any250Architecture: linux-any
@@ -275,6 +275,18 @@
275 .275 .
276 Contains a tool for stress testing the Mir display server276 Contains a tool for stress testing the Mir display server
277277
278Package: mir-android-diagnostics
279Architecture: i386 amd64 armhf
280Pre-Depends: ${misc:Pre-Depends}
281Depends: ${misc:Depends},
282 ${shlibs:Depends},
283Recommends: mir-demos,
284Description: Display Server for Ubuntu - android platform diagnostics utility
285 Mir is a display server running on linux systems, with a focus on efficiency,
286 robust operation and a well-defined driver model.
287 .
288 Contains a tool for checking the graphics components of android devices.
289
278Package: libmircommon5290Package: libmircommon5
279Section: libs291Section: libs
280Architecture: linux-any292Architecture: linux-any
@@ -345,7 +357,7 @@
345 Contains the shared libraries required for the Mir server to interact with357 Contains the shared libraries required for the Mir server to interact with
346 the input hardware using the evdev interface.358 the input hardware using the evdev interface.
347359
348Package: mir-client-platform-mesa4360Package: mir-client-platform-mesa5
349Section: libs361Section: libs
350Architecture: linux-any362Architecture: linux-any
351Multi-Arch: same363Multi-Arch: same
@@ -373,7 +385,7 @@
373 Contains header files required to use the platform specific capabilities of385 Contains header files required to use the platform specific capabilities of
374 the Mir Mesa backend.386 the Mir Mesa backend.
375387
376Package: mir-client-platform-android4388Package: mir-client-platform-android5
377Section: libs389Section: libs
378Architecture: i386 amd64 armhf390Architecture: i386 amd64 armhf
379Multi-Arch: same391Multi-Arch: same
@@ -395,7 +407,7 @@
395Depends: ${misc:Depends},407Depends: ${misc:Depends},
396 mir-platform-graphics-mesa-kms8,408 mir-platform-graphics-mesa-kms8,
397 mir-platform-graphics-mesa-x8,409 mir-platform-graphics-mesa-x8,
398 mir-client-platform-mesa4,410 mir-client-platform-mesa5,
399 mir-platform-input-evdev5,411 mir-platform-input-evdev5,
400Description: Display server for Ubuntu - desktop driver metapackage412Description: Display server for Ubuntu - desktop driver metapackage
401 Mir is a display server running on linux systems, with a focus on efficiency,413 Mir is a display server running on linux systems, with a focus on efficiency,
@@ -411,7 +423,7 @@
411Pre-Depends: ${misc:Pre-Depends}423Pre-Depends: ${misc:Pre-Depends}
412Depends: ${misc:Depends},424Depends: ${misc:Depends},
413 mir-platform-graphics-android8,425 mir-platform-graphics-android8,
414 mir-client-platform-android4,426 mir-client-platform-android5,
415 mir-platform-input-evdev5,427 mir-platform-input-evdev5,
416Description: Display server for Ubuntu - android driver metapackage428Description: Display server for Ubuntu - android driver metapackage
417 Mir is a display server running on linux systems, with a focus on efficiency,429 Mir is a display server running on linux systems, with a focus on efficiency,
418430
=== added file 'debian/mir-android-diagnostics.install'
--- debian/mir-android-diagnostics.install 1970-01-01 00:00:00 +0000
+++ debian/mir-android-diagnostics.install 2016-03-30 00:11:41 +0000
@@ -0,0 +1,1 @@
1usr/bin/mir_android_diagnostics
02
=== renamed file 'debian/mir-client-platform-android4.install' => 'debian/mir-client-platform-android5.install'
--- debian/mir-client-platform-android4.install 2016-01-29 08:18:22 +0000
+++ debian/mir-client-platform-android5.install 2016-03-30 00:11:41 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/mir/client-platform/android.so.41usr/lib/*/mir/client-platform/android.so.5
22
=== renamed file 'debian/mir-client-platform-mesa4.install' => 'debian/mir-client-platform-mesa5.install'
--- debian/mir-client-platform-mesa4.install 2016-01-29 08:18:22 +0000
+++ debian/mir-client-platform-mesa5.install 2016-03-30 00:11:41 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/mir/client-platform/mesa.so.41usr/lib/*/mir/client-platform/mesa.so.5
22
=== removed file 'debian/mir-demos.examples'
--- debian/mir-demos.examples 2013-08-29 03:48:16 +0000
+++ debian/mir-demos.examples 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1examples/basic.c
2examples/scroll.cpp
3examples/flicker.c
4examples/README
5examples/graphics.h
6examples/mir_image.h
7examples/graphics_utils.cpp
80
=== modified file 'debian/mir-test-tools.install'
--- debian/mir-test-tools.install 2016-01-29 08:18:22 +0000
+++ debian/mir-test-tools.install 2016-03-30 00:11:41 +0000
@@ -1,5 +1,6 @@
1usr/bin/mir_stress1usr/bin/mir_stress
2usr/bin/mir_unit_tests*2usr/bin/mir_unit_tests*
3usr/bin/mir_umock_unit_tests
3usr/bin/mir_acceptance_tests4usr/bin/mir_acceptance_tests
4usr/bin/mir_umock_acceptance_tests5usr/bin/mir_umock_acceptance_tests
5usr/bin/mir_integration_tests*6usr/bin/mir_integration_tests*
@@ -12,4 +13,4 @@
12usr/lib/*/mir/server-platform/graphics-throw.so13usr/lib/*/mir/server-platform/graphics-throw.so
13usr/lib/*/mir/server-platform/input-stub.so14usr/lib/*/mir/server-platform/input-stub.so
14usr/lib/*/mir/client-platform/dummy.so15usr/lib/*/mir/client-platform/dummy.so
15usr/share/udev_recordings16usr/share/mir-test-data
1617
=== modified file 'debian/mir-test-tools.lintian-overrides'
--- debian/mir-test-tools.lintian-overrides 2013-06-24 16:59:17 +0000
+++ debian/mir-test-tools.lintian-overrides 2016-03-30 00:11:41 +0000
@@ -1,2 +1,5 @@
1arch-dependent-file-in-usr-share
2binary-from-other-architecture
1package-name-doesnt-match-sonames3package-name-doesnt-match-sonames
2shlib-without-versioned-soname4shlib-without-versioned-soname
5unstripped-binary-or-object
36
=== modified file 'debian/mir-utils.install'
--- debian/mir-utils.install 2015-06-12 07:37:21 +0000
+++ debian/mir-utils.install 2016-03-30 00:11:41 +0000
@@ -1,4 +1,5 @@
1usr/bin/mirping1usr/bin/mirping
2usr/bin/mirout2usr/bin/mirout
3usr/bin/mirin
3usr/bin/mirscreencast4usr/bin/mirscreencast
4usr/bin/mirbacklight5usr/bin/mirbacklight
56
=== modified file 'debian/rules'
--- debian/rules 2016-01-29 08:18:22 +0000
+++ debian/rules 2016-03-30 00:11:41 +0000
@@ -20,7 +20,13 @@
20endif20endif
2121
22COMMON_CONFIGURE_OPTIONS = \22COMMON_CONFIGURE_OPTIONS = \
23 -DCMAKE_INSTALL_LIBEXECDIR="lib/$(DEB_HOST_MULTIARCH)/mir"23 -DCMAKE_INSTALL_LIBEXECDIR="lib/$(DEB_HOST_MULTIARCH)/mir"\
24
25ifeq ($(filter noopt,$(DEB_BUILD_OPTIONS)),noopt)
26 COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF
27else
28 COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=ON
29endif
2430
25override_dh_auto_configure:31override_dh_auto_configure:
26ifeq ($(DEB_HOST_ARCH),armhf)32ifeq ($(DEB_HOST_ARCH),armhf)
@@ -47,7 +53,7 @@
4753
48# TODO: we'll use a symbol file once mir is abi stable54# TODO: we'll use a symbol file once mir is abi stable
49override_dh_makeshlibs:55override_dh_makeshlibs:
50 dh_makeshlibs -V56 dh_makeshlibs -V -Nmir-test-tools
5157
52override_dh_install:58override_dh_install:
53# Nothing outside Mir should link to libmirprotobuf directly.59# Nothing outside Mir should link to libmirprotobuf directly.
@@ -56,3 +62,11 @@
56 -rm debian/tmp/usr/lib/*/libmirprotobuf.so62 -rm debian/tmp/usr/lib/*/libmirprotobuf.so
57 dh_install -p libmirplatform-dev -Xmesa --fail-missing63 dh_install -p libmirplatform-dev -Xmesa --fail-missing
58 dh_install --remaining-packages --fail-missing -Xjquery.js64 dh_install --remaining-packages --fail-missing -Xjquery.js
65
66# Don't try to strip libraries used as test data
67override_dh_strip:
68 dh_strip -Xmir-test-data
69
70# Don't try to find dependencies of libraries used as test data
71override_dh_shlibdeps:
72 dh_shlibdeps -Xmir-test-data
5973
=== removed file 'deploy-and-test.sh'
--- deploy-and-test.sh 2015-04-28 07:54:10 +0000
+++ deploy-and-test.sh 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1#!/bin/sh
2# WARNING: This script is slow. See: doc/avoid_deploy-and-test.md
3
4if [ ! -d build-android-arm ] ; then
5 echo "Built tree not found in $(pwd)/build-android-arm"
6 exit 1
7fi
8
9# Unpack umockdev requirements
10( cd build-android-arm ;
11 apt-get download umockdev:armhf libumockdev0:armhf ;
12 dpkg -x umockdev_*armhf*.deb . ;
13 dpkg -x libumockdev0_*armhf*.deb .
14)
15
16rundir=/home/phablet/mir/testing
17adb push build-android-arm/bin $rundir/bin
18adb push build-android-arm/lib $rundir/lib
19adb push build-android-arm/usr $rundir/usr
20
21libpath=$rundir/usr/lib/arm-linux-gnueabihf/:$rundir/lib
22run_with_env="LD_LIBRARY_PATH=$libpath $rundir/usr/bin/umockdev-run $rundir/bin/"
23
24adb shell "${run_with_env}mir_unit_tests"
25adb shell "${run_with_env}mir_integration_tests"
26adb shell "${run_with_env}mir_acceptance_tests"
270
=== modified file 'doc/abi_compatibility_tools.md'
--- doc/abi_compatibility_tools.md 2014-10-02 13:04:47 +0000
+++ doc/abi_compatibility_tools.md 2016-03-30 00:11:41 +0000
@@ -1,82 +1,26 @@
1Tools to track ABI compatibility {#abi_compatibility_tools}1Tracking ABI compatibility {#abi_compatibility_tools}
2================================2================================
33
4We have created a few build targets to help us track ABI compatibility across4A few make targets exist to help us track ABI compatibility across
5different Mir versions and ensure we increase the ABI version properly. These5different Mir versions and ensure we increase the ABI version properly.
6target use the abi-compliance-checker tool to create and check the ABI dumps.6These targets invoke the abi-compliance-checker tool for the actual ABI check.
77
8The targets are:8The targets are:
99
10* **make abi-dump** (or abi-dump-<library> for a specific library, e.g., abi-dump-mirclient)10* **make abi-check**
1111
12 Produces ABI dumps for the public versioned libraries shipped by Mir. The12 Compiles all the public libraries in the current tree and checks their ABI against the latest released archive version
13 resulting ABI dump for each library is saved as13
14 <build-dir>/abi_dumps/<arch>/<libname>_next.abi.tar.gz.14* **make abi-check-<library>**
1515
16 By default, this target also builds the libraries needed for create the16 Compiles only the specified library in the current tree and checks its ABI against the latest released archive version
17 requested ABI dumps. The environment variable `MIR_ABI_DUMP_PREBUILT_LIBDIR`17
18 can be set **at configuration time** (i.e., when invoking cmake) to a path18 - *library* can be any of the public library targets such as mirclient, mirserver, mirplatform, mircommon, etc.
19 containing pre-built libraries to use instead.
20
21 _N.B: the path set with MIR_ABI_DUMP_PREBUILT_LIBDIR is expected to contain
22 *.so files, not only *.so.X files._
23
24* **make abi-dump-base** (or abi-dump-base-<library> for a specific library,
25 e.g., abi-dump-base-mirclient)
26
27 Similar to make abi-dump, but saves the ABI dump as
28 <build-dir>/abi_dumps/<arch>/<libname>_base.abi.tar.gz (note the 'base' vs
29 'next' in the file name).
30
31* **make abi-check** (or abi-check-<library>, for a specific library)
32 e.g., abi-check-mirclient)
33
34 Produces ABI dumps (this target depends on the abi-dump target), and checks
35 them against a set of base ABI dumps. The base ABI dumps are assumed to be
36 located in <build-dir>/abi_dumps/<arch>/, i.e., where make abi-dump-base
37 would normally place the files.
38
39 The environment variable `MIR_ABI_CHECK_BASE_DIR` can be set **at
40 configuration time** (i.e., when invoking cmake) to set a different directory
41 for the base ABI dumps. The supplied directory must **not** contain the
42 <arch> portion of the path (e.g., just build_dir/abi_dumps, not
43 build_dir/abi_dumps/x86_64-linux-gnu).
44
45 Since this target depends on the abi-dump target, the
46 `MIR_ABI_DUMP_PREBUILT_LIBDIR` environment variable can be set to use
47 pre-built libraries instead of building them.
4819
49Sample usage20Sample usage
50------------21------------
5122
52A common scenario is to check the ABI of the development version against the23 $ bzr branch lp:mir && cd mir
53latest archive version. This is one way to perform the check:
54
55### Step 1: Produce the ABI dumps for the installed version
56
57Start by download the source corresponding to the installed version:
58
59 $ apt-get source mir
60 $ cd mir-<version>
61
62At this point we can select whether to build the libraries from scratch:
63
64 $ debian/rules override_dh_auto_configure24 $ debian/rules override_dh_auto_configure
65
66... or to reuse the pre-built libraries, assuming they are installed (we
67need their -dev packages too!):
68
69 $ MIR_ABI_DUMP_PREBUILT_LIBDIR=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) debian/rules override_dh_auto_configure
70
71Now we can create the ABI dumps:
72
73 $ cd <build-dir> && make abi-dump-base
74
75This will create base ABI dump files which we can use in the next step.
76
77### Step 2: Check the ABI of the development version against the produced base ABI dumps
78
79 $ bzr branch lp:mir && cd mir
80 $ MIR_ABI_CHECK_BASE_DIR=/path/to/base/abi/dumps debian/rules override_dh_auto_configure
81 $ cd <build-dir>25 $ cd <build-dir>
82 $ make abi-check26 $ make abi-check
8327
=== modified file 'doc/android_new_device_bringup.md'
--- doc/android_new_device_bringup.md 2015-07-16 07:03:19 +0000
+++ doc/android_new_device_bringup.md 2016-03-30 00:11:41 +0000
@@ -7,42 +7,50 @@
7team diagnose and fix the issues that are seen.7team diagnose and fix the issues that are seen.
88
9##Mir Tests##9##Mir Tests##
10The android platform of Mir has a variety of tests and tools that help the Mir10Mir has a test suite available in the package mir-test-tools that checks the
11team troubleshoot new devices. There are thousands of tests, but certain tests11operation of Mir.
12exercise the driver and have proven useful in diagnosing driver problems. These12Mir also provides a test suite in mir-android-diagnostics that is helpful in
13tests are available in the 'mir-test-tools' debian package.13checking how a new device will work with Mir.
14
15##Mir and libhybris##
16Vendor provided drivers are compiled against Android's bionic libc.
17Mir runs against glibc. To make the two libc's work together, Mir uses
18libhybris.
19
20libhybris has some internal tests (e.g., test_egl), but these are insufficient
21tests to see if mir will run on the device. The tests are aimed checking
22the operation of hybris on non-Mir graphics stacks. Furthermore, they test a
23more limited range of hardware module capabilities (e.g. they don't test HWC
24overlay capability)
1425
15###Mir Client Software Rendering###26###Mir Client Software Rendering###
1627
17 mir_integration_tests --gtest-filter="AndroidHardwareSanity.client_can_draw_with_cpu"28 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.client_can_draw_with_cpu"
1829
19This test checks that a buffer can travel from the server to the client accross30This test checks that the CPU can render pixels using software
20the interprocess communication channel. It then renders some pixels using31and checks that the pixels can be read back.
21software and the server will check that the pixels are present in the buffer.
2232
23###Mir Client OpenGLES 2.0 Rendering (Android EGLNativeWindowType test)###33###Mir Client OpenGLES 2.0 Rendering (Android EGLNativeWindowType test)###
2434
25 mir_integration_tests --gtest-filter="AndroidHardwareSanity.client_can_draw_with_gpu"35 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.client_can_draw_with_gpu"
2636
27This test checks that a buffer can travel from the server to the client accross37This test checks that the GL api can be used to glClear() a buffer, and checks
28the interprocess communication channel. It then renders some pixels using38that the content is correct after render.
29OpenGLES 2.0 and the server will check that the pixels are present in the
30buffer.
3139
32###Mir Display posting (HWC tests)###40###Mir Display posting (HWC tests)###
3341
34 mir_integration_tests --gtest-filter="AndroidHardwareSanity.display_can_post"42 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.display_can_post"
35 mir_integration_tests --gtest-filter="AndroidHardwareSanity.display_can_post_overlay"43 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.display_can_post_overlay"
3644
37This test checks that the display can post content to the screen. It should45This test checks that the display can post content to the screen. It should
38flash the screen briefly and run without error. Since it is important that46flash the screen briefly and run without error. Since it is important that
39screen looks flawless, a visual inspection should also be perfomed using47screen looks flawless, a visual inspection should also be perfomed using
40mir_demo_standalone_render_to_fb 48mir_demo_standalone_render_to_fb and mir_demo_standalone_render_overlays
4149
42###Mir GPU buffer allocations (gralloc tests)###50###Mir GPU buffer allocations (gralloc tests)###
4351
44 mir_integration_tests --gtest-filter="AndroidHardwareSanity.can_allocate_sw_buffer"52 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.can_allocate_sw_buffer"
45 mir_integration_tests --gtest-filter="AndroidHardwareSanity.can_allocate_hw_buffer"53 mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.can_allocate_hw_buffer"
4654
47This will test that Mir can access the gralloc module and allocate GPU buffers.55This will test that Mir can access the gralloc module and allocate GPU buffers.
4856
@@ -85,7 +93,7 @@
85and display to the screen.93and display to the screen.
86In one terminal, run94In one terminal, run
8795
88 mir_proving_server96 mir_demo_server
8997
90and in another terminal, run98and in another terminal, run
9199
@@ -138,6 +146,12 @@
138MIR_SERVER_HWC_REPORT=log to the environment of the running server will give 146MIR_SERVER_HWC_REPORT=log to the environment of the running server will give
139the hwc report on stdout.147the hwc report on stdout.
140148
149###Android platform quirks###
150If a driver has a bug that can be fixed, its best to fix the bug in the driver.
151However, if workarounds are needed due to source unavailability, they can be
152experimented with via quicks that can be activated via the command line.
153The list of quirks is printed with the --help flag on a mir_demo_server.
154
141###Note on HWC versions###155###Note on HWC versions###
142The "--hwc-report log" will log the HWC version at the beginning of the report,156The "--hwc-report log" will log the HWC version at the beginning of the report,
143 e.g.157 e.g.
@@ -149,8 +163,8 @@
149 HWC version unknown (<version>)163 HWC version unknown (<version>)
150164
151This means that Mir does not support the version of hwc on the device.165This means that Mir does not support the version of hwc on the device.
152As of Dec 2014, Mir supports the legacy FB module, as well as HWC versions166As of Feb 2016, Mir supports the legacy FB module, as well as HWC versions
1531.0, 1.1, 1.2, and 1.3. 1671.0, 1.1, 1.2, 1.3, and 1.4.
154168
155If you run169If you run
156170
157171
=== removed file 'doc/avoid_deploy-and-test.md'
--- doc/avoid_deploy-and-test.md 2015-01-22 05:40:40 +0000
+++ doc/avoid_deploy-and-test.md 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
1How to avoid deploy-and-test.sh
2===============================
3
4If you're running tests regularly from different branches on a remote
5Ubuntu touch device, you should avoid deploy-and-test.sh because it's very
6slow to complete. Particularly if you're making code changes and need to
7repeat the script each time. Instead, you can set up your device for rapid
8iteration like so:
9
10One-time setup
11--------------
12 adb push ~/.ssh/id_rsa.pub /home/phablet/.ssh/authorized_keys
13 adb shell
14 chown phablet ~/.ssh
15 chmod -R go-w ~/.ssh
16 mkdir ~/testrundir
17 sudo start ssh
18 sudo mount -o remount,rw /
19 sudo apt-get install umockdev
20
21Now for each branch you want to deploy and test
22-----------------------------------------------
23 device=<ip-or-hostname-of-your-device>
24 cd build-android-arm
25 rsync -avH lib bin phablet@$device:testrundir/
26 adb shell (or ssh phablet@$device)
27 cd testrundir
28 umockdev-run bin/mir_unit-tests
29 ...
300
=== removed file 'doc/snappy_appliances.md'
--- doc/snappy_appliances.md 2015-03-20 08:43:03 +0000
+++ doc/snappy_appliances.md 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
1Mir As An Appliance
2===================
3
4How to build a Mir-based appliance/kiosk using Ubuntu Core and Snappy
5packaging.
6
7Selection of hardware
8---------------------
9
10Mir as an appliance presently supports Mesa/DRM drivers. So almost any
11hardware that supports Mir on Ubuntu desktop will suffice. Virtual machines
12are generally NOT supported by Mir yet. So cannot be used here.
13
14Your chosen machine must be plugged into ethernet by cable (wifi not
15supported), and that cable must be able to reach a DHCP server
16(e.g. a typical home router). For more details see:
17<https://bugs.launchpad.net/snappy-ubuntu/+bugs?field.tag=wontboot>
18
19Getting the operating system
20----------------------------
21
22Ubuntu Core is a new product still and effectively pre-release. So you cannot
23download usable disk images yet. You need to make your own.
24
251. Use an Ubuntu desktop running 15.04 or later.
262. Install package: `ubuntu-device-flash`
273. Make a disk image:
28
29 $ sudo ubuntu-device-flash core --enable-ssh -o mysnappy.img
30
31You now have a 20GB (by default) disk image to dump on your machine's drive.
32This part and variations on it are left as an exercise for the reader.
33
34Booting the operating system
35----------------------------
36
37This can be troublesome. For known issues refer to:
38<https://bugs.launchpad.net/snappy-ubuntu/+bugs?field.tag=wontboot>
39
40Once booted you log in as user `ubuntu` with password `ubuntu`.
41
42Learn the basics of snappy
43--------------------------
44
45If you haven't already, learn here: <https://developer.ubuntu.com/en/snappy/>
46
47Building snap packages of Mir
48-----------------------------
49
501. Build Mir per normal. But if you want the quickest result then try:
51
52 $ mkdir build
53 $ cd build
54 $ cmake .. -DMIR_ENABLE_TESTS=OFF -DMIR_PLATFORM=mesa
55 $ make -j8
56
572. Build the .snap files:
58
59 $ make snap
60
613. Copy the .snap files from the location displayed at the end of step 2.
62
63Running the mir/mir-demos snap packages
64---------------------------------------
65
66Once installed you will have two new snappy `/apps`: mir and mir-demos
67
68Presently only server and standalone binaries work. To run them with the
69full environment, libraries and drivers they require, use:
70
71 sudo /apps/bin/mir-run /apps/mir-demos/current/mir_proving_server
72 sudo /apps/bin/mir-run /apps/mir-demos/current/mir_demo_standalone_render_surfaces
73 etc
74
75Automatic setting of privileges to avoid "sudo" is not yet implemented.
76
770
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ examples/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -41,8 +41,6 @@
41 xcursor.h41 xcursor.h
42)42)
4343
44SET_SOURCE_FILES_PROPERTIES(xcursor.c PROPERTIES COMPILE_FLAGS -D_GNU_SOURCE)
45
46target_link_libraries(eglapp44target_link_libraries(eglapp
47 mirclient45 mirclient
48 ${EGL_LIBRARIES}46 ${EGL_LIBRARIES}
@@ -73,6 +71,12 @@
73target_link_libraries(mir_demo_client_target71target_link_libraries(mir_demo_client_target
74 eglapp72 eglapp
75)73)
74mir_add_wrapped_executable(mir_demo_client_camera
75 camera.c
76)
77target_link_libraries(mir_demo_client_camera
78 eglapp
79)
76mir_add_wrapped_executable(mir_demo_client_eglcounter80mir_add_wrapped_executable(mir_demo_client_eglcounter
77 eglcounter.cpp81 eglcounter.cpp
78)82)
@@ -225,15 +229,6 @@
225mir_add_wrapped_executable(mir_demo_server_minimal server_minimal.cpp)229mir_add_wrapped_executable(mir_demo_server_minimal server_minimal.cpp)
226target_link_libraries(mir_demo_server_minimal mirserver)230target_link_libraries(mir_demo_server_minimal mirserver)
227231
228mir_add_wrapped_executable(mir_demo_standalone_render_overlays
229 render_overlays.cpp
230)
231
232target_link_libraries(mir_demo_standalone_render_overlays
233 mirserver
234 mircommon
235)
236
237if (MIR_ENABLE_TESTS)232if (MIR_ENABLE_TESTS)
238 add_executable(mir_symbol_test233 add_executable(mir_symbol_test
239 uses_non_client_symbol.cpp234 uses_non_client_symbol.cpp
@@ -255,7 +250,7 @@
255 COMMAND /bin/sh -c "(objdump -T mir_symbol_test | grep *UND* | grep mir | grep -v MIR_CLIENT)"250 COMMAND /bin/sh -c "(objdump -T mir_symbol_test | grep *UND* | grep mir | grep -v MIR_CLIENT)"
256 )251 )
257252
258 # We use a slightly weaker version of the test with clang as that generates spurious NEEDED253 # We can't use this test with clang as that generates spurious NEEDED
259 if (NOT "${CMAKE_CXX_COMPILER}" MATCHES "clang")254 if (NOT "${CMAKE_CXX_COMPILER}" MATCHES "clang")
260 # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI255 # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI
261 mir_add_test(NAME Clients-only-use-client-ABI256 mir_add_test(NAME Clients-only-use-client-ABI
@@ -267,17 +262,6 @@
267 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin262 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
268 COMMAND /bin/sh -c "(objdump -p mir_symbol_test | grep NEEDED | grep libmir | grep -v libmirclient)"263 COMMAND /bin/sh -c "(objdump -p mir_symbol_test | grep NEEDED | grep libmir | grep -v libmirclient)"
269 )264 )
270 else()
271 # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI
272 mir_add_test(NAME Clients-only-use-client-ABI
273 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
274 COMMAND /bin/sh -c "!(nm -u mir_demo_client* | grep -v @@MIR_CLIENT | grep @@MIR_)"
275 )
276 # Again, test the testcase...
277 mir_add_test(NAME Client-using-ABI-from-mircommon-fails-check
278 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
279 COMMAND /bin/sh -c "(nm -u mir_symbol_test | grep -v @@MIR_CLIENT | grep @@MIR_)"
280 )
281 endif ()265 endif ()
282endif ()266endif ()
283267
284268
=== modified file 'examples/animated_cursor_demo_client.c'
--- examples/animated_cursor_demo_client.c 2016-01-29 08:18:22 +0000
+++ examples/animated_cursor_demo_client.c 2016-03-30 00:11:41 +0000
@@ -16,12 +16,11 @@
16 * Author: Robert Carr <robert.carr@canonical.com>16 * Author: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#define _GNU_SOURCE // for nanosleep
20
21#include "eglapp.h"19#include "eglapp.h"
2220
23#include "mir_toolkit/mir_client_library.h"21#include "mir_toolkit/mir_client_library.h"
2422
23#include <math.h>
25#include <stdio.h>24#include <stdio.h>
26#include <stdlib.h>25#include <stdlib.h>
27#include <string.h>26#include <string.h>
@@ -33,19 +32,38 @@
3332
34void animate_cursor(MirBufferStream *stream)33void animate_cursor(MirBufferStream *stream)
35{34{
36 static double alpha = 0.0;35 // mir_pixel_format_argb_8888 as set below
37 char fill_color = 0xff * alpha;36 int const bpp = 4;
38 37 uint32_t const background = 0x00000000;
38 uint32_t const foreground = 0xffffffff;
39
39 MirGraphicsRegion region;40 MirGraphicsRegion region;
40 mir_buffer_stream_get_graphics_region(stream, &region);41 mir_buffer_stream_get_graphics_region(stream, &region);
41 42
42 memset(region.vaddr, fill_color, region.stride*region.height);43 for (int y = 0; y < region.height; ++y)
44 {
45 for (int x = 0; x < region.width; ++x)
46 {
47 uint32_t* pixel = (uint32_t*)
48 (region.vaddr + y * region.stride + x * bpp);
49 *pixel = background;
50 }
51 }
52
53 static float theta = 0.0f;
54 theta += 0.000234567f;
55
56 char* origin = region.vaddr + (region.height/2)*region.stride;
57
58 for (int x = 0; x < region.width; ++x)
59 {
60 int const magnitude = region.height / 3;
61 int y = magnitude * sinf(theta + x * 2 * M_PI / region.width);
62 uint32_t* pixel = (uint32_t*)(origin + x*bpp + y*region.stride);
63 *pixel = foreground;
64 }
43 65
44 mir_buffer_stream_swap_buffers_sync(stream);66 mir_buffer_stream_swap_buffers_sync(stream);
45 alpha += 0.01;
46 if (alpha >= 1.0)
47 alpha = 0.0;
48
49}67}
5068
51MirBufferStream* make_cursor_stream(MirConnection *connection, MirSurface *surface)69MirBufferStream* make_cursor_stream(MirConnection *connection, MirSurface *surface)
@@ -76,13 +94,8 @@
76 MirBufferStream* stream = make_cursor_stream(mir_eglapp_native_connection(),94 MirBufferStream* stream = make_cursor_stream(mir_eglapp_native_connection(),
77 mir_eglapp_native_surface());95 mir_eglapp_native_surface());
7896
79 struct timespec onehundred_millis = {
80 0, 100*1000000
81 };
82
83 while (mir_eglapp_running())97 while (mir_eglapp_running())
84 {98 {
85 nanosleep(&onehundred_millis, &onehundred_millis);
86 animate_cursor(stream);99 animate_cursor(stream);
87 }100 }
88101
89102
=== added file 'examples/camera.c'
--- examples/camera.c 1970-01-01 00:00:00 +0000
+++ examples/camera.c 2016-03-30 00:11:41 +0000
@@ -0,0 +1,541 @@
1/*
2 * Copyright © 2015-2016 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 * Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
17 */
18
19#include "eglapp.h"
20#include <assert.h>
21#include <stdio.h>
22#include <math.h>
23#include <fcntl.h>
24#include <GLES2/gl2.h>
25#include <mir_toolkit/mir_surface.h>
26#include <pthread.h>
27#include <stdlib.h>
28#include <signal.h>
29#include <sys/ioctl.h>
30#include <sys/mman.h>
31#include <linux/videodev2.h>
32#include <unistd.h>
33#include <string.h>
34#include <errno.h>
35#include <poll.h>
36
37typedef struct
38{
39 pthread_mutex_t mutex;
40 bool resized;
41} State;
42
43enum CameraPref
44{
45 camera_pref_defaults,
46 camera_pref_speed,
47 camera_pref_resolution
48};
49
50typedef struct
51{
52 void *start;
53 size_t length;
54} Buffer;
55
56typedef struct
57{
58 int fd;
59 struct v4l2_pix_format pix;
60 unsigned buffers;
61 Buffer buffer[];
62} Camera;
63
64static GLuint load_shader(const char *src, GLenum type)
65{
66 GLuint shader = glCreateShader(type);
67 if (shader)
68 {
69 GLint compiled;
70 glShaderSource(shader, 1, &src, NULL);
71 glCompileShader(shader);
72 glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
73 if (!compiled)
74 {
75 GLchar log[1024];
76 glGetShaderInfoLog(shader, sizeof log - 1, NULL, log);
77 log[sizeof log - 1] = '\0';
78 printf("load_shader compile failed: %s\n", log);
79 glDeleteShader(shader);
80 shader = 0;
81 }
82 }
83 return shader;
84}
85
86static void on_event(MirSurface *surface, const MirEvent *event, void *context)
87{
88 (void)surface;
89 State *state = (State*)context;
90
91 // FIXME: We presently need to know that events come in on a different
92 // thread to main (LP: #1194384). When that's resolved, simple
93 // single-threaded apps like this won't need pthread.
94 pthread_mutex_lock(&state->mutex);
95
96 switch (mir_event_get_type(event))
97 {
98 case mir_event_type_input:
99 break;
100 case mir_event_type_resize:
101 state->resized = true;
102 break;
103 case mir_event_type_close_surface:
104 // TODO: eglapp.h needs a quit() function or different behaviour of
105 // mir_eglapp_shutdown().
106 raise(SIGTERM); // handled by eglapp
107 break;
108 default:
109 break;
110 }
111
112 pthread_mutex_unlock(&state->mutex);
113}
114
115static void fourcc_string(__u32 x, char str[5])
116{
117 str[0] = (char)(x & 0xff);
118 str[1] = (char)(x >> 8 & 0xff);
119 str[2] = (char)(x >> 16 & 0xff);
120 str[3] = (char)(x >> 24);
121 str[4] = '\0';
122}
123
124static void close_camera(Camera *cam)
125{
126 if (!cam) return;
127
128 for (unsigned b = 0; b < cam->buffers; ++b)
129 if (cam->buffer[b].start)
130 munmap(cam->buffer[b].start, cam->buffer[b].length);
131 if (cam->fd >= 0)
132 close(cam->fd);
133 free(cam);
134}
135
136static Camera *open_camera(const char *path, enum CameraPref pref,
137 unsigned nbuffers)
138{
139 Camera *cam = calloc(1, sizeof(*cam) + nbuffers*sizeof(cam->buffer[0]));
140 if (cam == NULL)
141 {
142 perror("malloc");
143 goto fail;
144 }
145
146 printf("Opening device: %s\n", path);
147 cam->fd = open(path, O_RDWR);
148 if (cam->fd < 0)
149 {
150 perror("open");
151 goto fail;
152 }
153
154 struct v4l2_capability cap;
155 int ret = ioctl(cam->fd, VIDIOC_QUERYCAP, &cap);
156 if (ret == 0)
157 {
158 printf("Driver: %s\n", cap.driver);
159 printf("Card: %s\n", cap.card);
160 printf("Bus: %s\n", cap.bus_info);
161 printf("Capture: %s\n",
162 cap.capabilities & V4L2_CAP_VIDEO_CAPTURE ? "Yes" : "No");
163 printf("Streaming: %s\n",
164 cap.capabilities & V4L2_CAP_STREAMING ? "Yes" : "No");
165
166 }
167
168 const unsigned required = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
169 if (ret || (cap.capabilities & required) != required)
170 {
171 fprintf(stderr, "Can't get sufficient capabilities\n");
172 goto fail;
173 }
174
175 struct v4l2_format format;
176 memset(&format, 0, sizeof(format));
177 format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
178 struct v4l2_pix_format *pix = &format.fmt.pix;
179 // Driver will choose the best match
180 if (pref == camera_pref_speed)
181 {
182 pix->width = 1;
183 pix->height = 1;
184 }
185 else if (pref == camera_pref_resolution)
186 {
187 pix->width = 9999;
188 pix->height = 9999;
189 }
190 // But we really only need it to honour these:
191 pix->pixelformat = V4L2_PIX_FMT_YUYV;
192 pix->field = V4L2_FIELD_NONE;
193 // Just try, best effort. This may fail.
194 if (ioctl(cam->fd, VIDIOC_S_FMT, &format) &&
195 ioctl(cam->fd, VIDIOC_G_FMT, &format))
196 {
197 perror("VIDIOC_[SG]_FMT");
198 goto fail;
199 }
200 char str[5];
201 fourcc_string(pix->pixelformat, str);
202 printf("Pixel format: %ux%u fmt %s, stride %u\n",
203 (unsigned)pix->width, (unsigned)pix->height,
204 str, (unsigned)pix->bytesperline);
205 cam->pix = *pix;
206
207 // Always choose the highest frame rate. Although what you will get
208 // depends on the resolution vs speed set above.
209 struct v4l2_streamparm parm;
210 memset(&parm, 0, sizeof(parm));
211 parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
212 parm.parm.capture.timeperframe.numerator = 1;
213 parm.parm.capture.timeperframe.denominator = 1000;
214 if (ioctl(cam->fd, VIDIOC_S_PARM, &parm))
215 {
216 fprintf(stderr, "Setting frame rate is not supported.\n");
217 }
218 else
219 {
220 unsigned hz = parm.parm.capture.timeperframe.denominator /
221 parm.parm.capture.timeperframe.numerator;
222 printf("Maximum frame rate requested: %u Hz (may be less)\n", hz);
223 }
224
225 struct v4l2_requestbuffers req =
226 {
227 nbuffers,
228 V4L2_BUF_TYPE_VIDEO_CAPTURE,
229 V4L2_MEMORY_MMAP,
230 {0,0}
231 };
232 if (-1 == ioctl(cam->fd, VIDIOC_REQBUFS, &req))
233 {
234 perror("VIDIOC_REQBUFS");
235 goto fail;
236 }
237
238 cam->buffers = req.count;
239
240 for (unsigned b = 0; b < req.count; ++b)
241 {
242 struct v4l2_buffer buf;
243 memset(&buf, 0, sizeof(buf));
244 buf.index = b;
245 buf.type = req.type;
246 if (-1 == ioctl(cam->fd, VIDIOC_QUERYBUF, &buf))
247 {
248 perror("VIDIOC_QUERYBUF");
249 goto fail;
250 }
251 cam->buffer[b].length = buf.length;
252 cam->buffer[b].start = mmap(NULL, buf.length,
253 PROT_READ | PROT_WRITE,
254 MAP_SHARED,
255 cam->fd, buf.m.offset);
256
257 if (MAP_FAILED == cam->buffer[b].start)
258 {
259 perror("mmap");
260 goto fail;
261 }
262 }
263
264 for (unsigned b = 0; b < req.count; ++b)
265 {
266 struct v4l2_buffer buf;
267 memset(&buf, 0, sizeof(buf));
268 buf.index = b;
269 buf.type = req.type;
270 buf.memory = V4L2_MEMORY_MMAP;
271 if (-1 == ioctl(cam->fd, VIDIOC_QBUF, &buf))
272 {
273 perror("VIDIOC_QBUF");
274 goto fail;
275 }
276 }
277
278 int type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
279 if (-1 == ioctl(cam->fd, VIDIOC_STREAMON, &type))
280 {
281 perror("VIDIOC_STREAMON");
282 goto fail;
283 }
284
285 return cam;
286fail:
287 close_camera(cam);
288 return NULL;
289}
290
291static bool frame_ready(Camera *cam)
292{
293 struct pollfd pollfd = {cam->fd, POLLIN, 0};
294 return poll(&pollfd, 1, 0) == 1 && (pollfd.revents & POLLIN);
295}
296
297static const Buffer *acquire_frame(Camera *cam)
298{
299 struct v4l2_buffer frame;
300 memset(&frame, 0, sizeof(frame));
301 frame.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
302 frame.memory = V4L2_MEMORY_MMAP;
303 if (ioctl(cam->fd, VIDIOC_DQBUF, &frame))
304 {
305 perror("VIDIOC_DQBUF");
306 return NULL;
307 }
308 return cam->buffer + frame.index;
309}
310
311static void release_frame(Camera *cam, const Buffer *buf)
312{
313 struct v4l2_buffer frame;
314 memset(&frame, 0, sizeof(frame));
315 frame.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
316 frame.memory = V4L2_MEMORY_MMAP;
317 frame.index = buf - cam->buffer;
318 if (ioctl(cam->fd, VIDIOC_QBUF, &frame))
319 perror("VIDIOC_QBUF");
320}
321
322int main(int argc, char *argv[])
323{
324 const char vshadersrc[] =
325 "attribute vec2 position;\n"
326 "attribute vec2 texcoord;\n"
327 "uniform mat4 projection;\n"
328 "varying vec2 v_texcoord;\n"
329 "\n"
330 "void main()\n"
331 "{\n"
332 " gl_Position = projection *\n"
333 " vec4(position, 0.0, 1.0);\n"
334 " v_texcoord = texcoord;\n"
335 "}\n";
336
337 const char raw_fshadersrc[] =
338 "precision mediump float;\n"
339 "varying vec2 v_texcoord;\n"
340 "uniform sampler2D texture;\n"
341 "\n"
342 "void main()\n"
343 "{\n"
344 " vec4 f = texture2D(texture, v_texcoord);\n"
345 " gl_FragColor = vec4(f.rgb, 1.0);\n"
346 "}\n";
347
348 const char * const yuyv_greyscale_fshadersrc = raw_fshadersrc;
349
350 // This is the Android YUV to RGB calculation.
351 // TODO: Vary the shader to match the camera's reported colour space
352 const char yuyv_quickcolour_fshadersrc[] =
353 "precision mediump float;\n"
354 "varying vec2 v_texcoord;\n"
355 "uniform sampler2D texture;\n"
356 "\n"
357 "void main()\n"
358 "{\n"
359 " vec4 f = texture2D(texture, v_texcoord);\n"
360 " float y = (f.r + f.b) / 2.0;\n" // Y unsigned (from two pixels)
361 " float u = f.g - 0.5;\n" // U signed (same for both pixels)
362 " float v = f.a - 0.5;\n" // V signed (same for both pixels)
363 " float r = clamp(y + 1.370705*v, 0.0, 1.0);\n"
364 " float g = clamp(y - 0.698001*v - 0.337633*u, 0.0, 1.0);\n"
365 " float b = clamp(y + 1.732446*u, 0.0, 1.0);\n"
366 " gl_FragColor = vec4(r, g, b, 1.0);\n"
367 "}\n";
368
369 // TODO: Selectable between high-res grey vs half-res colour?
370 const char * const fshadersrc = yuyv_quickcolour_fshadersrc;
371
372 Camera *cam = open_camera("/dev/video0", camera_pref_resolution, 1);
373 if (!cam)
374 {
375 fprintf(stderr, "Failed to set up camera device\n");
376 return 0;
377 }
378
379 unsigned int win_width = cam->pix.width;
380 unsigned int win_height = cam->pix.height;
381 if (!mir_eglapp_init(argc, argv, &win_width, &win_height))
382 return 1;
383
384 GLuint vshader = load_shader(vshadersrc, GL_VERTEX_SHADER);
385 assert(vshader);
386 GLuint fshader = load_shader(fshadersrc, GL_FRAGMENT_SHADER);
387 assert(fshader);
388 GLuint prog = glCreateProgram();
389 assert(prog);
390 glAttachShader(prog, vshader);
391 glAttachShader(prog, fshader);
392 glLinkProgram(prog);
393
394 GLint linked;
395 glGetProgramiv(prog, GL_LINK_STATUS, &linked);
396 if (!linked)
397 {
398 GLchar log[1024];
399 glGetProgramInfoLog(prog, sizeof log - 1, NULL, log);
400 log[sizeof log - 1] = '\0';
401 printf("Link failed: %s\n", log);
402 return 2;
403 }
404
405 glUseProgram(prog);
406
407 const GLfloat camw = cam->pix.width, camh = cam->pix.height;
408 const GLfloat box[] =
409 { // position texcoord
410 0.0f, camh, 0.0f, 1.0f,
411 camw, camh, 1.0f, 1.0f,
412 camw, 0.0f, 1.0f, 0.0f,
413 0.0f, 0.0f, 0.0f, 0.0f,
414 };
415 GLint position = glGetAttribLocation(prog, "position");
416 GLint texcoord = glGetAttribLocation(prog, "texcoord");
417 glVertexAttribPointer(position, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat),
418 box);
419 glVertexAttribPointer(texcoord, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat),
420 box+2);
421 glEnableVertexAttribArray(position);
422 glEnableVertexAttribArray(texcoord);
423
424 GLint projection = glGetUniformLocation(prog, "projection");
425
426 GLuint tex;
427 glGenTextures(1, &tex);
428 glBindTexture(GL_TEXTURE_2D, tex);
429 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
430 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
431 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
432 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
433
434 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
435 glViewport(0, 0, win_width, win_height);
436
437 State state =
438 {
439 PTHREAD_MUTEX_INITIALIZER,
440 true
441 };
442 MirSurface *surface = mir_eglapp_native_surface();
443 mir_surface_set_event_handler(surface, on_event, &state);
444
445 bool first_frame = true;
446 while (mir_eglapp_running())
447 {
448 bool wait_for_new_frame = true;
449 pthread_mutex_lock(&state.mutex);
450
451 if (state.resized)
452 {
453 // mir_eglapp_swap_buffers updates the viewport for us...
454 GLint viewport[4];
455 glGetIntegerv(GL_VIEWPORT, viewport);
456 GLfloat scalex = 2.0f / viewport[2];
457 GLfloat scaley = -2.0f / viewport[3];
458
459 // Expand image to fit:
460 GLfloat scalew = (GLfloat)viewport[2] / cam->pix.width;
461 GLfloat scaleh = (GLfloat)viewport[3] / cam->pix.height;
462
463 GLfloat scale;
464 GLfloat offsetx = -1.0f, offsety = 1.0f;
465 if (scalew <= scaleh)
466 {
467 scale = scalew;
468 offsety -= (GLfloat)(viewport[3] - scale*cam->pix.height) /
469 viewport[3];
470 }
471 else
472 {
473 scale = scaleh;
474 offsetx += (GLfloat)(viewport[2] - scale*cam->pix.width) /
475 viewport[2];
476 }
477
478 scalex *= scale;
479 scaley *= scale;
480
481 // TRANSPOSED projection matrix to convert from the Mir input
482 // rectangle {{0,0},{w,h}} to GL screen rectangle {{-1,1},{2,2}}.
483 GLfloat matrix[16] = {scalex, 0.0f, 0.0f, 0.0f,
484 0.0f, scaley, 0.0f, 0.0f,
485 0.0f, 0.0f, 1.0f, 0.0f,
486 offsetx,offsety,0.0f, 1.0f};
487
488 // Note GL_FALSE: GLES does not support the transpose option
489 glUniformMatrix4fv(projection, 1, GL_FALSE, matrix);
490 state.resized = false;
491 wait_for_new_frame = first_frame;
492 first_frame = false;
493 }
494
495 if (wait_for_new_frame || frame_ready(cam))
496 {
497 const Buffer *buf = acquire_frame(cam);
498 if (cam->pix.pixelformat == V4L2_PIX_FMT_YUYV)
499 {
500 if (fshadersrc == yuyv_greyscale_fshadersrc)
501 {
502 // Greyscale, full resolution:
503 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA,
504 cam->pix.width, cam->pix.height, 0,
505 GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
506 buf->start);
507 }
508 else if (fshadersrc == yuyv_quickcolour_fshadersrc)
509 {
510 // Colour, half resolution:
511 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
512 cam->pix.width/2, cam->pix.height, 0,
513 GL_RGBA, GL_UNSIGNED_BYTE,
514 buf->start);
515 }
516 // TODO: Colour, full resolution. But it will be slow :(
517 }
518 else
519 {
520 char str[5];
521 fourcc_string(cam->pix.pixelformat, str);
522 fprintf(stderr, "FIXME: Unsupported camera pixel format 0x%08lx: %s\n",
523 (long)cam->pix.pixelformat, str);
524 }
525 release_frame(cam, buf);
526 }
527
528 glClear(GL_COLOR_BUFFER_BIT);
529 glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
530
531 pthread_mutex_unlock(&state.mutex);
532
533 mir_eglapp_swap_buffers();
534 }
535
536 mir_surface_set_event_handler(surface, NULL, NULL);
537 mir_eglapp_shutdown();
538 close_camera(cam);
539
540 return 0;
541}
0542
=== modified file 'examples/client_helpers.h'
--- examples/client_helpers.h 2016-01-29 08:18:22 +0000
+++ examples/client_helpers.h 2016-03-30 00:11:41 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#ifndef MIR_EXAMLPES_CLIENT_HELPERS_H_19#ifndef MIR_EXAMPLES_CLIENT_HELPERS_H_
20#define MIR_EXAMLPES_CLIENT_HELPERS_H_20#define MIR_EXAMPLES_CLIENT_HELPERS_H_
2121
22#include "mir_toolkit/mir_client_library.h"22#include "mir_toolkit/mir_client_library.h"
23#include <EGL/egl.h>23#include <EGL/egl.h>
2424
=== modified file 'examples/cursors_demo_client.c'
--- examples/cursors_demo_client.c 2016-01-29 08:18:22 +0000
+++ examples/cursors_demo_client.c 2016-03-30 00:11:41 +0000
@@ -16,6 +16,8 @@
16 * Author: Robert Carr <robert.carr@canonical.com>16 * Author: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#define _BSD_SOURCE /* for usleep() */
20
19#include "mir_toolkit/mir_client_library.h"21#include "mir_toolkit/mir_client_library.h"
2022
21#include "eglapp.h"23#include "eglapp.h"
@@ -26,7 +28,6 @@
26void configure_cursor(MirSurface *surface, unsigned int cursor_index)28void configure_cursor(MirSurface *surface, unsigned int cursor_index)
27{29{
28 char const *const cursors[] = {30 char const *const cursors[] = {
29 mir_arrow_cursor_name,
30 mir_busy_cursor_name,31 mir_busy_cursor_name,
31 mir_caret_cursor_name,32 mir_caret_cursor_name,
32 mir_pointing_hand_cursor_name,33 mir_pointing_hand_cursor_name,
@@ -67,7 +68,7 @@
67 while (mir_eglapp_running())68 while (mir_eglapp_running())
68 {69 {
69 configure_cursor(mir_eglapp_native_surface(), cursor_index++);70 configure_cursor(mir_eglapp_native_surface(), cursor_index++);
70 sleep(1);71 usleep(100000);
71 }72 }
7273
73 mir_eglapp_shutdown();74 mir_eglapp_shutdown();
7475
=== modified file 'examples/flicker.c'
--- examples/flicker.c 2016-01-29 08:18:22 +0000
+++ examples/flicker.c 2016-03-30 00:11:41 +0000
@@ -90,6 +90,18 @@
90 };90 };
91}91}
9292
93static volatile sig_atomic_t running = 1;
94
95static void shutdown(int signum)
96{
97 if (running)
98 {
99 running = 0;
100 printf("Signal %d received. Good night.\n", signum);
101 }
102}
103
104
93int main(int argc, char* argv[])105int main(int argc, char* argv[])
94{106{
95 MirConnection *connection = 0;107 MirConnection *connection = 0;
@@ -164,7 +176,11 @@
164 int i=0;176 int i=0;
165 MirBufferStream *bs = mir_surface_get_buffer_stream(surface);177 MirBufferStream *bs = mir_surface_get_buffer_stream(surface);
166178
167 while (1)179 signal(SIGINT, shutdown);
180 signal(SIGTERM, shutdown);
181 signal(SIGHUP, shutdown);
182
183 while (running)
168 {184 {
169 mir_buffer_stream_get_graphics_region(bs, &graphics_region);185 mir_buffer_stream_get_graphics_region(bs, &graphics_region);
170 i++;186 i++;
171187
=== modified file 'examples/mir_demo_server_loader.cpp'
--- examples/mir_demo_server_loader.cpp 2016-01-29 08:18:22 +0000
+++ examples/mir_demo_server_loader.cpp 2016-03-30 00:11:41 +0000
@@ -19,11 +19,25 @@
19#include <dlfcn.h>19#include <dlfcn.h>
20#include <stdexcept>20#include <stdexcept>
21#include <iostream>21#include <iostream>
22#include <pthread.h>
2223
23namespace24namespace
24{25{
25const char* const library = "libmir_demo_server_loadable.so";26const char* const library = "libmir_demo_server_loadable.so";
26const char* const entry = "main";27const char* const entry = "main";
28
29// Work around gold (or gcc/libstdc++-4.9 bug, it's not yet clear) bug
30// https://sourceware.org/bugzilla/show_bug.cgi?id=16417 by ensuring the
31// executable links with libpthread.
32struct GoldBug16417Workaround
33{
34 GoldBug16417Workaround()
35 {
36 pthread_attr_t attr;
37 pthread_attr_init(&attr);
38 pthread_attr_destroy(&attr);
39 }
40} gold_bug_16417_workaround;
27}41}
2842
29int main(int argc, char const* argv[])43int main(int argc, char const* argv[])
3044
=== modified file 'examples/render_surfaces.cpp'
--- examples/render_surfaces.cpp 2016-01-29 08:18:22 +0000
+++ examples/render_surfaces.cpp 2016-03-30 00:11:41 +0000
@@ -317,6 +317,10 @@
317 set_command_line(argc, argv);317 set_command_line(argc, argv);
318 setenv("MIR_SERVER_NO_FILE", "", 1);318 setenv("MIR_SERVER_NO_FILE", "", 1);
319319
320 // If there's a server available, try connecting to it
321 if (auto const socket = getenv("MIR_SOCKET"))
322 setenv("MIR_SERVER_HOST_SOCKET", socket, 0);
323
320 // Unless the compositor starts before we create the surfaces it won't respond to324 // Unless the compositor starts before we create the surfaces it won't respond to
321 // the change notification that causes.325 // the change notification that causes.
322 callback_when_started(*this, [this] { create_surfaces(); });326 callback_when_started(*this, [this] { create_surfaces(); });
323327
=== modified file 'examples/render_to_fb.cpp'
--- examples/render_to_fb.cpp 2016-01-29 08:18:22 +0000
+++ examples/render_to_fb.cpp 2016-03-30 00:11:41 +0000
@@ -86,6 +86,13 @@
86int main(int argc, char const** argv)86int main(int argc, char const** argv)
87try87try
88{88{
89 // We don't want to act as a server by providing an endpoint
90 setenv("MIR_SERVER_NO_FILE", "", 1);
91
92 // If there's a server available, try connecting to it
93 if (auto const socket = getenv("MIR_SOCKET"))
94 setenv("MIR_SERVER_HOST_SOCKET", socket, 0);
95
89 mir::Server server;96 mir::Server server;
90 server.set_command_line(argc, argv);97 server.set_command_line(argc, argv);
91 server.apply_settings();98 server.apply_settings();
9299
=== modified file 'examples/scroll.cpp'
--- examples/scroll.cpp 2016-01-29 08:18:22 +0000
+++ examples/scroll.cpp 2016-03-30 00:11:41 +0000
@@ -122,6 +122,15 @@
122 puts("Surface released");122 puts("Surface released");
123}123}
124124
125static void shutdown(int signum)
126{
127 // Exiting without closing surfaces and connection is impolite but should
128 // not kill the server. It actually did kill the server prior to -r 3385.
129 // Running this example in CI acts as a smoke test for that failure.
130 printf("Signal %d received. Good night.\n", signum);
131 exit(EXIT_SUCCESS);
132}
133
125int main(int argc, char* argv[])134int main(int argc, char* argv[])
126{135{
127 MirConnection *connection = 0;136 MirConnection *connection = 0;
@@ -152,6 +161,10 @@
152161
153 puts("Starting");162 puts("Starting");
154163
164 signal(SIGINT, shutdown);
165 signal(SIGTERM, shutdown);
166 signal(SIGHUP, shutdown);
167
155 connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__);168 connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__);
156 assert(connection != NULL);169 assert(connection != NULL);
157 assert(mir_connection_is_valid(connection));170 assert(mir_connection_is_valid(connection));
158171
=== modified file 'examples/server_example.cpp'
--- examples/server_example.cpp 2016-01-29 08:18:22 +0000
+++ examples/server_example.cpp 2016-03-30 00:11:41 +0000
@@ -29,6 +29,7 @@
2929
30#include "mir/server.h"30#include "mir/server.h"
31#include "mir/main_loop.h"31#include "mir/main_loop.h"
32#include "mir/fd.h"
3233
33#include "mir/report_exception.h"34#include "mir/report_exception.h"
34#include "mir/options/option.h"35#include "mir/options/option.h"
@@ -43,6 +44,16 @@
4344
44namespace45namespace
45{46{
47auto connection(int fd) -> std::string
48{
49 char connect_string[64] = {0};
50 // We can't have both the server and the client owning the same fd, since
51 // that will result in a double-close(). We give the client a duplicate which
52 // the client can safely own (and should close when done).
53 sprintf(connect_string, "fd://%d", dup(fd));
54 return connect_string;
55}
56
46void add_launcher_option_to(mir::Server& server)57void add_launcher_option_to(mir::Server& server)
47{58{
48 static const char* const launch_child_opt = "launch-client";59 static const char* const launch_child_opt = "launch-client";
@@ -54,8 +65,19 @@
54 const auto options = server.get_options();65 const auto options = server.get_options();
55 if (options->is_set(launch_child_opt))66 if (options->is_set(launch_child_opt))
56 {67 {
57 auto ignore = std::system((options->get<std::string>(launch_child_opt) + "&").c_str());68 auto const value = options->get<std::string>(launch_child_opt);
58 (void)(ignore);69
70 for (auto i = begin(value); i != end(value); )
71 {
72 auto const j = find(i, end(value), '&');
73
74 auto const cmd = "MIR_SOCKET=" + connection(server.open_client_socket()) + " " + std::string{i, j} + "&";
75
76 auto ignore = std::system(cmd.c_str());
77 (void)(ignore);
78
79 if ((i = j) != end(value)) ++i;
80 }
59 }81 }
60 });82 });
61}83}
6284
=== modified file 'examples/server_example_test_client.cpp'
--- examples/server_example_test_client.cpp 2016-01-29 08:18:22 +0000
+++ examples/server_example_test_client.cpp 2016-03-30 00:11:41 +0000
@@ -17,9 +17,11 @@
17 */17 */
1818
19#include "server_example_test_client.h"19#include "server_example_test_client.h"
20#include "mir/fd.h"
20#include "mir/server.h"21#include "mir/server.h"
21#include "mir/main_loop.h"22#include "mir/main_loop.h"
22#include "mir/logging/logger.h"23#include "mir/logging/logger.h"
24#include "mir/log.h"
23#include "mir/options/option.h"25#include "mir/options/option.h"
2426
25#include <csignal>27#include <csignal>
@@ -100,13 +102,24 @@
100 {102 {
101 context.test_failed = true;103 context.test_failed = true;
102104
105 auto const client_fd = server.open_client_socket();
106
103 auto const pid = fork();107 auto const pid = fork();
104108
105 if (pid == 0)109 if (pid == 0)
106 {110 {
111 char connect_string[64] = {0};
112 // We can't have both the server and the client owning the same fd, since
113 // that will result in a double-close(). We give the client a duplicate which
114 // the client can safely own (and should close when done).
115 sprintf(connect_string, "fd://%d", dup(client_fd));
116
117 setenv("MIR_SOCKET", connect_string, 1);
118
107 auto const client = options->get<std::string>(test_client_opt);119 auto const client = options->get<std::string>(test_client_opt);
108 execl(client.c_str(), client.c_str(), static_cast<char const*>(nullptr));120 execlp(client.c_str(), client.c_str(), static_cast<char const*>(nullptr));
109 ml::log(ml::Severity::critical, "Failed to execute client", component);121 log(logging::Severity::critical, "mir::examples",
122 "Failed to execute client (%s) error: %s", client.c_str(), strerror(errno));
110 abort(); // If execl() returns then something is badly wrong123 abort(); // If execl() returns then something is badly wrong
111 }124 }
112 else if (pid > 0)125 else if (pid > 0)
113126
=== modified file 'examples/server_example_window_management.cpp'
--- examples/server_example_window_management.cpp 2016-01-29 08:18:22 +0000
+++ examples/server_example_window_management.cpp 2016-03-30 00:11:41 +0000
@@ -58,14 +58,14 @@
58 FullscreenWindowManagerPolicy(me::WindowManagerTools* const /*tools*/, std::shared_ptr<msh::DisplayLayout> const& display_layout) :58 FullscreenWindowManagerPolicy(me::WindowManagerTools* const /*tools*/, std::shared_ptr<msh::DisplayLayout> const& display_layout) :
59 display_layout{display_layout} {}59 display_layout{display_layout} {}
6060
61 void handle_session_info_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) {}61 void handle_session_info_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) override {}
6262
63 void handle_displays_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) {}63 void handle_displays_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) override {}
6464
65 auto handle_place_new_surface(65 auto handle_place_new_surface(
66 std::shared_ptr<ms::Session> const& /*session*/,66 std::shared_ptr<ms::Session> const& /*session*/,
67 ms::SurfaceCreationParameters const& request_parameters)67 ms::SurfaceCreationParameters const& request_parameters)
68 -> ms::SurfaceCreationParameters68 -> ms::SurfaceCreationParameters override
69 {69 {
70 auto placed_parameters = request_parameters;70 auto placed_parameters = request_parameters;
7171
@@ -78,29 +78,29 @@
78 void handle_modify_surface(78 void handle_modify_surface(
79 std::shared_ptr<ms::Session> const& /*session*/,79 std::shared_ptr<ms::Session> const& /*session*/,
80 std::shared_ptr<ms::Surface> const& /*surface*/,80 std::shared_ptr<ms::Surface> const& /*surface*/,
81 msh::SurfaceSpecification const& /*modifications*/)81 msh::SurfaceSpecification const& /*modifications*/) override
82 {82 {
83 }83 }
8484
85 void handle_new_surface(std::shared_ptr<ms::Session> const& /*session*/, std::shared_ptr<ms::Surface> const& /*surface*/)85 void handle_new_surface(std::shared_ptr<ms::Session> const& /*session*/, std::shared_ptr<ms::Surface> const& /*surface*/) override
86 {86 {
87 }87 }
8888
89 void handle_delete_surface(std::shared_ptr<ms::Session> const& session, std::weak_ptr<ms::Surface> const& surface)89 void handle_delete_surface(std::shared_ptr<ms::Session> const& session, std::weak_ptr<ms::Surface> const& surface) override
90 { session->destroy_surface(surface); }90 { session->destroy_surface(surface); }
9191
92 int handle_set_state(std::shared_ptr<ms::Surface> const& /*surface*/, MirSurfaceState value)92 int handle_set_state(std::shared_ptr<ms::Surface> const& /*surface*/, MirSurfaceState value) override
93 { return value; }93 { return value; }
9494
95 bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) { return false; }95 bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) override { return false; }
9696
97 bool handle_touch_event(MirTouchEvent const* /*event*/) { return false; }97 bool handle_touch_event(MirTouchEvent const* /*event*/) override { return false; }
9898
99 bool handle_pointer_event(MirPointerEvent const* /*event*/) { return false; }99 bool handle_pointer_event(MirPointerEvent const* /*event*/) override { return false; }
100100
101 void handle_raise_surface(101 void handle_raise_surface(
102 std::shared_ptr<ms::Session> const& /*session*/,102 std::shared_ptr<ms::Session> const& /*session*/,
103 std::shared_ptr<ms::Surface> const& /*surface*/)103 std::shared_ptr<ms::Surface> const& /*surface*/) override
104 {104 {
105 }105 }
106106
@@ -108,7 +108,7 @@
108 std::shared_ptr<ms::Session> const&,108 std::shared_ptr<ms::Session> const&,
109 std::shared_ptr<ms::Surface> const&,109 std::shared_ptr<ms::Surface> const&,
110 SurfaceInfoMap&,110 SurfaceInfoMap&,
111 std::function<mf::SurfaceId(std::shared_ptr<ms::Session> const&, ms::SurfaceCreationParameters const&)> const&)111 std::function<mf::SurfaceId(std::shared_ptr<ms::Session> const&, ms::SurfaceCreationParameters const&)> const&) override
112 {112 {
113 }113 }
114private:114private:
115115
=== modified file 'examples/xcursor_loader.cpp'
--- examples/xcursor_loader.cpp 2016-01-29 08:18:22 +0000
+++ examples/xcursor_loader.cpp 2016-03-30 00:11:41 +0000
@@ -27,7 +27,7 @@
2727
28#include <mir_toolkit/cursors.h>28#include <mir_toolkit/cursors.h>
2929
30// Unforunately this can not be compiled as C++...so we can not namespace30// Unfortunately this can not be compiled as C++...so we can not namespace
31// these symbols. In order to differentiate from internal symbols31// these symbols. In order to differentiate from internal symbols
32// we refer to them via their _ prefixed version, i.e. _XcursorImage32// we refer to them via their _ prefixed version, i.e. _XcursorImage
33extern "C"33extern "C"
3434
=== modified file 'include/client/mir_toolkit/client_types.h'
--- include/client/mir_toolkit/client_types.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/client_types.h 2016-03-30 00:11:41 +0000
@@ -45,6 +45,15 @@
45typedef struct MirBufferStream MirBufferStream;45typedef struct MirBufferStream MirBufferStream;
46typedef struct MirPersistentId MirPersistentId;46typedef struct MirPersistentId MirPersistentId;
47typedef struct MirBlob MirBlob;47typedef struct MirBlob MirBlob;
48typedef struct MirDisplayConfig MirDisplayConfig;
49
50/**
51 * Descriptor for an output connection.
52 *
53 * Each MirOutput corresponds to a video output. This may be a physical connection on the system,
54 * like HDMI or DisplayPort, or may be a virtual output such as a remote display or screencast display.
55 */
56typedef struct MirOutput MirOutput;
4857
49/**58/**
50 * Returned by asynchronous functions. Must not be free'd by59 * Returned by asynchronous functions. Must not be free'd by
@@ -272,6 +281,32 @@
272 mir_display_output_type_edp281 mir_display_output_type_edp
273} MirDisplayOutputType;282} MirDisplayOutputType;
274283
284typedef enum MirOutputType
285{
286 mir_output_type_unknown,
287 mir_output_type_vga,
288 mir_output_type_dvii,
289 mir_output_type_dvid,
290 mir_output_type_dvia,
291 mir_output_type_composite,
292 mir_output_type_svideo,
293 mir_output_type_lvds,
294 mir_output_type_component,
295 mir_output_type_ninepindin,
296 mir_output_type_displayport,
297 mir_output_type_hdmia,
298 mir_output_type_hdmib,
299 mir_output_type_tv,
300 mir_output_type_edp
301} MirOutputType;
302
303typedef enum MirOutputConnectionState
304{
305 mir_output_connection_state_disconnected = 0,
306 mir_output_connection_state_connected,
307 mir_output_connection_state_unknown
308} MirOutputConnectionState;
309
275typedef struct MirDisplayMode310typedef struct MirDisplayMode
276{311{
277 uint32_t vertical_resolution;312 uint32_t vertical_resolution;
@@ -335,6 +370,9 @@
335 unsigned int height;370 unsigned int height;
336} MirRectangle;371} MirRectangle;
337372
373typedef struct MirInputConfig MirInputConfig;
374typedef struct MirInputDevice MirInputDevice;
375
338/**376/**
339 * MirScreencastParameters is the structure of required information that377 * MirScreencastParameters is the structure of required information that
340 * you must provide to Mir in order to create a MirScreencast.378 * you must provide to Mir in order to create a MirScreencast.
@@ -395,6 +433,16 @@
395typedef void (*mir_platform_operation_callback)(433typedef void (*mir_platform_operation_callback)(
396 MirConnection* connection, MirPlatformMessage* reply, void* context);434 MirConnection* connection, MirPlatformMessage* reply, void* context);
397435
436/**
437 * Callback called when a change of input devices has occurred
438 * \param [in] connection The connection associated with the input device
439 * change
440 * \param [in,out] context The context provided by client
441 */
442
443typedef void (*mir_input_config_callback)(
444 MirConnection* connection, void* context);
445
398#ifdef __cplusplus446#ifdef __cplusplus
399}447}
400/**@}*/448/**@}*/
401449
=== modified file 'include/client/mir_toolkit/events/event.h'
--- include/client/mir_toolkit/events/event.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/events/event.h 2016-03-30 00:11:41 +0000
@@ -84,7 +84,7 @@
84extern "C" {84extern "C" {
85#endif85#endif
8686
87/*87/**
88 * Retrieves the type of a MirEvent. Now preferred over direct access to ev->type.88 * Retrieves the type of a MirEvent. Now preferred over direct access to ev->type.
89 * In particular ev->type will never be mir_event_type_input and mir_event_get_type89 * In particular ev->type will never be mir_event_type_input and mir_event_get_type
90 * is the only way to ensure mir_event_get_input_event will succeed.90 * is the only way to ensure mir_event_get_input_event will succeed.
@@ -94,7 +94,7 @@
94 */94 */
95MirEventType mir_event_get_type(MirEvent const* ev);95MirEventType mir_event_get_type(MirEvent const* ev);
9696
97/*97/**
98 * Retrieve the MirInputEvent associated with a MirEvent of 98 * Retrieve the MirInputEvent associated with a MirEvent of
99 * type mir_event_type_input. See <mir_toolkit/events/input/input_event.h>99 * type mir_event_type_input. See <mir_toolkit/events/input/input_event.h>
100 * for accessors.100 * for accessors.
@@ -104,7 +104,7 @@
104 */104 */
105MirInputEvent const* mir_event_get_input_event(MirEvent const* ev);105MirInputEvent const* mir_event_get_input_event(MirEvent const* ev);
106106
107/*107/**
108 * Retrieve the MirSurfaceEvent associated with a MirEvent of108 * Retrieve the MirSurfaceEvent associated with a MirEvent of
109 * type mir_event_type_surface. See <mir_toolkit/events/surface_event.h>109 * type mir_event_type_surface. See <mir_toolkit/events/surface_event.h>
110 * for accessors.110 * for accessors.
@@ -114,7 +114,7 @@
114 */114 */
115MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev);115MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev);
116116
117/*117/**
118 * Retrieve the MirResizeEvent associated with a MirEvent of118 * Retrieve the MirResizeEvent associated with a MirEvent of
119 * type mir_event_type_resize. See <mir_toolkits/events/resize_event.h>119 * type mir_event_type_resize. See <mir_toolkits/events/resize_event.h>
120 * for accessors.120 * for accessors.
@@ -124,7 +124,7 @@
124 */124 */
125MirResizeEvent const* mir_event_get_resize_event(MirEvent const* ev);125MirResizeEvent const* mir_event_get_resize_event(MirEvent const* ev);
126126
127/*127/**
128 * Retrieve the MirPromptSessionEvent associated with a MirEvent of128 * Retrieve the MirPromptSessionEvent associated with a MirEvent of
129 * type mir_event_type_prompt_session_state_change. See <mir_toolkits/events/prompt_session_event.h>129 * type mir_event_type_prompt_session_state_change. See <mir_toolkits/events/prompt_session_event.h>
130 * for accessors.130 * for accessors.
@@ -134,7 +134,7 @@
134 */134 */
135MirPromptSessionEvent const* mir_event_get_prompt_session_event(MirEvent const* ev);135MirPromptSessionEvent const* mir_event_get_prompt_session_event(MirEvent const* ev);
136136
137/*137/**
138 * Retrieve the MirOrientationEvent associated with a MirEvent of138 * Retrieve the MirOrientationEvent associated with a MirEvent of
139 * type mir_event_type_orientation. See <mir_toolkit/events/orientation_event.h>139 * type mir_event_type_orientation. See <mir_toolkit/events/orientation_event.h>
140 * for accessors.140 * for accessors.
@@ -144,7 +144,7 @@
144 */144 */
145MirOrientationEvent const* mir_event_get_orientation_event(MirEvent const* ev);145MirOrientationEvent const* mir_event_get_orientation_event(MirEvent const* ev);
146146
147/*147/**
148 * Retrieve the MirCloseSurfaceEvent associated with a MirEvent of148 * Retrieve the MirCloseSurfaceEvent associated with a MirEvent of
149 * type mir_event_type_close_surface. The event is a request to close149 * type mir_event_type_close_surface. The event is a request to close
150 * the surface it is delivered to and has no accessors.150 * the surface it is delivered to and has no accessors.
@@ -160,7 +160,7 @@
160__attribute__ ((deprecated))160__attribute__ ((deprecated))
161MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev);161MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev);
162162
163/*163/**
164 * Retrieve the MirKeymapEvent associated with a MirEvent of164 * Retrieve the MirKeymapEvent associated with a MirEvent of
165 * type mir_event_type_keymap. The event signifies that the keymap165 * type mir_event_type_keymap. The event signifies that the keymap
166 * applied for the relevant surface has changed.166 * applied for the relevant surface has changed.
@@ -170,7 +170,7 @@
170 */170 */
171MirKeymapEvent const* mir_event_get_keymap_event(MirEvent const* ev);171MirKeymapEvent const* mir_event_get_keymap_event(MirEvent const* ev);
172172
173/*173/**
174 * Retrieve the MirInputConfiguration associated with a MirEvent of174 * Retrieve the MirInputConfiguration associated with a MirEvent of
175 * type mir_event_type_input_configuration. The event signifies that the175 * type mir_event_type_input_configuration. The event signifies that the
176 * input device configuration has changed.176 * input device configuration has changed.
@@ -213,7 +213,7 @@
213 *213 *
214 */214 */
215215
216/*216/**
217 * Reference this MirEvent and return a pointer to the217 * Reference this MirEvent and return a pointer to the
218 * newly referenced instance218 * newly referenced instance
219 *219 *
@@ -222,7 +222,7 @@
222 */222 */
223MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result));223MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result));
224224
225/*225/**
226 * Release a reference to a MirEvent.226 * Release a reference to a MirEvent.
227 *227 *
228 * \param[in] The event to un-reference228 * \param[in] The event to un-reference
229229
=== modified file 'include/client/mir_toolkit/events/input/input_event.h'
--- include/client/mir_toolkit/events/input/input_event.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/events/input/input_event.h 2016-03-30 00:11:41 +0000
@@ -82,7 +82,7 @@
82extern "C" {82extern "C" {
83#endif83#endif
8484
85/*85/**
86 * Retrieves the device id responsible for generating an input event.86 * Retrieves the device id responsible for generating an input event.
87 *87 *
88 * \param [in] event The input event88 * \param [in] event The input event
@@ -90,23 +90,23 @@
90 */90 */
91MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* ev);91MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* ev);
9292
93/*93/**
94 * Retrieve the time at which an input event occured.94 * Retrieve the time at which an input event occurred.
95 *95 *
96 * \param [in] event The input event96 * \param [in] event The input event
97 * \return A timestamp in nanoseconds-since-epoch97 * \return A timestamp in nanoseconds-since-epoch
98 */98 */
99int64_t mir_input_event_get_event_time(MirInputEvent const* ev);99int64_t mir_input_event_get_event_time(MirInputEvent const* ev);
100100
101/*101/**
102 * Retrieve the type of an input event (e.g. key, touch...)102 * Retrieve the type of an input event. E.g. key, touch...
103 *103 *
104 * \param [in] event The input event104 * \param [in] event The input event
105 * \return The input event type105 * \return The input event type
106 */106 */
107MirInputEventType mir_input_event_get_type(MirInputEvent const* ev);107MirInputEventType mir_input_event_get_type(MirInputEvent const* ev);
108108
109/*109/**
110 * Retrieve the MirKeyboardEvent associated with a given input event.110 * Retrieve the MirKeyboardEvent associated with a given input event.
111 *111 *
112 * \param[in] event The input event112 * \param[in] event The input event
@@ -115,7 +115,7 @@
115 */115 */
116MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* ev);116MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* ev);
117117
118/*118/**
119 * Retrieve the MirTouchEvent associated with a given input event.119 * Retrieve the MirTouchEvent associated with a given input event.
120 *120 *
121 * \param[in] event The input event121 * \param[in] event The input event
@@ -124,7 +124,7 @@
124 */124 */
125MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* ev);125MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* ev);
126126
127/*127/**
128 * Retrieve the MirPointerEvent associated with a given input event.128 * Retrieve the MirPointerEvent associated with a given input event.
129 *129 *
130 * \param[in] event The input event130 * \param[in] event The input event
@@ -133,14 +133,16 @@
133 */133 */
134MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* ev);134MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* ev);
135135
136/* Query if an input event contains a cookie136/**
137 * Query if an input event contains a cookie
137 *138 *
138 * \params[in] ev The input event139 * \params[in] ev The input event
139 * \return True if the input event contains a cookie140 * \return True if the input event contains a cookie
140 */141 */
141bool mir_input_event_has_cookie(MirInputEvent const* ev);142bool mir_input_event_has_cookie(MirInputEvent const* ev);
142143
143/* Returns the cookie associated with an input event.144/**
145 * Returns the cookie associated with an input event.
144 *146 *
145 * \pre The input event must have a MirCookie147 * \pre The input event must have a MirCookie
146 * \params[in] ev An input event148 * \params[in] ev An input event
147149
=== modified file 'include/client/mir_toolkit/events/input/keyboard_event.h'
--- include/client/mir_toolkit/events/input/keyboard_event.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/events/input/keyboard_event.h 2016-03-30 00:11:41 +0000
@@ -87,7 +87,7 @@
87 */87 */
88MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const* event);88MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const* event);
8989
90/*90/**
91 * Retrieve the corresponding input event.91 * Retrieve the corresponding input event.
92 *92 *
93 * \param [in] event The keyboard event93 * \param [in] event The keyboard event
9494
=== modified file 'include/client/mir_toolkit/events/input/pointer_event.h'
--- include/client/mir_toolkit/events/input/pointer_event.h 2016-02-24 13:04:14 +0000
+++ include/client/mir_toolkit/events/input/pointer_event.h 2016-03-30 00:11:41 +0000
@@ -130,7 +130,7 @@
130float mir_pointer_event_axis_value(MirPointerEvent const* event, 130float mir_pointer_event_axis_value(MirPointerEvent const* event,
131 MirPointerAxis axis);131 MirPointerAxis axis);
132132
133/*133/**
134 * Retrieve the corresponding input event.134 * Retrieve the corresponding input event.
135 *135 *
136 * \param [in] event The pointer event136 * \param [in] event The pointer event
137137
=== modified file 'include/client/mir_toolkit/events/input/touch_event.h'
--- include/client/mir_toolkit/events/input/touch_event.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/events/input/touch_event.h 2016-03-30 00:11:41 +0000
@@ -141,7 +141,7 @@
141float mir_touch_event_axis_value(MirTouchEvent const* event, 141float mir_touch_event_axis_value(MirTouchEvent const* event,
142 size_t touch_index, MirTouchAxis axis);142 size_t touch_index, MirTouchAxis axis);
143143
144/*144/**
145 * Retrieve the corresponding input event.145 * Retrieve the corresponding input event.
146 *146 *
147 * \param [in] event The touch event147 * \param [in] event The touch event
148148
=== modified file 'include/client/mir_toolkit/events/input_configuration_event.h'
--- include/client/mir_toolkit/events/input_configuration_event.h 2015-05-19 21:34:34 +0000
+++ include/client/mir_toolkit/events/input_configuration_event.h 2016-03-30 00:11:41 +0000
@@ -46,7 +46,7 @@
46 mir_input_configuration_action_device_reset46 mir_input_configuration_action_device_reset
47} MirInputConfigurationAction;47} MirInputConfigurationAction;
4848
49/*49/**
50 * Retrieve the input configuration action which occurred.50 * Retrieve the input configuration action which occurred.
51 *51 *
52 * \param[in] ev The input configuration event52 * \param[in] ev The input configuration event
@@ -54,7 +54,7 @@
54 */54 */
55MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev);55MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev);
5656
57/*57/**
58 * Retreive the time associated with a MirInputConfiguration event58 * Retreive the time associated with a MirInputConfiguration event
5959
60 * \param[in] ev The input configuration event60 * \param[in] ev The input configuration event
@@ -62,7 +62,7 @@
62 */62 */
63int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev);63int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev);
6464
65/*65/**
66 * Retreive the device id associated with a MirInputConfiguration event66 * Retreive the device id associated with a MirInputConfiguration event
6767
68 * \param[in] ev The input configuration event68 * \param[in] ev The input configuration event
6969
=== modified file 'include/client/mir_toolkit/events/keymap_event.h'
--- include/client/mir_toolkit/events/keymap_event.h 2016-01-22 17:12:31 +0000
+++ include/client/mir_toolkit/events/keymap_event.h 2016-03-30 00:11:41 +0000
@@ -31,7 +31,7 @@
31extern "C" {31extern "C" {
32#endif32#endif
3333
34/*34/**
35 * Retrieve the new keymap reported by this MirKeymapEvent35 * Retrieve the new keymap reported by this MirKeymapEvent
36 *36 *
37 * \deprecated keymap credentials are no longer available use37 * \deprecated keymap credentials are no longer available use
@@ -44,7 +44,7 @@
44 struct xkb_rule_names* names)44 struct xkb_rule_names* names)
45 __attribute__ ((deprecated));45 __attribute__ ((deprecated));
4646
47/*47/**
48 * Retrieve the new keymap reported by this MirKeymapEvent48 * Retrieve the new keymap reported by this MirKeymapEvent
49 *49 *
50 * The keymap buffer is only valid while the MirKeymapEvent is valid.50 * The keymap buffer is only valid while the MirKeymapEvent is valid.
@@ -56,7 +56,7 @@
56void mir_keymap_event_get_keymap_buffer(MirKeymapEvent const* ev,56void mir_keymap_event_get_keymap_buffer(MirKeymapEvent const* ev,
57 char const** buffer, size_t *length);57 char const** buffer, size_t *length);
5858
59/*59/**
60 * Retrieve the device id the keymap reported by this MirKeymapEvent applies to60 * Retrieve the device id the keymap reported by this MirKeymapEvent applies to
61 *61 *
62 * \param[in] ev The keymap event62 * \param[in] ev The keymap event
6363
=== modified file 'include/client/mir_toolkit/events/orientation_event.h'
--- include/client/mir_toolkit/events/orientation_event.h 2014-12-09 00:43:43 +0000
+++ include/client/mir_toolkit/events/orientation_event.h 2016-03-30 00:11:41 +0000
@@ -29,7 +29,7 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32/*32/**
33 * Retrieve the new orientation reported by this MirOrientationEvent33 * Retrieve the new orientation reported by this MirOrientationEvent
34 *34 *
35 * \param[in] ev The orientation event35 * \param[in] ev The orientation event
3636
=== modified file 'include/client/mir_toolkit/events/prompt_session_event.h'
--- include/client/mir_toolkit/events/prompt_session_event.h 2014-12-11 17:49:31 +0000
+++ include/client/mir_toolkit/events/prompt_session_event.h 2016-03-30 00:11:41 +0000
@@ -29,7 +29,7 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32/*32/**
33 * Retrieve the new prompt session state reported by a given MirPromptSessionEvent33 * Retrieve the new prompt session state reported by a given MirPromptSessionEvent
34 *34 *
35 * \param [in] event The prompt session event35 * \param [in] event The prompt session event
3636
=== modified file 'include/client/mir_toolkit/events/resize_event.h'
--- include/client/mir_toolkit/events/resize_event.h 2014-12-11 17:49:31 +0000
+++ include/client/mir_toolkit/events/resize_event.h 2016-03-30 00:11:41 +0000
@@ -29,7 +29,7 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32/*32/**
33 * Retrieve the new width reported by a given MirResizeEvent33 * Retrieve the new width reported by a given MirResizeEvent
34 * 34 *
35 * \param[in] ev The resize event35 * \param[in] ev The resize event
@@ -37,7 +37,7 @@
37 */37 */
38int mir_resize_event_get_width(MirResizeEvent const* ev);38int mir_resize_event_get_width(MirResizeEvent const* ev);
3939
40/*40/**
41 * Retrieve the new height reported by a given MirResizeEvent41 * Retrieve the new height reported by a given MirResizeEvent
42 * 42 *
43 * \param[in] ev The resize event43 * \param[in] ev The resize event
4444
=== modified file 'include/client/mir_toolkit/events/surface_event.h'
--- include/client/mir_toolkit/events/surface_event.h 2014-12-09 00:43:43 +0000
+++ include/client/mir_toolkit/events/surface_event.h 2016-03-30 00:11:41 +0000
@@ -29,7 +29,7 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32/*32/**
33 * Retrieve the attribute index configured with a given MirSurfaceEvent33 * Retrieve the attribute index configured with a given MirSurfaceEvent
34 *34 *
35 * \param [in] Event The event35 * \param [in] Event The event
@@ -37,7 +37,7 @@
37 */37 */
38MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev);38MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev);
3939
40/*40/**
41 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent41 * Retrieve the new value of the associated attribute for a given MirSurfaceEvent
42 *42 *
43 * \param [in] Event The event43 * \param [in] Event The event
4444
=== modified file 'include/client/mir_toolkit/mir_client_library.h'
--- include/client/mir_toolkit/mir_client_library.h 2016-01-22 05:26:25 +0000
+++ include/client/mir_toolkit/mir_client_library.h 2016-03-30 00:11:41 +0000
@@ -26,5 +26,7 @@
26#include <mir_toolkit/mir_platform_message.h>26#include <mir_toolkit/mir_platform_message.h>
27#include <mir_toolkit/cursors.h>27#include <mir_toolkit/cursors.h>
28#include <mir_toolkit/mir_cookie.h>28#include <mir_toolkit/mir_cookie.h>
29#include <mir_toolkit/mir_display_configuration.h>
30#include <mir_toolkit/mir_input_device.h>
2931
30#endif /* MIR_CLIENT_LIBRARY_H */32#endif /* MIR_CLIENT_LIBRARY_H */
3133
=== modified file 'include/client/mir_toolkit/mir_connection.h'
--- include/client/mir_toolkit/mir_connection.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/mir_connection.h 2016-03-30 00:11:41 +0000
@@ -145,6 +145,9 @@
145145
146/**146/**
147 * Query the display147 * Query the display
148 *
149 * \deprecated Use mir_connection_create_display_configuration() instead.
150 *
148 * \warning return value must be destroyed via mir_display_config_destroy()151 * \warning return value must be destroyed via mir_display_config_destroy()
149 * \warning may return null if connection is invalid152 * \warning may return null if connection is invalid
150 * \param [in] connection The connection153 * \param [in] connection The connection
@@ -153,9 +156,20 @@
153MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection);156MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection);
154157
155/**158/**
159 * Query the display
160 *
161 * \pre mir_connection_is_valid(connection) == true
162 * \warning return value must be destroyed via mir_display_config_release()
163 *
164 * \param [in] connection The connection
165 * \return structure that describes the display configuration
166 */
167MirDisplayConfig* mir_connection_create_display_configuration(MirConnection* connection);
168
169/**
156 * Register a callback to be called when the hardware display configuration changes170 * Register a callback to be called when the hardware display configuration changes
157 *171 *
158 * Once a change has occurred, you can use mir_connection_create_display_config to see172 * Once a change has occurred, you can use mir_connection_create_display_configuration to see
159 * the new configuration.173 * the new configuration.
160 *174 *
161 * \param [in] connection The connection175 * \param [in] connection The connection
@@ -266,6 +280,38 @@
266 MirPlatformMessage const* request,280 MirPlatformMessage const* request,
267 mir_platform_operation_callback callback, void* context);281 mir_platform_operation_callback callback, void* context);
268282
283/**
284 * Create a snapshot of the attached input devices and device configurations.
285 * \warning return value must be destroyed via mir_input_config_destroy()
286 * \warning may return null if connection is invalid
287 * \param [in] connection The connection
288 * \return structure that describes the input configuration
289 */
290MirInputConfig* mir_connection_create_input_config(MirConnection *connection);
291
292/**
293 * Release this snapshot of the input configuration.
294 * This invalidates any pointers retrieved from this structure.
295 *
296 * \param [in] devices The input configuration
297 */
298void mir_input_config_destroy(MirInputConfig const* config);
299
300/**
301 * Register a callback to be called when the input devices change.
302 *
303 * Once a change has occurred, you can use mir_connection_create_input_config
304 * to get an updated snapshot of the input device configuration.
305 *
306 * \param [in] connection The connection
307 * \param [in] callback The function to be called when a change occurs
308 * \param [in,out] context User data passed to the callback function
309 */
310void mir_connection_set_input_config_change_callback(
311 MirConnection* connection,
312 mir_input_config_callback callback, void* context);
313
314
269#ifdef __cplusplus315#ifdef __cplusplus
270}316}
271/**@}*/317/**@}*/
272318
=== modified file 'include/client/mir_toolkit/mir_cookie.h'
--- include/client/mir_toolkit/mir_cookie.h 2016-01-25 13:41:23 +0000
+++ include/client/mir_toolkit/mir_cookie.h 2016-03-30 00:11:41 +0000
@@ -29,14 +29,16 @@
29extern "C" {29extern "C" {
30#endif30#endif
3131
32/* Queries the size needed to serialize a given cookie32/**
33 * Queries the size needed to serialize a given cookie
33 *34 *
34 * \params[in] cookie A cookie instance35 * \params[in] cookie A cookie instance
35 * \return The size of the serialized representation of the given cookie36 * \return The size of the serialized representation of the given cookie
36 */37 */
37size_t mir_cookie_buffer_size(MirCookie const* cookie);38size_t mir_cookie_buffer_size(MirCookie const* cookie);
3839
39/* Serializes a cookie into the given buffer40/**
41 * Serializes a cookie into the given buffer
40 *42 *
41 * \pre The size must be equal to mir_cookie_size43 * \pre The size must be equal to mir_cookie_size
42 * \params[in] cookie A cookie instance44 * \params[in] cookie A cookie instance
@@ -46,7 +48,8 @@
46 */48 */
47void mir_cookie_to_buffer(MirCookie const* cookie, void* buffer, size_t size);49void mir_cookie_to_buffer(MirCookie const* cookie, void* buffer, size_t size);
4850
49/* Create a cookie from a serialized representation51/**
52 * Create a cookie from a serialized representation
50 *53 *
51 * \params[in] buffer The buffer containing a serialized cookie.54 * \params[in] buffer The buffer containing a serialized cookie.
52 * The buffer may be freed immediately after this call.55 * The buffer may be freed immediately after this call.
@@ -57,7 +60,8 @@
57 */60 */
58MirCookie const* mir_cookie_from_buffer(void const* buffer, size_t size);61MirCookie const* mir_cookie_from_buffer(void const* buffer, size_t size);
5962
60/* Release the MirCookie63/**
64 * Release the MirCookie
61 *65 *
62 * \params[in] cookie The cookie to release66 * \params[in] cookie The cookie to release
63 */67 */
6468
=== added file 'include/client/mir_toolkit/mir_display_configuration.h'
--- include/client/mir_toolkit/mir_display_configuration.h 1970-01-01 00:00:00 +0000
+++ include/client/mir_toolkit/mir_display_configuration.h 2016-03-30 00:11:41 +0000
@@ -0,0 +1,386 @@
1/*
2 * Copyright © 2016 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 * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17 */
18
19#ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
20#define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
21
22#include "client_types.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 * \addtogroup mir_toolkit
30 * @{
31 */
32
33/**
34 * A descriptor for a display mode.
35 *
36 * A display mode contains all the information necessary to drive a display. It
37 * includes resolution and refresh rate, but also pixel clock, vsync and hsync
38 * timings, and so on.
39 */
40typedef struct MirOutputMode MirOutputMode;
41
42/**
43 * Release resources associated with a MirDisplayConfig handle.
44 *
45 * \param [in] config The handle to release
46 */
47void mir_display_config_release(MirDisplayConfig* config);
48
49/**
50 * Get the maximum possible number of simultaneously active outputs this system
51 * supports.
52 *
53 * \note There may be restrictions on the configuration required to achieve this
54 * many active outputs. Typically the achievable number of simultaneously active
55 * outputs is lower than this number.
56 *
57 * \param [in] config The configuration to query
58 * \returns The maximum number of simultaneously active outputs
59 * supportable at this time.
60 */
61int mir_display_config_get_max_simultaneous_outputs(
62 MirDisplayConfig const* config);
63
64/**
65 * Get the number of outputs available in this display configuration.
66 *
67 * This returns the total number of outputs the system has. This includes both
68 * enabled and disabled output connections, and is typically larger than the
69 * value returned from mir_display_config_get_max_simultaneous_outputs().
70 *
71 * Typically this will be constant over the lifetime of a client as devices
72 * usually do not gain extra physical ports at runtime. However, hotpluggable
73 * display devices exist and the number of virtual outputs may change at
74 * runtime, so this should always be called to determine the number of outputs
75 * to iterate over.
76 *
77 * \param [in] config The configuration to query
78 * \returns The number of outputs available in this configuration.
79 */
80int mir_display_config_get_num_outputs(MirDisplayConfig const* config);
81
82/**
83 * Get a read-only handle to the index 'th output of this configuration
84 *
85 * \note The MirOutput handle is only valid while config is valid.
86 * \pre 0 <= index < mir_display_config_get_num_outputs(config)
87 * \param [in] config The configuration to query
88 * \param [in] index The index of the output to get
89 * \returns A read-only handle to a MirOutput within config which is valid
90 * until mir_display_config_release(config) is called.
91 */
92MirOutput const* mir_display_config_get_output(MirDisplayConfig const* config,
93 size_t index);
94
95/**
96 * Get the number of modes in the supported mode list of this output.
97 *
98 * The list of supported modes is retrieved from the hardware, possibly modified
99 * by any applicable quirk tables, and may not be exhaustive.
100 *
101 * \param [in] output The MirOutput to query
102 * \returns The number of modes in the supported mode list of output.
103 */
104int mir_output_get_num_modes(MirOutput const* output);
105
106/**
107 * Get a handle for a mode descriptor from the list of supported modes.
108 *
109 * The list of supported modes is retrieved from the hardware, possibly modified
110 * by any applicable quirk tables, and may not be exhaustive.
111 *
112 * \pre 0 <= index < mir_output_get_num_modes(output)
113 * \note The handle remains valid as long as output is valid.
114 *
115 * \param [in] output The MirOutput to query
116 * \param [in] index The index of the mode to retrieve.
117 * \returns A handle for a description of the supported mode. This is valid
118 * for as long as output is valid. The return value is never null.
119 */
120MirOutputMode const* mir_output_get_mode(MirOutput const* output, size_t index);
121
122/**
123 * Get a handle to the output's preferred mode.
124 *
125 * This is provided by the output itself. For modern displays (LCD, OLED, etc)
126 * it is typically a mode with the native resolution.
127 *
128 * An output may not have a preferred mode, in which case this call will return
129 * NULL.
130 *
131 * \note The handle remains valid as long as output is valid.
132 *
133 * \param [in] output The MirOutput to query
134 * \returns A handle for a description of the supported mode. This is valid
135 * for as long as output is valid. If the output does not have a
136 * preferred mode, it returns NULL.
137 */
138MirOutputMode const* mir_output_get_preferred_mode(MirOutput const* output);
139
140/**
141 * Get a handle to the output's current mode.
142 *
143 * An output may not have a current mode (for example, if it is disabled), in
144 * which case this call will return NULL.
145 *
146 * \note The handle remains valid as long as output is valid.
147 *
148 * \param [in] output The MirOutput to query
149 * \returns A handle for a description of the supported mode. This is valid
150 * for as long as output is valid. If the output does not have a
151 * current mode, it returns NULL.
152 */
153MirOutputMode const* mir_output_get_current_mode(MirOutput const* output);
154
155/**
156 * Get the number of pixel formats supported by this output
157 *
158 * \param [in] output The MirOutput to query
159 * \returns The number of pixel formats for output.
160 */
161int mir_output_get_num_pixel_formats(MirOutput const* output);
162
163/**
164 * Get a pixel format from the list of supported formats
165 *
166 * \pre 0 <= index < mir_output_get_num_pixel_formats(output)
167 *
168 * \param [in] output The MirOutput to query
169 * \param [in] index The index of the format to query
170 * \returns The index 'th supported pixel format.
171 */
172MirPixelFormat mir_output_get_pixel_format(MirOutput const* output,
173 size_t index);
174
175/**
176 * Get the current pixel format.
177 *
178 * \param [in] output The MirOutput to query
179 * \returns The current pixel format. This may be mir_pixel_format_invalid
180 * (for example, if the output is not currently enabled).
181 */
182MirPixelFormat mir_output_get_current_pixel_format(MirOutput const* output);
183
184/**
185 * Set the output format
186 *
187 * \param [in] output The MirOutput to modify
188 * \param [in] format The MirPixelFormat to set
189 */
190void mir_output_set_pixel_format(MirOutput* output, MirPixelFormat format);
191
192/**
193 * Get the ID of an output
194 *
195 * This can be used to refer to the output in other parts of the API, such as
196 * mir_surface_spec_set_fullscreen_on_output().
197 *
198 * \param [in] output The MirOutput to query.
199 * \returns The ID of output, which may be used to refer to it in other
200 * parts of the API.
201 */
202int mir_output_get_id(MirOutput const* output);
203
204/**
205 * Get the physical connection type of an output.
206 *
207 * This is a best-effort determination, and may be incorrect.
208 *
209 * \param [in] output The MirOutput to query
210 * \returns The type of the display connection, or mir_output_type_unknown
211 * if it cannot be determined.
212 */
213MirOutputType mir_output_get_type(MirOutput const* output);
214
215/**
216 * Get the x coordinate of the top-left point of the output in the virtual
217 * display space.
218 *
219 * Outputs can be thought of as viewports into a virtual display space. They may
220 * freely overlap, coincide, or be disjoint as desired.
221 *
222 * Output orientation changes the orientation of the output rectangle in virtual
223 * display space, but does not change its top-left corner.
224 *
225 * \param [in] output The MirOutput to query
226 * \returns The x coordinate of the top-left point of the output in the
227 * virtual display space.
228 */
229int mir_output_get_position_x(MirOutput const* output);
230
231/**
232 * Get the y coordinate of the top-left point of the output in the virtual
233 * display space.
234 *
235 * Outputs can be thought of as viewports into a virtual display space. They may
236 * freely overlap, coincide, or be disjoint as desired.
237 *
238 * Output orientation changes the orientation of the output rectangle in virtual
239 * display space, but does not change its top-left corner.
240 *
241 * \param [in] output The MirOutput to query
242 * \returns The y coordinate of the top-left point of the output in the
243 * virtual display space.
244 */
245int mir_output_get_position_y(MirOutput const* output);
246
247/**
248 * Get whether there is a display physically connected to the output.
249 *
250 * This gives a best-effort determination of whether or not enabling this output
251 * will result in an image being displayed to the user.
252 *
253 * The accuracy of this determination varies with connection type - for example,
254 * for DisplayPort and HDMI connections a return value of
255 * mir_output_connection_state_connected is usually a reliable indicator that
256 * there is a powered-on display connected.
257 *
258 * VGA and DVI connectors can usually determine whether or not there is a
259 * physically connected display, but cannot distinguish between a powered or
260 * unpowered display.
261 *
262 * It is not always possible to determine whether or not there is a display
263 * connected; in such cases mir_output_connection_state_unknown is returned.
264 *
265 * \param [in] output The MirOutput to query
266 * \returns Whether there is a display connected to this output.
267 */
268MirOutputConnectionState mir_output_get_connection_state(
269 MirOutput const* output);
270
271/**
272 * Get whether this output is enabled in the current configuration.
273 *
274 * \param [in] output the MirOutput to query
275 * \returns Whether the output is enabled.
276 */
277bool mir_output_is_enabled(MirOutput const* output);
278
279/**
280 * Get the physical width of the connected display, in millimetres.
281 *
282 * A best-effort report of the physical width of the display connected to this
283 * output. This is retrieved from the display hardware, possibly modified by any
284 * applicable quirk tables.
285 *
286 * Where this information is unavailable or inapplicable (for example,
287 * projectors), 0 is returned.
288 *
289 * \param [in] output the MirOutput to query
290 * \returns Physical width of the connected display, in mm.
291 */
292int mir_output_get_physical_width_mm(MirOutput const* output);
293
294/**
295 * Get the physical height of the connected display, in millimetres.
296 *
297 * A best-effort report of the physical height of the display connected to this
298 * output. This is retrieved from the display hardware, possibly modified by any
299 * applicable quirk tables.
300 *
301 * Where this information is unavailable or inapplicable (for example,
302 * projectors), 0 is returned.
303 *
304 * \param [in] output the MirOutput to query
305 * \returns Physical height of the connected display, in mm.
306 */
307int mir_output_get_physical_height_mm(MirOutput const* output);
308
309/**
310 * Get the power state of a connected display.
311 *
312 * It is undefined which power state is returned for an output which is not
313 * connected.
314 *
315 * \param [in] output The MirOutput to query
316 * \returns The power state of the display connected to output.
317 */
318MirPowerMode mir_output_get_power_mode(MirOutput const* output);
319
320/**
321 * Get the orientation of a display.
322 *
323 * \param [in] output The MirOutput to query
324 * \returns The orientation of output
325 */
326MirOrientation mir_output_get_orientation(MirOutput const* output);
327
328/**
329 * Get the scale-factor of a display
330 *
331 * The scale-factor specifies the conversion between logical pixels and physical pixels on this output.
332 *
333 * A surface with dimensions 200×100 on an output with scale-factor 2.0 will display 400x200 pixels
334 * on this output, will display 300x150 pixels on an output with scale-factor 1.5, and so on.
335 *
336 * Where this calculation would result in a fractional number of pixels the floor is used, so a surface with
337 * dimensions 101x100 on an output with scale-factor of 1.5 will display 151x150 pixels, not 152x150.
338 *
339 * \param [in] output The MirOutput to query
340 * \returns The scale-factor of this monitor
341 */
342float mir_output_get_scale_factor(MirOutput const* output);
343
344/**
345 * Get the form-factor of a connected output.
346 *
347 * This call succeeds even if the output is not connected, but may return nonsense values.
348 *
349 * \param [in] output The MirOutput to query
350 * \returns The form factor of this output
351 */
352MirFormFactor mir_output_get_form_factor(MirOutput const* output);
353
354/**
355 * Get the width, in pixels, of a MirOutputMode
356 *
357 * \note This is unaffected by the orientation of the output
358 *
359 * \param [in] mode The MirOutputMode to query
360 * \returns The width, in pixels, of mode.
361 */
362int mir_output_mode_get_width(MirOutputMode const* mode);
363
364/** Get the height, in pixels, of a MirOutputMode
365 *
366 * \note This is unaffected by the orientation of the output
367 *
368 * \param [in] mode The MirOutputMode to query
369 * \returns The height, in pixels, of mode.
370 */
371int mir_output_mode_get_height(MirOutputMode const* mode);
372
373/** Get the refresh rate, in Hz, of a MirOutputMode
374 *
375 * \param [in] mode The MirOutputMode to query
376 * \returns The refresh rate, in Hz, of mode
377 */
378double mir_output_mode_get_refresh_rate(MirOutputMode const* mode);
379
380/**@}*/
381
382#ifdef __cplusplus
383}
384#endif
385
386#endif //MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
0387
=== modified file 'include/client/mir_toolkit/mir_input_device.h'
--- include/client/mir_toolkit/mir_input_device.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/mir_input_device.h 2016-03-30 00:11:41 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2015 Canonical Ltd.2 * Copyright © 2015-2016 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * 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,5 * under the terms of the GNU Lesser General Public License version 3,
@@ -18,6 +18,8 @@
18#ifndef MIR_TOOLKIT_MIR_INPUT_DEVICE_H_18#ifndef MIR_TOOLKIT_MIR_INPUT_DEVICE_H_
19#define MIR_TOOLKIT_MIR_INPUT_DEVICE_H_19#define MIR_TOOLKIT_MIR_INPUT_DEVICE_H_
2020
21#include "mir_toolkit/client_types.h"
22
21/**23/**
22 * \addtogroup mir_toolkit24 * \addtogroup mir_toolkit
23 * @{25 * @{
@@ -64,6 +66,134 @@
64} MirTouchpadScrollMode;66} MirTouchpadScrollMode;
65typedef unsigned int MirTouchpadScrollModes;67typedef unsigned int MirTouchpadScrollModes;
6668
69enum MirInputDeviceCapability
70{
71 mir_input_device_capability_none = 0,
72 mir_input_device_capability_pointer = 1<<1,
73 mir_input_device_capability_keyboard = 1<<2,
74 mir_input_device_capability_touchpad = 1<<3,
75 mir_input_device_capability_touchscreen = 1<<4,
76 mir_input_device_capability_gamepad = 1<<5,
77 mir_input_device_capability_joystick = 1<<6,
78 mir_input_device_capability_switch = 1<<7,
79 mir_input_device_capability_multitouch = 1<<8, //! capable to detect multiple contacts
80 mir_input_device_capability_alpha_numeric = 1<<9 //! offers enough keys for text entry
81};
82typedef unsigned int MirInputDeviceCapabilities;
83
84/**
85 * Retrieve the number of available input devices.
86 *
87 * \param [in] config The input configuration snapshot
88 *
89 * \return Number of input devices
90 */
91size_t mir_input_config_device_count(MirInputConfig const* config);
92
93/**
94 * Retrieve the input device at given \a index.
95 *
96 * The pointer returned stays valid until mir_input_config_destroy
97 * is called with \a config.
98 *
99 * \param [in] config The input configuration snapshot
100 * \param [in] index The index of the input device to return.
101 * \return input device
102 */
103MirInputDevice const* mir_input_config_get_device(
104 MirInputConfig const* config,
105 size_t index);
106
107/**
108 * Retrieve the input device by \a id.
109 *
110 * The MirInputDevice returned stays valid until mir_input_config_destroy
111 * is called with \a config. If no device with the given \a id is found
112 * NULL will be returned.
113 *
114 * \param [in] config The input configuration snapshot
115 * \param [in] id The input device id to search for
116 *
117 * \return input device
118 */
119MirInputDevice const* mir_input_config_get_device_by_id(
120 MirInputConfig const* config,
121 MirInputDeviceId id);
122
123/**
124 * Retrieve the input device at given \a index.
125 *
126 * The pointer returned stays valid until mir_input_config_destroy
127 * is called with \a config.
128 *
129 * \param [in] config The input configuration snapshot
130 * \param [in] index The index of the input device to return.
131 * \return input device
132 */
133MirInputDevice* mir_input_config_get_mutable_device(
134 MirInputConfig* config,
135 size_t index);
136
137/**
138 * Retrieve the input device by \a id.
139 *
140 * The MirInputDevice returned stays valid until mir_input_config_destroy
141 * is called with \a config. If no device with the given \a id is found
142 * NULL will be returned.
143 *
144 * \param [in] config The input configuration snapshot
145 * \param [in] id The input device id to search for
146 *
147 * \return input device
148 */
149MirInputDevice* mir_input_config_get_mutable_device_by_id(
150 MirInputConfig* config,
151 MirInputDeviceId id);
152
153/**
154 * Retrieve the capabilities of the input device at the given index.
155 *
156 * \param [in] device The input device
157 *
158 * \return The capability flags of the input device
159 */
160MirInputDeviceCapabilities mir_input_device_get_capabilities(
161 MirInputDevice const* device);
162
163/**
164 * Retrieve the device id of the input device.
165 * The device id is a unique integer value, only valid while the device is
166 * attached. The device id matches the device id attached every input event.
167 *
168 * \param [in] device The input device
169 *
170 * \return The device id of the input device
171 */
172MirInputDeviceId mir_input_device_get_id(MirInputDevice const* device);
173
174/**
175 * Retrieve the name of the input device.
176 * The string pointed to will be valid as long as MirInputDevice is valid.
177 * The name may be empty but never NULL.
178 *
179 * \param [in] device The input device
180 *
181 * \return The name of the input device
182 */
183char const* mir_input_device_get_name(MirInputDevice const* device);
184
185/**
186 * Retrieve the unique id of the input device.
187 * The string pointed to will be valid as long as \a device is valid.
188 * The value of the unique id of a given device should be valid across mir
189 * connections session and servers of the same version.
190 *
191 * \param [in] device The input device
192 *
193 * \return The unique id of the input device
194 */
195char const* mir_input_device_get_unique_id(MirInputDevice const* device);
196
67#ifdef __cplusplus197#ifdef __cplusplus
68}198}
69#endif199#endif
70200
=== modified file 'include/client/mir_toolkit/mir_surface.h'
--- include/client/mir_toolkit/mir_surface.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/mir_surface.h 2016-03-30 00:11:41 +0000
@@ -494,6 +494,17 @@
494 MirRectangle const *rectangles,494 MirRectangle const *rectangles,
495 size_t n_rects);495 size_t n_rects);
496496
497/**
498 * Set the event handler to be called when events arrive for a surface.
499 * \warning event_handler could be called from another thread. You must do
500 * any locking appropriate to protect your data accessed in the
501 * callback. There is also a chance that different events will be
502 * called back in different threads, for the same surface,
503 * simultaneously.
504 * \param [in] spec The spec to accumulate the request in.
505 * \param [in] callback The callback function
506 * \param [in] context Additional argument to be passed to callback
507 */
497void mir_surface_spec_set_event_handler(508void mir_surface_spec_set_event_handler(
498 MirSurfaceSpec* spec,509 MirSurfaceSpec* spec,
499 mir_surface_event_callback callback,510 mir_surface_event_callback callback,
@@ -766,13 +777,13 @@
766 */777 */
767MirPersistentId* mir_persistent_id_from_string(char const* string_representation);778MirPersistentId* mir_persistent_id_from_string(char const* string_representation);
768779
769/*780/**
770* Attempts to raise the surface to the front.781 * Attempts to raise the surface to the front.
771*782 *
772* \param [in] surface The surface to raise783 * \param [in] surface The surface to raise
773* \param [in] cookie A cookie instance obtained from an input event.784 * \param [in] cookie A cookie instance obtained from an input event.
774* An invalid cookie will terminate the client connection.785 * An invalid cookie will terminate the client connection.
775*/786 */
776void mir_surface_raise(MirSurface* surface, MirCookie const* cookie);787void mir_surface_raise(MirSurface* surface, MirCookie const* cookie);
777788
778#ifdef __cplusplus789#ifdef __cplusplus
779790
=== modified file 'include/client/mir_toolkit/version.h'
--- include/client/mir_toolkit/version.h 2016-01-29 08:18:22 +0000
+++ include/client/mir_toolkit/version.h 2016-03-30 00:11:41 +0000
@@ -43,7 +43,7 @@
43 * 43 *
44 * See also: http://semver.org/44 * See also: http://semver.org/
45 */45 */
46#define MIR_CLIENT_MINOR_VERSION (2)46#define MIR_CLIENT_MINOR_VERSION (3)
4747
48/**48/**
49 * MIR_CLIENT_MICRO_VERSION49 * MIR_CLIENT_MICRO_VERSION
5050
=== modified file 'include/common/mir/logging/logger.h'
--- include/common/mir/logging/logger.h 2016-01-29 08:18:22 +0000
+++ include/common/mir/logging/logger.h 2016-03-30 00:11:41 +0000
@@ -45,7 +45,15 @@
45 const std::string& message,45 const std::string& message,
46 const std::string& component) = 0;46 const std::string& component) = 0;
4747
48 virtual void log(char const* component, Severity severity, char const* format, ...);48 /*
49 * Those playing at home may wonder why we're saying the 4th argument is the format string,
50 * when it's the 3rd argument in the signature.
51 *
52 * The answer, of course, is that the attribute doesn't know about the implicit
53 * 'this' first parameter of C++!
54 */
55 virtual void log(char const* component, Severity severity, char const* format, ...)
56 __attribute__ ((format (printf, 4, 5)));
4957
50protected:58protected:
51 Logger() {}59 Logger() {}
5260
=== modified file 'include/server/mir/input/input_device_hub.h'
--- include/server/mir/input/input_device_hub.h 2015-05-19 21:34:34 +0000
+++ include/server/mir/input/input_device_hub.h 2016-03-30 00:11:41 +0000
@@ -25,6 +25,7 @@
25{25{
26namespace input26namespace input
27{27{
28class Device;
28class InputDeviceInfo;29class InputDeviceInfo;
29class InputDeviceObserver;30class InputDeviceObserver;
3031
@@ -36,6 +37,7 @@
3637
37 virtual void add_observer(std::shared_ptr<InputDeviceObserver> const&) = 0;38 virtual void add_observer(std::shared_ptr<InputDeviceObserver> const&) = 0;
38 virtual void remove_observer(std::weak_ptr<InputDeviceObserver> const&) = 0;39 virtual void remove_observer(std::weak_ptr<InputDeviceObserver> const&) = 0;
40 virtual void for_each_input_device(std::function<void(Device const& device)> const& callback) = 0;
3941
40 InputDeviceHub(InputDeviceHub const&) = delete;42 InputDeviceHub(InputDeviceHub const&) = delete;
41 InputDeviceHub& operator=(InputDeviceHub const&) = delete;43 InputDeviceHub& operator=(InputDeviceHub const&) = delete;
4244
=== modified file 'include/server/mir/input/input_manager.h'
--- include/server/mir/input/input_manager.h 2015-06-17 05:20:42 +0000
+++ include/server/mir/input/input_manager.h 2016-03-30 00:11:41 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012, 2016 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU General Public License version 3,
@@ -32,6 +32,8 @@
32class InputManager32class InputManager
33{33{
34public:34public:
35 // TODO Remove add_platform() when we next break mirserver ABI
36 __attribute__ ((deprecated))
35 virtual void add_platform(std::shared_ptr<Platform> const& platform) = 0;37 virtual void add_platform(std::shared_ptr<Platform> const& platform) = 0;
36 virtual void start() = 0;38 virtual void start() = 0;
37 virtual void stop() = 0;39 virtual void stop() = 0;
3840
=== modified file 'include/test/mir/test/display_config_matchers.h'
--- include/test/mir/test/display_config_matchers.h 2016-01-29 08:18:22 +0000
+++ include/test/mir/test/display_config_matchers.h 2016-03-30 00:11:41 +0000
@@ -54,31 +54,60 @@
54namespace test54namespace test
55{55{
5656
57bool compare_display_configurations(graphics::DisplayConfiguration const& display_config1,57bool compare_display_configurations(
58 graphics::DisplayConfiguration const& display_config2);58 testing::MatchResultListener* listener,
5959 graphics::DisplayConfiguration const& display_config1,
60bool compare_display_configurations(MirDisplayConfiguration const& client_config,60 graphics::DisplayConfiguration const& display_config2);
61 graphics::DisplayConfiguration const& display_config);61
6262bool compare_display_configurations(
63bool compare_display_configurations(protobuf::DisplayConfiguration const& protobuf_config,63 testing::MatchResultListener* listener,
64 graphics::DisplayConfiguration const& display_config);64 MirDisplayConfiguration const& client_config,
6565 graphics::DisplayConfiguration const& display_config);
66bool compare_display_configurations(MirDisplayConfiguration const* client_config1,66
67 MirDisplayConfiguration const* client_config2);67bool compare_display_configurations(
6868 testing::MatchResultListener* listener,
69bool compare_display_configurations(MirDisplayConfiguration const& client_config,69 protobuf::DisplayConfiguration const& protobuf_config,
70 protobuf::DisplayConfiguration const& protobuf_config);70 graphics::DisplayConfiguration const& display_config);
7171
72bool compare_display_configurations(graphics::DisplayConfiguration const& display_config1,72bool compare_display_configurations(
73 MirDisplayConfiguration const* display_config2);73 testing::MatchResultListener* listener,
7474 MirDisplayConfiguration const* client_config1,
7575 MirDisplayConfiguration const* client_config2);
76bool compare_display_configurations(MirDisplayConfiguration const* display_config2,76
77 graphics::DisplayConfiguration const& display_config1);77bool compare_display_configurations(
78 testing::MatchResultListener* listener,
79 MirDisplayConfiguration const& client_config,
80 protobuf::DisplayConfiguration const& protobuf_config);
81
82bool compare_display_configurations(
83 testing::MatchResultListener* listener,
84 graphics::DisplayConfiguration const& display_config1,
85 MirDisplayConfiguration const* display_config2);
86
87
88bool compare_display_configurations(
89 testing::MatchResultListener* listener,
90 MirDisplayConfiguration const* display_config2,
91 graphics::DisplayConfiguration const& display_config1);
92
93bool compare_display_configurations(
94 testing::MatchResultListener* listener,
95 MirDisplayConfig const* client_config,
96 graphics::DisplayConfiguration const& server_config);
97
98bool compare_display_configurations(
99 testing::MatchResultListener* listener,
100 graphics::DisplayConfiguration const& server_config,
101 MirDisplayConfig const* client_config);
102
103bool compare_display_configurations(
104 testing::MatchResultListener* listener,
105 MirDisplayConfig const* config1,
106 MirDisplayConfig const* config2);
78107
79MATCHER_P(DisplayConfigMatches, config, "")108MATCHER_P(DisplayConfigMatches, config, "")
80{109{
81 return compare_display_configurations(arg, config);110 return compare_display_configurations(result_listener, arg, config);
82}111}
83112
84}113}
85114
=== added file 'include/test/mir/test/doubles/mock_input_device_hub.h'
--- include/test/mir/test/doubles/mock_input_device_hub.h 1970-01-01 00:00:00 +0000
+++ include/test/mir/test/doubles/mock_input_device_hub.h 2016-03-30 00:11:41 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU 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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_
20#define MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_
21
22#include "mir/input/input_device_hub.h"
23
24namespace mir
25{
26namespace test
27{
28namespace doubles
29{
30
31struct MockInputDeviceHub : input::InputDeviceHub
32{
33 MOCK_METHOD1(add_observer, void(std::shared_ptr<input::InputDeviceObserver> const&));
34 MOCK_METHOD1(remove_observer, void(std::weak_ptr<input::InputDeviceObserver> const&));
35 MOCK_METHOD1(for_each_input_device, void(std::function<void(input::Device const&)> const&));
36
37};
38
39}
40}
41}
42
43#endif
044
=== removed file 'include/test/mir/test/doubles/mock_input_device_hub.h'
--- include/test/mir/test/doubles/mock_input_device_hub.h 2016-03-02 13:21:10 +0000
+++ include/test/mir/test/doubles/mock_input_device_hub.h 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1/*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU 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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_
20#define MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_
21
22#include "mir/input/input_device_hub.h"
23
24namespace mir
25{
26namespace test
27{
28namespace doubles
29{
30
31struct MockInputDeviceHub : input::InputDeviceHub
32{
33 MOCK_METHOD1(add_observer, void(std::shared_ptr<input::InputDeviceObserver> const&));
34 MOCK_METHOD1(remove_observer, void(std::weak_ptr<input::InputDeviceObserver> const&));
35 MOCK_METHOD1(for_each_input_device, void(std::function<void(std::shared_ptr<input::Device>const&)> const&));
36
37};
38
39}
40}
41}
42
43#endif
440
=== modified file 'include/test/mir/test/doubles/stub_display_configuration.h'
--- include/test/mir/test/doubles/stub_display_configuration.h 2016-01-29 08:18:22 +0000
+++ include/test/mir/test/doubles/stub_display_configuration.h 2016-03-30 00:11:41 +0000
@@ -22,6 +22,7 @@
22#include "mir/graphics/display_configuration.h"22#include "mir/graphics/display_configuration.h"
2323
24#include <vector>24#include <vector>
25#include <mir_toolkit/client_types.h>
2526
26namespace mir27namespace mir
27{28{
@@ -37,6 +38,9 @@
3738
38 StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,39 StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,
39 geometry::Size px_size, geometry::Size mm_size, MirPixelFormat format, double vrefresh, bool connected);40 geometry::Size px_size, geometry::Size mm_size, MirPixelFormat format, double vrefresh, bool connected);
41
42 StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,
43 std::vector<graphics::DisplayConfigurationMode> modes, std::vector<MirPixelFormat> formats);
40};44};
4145
42class StubDisplayConfig : public graphics::DisplayConfiguration46class StubDisplayConfig : public graphics::DisplayConfiguration
4347
=== added file 'include/test/mir/test/doubles/stub_input_device.h'
--- include/test/mir/test/doubles/stub_input_device.h 1970-01-01 00:00:00 +0000
+++ include/test/mir/test/doubles/stub_input_device.h 2016-03-30 00:11:41 +0000
@@ -0,0 +1,82 @@
1/*
2 * Copyright © 2016 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_STUB_INPUT_DEVICE_H_
20#define MIR_TEST_DOUBLES_STUB_INPUT_DEVICE_H_
21
22#include "mir/input/device.h"
23#include "mir/input/device_capability.h"
24#include "mir/input/pointer_configuration.h"
25#include "mir/input/touchpad_configuration.h"
26#include "mir/optional_value.h"
27
28namespace mir
29{
30namespace test
31{
32namespace doubles
33{
34
35struct StubDevice : input::Device
36{
37 StubDevice(MirInputDeviceId id, input::DeviceCapabilities caps, std::string const& name, std::string const& unique_id)
38 : device_id(id), device_capabilities(caps), device_name(name), device_unique_id(unique_id) {}
39
40 MirInputDeviceId id() const override
41 {
42 return device_id;
43 }
44 input::DeviceCapabilities capabilities() const override
45 {
46 return device_capabilities;
47 }
48 std::string name() const override
49 {
50 return device_name;
51 }
52 std::string unique_id() const override
53 {
54 return device_unique_id;
55 }
56 mir::optional_value<input::PointerConfiguration> pointer_configuration() const override
57 {
58 return {};
59 }
60 void apply_pointer_configuration(input::PointerConfiguration const&) override
61 {
62 }
63
64 mir::optional_value<input::TouchpadConfiguration> touchpad_configuration() const override
65 {
66 return {};
67 }
68 void apply_touchpad_configuration(input::TouchpadConfiguration const&) override
69 {
70 }
71
72 MirInputDeviceId device_id;
73 input::DeviceCapabilities device_capabilities;
74 std::string device_name;
75 std::string device_unique_id;
76};
77
78}
79}
80}
81#endif
82
083
=== modified file 'include/test/mir/test/wait_condition.h'
--- include/test/mir/test/wait_condition.h 2016-01-29 08:18:22 +0000
+++ include/test/mir/test/wait_condition.h 2016-03-30 00:11:41 +0000
@@ -58,6 +58,12 @@
58 return woken_;58 return woken_;
59 }59 }
6060
61 void reset()
62 {
63 std::lock_guard<std::mutex> ul(guard);
64 woken_ = false;
65 }
66
61 std::mutex guard;67 std::mutex guard;
62 std::condition_variable condition;68 std::condition_variable condition;
63 bool woken_;69 bool woken_;
6470
=== modified file 'include/test/mir_test_framework/declarative_placement_window_manage_policy.h'
--- include/test/mir_test_framework/declarative_placement_window_manage_policy.h 2016-01-29 08:18:22 +0000
+++ include/test/mir_test_framework/declarative_placement_window_manage_policy.h 2016-03-30 00:11:41 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2014 Canonical Ltd.2 * Copyright © 2014-2016 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU General Public License version 3,
@@ -38,7 +38,7 @@
38{38{
39public:39public:
40 DeclarativePlacementWindowManagerPolicy(40 DeclarativePlacementWindowManagerPolicy(
41 Tools* const tools,41 mir::shell::WindowManagerTools* const tools,
42 SurfaceGeometries const& positions_by_name, 42 SurfaceGeometries const& positions_by_name,
43 std::shared_ptr<mir::shell::DisplayLayout> const& display_layout);43 std::shared_ptr<mir::shell::DisplayLayout> const& display_layout);
4444
4545
=== modified file 'include/test/mir_test_framework/executable_path.h'
--- include/test/mir_test_framework/executable_path.h 2016-01-29 08:18:22 +0000
+++ include/test/mir_test_framework/executable_path.h 2016-03-30 00:11:41 +0000
@@ -27,7 +27,7 @@
2727
28std::string library_path();28std::string library_path();
29std::string server_platform_path();29std::string server_platform_path();
30std::string udev_recordings_path();30std::string test_data_path();
31std::string server_platform(std::string const& name);31std::string server_platform(std::string const& name);
32std::string server_input_platform(std::string const& name);32std::string server_input_platform(std::string const& name);
33std::string client_platform(std::string const& name);33std::string client_platform(std::string const& name);
3434
=== modified file 'include/test/mir_test_framework/fake_input_device.h'
--- include/test/mir_test_framework/fake_input_device.h 2016-01-29 08:18:22 +0000
+++ include/test/mir_test_framework/fake_input_device.h 2016-03-30 00:11:41 +0000
@@ -30,8 +30,8 @@
30{30{
31public:31public:
32 /**32 /**
33 * Valid value range of simulated touch coordinates. The simulated coordinates will be remapped to the33 * Valid value range of simulated touch coordinates. The simulated coordinates will be remapped to
34 * the coorindates of the given input sink.34 * the coordinates of the given input sink.
35 * \{35 * \{
36 */36 */
37 static const int maximum_touch_axis_value = 0xFFFF;37 static const int maximum_touch_axis_value = 0xFFFF;
@@ -41,6 +41,8 @@
41 FakeInputDevice() = default;41 FakeInputDevice() = default;
42 virtual ~FakeInputDevice() = default;42 virtual ~FakeInputDevice() = default;
4343
44
45 virtual void emit_device_removal() = 0;
44 virtual void emit_runtime_error() = 0;46 virtual void emit_runtime_error() = 0;
45 virtual void emit_event(synthesis::KeyParameters const& key) = 0;47 virtual void emit_event(synthesis::KeyParameters const& key) = 0;
46 virtual void emit_event(synthesis::ButtonParameters const& button) = 0;48 virtual void emit_event(synthesis::ButtonParameters const& button) = 0;
4749
=== modified file 'include/test/mir_test_framework/placement_applying_shell.h'
--- include/test/mir_test_framework/placement_applying_shell.h 2016-01-29 08:18:22 +0000
+++ include/test/mir_test_framework/placement_applying_shell.h 2016-03-30 00:11:41 +0000
@@ -29,6 +29,8 @@
29#include <vector>29#include <vector>
30#include <string>30#include <string>
31#include <map>31#include <map>
32#include <mutex>
33#include <condition_variable>
3234
33namespace mir_test_framework35namespace mir_test_framework
34{36{
@@ -42,13 +44,24 @@
42 ClientInputRegions const& client_input_regions,44 ClientInputRegions const& client_input_regions,
43 ClientPositions const& client_positions);45 ClientPositions const& client_positions);
4446
47 ~PlacementApplyingShell();
45 mir::frontend::SurfaceId create_surface(48 mir::frontend::SurfaceId create_surface(
46 std::shared_ptr<mir::scene::Session> const& session,49 std::shared_ptr<mir::scene::Session> const& session,
47 mir::scene::SurfaceCreationParameters const& params,50 mir::scene::SurfaceCreationParameters const& params,
48 std::shared_ptr<mir::frontend::EventSink> const& sink) override;51 std::shared_ptr<mir::frontend::EventSink> const& sink) override;
52
53 void modify_surface(
54 std::shared_ptr<mir::scene::Session> const& session,
55 std::shared_ptr<mir::scene::Surface> const& surface,
56 mir::shell::SurfaceSpecification const& modifications) override;
57
58 bool wait_for_modify_surface(std::chrono::seconds timeout);
49private:59private:
50 ClientInputRegions const& client_input_regions;60 ClientInputRegions const& client_input_regions;
51 ClientPositions const& client_positions;61 ClientPositions const& client_positions;
62 std::mutex mutex;
63 std::condition_variable cv;
64 bool modified {false};
52};65};
5366
54}67}
5568
=== modified file 'playground/CMakeLists.txt'
--- playground/CMakeLists.txt 2016-01-29 15:44:15 +0000
+++ playground/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -20,10 +20,11 @@
20add_subdirectory(demo-shell/)20add_subdirectory(demo-shell/)
2121
22set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")22set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
23mir_add_wrapped_executable(mir_demo_prerendered_frames23mir_add_wrapped_executable(mir_demo_client_prerendered_frames
24 mir_demo_prerendered_frames.c24 mir_demo_client_prerendered_frames.c
25)25)
2626
27target_link_libraries(mir_demo_prerendered_frames27target_link_libraries(mir_demo_client_prerendered_frames
28 mirclient28 mirclient
29 m
29)30)
3031
=== renamed file 'playground/mir_demo_prerendered_frames.c' => 'playground/mir_demo_client_prerendered_frames.c'
--- playground/mir_demo_prerendered_frames.c 2016-02-04 18:15:50 +0000
+++ playground/mir_demo_client_prerendered_frames.c 2016-03-30 00:11:41 +0000
@@ -22,29 +22,45 @@
22#include <mir_toolkit/mir_surface.h>22#include <mir_toolkit/mir_surface.h>
23#include <mir_toolkit/mir_presentation_chain.h>23#include <mir_toolkit/mir_presentation_chain.h>
24#include <mir_toolkit/mir_buffer.h>24#include <mir_toolkit/mir_buffer.h>
25#include <mir_toolkit/version.h>
25#include <sys/types.h>26#include <sys/types.h>
26#include <signal.h>27#include <signal.h>
27#include <string.h>28#include <string.h>
28#include <pthread.h>29#include <pthread.h>
2930#include <math.h>
30void fill_buffer(MirBuffer* buffer, int shade, int min, int max)31#include <stdlib.h>
31{32#include <getopt.h>
32 unsigned char val = (unsigned char) (((float) shade / (max-min)) + min) * 0xFF;33
33 34float distance(int x0, int y0, int x1, int y1)
34 MirGraphicsRegion* region = mir_buffer_acquire_region(buffer, mir_read_write);35{
35 if (!region)36 float dx = x1 - x0;
37 float dy = y1 - y0;
38 return sqrt((dx * dx + dy * dy));
39}
40
41void fill_buffer_with_centered_circle_abgr(
42 MirBuffer* buffer, float radius, unsigned int fg, unsigned int bg)
43{
44 MirGraphicsRegion region = mir_buffer_get_graphics_region(buffer, mir_read_write);
45 if ((!region.vaddr) || (region.pixel_format != mir_pixel_format_abgr_8888))
36 return;46 return;
3747 int const center_x = region.width / 2;
38 unsigned char* px = (unsigned char*) region->vaddr;48 int const center_y = region.height / 2;
39 for(int i = 0; i < region->height; i++)49 unsigned char* vaddr = (unsigned char*) region.vaddr;
50 for(int i = 0; i < region.height; i++)
40 {51 {
41 px += region->stride; 52 unsigned int* pixel = (unsigned int*) vaddr;
42 for(int j = 0; j < region->width; j++)53 for(int j = 0; j < region.width ; j++)
43 {54 {
44 px[j] = val;55 int const centered_i = i - center_y;
56 int const centered_j = j - center_x;
57 if (distance(0,0, centered_i, centered_j) > radius)
58 pixel[j] = bg;
59 else
60 pixel[j] = fg;
45 }61 }
62 vaddr += region.stride;
46 }63 }
47 mir_buffer_release_region(region);
48}64}
4965
50typedef struct SubmissionInfo66typedef struct SubmissionInfo
@@ -55,9 +71,9 @@
55 pthread_cond_t cv;71 pthread_cond_t cv;
56} SubmissionInfo;72} SubmissionInfo;
5773
58static void available_callback(MirPresentationChain* stream, MirBuffer* buffer, void* client_context)74static void available_callback(MirPresentationChain* chain, MirBuffer* buffer, void* client_context)
59{75{
60 (void) stream;76 (void)chain;
61 SubmissionInfo* info = (SubmissionInfo*) client_context;77 SubmissionInfo* info = (SubmissionInfo*) client_context;
62 pthread_mutex_lock(&info->lock);78 pthread_mutex_lock(&info->lock);
63 info->available = 1;79 info->available = 1;
@@ -75,35 +91,82 @@
7591
76int main(int argc, char** argv)92int main(int argc, char** argv)
77{93{
78 (void) argc;94 static char const *socket_file = NULL;
79 (void) argv;95 int arg = -1;
96 int width = 400;
97 int height = 400;
98 while ((arg = getopt (argc, argv, "m:s:h:")) != -1)
99 {
100 switch (arg)
101 {
102 case 'm':
103 socket_file = optarg;
104 break;
105 case 's':
106 {
107 unsigned int w, h;
108 if (sscanf(optarg, "%ux%u", &w, &h) == 2)
109 {
110 width = w;
111 height = h;
112 }
113 else
114 {
115 printf("Invalid size: %s, using default size\n", optarg);
116 }
117 break;
118 }
119 case 'h':
120 case '?':
121 default:
122 puts(argv[0]);
123 printf("Usage:\n");
124 printf(" -m <Mir server socket>\n");
125 printf(" -s WIDTHxHEIGHT of window\n");
126 printf(" -h help dialog\n");
127 return -1;
128 }
129 }
80130
81 signal(SIGTERM, shutdown);131 signal(SIGTERM, shutdown);
82 signal(SIGINT, shutdown);132 signal(SIGINT, shutdown);
83133
84 int width = 20;134 int displacement_x = 0;
85 int height = 25;135 int displacement_y = 0;
136 unsigned int fg = 0xFF1448DD;
137 unsigned int bg = 0xFF6F2177;
86 MirPixelFormat format = mir_pixel_format_abgr_8888;138 MirPixelFormat format = mir_pixel_format_abgr_8888;
87139
88 MirConnection* connection = mir_connect_sync(NULL, "prerendered_frames");140 MirConnection* connection = mir_connect_sync(socket_file, "prerendered_frames");
89141 if (!mir_connection_is_valid(connection))
90 MirSurfaceSpec* spec =142 {
91 mir_connection_create_spec_for_normal_surface(connection, width, height, format);143 printf("could not connect to server file at: %s\n", socket_file);
92 MirSurface* surface = mir_surface_create_sync(spec);144 return -1;
93 mir_surface_spec_release(spec);145 }
94146
95 MirPresentationChain* chain = mir_connection_create_presentation_chain_sync(connection);147 MirPresentationChain* chain = mir_connection_create_presentation_chain_sync(connection);
96 if (!mir_presentation_chain_is_valid(chain))148 if (!mir_presentation_chain_is_valid(chain))
149 {
150 printf("could not create MirPresentationChain\n");
151
152// TODO this is a frig to pass smoke tests until we support NBS by default
153#if (MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 3, 0))
154 printf("This is currently an unreleased API - likely server support is switched off\n");
155 return 0;
156#else
97 return -1;157 return -1;
158#endif
159 }
160
161 MirSurfaceSpec* spec = mir_connection_create_spec_for_normal_surface(connection, width, height, format);
162 MirSurface* surface = mir_surface_create_sync(spec);
163 mir_surface_spec_release(spec);
98164
99 //reassociate for advanced control165 //reassociate for advanced control
100 MirBufferStreamInfo info;
101 info.displacement_x = 0;
102 info.displacement_y = 0;
103 //will make this a union.
104 info.stream = (MirBufferStream*) chain;
105 spec = mir_create_surface_spec(connection);166 spec = mir_create_surface_spec(connection);
106 mir_surface_spec_set_streams(spec, &info, 1);167 mir_surface_spec_add_presentation_chain(
168 spec, width, height, displacement_x, displacement_y, chain);
169 mir_surface_apply_spec(surface, spec);
107 mir_surface_spec_release(spec);170 mir_surface_spec_release(spec);
108171
109 int num_prerendered_frames = 20;172 int num_prerendered_frames = 20;
@@ -123,11 +186,16 @@
123 pthread_mutex_lock(&buffer_available[i].lock);186 pthread_mutex_lock(&buffer_available[i].lock);
124 while(!buffer_available[i].buffer)187 while(!buffer_available[i].buffer)
125 pthread_cond_wait(&buffer_available[i].cv, &buffer_available[i].lock);188 pthread_cond_wait(&buffer_available[i].cv, &buffer_available[i].lock);
126 fill_buffer(buffer_available[i].buffer, i, 0, num_prerendered_frames);189
190 float max_radius = distance(0, 0, width, height) / 2.0f;
191 float radius_i = ((float) i + 1) / num_prerendered_frames * max_radius;
192 fill_buffer_with_centered_circle_abgr(buffer_available[i].buffer, radius_i, fg, bg);
193
127 pthread_mutex_unlock(&buffer_available[i].lock);194 pthread_mutex_unlock(&buffer_available[i].lock);
128 }195 }
129196
130 int i = 0;197 int i = 0;
198 int inc = -1;
131 while (rendering)199 while (rendering)
132 {200 {
133 MirBuffer* b;201 MirBuffer* b;
@@ -138,10 +206,11 @@
138 b = buffer_available[i].buffer;206 b = buffer_available[i].buffer;
139 pthread_mutex_unlock(&buffer_available[i].lock);207 pthread_mutex_unlock(&buffer_available[i].lock);
140208
141 if (!mir_presentation_chain_submit_buffer(chain, b))209 mir_presentation_chain_submit_buffer(chain, b);
142 rendering = false;
143210
144 i = (i + 1) % num_prerendered_frames;211 if ((i == num_prerendered_frames - 1) || (i == 0))
212 inc *= -1;
213 i = i + inc;
145 }214 }
146215
147 for (i = 0u; i < num_prerendered_frames; i++)216 for (i = 0u; i < num_prerendered_frames; i++)
148217
=== removed directory 'snappy'
=== removed file 'snappy/CMakeLists.txt'
--- snappy/CMakeLists.txt 2015-03-23 04:13:45 +0000
+++ snappy/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1set(MIR_PKG_ARCH ${CMAKE_SYSTEM_PROCESSOR})
2# FIXME: This is blank on armhf cross-compiles. But don't care right now.
3if ("${MIR_PKG_ARCH}" STREQUAL x86_64)
4 set(MIR_PKG_ARCH amd64)
5endif()
6
7configure_file(mir.package.yaml.in mir.package.yaml)
8configure_file(mir.framework.in mir.framework)
9configure_file(mir-demos.package.yaml.in mir-demos.package.yaml)
10
11set(ARCH_LIB_DIR /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
12set(MIR_IMAGE ${CMAKE_BINARY_DIR}/mir-image)
13set(MIR_DEMOS_IMAGE ${CMAKE_BINARY_DIR}/mir-demos-image)
14
15add_custom_target(snap
16 # Create a clean stripped install tree
17 COMMAND rm -rf ${MIR_IMAGE} ${MIR_DEMOS_IMAGE}
18 COMMAND make -j8 -C ${CMAKE_BINARY_DIR} DESTDIR=${MIR_IMAGE} install/strip
19
20 COMMAND mv -f ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX}/lib ${MIR_IMAGE}/
21 COMMAND mv -f ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX}/bin ${MIR_DEMOS_IMAGE}/
22
23 COMMAND mkdir ${MIR_IMAGE}/meta
24 COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir.package.yaml ${MIR_IMAGE}/meta/package.yaml
25 COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir.framework ${MIR_IMAGE}/meta/
26 COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/readme.md ${MIR_IMAGE}/meta/
27 COMMAND mkdir ${MIR_IMAGE}/bin
28 COMMAND cp -p ${CMAKE_CURRENT_SOURCE_DIR}/mir-run ${MIR_IMAGE}/bin/
29
30 COMMAND mkdir -p ${MIR_DEMOS_IMAGE}/meta
31 COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir-demos.package.yaml ${MIR_DEMOS_IMAGE}/meta/package.yaml
32 COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/readme.md ${MIR_DEMOS_IMAGE}/meta/
33
34 # Remove bits of Mir we don't need
35 COMMAND rm -rf ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX}
36
37 # Copy in the DRM libraries needed by Mesa
38 COMMAND cp -vdp ${ARCH_LIB_DIR}/libdrm_*.so* ${MIR_IMAGE}/lib/
39
40 # Search all the binaries and copy more libraries they need
41 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/copy-external-libs.sh ${MIR_IMAGE}/lib/ ${MIR_DEMOS_IMAGE}/bin/* ${MIR_IMAGE}/lib/*
42
43 # Copy in the Mesa DRI drivers
44 COMMAND cp -Rdvp ${ARCH_LIB_DIR}/dri ${MIR_IMAGE}/
45
46 # Remove duplicate libs already built-in to Ubuntu Core
47 COMMAND rm -f ${MIR_IMAGE}/lib/libboost_program_options.so.1.55.0
48 COMMAND rm -f ${MIR_IMAGE}/lib/libstdc++.so.6
49 COMMAND rm -f ${MIR_IMAGE}/lib/libfreetype.so.6
50 COMMAND rm -f ${MIR_IMAGE}/lib/libunwind.so.8
51 COMMAND rm -f ${MIR_IMAGE}/lib/libffi.so.6
52
53 COMMAND snappy build ${MIR_IMAGE}
54 COMMAND snappy build ${MIR_DEMOS_IMAGE}
55 COMMAND ls -l ${CMAKE_CURRENT_BINARY_DIR}/*.snap
56)
57
580
=== removed file 'snappy/copy-external-libs.sh'
--- snappy/copy-external-libs.sh 2015-03-20 09:22:35 +0000
+++ snappy/copy-external-libs.sh 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1#!/bin/sh
2
3dest=$1
4shift
5paths=$*
6externs=`ldd $paths |
7 awk '/.* => \/usr\/lib\// {print $3;}' |
8 sort |
9 grep -v libmir |
10 uniq`
11
12echo "External libs:"
13echo "~~~~~~~~~~~~~~~~~~~~"
14ls $externs
15echo "~~~~~~~~~~~~~~~~~~~~"
16
17cp $externs $dest
180
=== removed file 'snappy/mir-demos.package.yaml.in'
--- snappy/mir-demos.package.yaml.in 2015-03-18 09:46:40 +0000
+++ snappy/mir-demos.package.yaml.in 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1name: mir-demos
2version: @MIR_VERSION@
3architecture: @MIR_PKG_ARCH@
4# frameworks: mir # FIXME: LP: #1433489
5
60
=== removed file 'snappy/mir-run'
--- snappy/mir-run 2015-03-18 09:46:40 +0000
+++ snappy/mir-run 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1#!/bin/sh
2
3MIR_DIR=$SNAP_APP_PATH
4if [ -z "$MIR_DIR" ] ; then
5 MIR_DIR=/apps/mir/current
6fi
7export MIR_DIR
8
9export LIBGL_DRIVERS_PATH=$MIR_DIR/dri
10export MIR_SERVER_PLATFORM_PATH=$MIR_DIR/lib/mir/server-platform
11export MIR_CLIENT_PLATFORM_PATH=$MIR_DIR/lib/mir/client-platform
12export LD_LIBRARY_PATH=$MIR_DIR/lib
13
14exec $*
150
=== removed file 'snappy/mir.framework.in'
--- snappy/mir.framework.in 2015-03-18 08:42:06 +0000
+++ snappy/mir.framework.in 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1Base-Name: mir
2Base-Version: 0
30
=== removed file 'snappy/mir.package.yaml.in'
--- snappy/mir.package.yaml.in 2015-03-18 09:46:40 +0000
+++ snappy/mir.package.yaml.in 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1name: mir
2version: @MIR_VERSION@
3architecture: @MIR_PKG_ARCH@
4type: framework
5integration:
6 framework:
7 framework: meta/mir.framework
8 mir-run:
9 bin-path: bin/mir-run
100
=== removed file 'snappy/readme.md'
--- snappy/readme.md 2015-03-20 09:43:39 +0000
+++ snappy/readme.md 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1Mir
2
3This is an experimental Mir package.
40
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ src/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -28,10 +28,10 @@
28add_subdirectory(gl/)28add_subdirectory(gl/)
2929
30add_executable(wrapper wrapper.c)30add_executable(wrapper wrapper.c)
31set_property(TARGET wrapper31target_compile_definitions(wrapper PUBLIC
32 APPEND_STRING PROPERTY COMPILE_FLAGS " -DEXECUTABLE_FORMAT=\\\"%s.bin\\\"")32 EXECUTABLE_FORMAT=\"%s.bin\"
33set_property(TARGET wrapper33 _DEFAULT_SOURCE
34 APPEND_STRING PROPERTY COMPILE_FLAGS " -D_DEFAULT_SOURCE -D_BSD_SOURCE")34 _BSD_SOURCE)
3535
36set(36set(
37 MIR_GENERATED_INCLUDE_DIRECTORIES37 MIR_GENERATED_INCLUDE_DIRECTORIES
3838
=== modified file 'src/client/CMakeLists.txt'
--- src/client/CMakeLists.txt 2016-02-12 04:02:11 +0000
+++ src/client/CMakeLists.txt 2016-03-30 00:11:41 +0000
@@ -52,6 +52,7 @@
52 mir_cookie.cpp52 mir_cookie.cpp
53 mir_connection.cpp53 mir_connection.cpp
54 mir_connection_api.cpp54 mir_connection_api.cpp
55 mir_input_device_api.cpp
55 mir_wait_handle.cpp56 mir_wait_handle.cpp
56 mir_wait_api.cpp57 mir_wait_api.cpp
57 mir_surface.cpp58 mir_surface.cpp
@@ -76,12 +77,17 @@
76 buffer_vault.cpp77 buffer_vault.cpp
77 mir_buffer_stream_api.cpp78 mir_buffer_stream_api.cpp
78 error_stream.cpp79 error_stream.cpp
80 error_chain.cpp
79 buffer.cpp81 buffer.cpp
80 presentation_chain.cpp82 presentation_chain.cpp
81 mir_presentation_chain_api.cpp83 mir_presentation_chain_api.cpp
82 mir_buffer_api.cpp84 mir_buffer_api.cpp
85 display_configuration_api.cpp
86 protobuf_to_native_buffer.cpp
87 buffer_factory.cpp
83 ${MIR_CLIENT_SOURCES}88 ${MIR_CLIENT_SOURCES}
84 ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/events/surface_output_event.h89 ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/events/surface_output_event.h
90 ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/mir_display_configuration.h
85)91)
8692
87# Ensure protobuf C++ headers have been produced before93# Ensure protobuf C++ headers have been produced before
8894
=== modified file 'src/client/buffer.cpp'
--- src/client/buffer.cpp 2016-02-10 18:44:17 +0000
+++ src/client/buffer.cpp 2016-03-30 00:11:41 +0000
@@ -16,6 +16,7 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#include "mir/client_buffer.h"
19#include "buffer.h"20#include "buffer.h"
20#include <boost/throw_exception.hpp>21#include <boost/throw_exception.hpp>
2122
@@ -24,12 +25,16 @@
24mcl::Buffer::Buffer(25mcl::Buffer::Buffer(
25 mir_buffer_callback cb, void* context,26 mir_buffer_callback cb, void* context,
26 int buffer_id,27 int buffer_id,
27 std::shared_ptr<ClientBuffer> const& buffer) :28 std::shared_ptr<ClientBuffer> const& buffer,
29 MirPresentationChain* chain,
30 MirBufferUsage usage) :
28 cb(cb),31 cb(cb),
29 cb_context(context),32 cb_context(context),
30 buffer_id(buffer_id),33 buffer_id(buffer_id),
31 buffer(buffer),34 buffer(buffer),
32 owned(true)35 owned(true),
36 chain(chain),
37 usage(usage)
33{38{
34 cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context);39 cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context);
35}40}
@@ -41,16 +46,73 @@
4146
42void mcl::Buffer::submitted()47void mcl::Buffer::submitted()
43{48{
49 std::lock_guard<decltype(mutex)> lk(mutex);
44 if (!owned)50 if (!owned)
45 BOOST_THROW_EXCEPTION(std::logic_error("cannot submit unowned buffer"));51 BOOST_THROW_EXCEPTION(std::logic_error("cannot submit unowned buffer"));
52 mapped_region.reset();
46 owned = false;53 owned = false;
47}54}
4855
49void mcl::Buffer::received()56void mcl::Buffer::received(MirBufferPackage const& update_package)
50{57{
58 std::lock_guard<decltype(mutex)> lk(mutex);
51 if (!owned)59 if (!owned)
52 {60 {
53 owned = true;61 owned = true;
62 buffer->update_from(update_package);
54 cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context);63 cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context);
55 }64 }
56}65}
66
67MirGraphicsRegion mcl::Buffer::map_region()
68{
69 std::lock_guard<decltype(mutex)> lk(mutex);
70 mapped_region = buffer->secure_for_cpu_write();
71 return MirGraphicsRegion {
72 mapped_region->width.as_int(),
73 mapped_region->height.as_int(),
74 mapped_region->stride.as_int(),
75 mapped_region->format,
76 mapped_region->vaddr.get()
77 };
78}
79
80MirNativeBuffer* mcl::Buffer::as_mir_native_buffer() const
81{
82 return buffer->as_mir_native_buffer();
83}
84
85void mcl::Buffer::set_fence(MirNativeFence* native_fence, MirBufferAccess access)
86{
87 buffer->set_fence(native_fence, access);
88}
89
90MirNativeFence* mcl::Buffer::get_fence() const
91{
92 return buffer->get_fence();
93}
94
95bool mcl::Buffer::wait_fence(MirBufferAccess access, std::chrono::nanoseconds timeout)
96{
97 return buffer->wait_fence(access, timeout);
98}
99
100MirPresentationChain* mcl::Buffer::allocating_chain() const
101{
102 return chain;
103}
104
105MirBufferUsage mcl::Buffer::buffer_usage() const
106{
107 return usage;
108}
109
110MirPixelFormat mcl::Buffer::pixel_format() const
111{
112 return buffer->pixel_format();
113}
114
115mir::geometry::Size mcl::Buffer::size() const
116{
117 return buffer->size();
118}
57119
=== modified file 'src/client/buffer.h'
--- src/client/buffer.h 2016-02-11 03:04:05 +0000
+++ src/client/buffer.h 2016-03-30 00:11:41 +0000
@@ -21,12 +21,15 @@
2121
22#include "mir_toolkit/mir_buffer.h"22#include "mir_toolkit/mir_buffer.h"
23#include <memory>23#include <memory>
24#include <chrono>
25#include <mutex>
2426
25namespace mir27namespace mir
26{28{
27namespace client29namespace client
28{30{
29class ClientBuffer;31class ClientBuffer;
32class MemoryRegion;
30//this is the type backing MirBuffer* 33//this is the type backing MirBuffer*
31class Buffer34class Buffer
32{35{
@@ -34,17 +37,37 @@
34 Buffer(37 Buffer(
35 mir_buffer_callback cb, void* context,38 mir_buffer_callback cb, void* context,
36 int buffer_id,39 int buffer_id,
37 std::shared_ptr<ClientBuffer> const& buffer);40 std::shared_ptr<ClientBuffer> const& buffer,
41 MirPresentationChain* chain,
42 MirBufferUsage usage);
38 int rpc_id() const;43 int rpc_id() const;
3944
40 void submitted();45 void submitted();
41 void received();46 void received(MirBufferPackage const& update_message);
47
48 MirNativeBuffer* as_mir_native_buffer() const;
49 MirGraphicsRegion map_region();
50
51 void set_fence(MirNativeFence*, MirBufferAccess);
52 MirNativeFence* get_fence() const;
53 bool wait_fence(MirBufferAccess, std::chrono::nanoseconds);
54
55 MirBufferUsage buffer_usage() const;
56 MirPixelFormat pixel_format() const;
57 geometry::Size size() const;
58
59 MirPresentationChain* allocating_chain() const;
42private:60private:
43 mir_buffer_callback cb;61 mir_buffer_callback cb;
44 void* cb_context;62 void* cb_context;
45 int const buffer_id;63 int const buffer_id;
46 std::shared_ptr<ClientBuffer> buffer;64 std::shared_ptr<ClientBuffer> buffer;
65
66 std::mutex mutex;
47 bool owned;67 bool owned;
68 std::shared_ptr<MemoryRegion> mapped_region;
69 MirPresentationChain* const chain;
70 MirBufferUsage const usage;
48};71};
49}72}
50}73}
5174
=== added file 'src/client/buffer_factory.cpp'
--- src/client/buffer_factory.cpp 1970-01-01 00:00:00 +0000
+++ src/client/buffer_factory.cpp 2016-03-30 00:11:41 +0000
@@ -0,0 +1,79 @@
1/*
2 * Copyright © 2016 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 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */
18
19#include "mir/client_buffer_factory.h"
20#include "buffer_factory.h"
21#include <algorithm>
22#include <boost/throw_exception.hpp>
23#include "protobuf_to_native_buffer.h"
24
25namespace mcl = mir::client;
26namespace geom = mir::geometry;
27
28mcl::BufferFactory::AllocationRequest::AllocationRequest(
29 std::shared_ptr<mcl::ClientBufferFactory> const& native_buffer_factory,
30 MirPresentationChain* chain,
31 geom::Size size, MirPixelFormat format, MirBufferUsage usage,
32 mir_buffer_callback cb, void* cb_context) :
33 native_buffer_factory(native_buffer_factory),
34 chain(chain),
35 size(size),
36 format(format),
37 usage(usage),
38 cb(cb),
39 cb_context(cb_context)
40{
41}
42
43void mcl::BufferFactory::expect_buffer(
44 std::shared_ptr<mcl::ClientBufferFactory> const& factory,
45 MirPresentationChain* chain,
46 geometry::Size size,
47 MirPixelFormat format,
48 MirBufferUsage usage,
49 mir_buffer_callback cb,
50 void* cb_context)
51{
52 std::lock_guard<decltype(mutex)> lk(mutex);
53 allocation_requests.emplace_back(
54 std::make_unique<AllocationRequest>(factory, chain, size, format, usage, cb, cb_context));
55}
56
57std::unique_ptr<mcl::Buffer> mcl::BufferFactory::generate_buffer(mir::protobuf::Buffer const& buffer)
58{
59 std::lock_guard<decltype(mutex)> lk(mutex);
60 auto request_it = std::find_if(allocation_requests.begin(), allocation_requests.end(),
61 [&buffer](std::unique_ptr<AllocationRequest> const& it)
62 {
63 return geom::Size{buffer.width(), buffer.height()} == it->size;
64 });
65
66 if (request_it == allocation_requests.end())
67 BOOST_THROW_EXCEPTION(std::logic_error("unrequested buffer received"));
68
69 auto b = std::make_unique<Buffer>(
70 (*request_it)->cb, (*request_it)->cb_context,
71 buffer.buffer_id(),
72 (*request_it)->native_buffer_factory->create_buffer(
73 mcl::protobuf_to_native_buffer(buffer),
74 (*request_it)->size, (*request_it)->format),
75 (*request_it)->chain, (*request_it)->usage);
76
77 allocation_requests.erase(request_it);
78 return std::move(b);
79}
080
=== added file 'src/client/buffer_factory.h'
--- src/client/buffer_factory.h 1970-01-01 00:00:00 +0000
+++ src/client/buffer_factory.h 2016-03-30 00:11:41 +0000
@@ -0,0 +1,91 @@
1/*
2 * Copyright © 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 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 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */
18
19#ifndef MIR_CLIENT_MIR_BUFFER_FACTORY_H
20#define MIR_CLIENT_MIR_BUFFER_FACTORY_H
21
22#include "mir/geometry/size.h"
23#include "mir_protobuf.pb.h"
24#include "buffer.h"
25#include <mutex>
26#include <memory>
27
28namespace mir
29{
30namespace client
31{
32class ClientBufferFactory;
33class AsyncBufferFactory
34{
35public:
36 virtual ~AsyncBufferFactory() = default;
37 AsyncBufferFactory() = default;
38
39 virtual std::unique_ptr<Buffer> generate_buffer(mir::protobuf::Buffer const& buffer) = 0;
40 virtual void expect_buffer(
41 std::shared_ptr<ClientBufferFactory> const& native_buffer_factory,
42 MirPresentationChain* chain,
43 geometry::Size size,
44 MirPixelFormat format,
45 MirBufferUsage usage,
46 mir_buffer_callback cb,
47 void* cb_context) = 0;
48private:
49 AsyncBufferFactory(AsyncBufferFactory const&) = delete;
50 AsyncBufferFactory& operator=(AsyncBufferFactory const&) = delete;
51};
52
53class BufferFactory : public AsyncBufferFactory
54{
55public:
56 std::unique_ptr<Buffer> generate_buffer(mir::protobuf::Buffer const& buffer) override;
57 void expect_buffer(
58 std::shared_ptr<ClientBufferFactory> const& native_buffer_factory,
59 MirPresentationChain* chain,
60 geometry::Size size,
61 MirPixelFormat format,
62 MirBufferUsage usage,
63 mir_buffer_callback cb,
64 void* cb_context) override;
65
66private:
67 std::mutex mutex;
68 struct AllocationRequest
69 {
70 AllocationRequest(
71 std::shared_ptr<ClientBufferFactory> const& native_buffer_factory,
72 MirPresentationChain* chain,
73 geometry::Size size,
74 MirPixelFormat format,
75 MirBufferUsage usage,
76 mir_buffer_callback cb,
77 void* cb_context);
78
79 std::shared_ptr<ClientBufferFactory> const native_buffer_factory;
80 MirPresentationChain* chain;
81 geometry::Size size;
82 MirPixelFormat format;
83 MirBufferUsage usage;
84 mir_buffer_callback cb;
85 void* cb_context;
86 };
87 std::vector<std::unique_ptr<AllocationRequest>> allocation_requests;
88};
89}
90}
91#endif /* MIR_CLIENT_MIR_BUFFER_FACTORY_H_ */
092
=== modified file 'src/client/buffer_stream.cpp'
--- src/client/buffer_stream.cpp 2016-01-29 15:44:15 +0000
+++ src/client/buffer_stream.cpp 2016-03-30 00:11:41 +0000
@@ -26,6 +26,7 @@
26#include "rpc/mir_display_server.h"26#include "rpc/mir_display_server.h"
27#include "mir_protobuf.pb.h"27#include "mir_protobuf.pb.h"
28#include "buffer_vault.h"28#include "buffer_vault.h"
29#include "protobuf_to_native_buffer.h"
2930
30#include "mir/log.h"31#include "mir/log.h"
31#include "mir/client_platform.h"32#include "mir/client_platform.h"
@@ -73,42 +74,6 @@
73namespace74namespace
74{75{
7576
76void populate_buffer_package(
77 MirBufferPackage& buffer_package,
78 mir::protobuf::Buffer const& protobuf_buffer)
79{
80 if (!protobuf_buffer.has_error())
81 {
82 buffer_package.data_items = protobuf_buffer.data_size();
83 for (int i = 0; i != protobuf_buffer.data_size(); ++i)
84 {
85 buffer_package.data[i] = protobuf_buffer.data(i);
86 }
87
88 buffer_package.fd_items = protobuf_buffer.fd_size();
89
90 for (int i = 0; i != protobuf_buffer.fd_size(); ++i)
91 {
92 buffer_package.fd[i] = protobuf_buffer.fd(i);
93 }
94
95 buffer_package.stride = protobuf_buffer.stride();
96 buffer_package.flags = protobuf_buffer.flags();
97 buffer_package.width = protobuf_buffer.width();
98 buffer_package.height = protobuf_buffer.height();
99 }
100 else
101 {
102 buffer_package.data_items = 0;
103 buffer_package.fd_items = 0;
104 buffer_package.stride = 0;
105 buffer_package.flags = 0;
106 buffer_package.width = 0;
107 buffer_package.height = 0;
108 }
109}
110
111
112struct ExchangeSemantics : mcl::ServerBufferSemantics77struct ExchangeSemantics : mcl::ServerBufferSemantics
113{78{
114 ExchangeSemantics(79 ExchangeSemantics(
@@ -118,9 +83,9 @@
118 wrapped{factory, max_buffers},83 wrapped{factory, max_buffers},
119 display_server(server)84 display_server(server)
120 {85 {
121 auto buffer_package = std::make_shared<MirBufferPackage>();86 wrapped.deposit_package(
122 populate_buffer_package(*buffer_package, first_buffer);87 mcl::protobuf_to_native_buffer(first_buffer),
123 wrapped.deposit_package(buffer_package, first_buffer.buffer_id(), first_size, first_pf);88 first_buffer.buffer_id(), first_size, first_pf);
124 }89 }
12590
126 void deposit(mp::Buffer const& buffer, geom::Size size, MirPixelFormat pf) override91 void deposit(mp::Buffer const& buffer, geom::Size size, MirPixelFormat pf) override
@@ -128,9 +93,9 @@
128 std::unique_lock<std::mutex> lock(mutex);93 std::unique_lock<std::mutex> lock(mutex);
129 if (on_incoming_buffer)94 if (on_incoming_buffer)
130 {95 {
131 auto buffer_package = std::make_shared<MirBufferPackage>();96 wrapped.deposit_package(
132 populate_buffer_package(*buffer_package, buffer);97 mcl::protobuf_to_native_buffer(buffer),
133 wrapped.deposit_package(buffer_package, buffer.buffer_id(), size, pf);98 buffer.buffer_id(), size, pf);
134 if (on_incoming_buffer)99 if (on_incoming_buffer)
135 {100 {
136 on_incoming_buffer();101 on_incoming_buffer();
@@ -186,9 +151,9 @@
186 }151 }
187 else152 else
188 {153 {
189 auto buffer_package = std::make_shared<MirBufferPackage>();154 wrapped.deposit_package(
190 populate_buffer_package(*buffer_package, incoming_buffers.front());155 mcl::protobuf_to_native_buffer(incoming_buffers.front()),
191 wrapped.deposit_package(buffer_package, incoming_buffers.front().buffer_id(), sz, pf);156 incoming_buffers.front().buffer_id(), sz, pf);
192 incoming_buffers.pop();157 incoming_buffers.pop();
193 done();158 done();
194 }159 }
@@ -261,8 +226,11 @@
261 buf_params->set_height(size.height.as_int());226 buf_params->set_height(size.height.as_int());
262 buf_params->set_pixel_format(format);227 buf_params->set_pixel_format(format);
263 buf_params->set_buffer_usage(usage);228 buf_params->set_buffer_usage(usage);
264 server.allocate_buffers(&request, &protobuf_void, 229
265 google::protobuf::NewCallback(google::protobuf::DoNothing));230 //note, NewCallback will trigger on exception, deleting this object there
231 auto protobuf_void = new mp::Void;
232 server.allocate_buffers(&request, protobuf_void,
233 google::protobuf::NewCallback(Requests::ignore_response, protobuf_void));
266 }234 }
267235
268 void free_buffer(int buffer_id) override236 void free_buffer(int buffer_id) override
@@ -270,8 +238,11 @@
270 mp::BufferRelease request;238 mp::BufferRelease request;
271 request.mutable_id()->set_value(stream_id);239 request.mutable_id()->set_value(stream_id);
272 request.add_buffers()->set_buffer_id(buffer_id);240 request.add_buffers()->set_buffer_id(buffer_id);
273 server.release_buffers(&request, &protobuf_void,241
274 google::protobuf::NewCallback(google::protobuf::DoNothing));242 //note, NewCallback will trigger on exception, deleting this object there
243 auto protobuf_void = new mp::Void;
244 server.release_buffers(&request, protobuf_void,
245 google::protobuf::NewCallback(Requests::ignore_response, protobuf_void));
275 }246 }
276247
277 void submit_buffer(int id, mcl::ClientBuffer&) override248 void submit_buffer(int id, mcl::ClientBuffer&) override
@@ -279,8 +250,16 @@
279 mp::BufferRequest request;250 mp::BufferRequest request;
280 request.mutable_id()->set_value(stream_id);251 request.mutable_id()->set_value(stream_id);
281 request.mutable_buffer()->set_buffer_id(id);252 request.mutable_buffer()->set_buffer_id(id);
282 server.submit_buffer(&request, &protobuf_void,253
283 google::protobuf::NewCallback(google::protobuf::DoNothing));254 //note, NewCallback will trigger on exception, deleting this object there
255 auto protobuf_void = new mp::Void;
256 server.submit_buffer(&request, protobuf_void,
257 google::protobuf::NewCallback(Requests::ignore_response, protobuf_void));
258 }
259
260 static void ignore_response(mp::Void* void_response)
261 {
262 delete void_response;
284 }263 }
285264
286private:265private:
@@ -425,10 +404,12 @@
425 }404 }
426 else405 else
427 {406 {
407 cached_buffer_size = ideal_buffer_size;
428 buffer_depository = std::make_unique<NewBufferSemantics>(408 buffer_depository = std::make_unique<NewBufferSemantics>(
429 client_platform->create_buffer_factory(),409 client_platform->create_buffer_factory(),
430 std::make_shared<Requests>(display_server, protobuf_bs->id().value()),410 std::make_shared<Requests>(display_server, protobuf_bs->id().value()),
431 ideal_buffer_size, static_cast<MirPixelFormat>(protobuf_bs->pixel_format()), 0, nbuffers);411 ideal_buffer_size, static_cast<MirPixelFormat>(protobuf_bs->pixel_format()),
412 protobuf_bs->buffer_usage(), nbuffers);
432 }413 }
433414
434415
@@ -552,8 +533,9 @@
552533
553MirWaitHandle* mcl::BufferStream::next_buffer(std::function<void()> const& done)534MirWaitHandle* mcl::BufferStream::next_buffer(std::function<void()> const& done)
554{535{
536 auto id = buffer_depository->current_buffer_id();
555 std::unique_lock<decltype(mutex)> lock(mutex);537 std::unique_lock<decltype(mutex)> lock(mutex);
556 perf_report->end_frame(buffer_depository->current_buffer_id());538 perf_report->end_frame(id);
557539
558 secured_region.reset();540 secured_region.reset();
559541
@@ -572,7 +554,7 @@
572EGLNativeWindowType mcl::BufferStream::egl_native_window()554EGLNativeWindowType mcl::BufferStream::egl_native_window()
573{555{
574 std::unique_lock<decltype(mutex)> lock(mutex);556 std::unique_lock<decltype(mutex)> lock(mutex);
575 return *egl_native_window_;557 return static_cast<EGLNativeWindowType>(egl_native_window_.get());
576}558}
577559
578void mcl::BufferStream::release_cpu_region()560void mcl::BufferStream::release_cpu_region()
@@ -633,7 +615,6 @@
633615
634uint32_t mcl::BufferStream::get_current_buffer_id()616uint32_t mcl::BufferStream::get_current_buffer_id()
635{617{
636 std::unique_lock<decltype(mutex)> lock(mutex);
637 return buffer_depository->current_buffer_id();618 return buffer_depository->current_buffer_id();
638}619}
639620
640621
=== modified file 'src/client/buffer_stream.h'
--- src/client/buffer_stream.h 2016-01-29 15:44:15 +0000
+++ src/client/buffer_stream.h 2016-03-30 00:11:41 +0000
@@ -147,7 +147,7 @@
147 float scale_;147 float scale_;
148148
149 std::shared_ptr<mir::client::PerfReport> const perf_report;149 std::shared_ptr<mir::client::PerfReport> const perf_report;
150 std::shared_ptr<EGLNativeWindowType> egl_native_window_;150 std::shared_ptr<void> egl_native_window_;
151151
152 MirWaitHandle interval_wait_handle;152 MirWaitHandle interval_wait_handle;
153 std::unique_ptr<mir::protobuf::Void> protobuf_void;153 std::unique_ptr<mir::protobuf::Void> protobuf_void;
154154
=== modified file 'src/client/buffer_vault.cpp'
--- src/client/buffer_vault.cpp 2016-01-29 08:18:22 +0000
+++ src/client/buffer_vault.cpp 2016-03-30 00:11:41 +0000
@@ -20,6 +20,7 @@
20#include "mir/client_buffer.h"20#include "mir/client_buffer.h"
21#include "buffer_vault.h"21#include "buffer_vault.h"
22#include "mir_protobuf.pb.h"22#include "mir_protobuf.pb.h"
23#include "protobuf_to_native_buffer.h"
23#include <algorithm>24#include <algorithm>
24#include <boost/throw_exception.hpp>25#include <boost/throw_exception.hpp>
2526
@@ -118,31 +119,33 @@
118119
119void mcl::BufferVault::wire_transfer_inbound(mp::Buffer const& protobuf_buffer)120void mcl::BufferVault::wire_transfer_inbound(mp::Buffer const& protobuf_buffer)
120{121{
121 auto package = std::make_shared<MirBufferPackage>();122 std::shared_ptr<MirBufferPackage> package = mcl::protobuf_to_native_buffer(protobuf_buffer);
122 package->data_items = protobuf_buffer.data_size();
123 package->fd_items = protobuf_buffer.fd_size();
124 for (int i = 0; i != protobuf_buffer.data_size(); ++i)
125 package->data[i] = protobuf_buffer.data(i);
126 for (int i = 0; i != protobuf_buffer.fd_size(); ++i)
127 package->fd[i] = protobuf_buffer.fd(i);
128 package->stride = protobuf_buffer.stride();
129 package->flags = protobuf_buffer.flags();
130 package->width = protobuf_buffer.width();
131 package->height = protobuf_buffer.height();
132123
133 std::unique_lock<std::mutex> lk(mutex);124 std::unique_lock<std::mutex> lk(mutex);
134 auto it = buffers.find(protobuf_buffer.buffer_id());125 auto it = buffers.find(protobuf_buffer.buffer_id());
135 if (it == buffers.end())126 if (it == buffers.end())
136 {127 {
137 auto buffer = factory->create_buffer(package, geom::Size{package->width, package->height}, format);128 geom::Size sz{package->width, package->height};
138 buffers[protobuf_buffer.buffer_id()] = BufferEntry{ buffer, Owner::Self };129 if (sz != size)
130 {
131 lk.unlock();
132 server_requests->free_buffer(protobuf_buffer.buffer_id());
133 for (int i = 0; i != package->fd_items; ++i)
134 close(package->fd[i]);
135
136 server_requests->allocate_buffer(size, format, usage);
137 return;
138 }
139
140 buffers[protobuf_buffer.buffer_id()] =
141 BufferEntry{ factory->create_buffer(package, sz, format), Owner::Self };
139 }142 }
140 else143 else
141 {144 {
145 it->second.buffer->update_from(*package);
142 if (size == it->second.buffer->size())146 if (size == it->second.buffer->size())
143 { 147 {
144 it->second.owner = Owner::Self;148 it->second.owner = Owner::Self;
145 it->second.buffer->update_from(*package);
146 }149 }
147 else150 else
148 {151 {
149152
=== modified file 'src/client/client_buffer_stream.h'
--- src/client/client_buffer_stream.h 2016-02-12 04:02:11 +0000
+++ src/client/client_buffer_stream.h 2016-03-30 00:11:41 +0000
@@ -27,10 +27,33 @@
27#include "mir_toolkit/mir_native_buffer.h"27#include "mir_toolkit/mir_native_buffer.h"
28#include "mir_wait_handle.h"28#include "mir_wait_handle.h"
2929
30#include <EGL/eglplatform.h>
31
32#include <memory>30#include <memory>
33#include <functional>31#include <functional>
32#include <EGL/eglplatform.h>
33
34/*
35 * ClientBufferStream::egl_native_window() returns EGLNativeWindowType.
36 *
37 * EGLNativeWindowType is an EGL platform-specific type that is typically a
38 * (possibly slightly obfuscated) pointer. This makes our client module ABI
39 * technically EGL-platform dependent, which is awkward because we support
40 * multiple EGL platforms.
41 *
42 * On both the Mesa and the Android EGL platforms EGLNativeWindow is a
43 * pointer or a uintptr_t.
44 *
45 * In practise EGLNativeWindowType is always a typedef to a pointer-ish, but
46 * for paranoia's sake make sure the build will fail if we ever encounter a
47 * strange EGL platform where this isn't the case.
48 */
49#include <type_traits>
50static_assert(
51 sizeof(EGLNativeWindowType) == sizeof(void*) &&
52 std::is_pod<EGLNativeWindowType>::value,
53 "The ClientBufferStream requires that EGLNativeWindowType be no-op convertible to void*");
54
55#undef EGLNativeWindowType
56#define EGLNativeWindowType void*
3457
35namespace mir58namespace mir
36{59{
3760
=== modified file 'src/client/connection_configuration.h'
--- src/client/connection_configuration.h 2016-01-29 08:18:22 +0000
+++ src/client/connection_configuration.h 2016-03-30 00:11:41 +0000
@@ -52,6 +52,7 @@
52class DisplayConfiguration;52class DisplayConfiguration;
53class EventSink;53class EventSink;
54class EventHandlerRegister;54class EventHandlerRegister;
55class AsyncBufferFactory;
5556
56class ConnectionConfiguration57class ConnectionConfiguration
57{58{
@@ -69,6 +70,7 @@
69 virtual std::shared_ptr<PingHandler> the_ping_handler() = 0;70 virtual std::shared_ptr<PingHandler> the_ping_handler() = 0;
70 virtual std::shared_ptr<EventSink> the_event_sink() = 0;71 virtual std::shared_ptr<EventSink> the_event_sink() = 0;
71 virtual std::shared_ptr<EventHandlerRegister> the_event_handler_register() = 0;72 virtual std::shared_ptr<EventHandlerRegister> the_event_handler_register() = 0;
73 virtual std::shared_ptr<mir::client::AsyncBufferFactory> the_buffer_factory() = 0;
7274
73protected:75protected:
74 ConnectionConfiguration() = default;76 ConnectionConfiguration() = default;
7577
=== modified file 'src/client/connection_surface_map.h'
--- src/client/connection_surface_map.h 2016-02-12 04:02:11 +0000
+++ src/client/connection_surface_map.h 2016-03-30 00:11:41 +0000
@@ -28,6 +28,7 @@
28{28{
29namespace client29namespace client
30{30{
31class Buffer;
31class PresentationChain;32class PresentationChain;
32class ConnectionSurfaceMap : public SurfaceMap33class ConnectionSurfaceMap : public SurfaceMap
33{34{
@@ -42,10 +43,16 @@
42 void insert(frontend::BufferStreamId stream_id, std::shared_ptr<BufferReceiver> const& stream);43 void insert(frontend::BufferStreamId stream_id, std::shared_ptr<BufferReceiver> const& stream);
43 void erase(frontend::BufferStreamId surface_id);44 void erase(frontend::BufferStreamId surface_id);
4445
46 //TODO: should have a mf::BufferID
47 void insert(int buffer_id, std::shared_ptr<Buffer> const& buffer) override;
48 void erase(int buffer_id) override;
49 std::shared_ptr<Buffer> buffer(int buffer_id) const override;
50
45private:51private:
46 std::shared_timed_mutex mutable guard;52 std::shared_timed_mutex mutable guard;
47 std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces;53 std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces;
48 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<BufferReceiver>> streams;54 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<BufferReceiver>> streams;
55 std::unordered_map<int, std::shared_ptr<Buffer>> buffers;
49};56};
5057
51}58}
5259
=== modified file 'src/client/default_connection_configuration.cpp'
--- src/client/default_connection_configuration.cpp 2016-01-29 08:18:22 +0000
+++ src/client/default_connection_configuration.cpp 2016-03-30 00:11:41 +0000
@@ -21,7 +21,7 @@
21#include "display_configuration.h"21#include "display_configuration.h"
22#include "rpc/make_rpc_channel.h"22#include "rpc/make_rpc_channel.h"
23#include "rpc/null_rpc_report.h"23#include "rpc/null_rpc_report.h"
24#include "mir/logging/dumb_console_logger.h"24#include "mir/logging/logger.h"
25#include "mir/input/input_platform.h"25#include "mir/input/input_platform.h"
26#include "mir/input/input_devices.h"26#include "mir/input/input_devices.h"
27#include "mir/input/null_input_receiver_report.h"27#include "mir/input/null_input_receiver_report.h"
@@ -37,6 +37,7 @@
37#include "mir/client_platform_factory.h"37#include "mir/client_platform_factory.h"
38#include "probing_client_platform_factory.h"38#include "probing_client_platform_factory.h"
39#include "mir_event_distributor.h"39#include "mir_event_distributor.h"
40#include "buffer_factory.h"
4041
41namespace mcl = mir::client;42namespace mcl = mir::client;
4243
@@ -69,18 +70,24 @@
69 [this]70 [this]
70 {71 {
71 return mcl::rpc::make_rpc_channel(72 return mcl::rpc::make_rpc_channel(
72 the_socket_file(), the_surface_map(), the_display_configuration(), the_input_devices(), the_rpc_report(), the_lifecycle_control(), the_ping_handler(), the_event_sink());73 the_socket_file(), the_surface_map(), the_buffer_factory(),
74 the_display_configuration(), the_input_devices(), the_rpc_report(),
75 the_lifecycle_control(), the_ping_handler(), the_event_sink());
73 });76 });
74}77}
7578
76std::shared_ptr<mir::logging::Logger>79std::shared_ptr<mir::logging::Logger>
77mcl::DefaultConnectionConfiguration::the_logger()80mcl::DefaultConnectionConfiguration::the_logger()
78{81{
79 return logger(82 class ProxyLogger : public mir::logging::Logger
80 []83 {
84 void log(mir::logging::Severity severity, const std::string& message, const std::string& component) override
81 {85 {
82 return std::make_shared<mir::logging::DumbConsoleLogger>();86 mir::logging::log(severity, message, component);
83 });87 }
88 };
89
90 return logger([]{ return std::make_shared<ProxyLogger>(); });
84}91}
8592
86std::shared_ptr<mcl::ClientPlatformFactory>93std::shared_ptr<mcl::ClientPlatformFactory>
@@ -228,3 +235,12 @@
228 return std::make_shared<mir::logging::NullSharedLibraryProberReport>();235 return std::make_shared<mir::logging::NullSharedLibraryProberReport>();
229 });236 });
230}237}
238
239std::shared_ptr<mir::client::AsyncBufferFactory> mir::client::DefaultConnectionConfiguration::the_buffer_factory()
240{
241 return async_buffer_factory(
242 [this] () -> std::shared_ptr<mir::client::AsyncBufferFactory>
243 {
244 return std::make_shared<mir::client::BufferFactory>();
245 });
246}
231247
=== modified file 'src/client/default_connection_configuration.h'
--- src/client/default_connection_configuration.h 2016-01-29 08:18:22 +0000
+++ src/client/default_connection_configuration.h 2016-03-30 00:11:41 +0000
@@ -62,6 +62,7 @@
62 std::shared_ptr<EventSink> the_event_sink() override;62 std::shared_ptr<EventSink> the_event_sink() override;
63 std::shared_ptr<EventHandlerRegister> the_event_handler_register() override;63 std::shared_ptr<EventHandlerRegister> the_event_handler_register() override;
64 std::shared_ptr<mir::SharedLibraryProberReport> the_shared_library_prober_report();64 std::shared_ptr<mir::SharedLibraryProberReport> the_shared_library_prober_report();
65 std::shared_ptr<mir::client::AsyncBufferFactory> the_buffer_factory() override;
6566
66 virtual std::string the_socket_file();67 virtual std::string the_socket_file();
67 virtual std::shared_ptr<rpc::RpcReport> the_rpc_report();68 virtual std::shared_ptr<rpc::RpcReport> the_rpc_report();
@@ -82,6 +83,7 @@
82 CachedPtr<rpc::RpcReport> rpc_report;83 CachedPtr<rpc::RpcReport> rpc_report;
83 CachedPtr<input::receiver::InputReceiverReport> input_receiver_report;84 CachedPtr<input::receiver::InputReceiverReport> input_receiver_report;
84 CachedPtr<mir::SharedLibraryProberReport> shared_library_prober_report;85 CachedPtr<mir::SharedLibraryProberReport> shared_library_prober_report;
86 CachedPtr<mir::client::AsyncBufferFactory> async_buffer_factory;
8587
86private:88private:
87 std::string const socket_file;89 std::string const socket_file;
8890
=== modified file 'src/client/display_configuration.cpp'
--- src/client/display_configuration.cpp 2016-01-29 08:18:22 +0000
+++ src/client/display_configuration.cpp 2016-03-30 00:11:41 +0000
@@ -53,6 +53,13 @@
53 output_formats = new MirPixelFormat[num_formats];53 output_formats = new MirPixelFormat[num_formats];
54}54}
5555
56mcl::DisplayOutput::DisplayOutput(DisplayOutput&& rhs)
57{
58 std::memcpy(this, &rhs, sizeof(*this));
59 rhs.modes = nullptr;
60 rhs.output_formats = nullptr;
61}
62
56mcl::DisplayOutput::~DisplayOutput()63mcl::DisplayOutput::~DisplayOutput()
57{64{
58 delete[] modes;65 delete[] modes;
@@ -74,6 +81,8 @@
74 output.output_id = msg.output_id();81 output.output_id = msg.output_id();
75 output.type = static_cast<MirDisplayOutputType>(msg.type());82 output.type = static_cast<MirDisplayOutputType>(msg.type());
7683
84 output.num_modes = msg.mode_size();
85 output.modes = new MirDisplayMode[output.num_modes];
77 for (auto i = 0u; i < output.num_modes; i++)86 for (auto i = 0u; i < output.num_modes; i++)
78 {87 {
79 auto mode = msg.mode(i);88 auto mode = msg.mode(i);
@@ -84,6 +93,8 @@
84 output.preferred_mode = msg.preferred_mode();93 output.preferred_mode = msg.preferred_mode();
85 output.current_mode = msg.current_mode();94 output.current_mode = msg.current_mode();
8695
96 output.num_output_formats = msg.pixel_format_size();
97 output.output_formats = new MirPixelFormat[output.num_output_formats];
87 for (auto i = 0u; i < output.num_output_formats; i++)98 for (auto i = 0u; i < output.num_output_formats; i++)
88 {99 {
89 output.output_formats[i] = static_cast<MirPixelFormat>(msg.pixel_format(i));100 output.output_formats[i] = static_cast<MirPixelFormat>(msg.pixel_format(i));
@@ -113,25 +124,8 @@
113124
114void mcl::DisplayConfiguration::set_configuration(mp::DisplayConfiguration const& msg)125void mcl::DisplayConfiguration::set_configuration(mp::DisplayConfiguration const& msg)
115{126{
116 std::lock_guard<std::mutex> lk(guard);
117
118 cards.clear();
119 for (auto i = 0; i < msg.display_card_size(); i++)
120 {
121 auto const& msg_card = msg.display_card(i);
122 MirDisplayCard card;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: