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 |
Related bugs: |
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
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3410
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
debian/changelog:
- 17 fixes listed but there are 27 in https:/
- some enhancements not mentioned
- "No ABIs changed" could be expressed more simply
- 3411. By Daniel van Vugt
-
Fix up debian/changelog
Daniel van Vugt (vanvugt) : | # |
Daniel van Vugt (vanvugt) wrote : | # |
Are these not ABI breaks?
include/
include/
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3411
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3411
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Griffiths (alan-griffiths) wrote : | # |
> Are these not ABI breaks?
>
> include/
> include/
Looks like it to me.
We ought to have detected this earlier.
- 3412. By Alberto Aguirre
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3412
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Nice work on the 'unbreak' effort.
Unfortunately I just noticed another one. The changelog incorrectly states:
mirclientpla
but actually we did break it:
CMakeLists.
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.
Alan Griffiths (alan-griffiths) wrote : | # |
> but actually we did break it:
>
> CMakeLists.
>
> 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.
- 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.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3416
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 3417. By Daniel van Vugt
-
debian/changelog: Can't say "no ABI breaks" any more.
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/
> virtual void emit_device_
It's near the start of the vtable too.
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3417
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Ignore that failure, it's happening on all branches right now.
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.
- 3418. By Daniel van Vugt
-
No change. Try again, Jenkins.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3418
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 3419. By Alberto Aguirre
-
Fix latest mirclient symbol stanza
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3419
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
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).
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.
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_
- 3420. By Daniel van Vugt
-
Corrected src/client/
symbols. map naming
Daniel van Vugt (vanvugt) wrote : | # |
And more errors found :S ...
src/platform/
mir:
src/server/
+ mir::shell:
+ mir::shell:
+ mir::shell:
+ mir::shell:
+ mir::shell:
...
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.
- 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.
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.
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3420
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
ABORTED: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Just waiting on agreement from trunk now, so we don't diverge:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3421
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
ABORTED: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 3422. By Alberto Aguirre
-
merge lp:mir/ubuntu
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3422
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3422
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Looks good now.
- 3423. By Andreas Pokorny
-
disable key repeats on the mx4 touchscreen
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3423
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 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
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3425
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
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_
00:55:22 13 - mir_acceptance_
00:55:22 17 - mir_integration
Brandon Schaefer (brandontschaefer) wrote : | # |
Tested on krillin, good on this device!
Preview Diff
1 | === modified file '3rd_party/CMakeLists.txt' | |||
2 | --- 3rd_party/CMakeLists.txt 2016-01-29 08:18:22 +0000 | |||
3 | +++ 3rd_party/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
4 | @@ -8,8 +8,6 @@ | |||
5 | 8 | ) | 8 | ) |
6 | 9 | 9 | ||
7 | 10 | set(MIR_3RD_PARTY_INCLUDE_DIRECTORIES ${MIR_3RD_PARTY_INCLUDE_DIRECTORIES} PARENT_SCOPE) | 10 | set(MIR_3RD_PARTY_INCLUDE_DIRECTORIES ${MIR_3RD_PARTY_INCLUDE_DIRECTORIES} PARENT_SCOPE) |
8 | 11 | set(MIR_INPUT_ANDROID_COMPILE_FLAGS ${MIR_INPUT_ANDROID_COMPILE_FLAGS} | ||
9 | 12 | PARENT_SCOPE) | ||
10 | 13 | 11 | ||
11 | 14 | include_directories(${PROJECT_SOURCE_DIR}/src/include/cookie) | 12 | include_directories(${PROJECT_SOURCE_DIR}/src/include/cookie) |
12 | 15 | include_directories(${PROJECT_SOURCE_DIR}/src/include/common) | 13 | include_directories(${PROJECT_SOURCE_DIR}/src/include/common) |
13 | 16 | 14 | ||
14 | === modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h' | |||
15 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2016-01-29 08:18:22 +0000 | |||
16 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2016-03-30 00:11:41 +0000 | |||
17 | @@ -554,6 +554,7 @@ | |||
18 | 554 | } | 554 | } |
19 | 555 | 555 | ||
20 | 556 | protected: | 556 | protected: |
21 | 557 | float getAccumulatedAxisValue(int32_t axis, size_t pointerIndex) const; | ||
22 | 557 | int32_t mAction; | 558 | int32_t mAction; |
23 | 558 | int32_t mFlags; | 559 | int32_t mFlags; |
24 | 559 | int32_t mEdgeFlags; | 560 | int32_t mEdgeFlags; |
25 | 560 | 561 | ||
26 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/Input.cpp' | |||
27 | --- 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2016-01-29 08:18:22 +0000 | |||
28 | +++ 3rd_party/android-input/android/frameworks/base/services/input/Input.cpp 2016-03-30 00:11:41 +0000 | |||
29 | @@ -359,12 +359,29 @@ | |||
30 | 359 | return &mSamplePointerCoords[getHistorySize() * getPointerCount() + pointerIndex]; | 359 | return &mSamplePointerCoords[getHistorySize() * getPointerCount() + pointerIndex]; |
31 | 360 | } | 360 | } |
32 | 361 | 361 | ||
33 | 362 | float MotionEvent::getAccumulatedAxisValue(int32_t axis, size_t pointerIndex) const { | ||
34 | 363 | float acc = 0; | ||
35 | 364 | auto const pointerCount = getPointerCount(); | ||
36 | 365 | for (size_t i = 0, num_entries = getHistorySize() + 1; i != num_entries; ++i) | ||
37 | 366 | acc += mSamplePointerCoords[i * pointerCount + pointerIndex].getAxisValue(axis); | ||
38 | 367 | return acc; | ||
39 | 368 | } | ||
40 | 369 | |||
41 | 362 | float MotionEvent::getRawAxisValue(int32_t axis, size_t pointerIndex) const { | 370 | float MotionEvent::getRawAxisValue(int32_t axis, size_t pointerIndex) const { |
43 | 363 | return getRawPointerCoords(pointerIndex)->getAxisValue(axis); | 371 | switch (axis) |
44 | 372 | { | ||
45 | 373 | case AMOTION_EVENT_AXIS_RX: // joystick rotation axis are abused as relative x and y | ||
46 | 374 | case AMOTION_EVENT_AXIS_RY: | ||
47 | 375 | case AMOTION_EVENT_AXIS_VSCROLL: | ||
48 | 376 | case AMOTION_EVENT_AXIS_HSCROLL: | ||
49 | 377 | return getAccumulatedAxisValue(axis, pointerIndex); | ||
50 | 378 | default: | ||
51 | 379 | return getRawPointerCoords(pointerIndex)->getAxisValue(axis); | ||
52 | 380 | } | ||
53 | 364 | } | 381 | } |
54 | 365 | 382 | ||
55 | 366 | float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const { | 383 | float MotionEvent::getAxisValue(int32_t axis, size_t pointerIndex) const { |
57 | 367 | float value = getRawPointerCoords(pointerIndex)->getAxisValue(axis); | 384 | float value = getRawAxisValue(axis, pointerIndex); |
58 | 368 | switch (axis) { | 385 | switch (axis) { |
59 | 369 | case AMOTION_EVENT_AXIS_X: | 386 | case AMOTION_EVENT_AXIS_X: |
60 | 370 | return value + mXOffset; | 387 | return value + mXOffset; |
61 | 371 | 388 | ||
62 | === modified file 'CMakeLists.txt' | |||
63 | --- CMakeLists.txt 2016-03-15 03:05:51 +0000 | |||
64 | +++ CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
65 | @@ -28,12 +28,14 @@ | |||
66 | 28 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | 28 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
67 | 29 | 29 | ||
68 | 30 | set(MIR_VERSION_MAJOR 0) | 30 | set(MIR_VERSION_MAJOR 0) |
71 | 31 | set(MIR_VERSION_MINOR 20) | 31 | set(MIR_VERSION_MINOR 21) |
72 | 32 | set(MIR_VERSION_PATCH 3) | 32 | set(MIR_VERSION_PATCH 0) |
73 | 33 | 33 | ||
74 | 34 | add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR}) | 34 | add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR}) |
75 | 35 | add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR}) | 35 | add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR}) |
76 | 36 | add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH}) | 36 | add_definitions(-DMIR_VERSION_MICRO=${MIR_VERSION_PATCH}) |
77 | 37 | add_definitions(-D_GNU_SOURCE) | ||
78 | 38 | add_definitions(-D_FILE_OFFSET_BITS=64) | ||
79 | 37 | 39 | ||
80 | 38 | set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH}) | 40 | set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH}) |
81 | 39 | 41 | ||
82 | @@ -81,6 +83,11 @@ | |||
83 | 81 | if(MIR_LINK_TIME_OPTIMIZATION) | 83 | if(MIR_LINK_TIME_OPTIMIZATION) |
84 | 82 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") | 84 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") |
85 | 83 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto") | 85 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto") |
86 | 86 | if(${CMAKE_COMPILER_IS_GNUCXX}) | ||
87 | 87 | set(CMAKE_NM "gcc-nm") | ||
88 | 88 | set(CMAKE_AR "gcc-ar") | ||
89 | 89 | set(CMAKE_RANLIB "gcc-ranlib") | ||
90 | 90 | endif() | ||
91 | 84 | endif() | 91 | endif() |
92 | 85 | 92 | ||
93 | 86 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) | 93 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) |
94 | @@ -110,6 +117,7 @@ | |||
95 | 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") |
96 | 111 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread") | 118 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread") |
97 | 112 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread") | 119 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread") |
98 | 120 | link_libraries(tsan) # Workaround for LP:1413474 | ||
99 | 113 | elseif(cmake_build_type_lower MATCHES "ubsanitizer") | 121 | elseif(cmake_build_type_lower MATCHES "ubsanitizer") |
100 | 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") |
101 | 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") |
102 | @@ -163,6 +171,8 @@ | |||
103 | 163 | 171 | ||
104 | 164 | list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM) | 172 | list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM) |
105 | 165 | 173 | ||
106 | 174 | option(MIR_ENABLE_TESTS "Build tests" ON) | ||
107 | 175 | |||
108 | 166 | foreach(platform IN LISTS MIR_PLATFORM) | 176 | foreach(platform IN LISTS MIR_PLATFORM) |
109 | 167 | if (platform STREQUAL "mesa-kms") | 177 | if (platform STREQUAL "mesa-kms") |
110 | 168 | set(MIR_BUILD_PLATFORM_MESA_KMS TRUE) | 178 | set(MIR_BUILD_PLATFORM_MESA_KMS TRUE) |
111 | @@ -214,7 +224,12 @@ | |||
112 | 214 | add_subdirectory(src/) | 224 | add_subdirectory(src/) |
113 | 215 | include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES}) | 225 | include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES}) |
114 | 216 | 226 | ||
116 | 217 | option(MIR_ENABLE_TESTS "Build tests" ON) | 227 | # This copy is used by users of mirplatforminputevdev |
117 | 228 | if ("${LIBINPUT_VERSION}" VERSION_LESS "1.1") | ||
118 | 229 | add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=0) | ||
119 | 230 | else () | ||
120 | 231 | add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1) | ||
121 | 232 | endif () | ||
122 | 218 | 233 | ||
123 | 219 | add_subdirectory(benchmarks/) | 234 | add_subdirectory(benchmarks/) |
124 | 220 | add_subdirectory(examples/) | 235 | add_subdirectory(examples/) |
125 | @@ -244,8 +259,6 @@ | |||
126 | 244 | include (cmake/Doxygen.cmake) | 259 | include (cmake/Doxygen.cmake) |
127 | 245 | include (cmake/ABICheck.cmake) | 260 | include (cmake/ABICheck.cmake) |
128 | 246 | 261 | ||
129 | 247 | add_subdirectory(snappy) | ||
130 | 248 | |||
131 | 249 | add_custom_target(ptest | 262 | add_custom_target(ptest |
132 | 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" |
133 | 251 | ) | 264 | ) |
134 | 252 | 265 | ||
135 | === modified file 'benchmarks/frame-uniformity/CMakeLists.txt' | |||
136 | --- benchmarks/frame-uniformity/CMakeLists.txt 2016-01-29 08:18:22 +0000 | |||
137 | +++ benchmarks/frame-uniformity/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
138 | @@ -15,6 +15,12 @@ | |||
139 | 15 | ${PROJECT_SOURCE_DIR}/tests/include/ | 15 | ${PROJECT_SOURCE_DIR}/tests/include/ |
140 | 16 | ) | 16 | ) |
141 | 17 | 17 | ||
142 | 18 | # We use mir-test-{doubles,framework}, which builds differently based on | ||
143 | 19 | # the primary test platform. | ||
144 | 20 | if (MIR_TEST_PLATFORM STREQUAL "android") | ||
145 | 21 | add_definitions(-DANDROID) | ||
146 | 22 | endif() | ||
147 | 23 | |||
148 | 18 | mir_add_wrapped_executable(frame_uniformity_test_client NOINSTALL | 24 | mir_add_wrapped_executable(frame_uniformity_test_client NOINSTALL |
149 | 19 | touch_measuring_client.cpp | 25 | touch_measuring_client.cpp |
150 | 20 | touch_producing_server.cpp | 26 | touch_producing_server.cpp |
151 | 21 | 27 | ||
152 | === modified file 'cmake/ABICheck.cmake' | |||
153 | --- cmake/ABICheck.cmake 2016-01-29 08:18:22 +0000 | |||
154 | +++ cmake/ABICheck.cmake 2016-03-30 00:11:41 +0000 | |||
155 | @@ -1,33 +1,29 @@ | |||
156 | 1 | cmake_minimum_required (VERSION 2.6) | 1 | cmake_minimum_required (VERSION 2.6) |
157 | 2 | 2 | ||
158 | 3 | find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker) | 3 | find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker) |
159 | 4 | |||
160 | 5 | if (NOT ABI_COMPLIANCE_CHECKER) | 4 | if (NOT ABI_COMPLIANCE_CHECKER) |
161 | 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") |
162 | 7 | return() | 6 | return() |
163 | 8 | endif() | 7 | endif() |
164 | 9 | 8 | ||
165 | 9 | set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST}) | ||
166 | 10 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE) | 10 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE) |
167 | 11 | 11 | ||
180 | 12 | set(ABI_CHECK_BASE_DIR $ENV{MIR_ABI_CHECK_BASE_DIR}) | 12 | set(ABI_DUMPS_DIR "${CMAKE_BINARY_DIR}/abi_dumps/${ABI_CHECK_TARGET_MACH}") |
181 | 13 | set(ABI_DUMP_PREBUILT_LIBDIR $ENV{MIR_ABI_DUMP_PREBUILT_LIBDIR}) | 13 | |
182 | 14 | set(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" |
183 | 15 | 15 | # extract the value corresponding to the given key | |
184 | 16 | if ("${ABI_CHECK_BASE_DIR}" STREQUAL "") | 16 | function(get_value_for_key a_list key value) |
185 | 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) |
174 | 18 | endif() | ||
175 | 19 | |||
176 | 20 | set(ABI_DUMPS_DIR_PREFIX "abi_dumps/${ABI_CHECK_TARGET_MACH}") | ||
177 | 21 | |||
178 | 22 | function(get_value_for_arg alist name output) | ||
179 | 23 | list(FIND alist ${name} idx) | ||
186 | 24 | if (idx GREATER -1) | 18 | if (idx GREATER -1) |
187 | 25 | math(EXPR idx "${idx} + 1") | 19 | math(EXPR idx "${idx} + 1") |
190 | 26 | list(GET alist ${idx} tmp_out) | 20 | list(GET a_list ${idx} tmp_value) |
191 | 27 | set(${output} "${tmp_out}" PARENT_SCOPE) | 21 | set(${value} "${tmp_value}" PARENT_SCOPE) |
192 | 28 | endif() | 22 | endif() |
193 | 29 | endfunction() | 23 | endfunction() |
194 | 30 | 24 | ||
195 | 25 | # Makes a one-entry per line list of all include paths used | ||
196 | 26 | # to compile the given library target | ||
197 | 31 | function(get_includes libname output) | 27 | function(get_includes libname output) |
198 | 32 | get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES) | 28 | get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES) |
199 | 33 | list(REMOVE_DUPLICATES lib_includes) | 29 | list(REMOVE_DUPLICATES lib_includes) |
200 | @@ -35,52 +31,44 @@ | |||
201 | 35 | set(${output} "${tmp_out}" PARENT_SCOPE) | 31 | set(${output} "${tmp_out}" PARENT_SCOPE) |
202 | 36 | endfunction() | 32 | endfunction() |
203 | 37 | 33 | ||
204 | 34 | # Creates the XML descriptor file that describes the given library target | ||
205 | 35 | # suitable for abi-compliance-checker | ||
206 | 38 | function(make_lib_descriptor name) | 36 | function(make_lib_descriptor name) |
207 | 39 | set(libname "mir${name}") | 37 | set(libname "mir${name}") |
208 | 40 | 38 | ||
215 | 41 | list(FIND ARGN "INCLUDE_PRIVATE" include_private) | 39 | # Optional argument LIBRARY_HEADER - use the given header to describe |
216 | 42 | if (include_private GREATER -1) | 40 | # the binary library instead of assuming its described by include/<name> |
217 | 43 | set(private_headers "${CMAKE_SOURCE_DIR}/src/include/${name}") | 41 | get_value_for_key("${ARGN}" "LIBRARY_HEADER" library_header) |
212 | 44 | endif() | ||
213 | 45 | |||
214 | 46 | get_value_for_arg("${ARGN}" "LIBRARY_HEADER" library_header) | ||
218 | 47 | if ("${library_header}" STREQUAL "") | 42 | if ("${library_header}" STREQUAL "") |
219 | 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}") |
220 | 49 | else() | 44 | else() |
221 | 50 | set(LIB_DESC_HEADERS ${library_header}) | 45 | set(LIB_DESC_HEADERS ${library_header}) |
222 | 51 | endif() | 46 | endif() |
223 | 52 | 47 | ||
224 | 48 | # FIXME: Property "LOCATION" is now deprecated | ||
225 | 53 | if (NOT ${CMAKE_MAJOR_VERSION} LESS 3) | 49 | if (NOT ${CMAKE_MAJOR_VERSION} LESS 3) |
226 | 54 | cmake_policy(SET CMP0026 OLD) | 50 | cmake_policy(SET CMP0026 OLD) |
227 | 55 | endif() | 51 | endif() |
237 | 56 | # TODO: Deprecate use of "LOCATION" (CMP0026) ... | 52 | get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION) |
238 | 57 | if ("${ABI_DUMP_PREBUILT_LIBDIR}" STREQUAL "") | 53 | |
230 | 58 | get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION) | ||
231 | 59 | else() | ||
232 | 60 | get_property(liblocation TARGET ${libname} PROPERTY LOCATION) | ||
233 | 61 | get_filename_component(libfilename ${liblocation} NAME) | ||
234 | 62 | set(LIB_DESC_LIBS "${ABI_DUMP_PREBUILT_LIBDIR}/${libfilename}") | ||
235 | 63 | endif() | ||
236 | 64 | |||
239 | 65 | get_includes(${libname} LIB_DESC_INCLUDE_PATHS) | 54 | get_includes(${libname} LIB_DESC_INCLUDE_PATHS) |
240 | 66 | set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}") | 55 | set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}") |
241 | 67 | 56 | ||
243 | 68 | get_value_for_arg("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS) | 57 | # Optional EXCLUDE_HEADERS - a list |
244 | 58 | # while attempting an abi dump | ||
245 | 59 | get_value_for_key("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS) | ||
246 | 69 | 60 | ||
247 | 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) |
248 | 71 | endfunction() | 62 | endfunction() |
249 | 72 | 63 | ||
250 | 73 | #These headers are not part of the libmircommon ABI | ||
251 | 74 | set(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") | ||
252 | 75 | |||
253 | 76 | #These headers are not part of the libmirplatform ABI | 64 | #These headers are not part of the libmirplatform ABI |
254 | 77 | set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input") | 65 | set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input") |
255 | 78 | 66 | ||
256 | 79 | make_lib_descriptor(client) | 67 | make_lib_descriptor(client) |
257 | 80 | make_lib_descriptor(server) | 68 | make_lib_descriptor(server) |
259 | 81 | make_lib_descriptor(common INCLUDE_PRIVATE EXCLUDE_HEADERS ${mircommon-exclude-headers}) | 69 | make_lib_descriptor(common) |
260 | 82 | make_lib_descriptor(cookie) | 70 | make_lib_descriptor(cookie) |
262 | 83 | make_lib_descriptor(platform INCLUDE_PRIVATE EXCLUDE_HEADERS ${mirplatform-exclude-headers}) | 71 | make_lib_descriptor(platform EXCLUDE_HEADERS ${mirplatform-exclude-headers}) |
263 | 84 | if(MIR_BUILD_PLATFORM_MESA_KMS) | 72 | if(MIR_BUILD_PLATFORM_MESA_KMS) |
264 | 85 | make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h) | 73 | make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h) |
265 | 86 | make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h) | 74 | make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h) |
266 | @@ -91,38 +79,21 @@ | |||
267 | 91 | endif() | 79 | endif() |
268 | 92 | make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/) | 80 | make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/) |
269 | 93 | 81 | ||
282 | 94 | add_custom_target(abi-release-dump | 82 | |
283 | 95 | COMMAND /bin/sh -c '${CMAKE_SOURCE_DIR}/tools/generate-abi-base-dump.sh ${CMAKE_SOURCE_DIR}' | 83 | macro(_define_abi_dump_for libname) |
284 | 96 | ) | 84 | set(ABI_DUMP_NAME ${ABI_DUMPS_DIR}/${libname}_next.abi.tar.gz) |
273 | 97 | |||
274 | 98 | macro(_add_custom_abi_dump_command libname version) | ||
275 | 99 | set(ABI_DUMP_NAME ${ABI_DUMPS_DIR_PREFIX}/${libname}_${version}.abi.tar.gz) | ||
276 | 100 | |||
277 | 101 | if ("${ABI_DUMP_PREBUILT_LIBDIR}" STREQUAL "") | ||
278 | 102 | set(dump_depends ${libname}) | ||
279 | 103 | else() | ||
280 | 104 | set(dump_depends "") | ||
281 | 105 | endif() | ||
285 | 106 | 85 | ||
286 | 107 | add_custom_command(OUTPUT ${ABI_DUMP_NAME} | 86 | add_custom_command(OUTPUT ${ABI_DUMP_NAME} |
289 | 108 | COMMAND abi-compliance-checker -gcc-path ${CMAKE_C_COMPILER} -l ${libname} -v1 ${version} -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml | 87 | COMMAND abi-compliance-checker -gcc-path ${CMAKE_CXX_COMPILER} -l ${libname} -v1 next -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml |
290 | 109 | DEPENDS ${dump_depends} | 88 | DEPENDS ${libname} |
291 | 110 | ) | 89 | ) |
292 | 111 | endmacro(_add_custom_abi_dump_command) | ||
293 | 112 | |||
294 | 113 | macro(_define_abi_dump_for libname) | ||
295 | 114 | _add_custom_abi_dump_command(${libname} next) | ||
296 | 115 | add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME}) | 90 | add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME}) |
297 | 116 | _add_custom_abi_dump_command(${libname} base) | ||
298 | 117 | add_custom_target(abi-dump-base-${libname} DEPENDS ${ABI_DUMP_NAME}) | ||
299 | 118 | endmacro(_define_abi_dump_for) | 91 | endmacro(_define_abi_dump_for) |
300 | 119 | 92 | ||
301 | 120 | macro(_define_abi_check_for libname) | 93 | macro(_define_abi_check_for libname) |
302 | 121 | set(OLD_ABI_DUMP "${ABI_CHECK_BASE_DIR}/${ABI_CHECK_TARGET_MACH}/${libname}_base.abi.tar.gz") | ||
303 | 122 | set(NEW_ABI_DUMP ${ABI_DUMPS_DIR_PREFIX}/${libname}_next.abi.tar.gz) | ||
304 | 123 | add_custom_target(abi-check-${libname} | 94 | add_custom_target(abi-check-${libname} |
307 | 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}' |
308 | 125 | DEPENDS abi-dump-${libname} abi-release-dump | 96 | DEPENDS abi-dump-${libname} |
309 | 126 | ) | 97 | ) |
310 | 127 | endmacro(_define_abi_check_for) | 98 | endmacro(_define_abi_check_for) |
311 | 128 | 99 | ||
312 | @@ -138,12 +109,10 @@ | |||
313 | 138 | _define_abi_dump_for(${libname}) | 109 | _define_abi_dump_for(${libname}) |
314 | 139 | _define_abi_check_for(${libname}) | 110 | _define_abi_check_for(${libname}) |
315 | 140 | list(APPEND abi-dump-list abi-dump-${libname}) | 111 | list(APPEND abi-dump-list abi-dump-${libname}) |
316 | 141 | list(APPEND abi-dump-base-list abi-dump-base-${libname}) | ||
317 | 142 | list(APPEND abi-check-list abi-check-${libname}) | 112 | list(APPEND abi-check-list abi-check-${libname}) |
318 | 143 | endforeach(libname) | 113 | endforeach(libname) |
319 | 144 | 114 | ||
320 | 145 | add_custom_target(abi-dump DEPENDS ${abi-dump-list}) | 115 | add_custom_target(abi-dump DEPENDS ${abi-dump-list}) |
321 | 146 | add_custom_target(abi-dump-base DEPENDS ${abi-dump-base-list}) | ||
322 | 147 | add_custom_target(abi-check DEPENDS ${abi-check-list}) | 116 | add_custom_target(abi-check DEPENDS ${abi-check-list}) |
323 | 148 | 117 | ||
324 | 149 | if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST) | 118 | if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST) |
325 | 150 | 119 | ||
326 | === modified file 'cmake/FindGtestGmock.cmake' | |||
327 | --- cmake/FindGtestGmock.cmake 2016-01-29 08:18:22 +0000 | |||
328 | +++ cmake/FindGtestGmock.cmake 2016-03-30 00:11:41 +0000 | |||
329 | @@ -20,7 +20,7 @@ | |||
330 | 20 | set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs) | 20 | set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs) |
331 | 21 | set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest) | 21 | set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest) |
332 | 22 | 22 | ||
334 | 23 | set(GTEST_CXX_FLAGS "-fPIC") | 23 | set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64") |
335 | 24 | if (cmake_build_type_lower MATCHES "threadsanitizer") | 24 | if (cmake_build_type_lower MATCHES "threadsanitizer") |
336 | 25 | set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread") | 25 | set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread") |
337 | 26 | elseif (cmake_build_type_lower MATCHES "ubsanitizer") | 26 | elseif (cmake_build_type_lower MATCHES "ubsanitizer") |
338 | 27 | 27 | ||
339 | === modified file 'cmake/FindLibHardware.cmake' | |||
340 | --- cmake/FindLibHardware.cmake 2016-01-29 04:07:19 +0000 | |||
341 | +++ cmake/FindLibHardware.cmake 2016-03-30 00:11:41 +0000 | |||
342 | @@ -7,7 +7,7 @@ | |||
343 | 7 | INCLUDE(FindPackageHandleStandardArgs) | 7 | INCLUDE(FindPackageHandleStandardArgs) |
344 | 8 | 8 | ||
345 | 9 | find_package( PkgConfig ) | 9 | find_package( PkgConfig ) |
347 | 10 | pkg_search_module(ANDROID_HEADERS REQUIRED android-headers-19 android-headers) | 10 | pkg_search_module(ANDROID_HEADERS REQUIRED android-headers) |
348 | 11 | set(LIBHARDWARE_INCLUDE_DIRS ${ANDROID_HEADERS_INCLUDE_DIRS}) | 11 | set(LIBHARDWARE_INCLUDE_DIRS ${ANDROID_HEADERS_INCLUDE_DIRS}) |
349 | 12 | 12 | ||
350 | 13 | find_library(LIBHARDWARE_LIBRARY | 13 | find_library(LIBHARDWARE_LIBRARY |
351 | 14 | 14 | ||
352 | === modified file 'cmake/MirCommon.cmake' | |||
353 | --- cmake/MirCommon.cmake 2016-02-12 04:02:11 +0000 | |||
354 | +++ cmake/MirCommon.cmake 2016-03-30 00:11:41 +0000 | |||
355 | @@ -52,12 +52,17 @@ | |||
356 | 52 | set(${STR_VAR} "${tmp_str}" PARENT_SCOPE) | 52 | set(${STR_VAR} "${tmp_str}" PARENT_SCOPE) |
357 | 53 | endfunction() | 53 | endfunction() |
358 | 54 | 54 | ||
360 | 55 | function (mir_discover_tests_internal EXECUTABLE DETECT_FD_LEAKS) | 55 | function (mir_discover_tests_internal EXECUTABLE TEST_ENV_OPTIONS DETECT_FD_LEAKS ) |
361 | 56 | # Set vars | 56 | # Set vars |
362 | 57 | set(test_cmd_no_memcheck "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}") | 57 | set(test_cmd_no_memcheck "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}") |
363 | 58 | set(test_cmd "${test_cmd_no_memcheck}") | 58 | set(test_cmd "${test_cmd_no_memcheck}") |
366 | 59 | set(test_env ${ARGN}) | 59 | set(test_env ${ARGN} ${TEST_ENV_OPTIONS}) |
367 | 60 | set(test_name ${EXECUTABLE}) | 60 | |
368 | 61 | if (TEST_ENV_OPTIONS) | ||
369 | 62 | set(test_name ${EXECUTABLE}---${TEST_ENV_OPTIONS}---) | ||
370 | 63 | else() | ||
371 | 64 | set(test_name ${EXECUTABLE}) | ||
372 | 65 | endif() | ||
373 | 61 | set(test_no_memcheck_filter) | 66 | set(test_no_memcheck_filter) |
374 | 62 | set(test_exclusion_filter) | 67 | set(test_exclusion_filter) |
375 | 63 | 68 | ||
376 | @@ -82,6 +87,11 @@ | |||
377 | 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") |
378 | 83 | endif() | 88 | endif() |
379 | 84 | 89 | ||
380 | 90 | if(cmake_build_type_lower MATCHES "ubsanitizer") | ||
381 | 91 | list(APPEND test_env "UBSAN_OPTIONS=\"suppressions=${CMAKE_SOURCE_DIR}/tools/ubsan-suppressions print_stacktrace=1 die_after_fork=0\"") | ||
382 | 92 | set(test_exclusion_filter "${test_exclusion_filter}:*DeathTest*") | ||
383 | 93 | endif() | ||
384 | 94 | |||
385 | 85 | if(SYSTEM_SUPPORTS_O_TMPFILE EQUAL 1) | 95 | if(SYSTEM_SUPPORTS_O_TMPFILE EQUAL 1) |
386 | 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") |
387 | 87 | endif() | 97 | endif() |
388 | @@ -115,11 +125,15 @@ | |||
389 | 115 | endfunction () | 125 | endfunction () |
390 | 116 | 126 | ||
391 | 117 | function (mir_discover_tests EXECUTABLE) | 127 | function (mir_discover_tests EXECUTABLE) |
393 | 118 | mir_discover_tests_internal(${EXECUTABLE} FALSE ${ARGN}) | 128 | mir_discover_tests_internal(${EXECUTABLE} "" FALSE ${ARGN}) |
394 | 119 | endfunction() | 129 | endfunction() |
395 | 120 | 130 | ||
396 | 121 | function (mir_discover_tests_with_fd_leak_detection EXECUTABLE) | 131 | function (mir_discover_tests_with_fd_leak_detection EXECUTABLE) |
398 | 122 | mir_discover_tests_internal(${EXECUTABLE} TRUE ${ARGN}) | 132 | mir_discover_tests_internal(${EXECUTABLE} "" TRUE ${ARGN}) |
399 | 133 | endfunction() | ||
400 | 134 | |||
401 | 135 | function (mir_discover_tests_with_fd_leak_detection_and_env EXECUTABLE TEST_ENV_OPTION) | ||
402 | 136 | mir_discover_tests_internal(${EXECUTABLE} ${TEST_ENV_OPTION} TRUE ${ARGN}) | ||
403 | 123 | endfunction() | 137 | endfunction() |
404 | 124 | 138 | ||
405 | 125 | function (mir_add_memcheck_test) | 139 | function (mir_add_memcheck_test) |
406 | @@ -145,11 +159,15 @@ | |||
407 | 145 | endif() | 159 | endif() |
408 | 146 | endfunction() | 160 | endfunction() |
409 | 147 | 161 | ||
410 | 148 | |||
411 | 149 | function (mir_precompiled_header TARGET HEADER) | 162 | function (mir_precompiled_header TARGET HEADER) |
412 | 150 | if (MIR_USE_PRECOMPILED_HEADERS) | 163 | if (MIR_USE_PRECOMPILED_HEADERS) |
414 | 151 | get_property(TARGET_COMPILE_FLAGS TARGET ${TARGET} PROPERTY COMPILE_FLAGS) | 164 | get_filename_component(HEADER_NAME ${HEADER} NAME) |
415 | 165 | |||
416 | 152 | get_property(TARGET_INCLUDE_DIRECTORIES TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) | 166 | get_property(TARGET_INCLUDE_DIRECTORIES TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) |
417 | 167 | |||
418 | 168 | set(TARGET_COMPILE_DEFINITIONS "$<TARGET_PROPERTY:${TARGET},COMPILE_DEFINITIONS>") | ||
419 | 169 | set(TARGET_COMPILE_DEFINITIONS "$<$<BOOL:${TARGET_COMPILE_DEFINITIONS}>:-D$<JOIN:${TARGET_COMPILE_DEFINITIONS},\n-D>\n>") | ||
420 | 170 | |||
421 | 153 | foreach(dir ${TARGET_INCLUDE_DIRECTORIES}) | 171 | foreach(dir ${TARGET_INCLUDE_DIRECTORIES}) |
422 | 154 | if (${dir} MATCHES "usr/include") | 172 | if (${dir} MATCHES "usr/include") |
423 | 155 | set(TARGET_INCLUDE_DIRECTORIES_STRING "${TARGET_INCLUDE_DIRECTORIES_STRING} -isystem ${dir}") | 173 | set(TARGET_INCLUDE_DIRECTORIES_STRING "${TARGET_INCLUDE_DIRECTORIES_STRING} -isystem ${dir}") |
424 | @@ -169,15 +187,44 @@ | |||
425 | 169 | # | 187 | # |
426 | 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. |
427 | 171 | string(TOUPPER "${CMAKE_BUILD_TYPE}" UC_BUILD_TYPE) | 189 | string(TOUPPER "${CMAKE_BUILD_TYPE}" UC_BUILD_TYPE) |
433 | 172 | separate_arguments( | 190 | |
434 | 173 | PCH_CXX_FLAGS UNIX_COMMAND | 191 | # Lllloook at you, haaacker. A pa-pa-pathetic creature of meat and bone. |
435 | 174 | "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UC_BUILD_TYPE}} ${TARGET_COMPILE_FLAGS} ${TARGET_INCLUDE_DIRECTORIES_STRING}" | 192 | # |
436 | 175 | ) | 193 | # It appears that we can *only* get the COMPILE_DEFINITIONS as a generator expression. |
437 | 176 | 194 | # This wouldn't be so bad if http://www.kwwidgets.org/Bug/view.php?id=14353#c33712 didn't mean | |
438 | 195 | # that you can't use generator expressions in custom commands. | ||
439 | 196 | # | ||
440 | 197 | # So! | ||
441 | 198 | # What we *can* do is generate a file with the contents of the generator expressions, | ||
442 | 199 | # then use gcc's @file mechanism... | ||
443 | 200 | set(FLAGS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_NAME}.compileflags") | ||
444 | 201 | |||
445 | 202 | file( | ||
446 | 203 | GENERATE | ||
447 | 204 | OUTPUT "${FLAGS_FILE}" | ||
448 | 205 | CONTENT " | ||
449 | 206 | ${CMAKE_CXX_FLAGS} | ||
450 | 207 | ${CMAKE_CXX_FLAGS_${UC_BUILD_TYPE}} | ||
451 | 208 | ${TARGET_INCLUDE_DIRECTORIES_STRING} | ||
452 | 209 | ${TARGET_COMPILE_DEFINITIONS}" | ||
453 | 210 | ) | ||
454 | 211 | |||
455 | 212 | # HA HA! | ||
456 | 213 | # | ||
457 | 214 | # Of course, that has unescaped all the escaped \"s we have in the compile definitions. | ||
458 | 215 | # gcc treats the contents of @file exactly as if it came from the command line, so we need to | ||
459 | 216 | # re-escape them. | ||
460 | 217 | add_custom_command( | ||
461 | 218 | OUTPUT ${FLAGS_FILE}.processed | ||
462 | 219 | DEPENDS ${FLAGS_FILE} | ||
463 | 220 | # ESCAPE ALL THE THINGS! | ||
464 | 221 | COMMAND sh -c "sed s_\\\"_\\\\\\\\\\\"_g ${FLAGS_FILE} > ${FLAGS_FILE}.processed" | ||
465 | 222 | VERBATIM | ||
466 | 223 | ) | ||
467 | 177 | add_custom_command( | 224 | add_custom_command( |
468 | 178 | OUTPUT ${TARGET}_precompiled.hpp.gch | 225 | OUTPUT ${TARGET}_precompiled.hpp.gch |
471 | 179 | DEPENDS ${HEADER} | 226 | DEPENDS ${HEADER} ${FLAGS_FILE}.processed |
472 | 180 | COMMAND ${CMAKE_CXX_COMPILER} ${PCH_CXX_FLAGS} -x c++-header -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp.gch | 227 | COMMAND ${CMAKE_CXX_COMPILER} @${FLAGS_FILE}.processed -x c++-header -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_precompiled.hpp.gch |
473 | 181 | ) | 228 | ) |
474 | 182 | 229 | ||
475 | 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 ") |
476 | 184 | 231 | ||
477 | === modified file 'debian/changelog' | |||
478 | --- debian/changelog 2016-03-22 15:42:36 +0000 | |||
479 | +++ debian/changelog 2016-03-30 00:11:41 +0000 | |||
480 | @@ -1,3 +1,66 @@ | |||
481 | 1 | mir (0.21.0-0ubuntu1) UNRELEASED; urgency=medium | ||
482 | 2 | |||
483 | 3 | * New upstream release 0.21.0 (https://launchpad.net/mir/+milestone/0.21.0) | ||
484 | 4 | - ABI summary: | ||
485 | 5 | . mirclient ABI unchanged at 9 | ||
486 | 6 | . mirserver ABI unchanged at 38 | ||
487 | 7 | . mircommon ABI unchanged at 5 | ||
488 | 8 | . mirplatform ABI unchanged at 11 | ||
489 | 9 | . mirprotobuf ABI unchanged at 3 | ||
490 | 10 | . mirplatformgraphics ABI unchaged at 8 | ||
491 | 11 | . mirclientplatform ABI bumped to 5 | ||
492 | 12 | . mirinputplatform ABI unchanged at 5 | ||
493 | 13 | - Enhancements: | ||
494 | 14 | . New display enumeration API | ||
495 | 15 | . Added Android diagnostic tests to assist during porting to | ||
496 | 16 | new devices | ||
497 | 17 | . Added mir_demo_client_camera: a Video4Linux2 client | ||
498 | 18 | - Bugs fixed: | ||
499 | 19 | . Sometimes devices don't suspend - display turns back on | ||
500 | 20 | immediately (LP: #1549701) | ||
501 | 21 | . Mir crashed with exception 'failed to add sync point to command | ||
502 | 22 | buffer' (LP: #1554635) | ||
503 | 23 | . Mouse cursor is unusably slow in Unity 8 with a 1000Hz mouse | ||
504 | 24 | (LP: #1539009) | ||
505 | 25 | . Packaged mir_unit_tests binary is not suitable for general use | ||
506 | 26 | (LP: #1547015) | ||
507 | 27 | . [regression] Mir stops receiving input after a pause/resume | ||
508 | 28 | cycle (LP: #1548989) | ||
509 | 29 | . NBS (--nbuffers=0) causes software clients to crash with | ||
510 | 30 | std::exception::what: Failed to mmap buffer 13, "Permission denied") | ||
511 | 31 | (LP: #1550432) | ||
512 | 32 | . Fullscreen clients freeze when using NBS with multiple monitors | ||
513 | 33 | (LP: #1551536) | ||
514 | 34 | . [ FAILED ] DisplayConfigurationTest.output_position_is_independent_of_ | ||
515 | 35 | orientation (LP: #1552065) | ||
516 | 36 | . The server-side use of MIR_SOCKET is confusing (LP: #1290345) | ||
517 | 37 | . [regression] FTBFS with -DMIR_LINK_TIME_OPTIMIZATION=on | ||
518 | 38 | -Duse_debflags=on (LP: #1350343) | ||
519 | 39 | . Mir On X (mesa-x11) keeps receiving mouse movement events even | ||
520 | 40 | when not focused (LP: #1528110) | ||
521 | 41 | . x11 platform: mouse cursor moves strange (LP: #1546324) | ||
522 | 42 | . Cross compiling to wily/vivid doesn't work (LP: #1549152) | ||
523 | 43 | . Rendering stutters when a new client establishes a connection | ||
524 | 44 | (LP: #1549359) | ||
525 | 45 | . 'mir_demo_server --test-client' crashes (SIGSEGV) when client | ||
526 | 46 | dies (LP: #1555620) | ||
527 | 47 | . [testfail] CI failure: TestClientInput.client_input_config_request_ | ||
528 | 48 | receives_all_attached_devices (LP: #1555708) | ||
529 | 49 | . [regression] Mir FTBFS when MIR_ENABLE_TESTS=no (LP: #1556080) | ||
530 | 50 | . Mir-on-X11 doesn't exit (until it gets an event) (LP: #1556210) | ||
531 | 51 | . InputPlatformProbe.x11_platform_found_and_used_when_display_connection_ | ||
532 | 52 | works breaks with old input drivers present (LP: #1543049) | ||
533 | 53 | . [regression] MIR_CLIENT_PERF_REPORT is missing window/surface | ||
534 | 54 | names (LP: #1546933) | ||
535 | 55 | . Installed binaries fail to run with mir_demo_server --test-client XXXX | ||
536 | 56 | (LP: #1556160) | ||
537 | 57 | . mir_demo_server --test-client [mir_demo_client_scroll| | ||
538 | 58 | mir_demo_client_flicker] fails (LP: #1556205) | ||
539 | 59 | . The contents of debian/mir-demos.examples are out of date and useless | ||
540 | 60 | (LP: #1557446) | ||
541 | 61 | |||
542 | 62 | -- Alberto Aguirre <alberto.aguirre@canonical.com> Thu, 17 Mar 2016 14:08:50 -0500 | ||
543 | 63 | |||
544 | 1 | mir (0.20.3+16.04.20160322-0ubuntu1) xenial; urgency=medium | 64 | mir (0.20.3+16.04.20160322-0ubuntu1) xenial; urgency=medium |
545 | 2 | 65 | ||
546 | 3 | [ Alberto Aguirre ] | 66 | [ Alberto Aguirre ] |
547 | 4 | 67 | ||
548 | === modified file 'debian/control' | |||
549 | --- debian/control 2016-02-08 17:31:22 +0000 | |||
550 | +++ debian/control 2016-03-30 00:11:41 +0000 | |||
551 | @@ -244,7 +244,7 @@ | |||
552 | 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, |
553 | 245 | robust operation and a well-defined driver model. | 245 | robust operation and a well-defined driver model. |
554 | 246 | . | 246 | . |
556 | 247 | Contains demo applications (with source) that use the Mir display server | 247 | Contains demo applications that use the Mir display server |
557 | 248 | 248 | ||
558 | 249 | Package: mir-utils | 249 | Package: mir-utils |
559 | 250 | Architecture: linux-any | 250 | Architecture: linux-any |
560 | @@ -275,6 +275,18 @@ | |||
561 | 275 | . | 275 | . |
562 | 276 | Contains a tool for stress testing the Mir display server | 276 | Contains a tool for stress testing the Mir display server |
563 | 277 | 277 | ||
564 | 278 | Package: mir-android-diagnostics | ||
565 | 279 | Architecture: i386 amd64 armhf | ||
566 | 280 | Pre-Depends: ${misc:Pre-Depends} | ||
567 | 281 | Depends: ${misc:Depends}, | ||
568 | 282 | ${shlibs:Depends}, | ||
569 | 283 | Recommends: mir-demos, | ||
570 | 284 | Description: Display Server for Ubuntu - android platform diagnostics utility | ||
571 | 285 | Mir is a display server running on linux systems, with a focus on efficiency, | ||
572 | 286 | robust operation and a well-defined driver model. | ||
573 | 287 | . | ||
574 | 288 | Contains a tool for checking the graphics components of android devices. | ||
575 | 289 | |||
576 | 278 | Package: libmircommon5 | 290 | Package: libmircommon5 |
577 | 279 | Section: libs | 291 | Section: libs |
578 | 280 | Architecture: linux-any | 292 | Architecture: linux-any |
579 | @@ -345,7 +357,7 @@ | |||
580 | 345 | Contains the shared libraries required for the Mir server to interact with | 357 | Contains the shared libraries required for the Mir server to interact with |
581 | 346 | the input hardware using the evdev interface. | 358 | the input hardware using the evdev interface. |
582 | 347 | 359 | ||
584 | 348 | Package: mir-client-platform-mesa4 | 360 | Package: mir-client-platform-mesa5 |
585 | 349 | Section: libs | 361 | Section: libs |
586 | 350 | Architecture: linux-any | 362 | Architecture: linux-any |
587 | 351 | Multi-Arch: same | 363 | Multi-Arch: same |
588 | @@ -373,7 +385,7 @@ | |||
589 | 373 | Contains header files required to use the platform specific capabilities of | 385 | Contains header files required to use the platform specific capabilities of |
590 | 374 | the Mir Mesa backend. | 386 | the Mir Mesa backend. |
591 | 375 | 387 | ||
593 | 376 | Package: mir-client-platform-android4 | 388 | Package: mir-client-platform-android5 |
594 | 377 | Section: libs | 389 | Section: libs |
595 | 378 | Architecture: i386 amd64 armhf | 390 | Architecture: i386 amd64 armhf |
596 | 379 | Multi-Arch: same | 391 | Multi-Arch: same |
597 | @@ -395,7 +407,7 @@ | |||
598 | 395 | Depends: ${misc:Depends}, | 407 | Depends: ${misc:Depends}, |
599 | 396 | mir-platform-graphics-mesa-kms8, | 408 | mir-platform-graphics-mesa-kms8, |
600 | 397 | mir-platform-graphics-mesa-x8, | 409 | mir-platform-graphics-mesa-x8, |
602 | 398 | mir-client-platform-mesa4, | 410 | mir-client-platform-mesa5, |
603 | 399 | mir-platform-input-evdev5, | 411 | mir-platform-input-evdev5, |
604 | 400 | Description: Display server for Ubuntu - desktop driver metapackage | 412 | Description: Display server for Ubuntu - desktop driver metapackage |
605 | 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, |
606 | @@ -411,7 +423,7 @@ | |||
607 | 411 | Pre-Depends: ${misc:Pre-Depends} | 423 | Pre-Depends: ${misc:Pre-Depends} |
608 | 412 | Depends: ${misc:Depends}, | 424 | Depends: ${misc:Depends}, |
609 | 413 | mir-platform-graphics-android8, | 425 | mir-platform-graphics-android8, |
611 | 414 | mir-client-platform-android4, | 426 | mir-client-platform-android5, |
612 | 415 | mir-platform-input-evdev5, | 427 | mir-platform-input-evdev5, |
613 | 416 | Description: Display server for Ubuntu - android driver metapackage | 428 | Description: Display server for Ubuntu - android driver metapackage |
614 | 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, |
615 | 418 | 430 | ||
616 | === added file 'debian/mir-android-diagnostics.install' | |||
617 | --- debian/mir-android-diagnostics.install 1970-01-01 00:00:00 +0000 | |||
618 | +++ debian/mir-android-diagnostics.install 2016-03-30 00:11:41 +0000 | |||
619 | @@ -0,0 +1,1 @@ | |||
620 | 1 | usr/bin/mir_android_diagnostics | ||
621 | 0 | 2 | ||
622 | === renamed file 'debian/mir-client-platform-android4.install' => 'debian/mir-client-platform-android5.install' | |||
623 | --- debian/mir-client-platform-android4.install 2016-01-29 08:18:22 +0000 | |||
624 | +++ debian/mir-client-platform-android5.install 2016-03-30 00:11:41 +0000 | |||
625 | @@ -1,1 +1,1 @@ | |||
627 | 1 | usr/lib/*/mir/client-platform/android.so.4 | 1 | usr/lib/*/mir/client-platform/android.so.5 |
628 | 2 | 2 | ||
629 | === renamed file 'debian/mir-client-platform-mesa4.install' => 'debian/mir-client-platform-mesa5.install' | |||
630 | --- debian/mir-client-platform-mesa4.install 2016-01-29 08:18:22 +0000 | |||
631 | +++ debian/mir-client-platform-mesa5.install 2016-03-30 00:11:41 +0000 | |||
632 | @@ -1,1 +1,1 @@ | |||
634 | 1 | usr/lib/*/mir/client-platform/mesa.so.4 | 1 | usr/lib/*/mir/client-platform/mesa.so.5 |
635 | 2 | 2 | ||
636 | === removed file 'debian/mir-demos.examples' | |||
637 | --- debian/mir-demos.examples 2013-08-29 03:48:16 +0000 | |||
638 | +++ debian/mir-demos.examples 1970-01-01 00:00:00 +0000 | |||
639 | @@ -1,7 +0,0 @@ | |||
640 | 1 | examples/basic.c | ||
641 | 2 | examples/scroll.cpp | ||
642 | 3 | examples/flicker.c | ||
643 | 4 | examples/README | ||
644 | 5 | examples/graphics.h | ||
645 | 6 | examples/mir_image.h | ||
646 | 7 | examples/graphics_utils.cpp | ||
647 | 8 | 0 | ||
648 | === modified file 'debian/mir-test-tools.install' | |||
649 | --- debian/mir-test-tools.install 2016-01-29 08:18:22 +0000 | |||
650 | +++ debian/mir-test-tools.install 2016-03-30 00:11:41 +0000 | |||
651 | @@ -1,5 +1,6 @@ | |||
652 | 1 | usr/bin/mir_stress | 1 | usr/bin/mir_stress |
653 | 2 | usr/bin/mir_unit_tests* | 2 | usr/bin/mir_unit_tests* |
654 | 3 | usr/bin/mir_umock_unit_tests | ||
655 | 3 | usr/bin/mir_acceptance_tests | 4 | usr/bin/mir_acceptance_tests |
656 | 4 | usr/bin/mir_umock_acceptance_tests | 5 | usr/bin/mir_umock_acceptance_tests |
657 | 5 | usr/bin/mir_integration_tests* | 6 | usr/bin/mir_integration_tests* |
658 | @@ -12,4 +13,4 @@ | |||
659 | 12 | usr/lib/*/mir/server-platform/graphics-throw.so | 13 | usr/lib/*/mir/server-platform/graphics-throw.so |
660 | 13 | usr/lib/*/mir/server-platform/input-stub.so | 14 | usr/lib/*/mir/server-platform/input-stub.so |
661 | 14 | usr/lib/*/mir/client-platform/dummy.so | 15 | usr/lib/*/mir/client-platform/dummy.so |
663 | 15 | usr/share/udev_recordings | 16 | usr/share/mir-test-data |
664 | 16 | 17 | ||
665 | === modified file 'debian/mir-test-tools.lintian-overrides' | |||
666 | --- debian/mir-test-tools.lintian-overrides 2013-06-24 16:59:17 +0000 | |||
667 | +++ debian/mir-test-tools.lintian-overrides 2016-03-30 00:11:41 +0000 | |||
668 | @@ -1,2 +1,5 @@ | |||
669 | 1 | arch-dependent-file-in-usr-share | ||
670 | 2 | binary-from-other-architecture | ||
671 | 1 | package-name-doesnt-match-sonames | 3 | package-name-doesnt-match-sonames |
672 | 2 | shlib-without-versioned-soname | 4 | shlib-without-versioned-soname |
673 | 5 | unstripped-binary-or-object | ||
674 | 3 | 6 | ||
675 | === modified file 'debian/mir-utils.install' | |||
676 | --- debian/mir-utils.install 2015-06-12 07:37:21 +0000 | |||
677 | +++ debian/mir-utils.install 2016-03-30 00:11:41 +0000 | |||
678 | @@ -1,4 +1,5 @@ | |||
679 | 1 | usr/bin/mirping | 1 | usr/bin/mirping |
680 | 2 | usr/bin/mirout | 2 | usr/bin/mirout |
681 | 3 | usr/bin/mirin | ||
682 | 3 | usr/bin/mirscreencast | 4 | usr/bin/mirscreencast |
683 | 4 | usr/bin/mirbacklight | 5 | usr/bin/mirbacklight |
684 | 5 | 6 | ||
685 | === modified file 'debian/rules' | |||
686 | --- debian/rules 2016-01-29 08:18:22 +0000 | |||
687 | +++ debian/rules 2016-03-30 00:11:41 +0000 | |||
688 | @@ -20,7 +20,13 @@ | |||
689 | 20 | endif | 20 | endif |
690 | 21 | 21 | ||
691 | 22 | COMMON_CONFIGURE_OPTIONS = \ | 22 | COMMON_CONFIGURE_OPTIONS = \ |
693 | 23 | -DCMAKE_INSTALL_LIBEXECDIR="lib/$(DEB_HOST_MULTIARCH)/mir" | 23 | -DCMAKE_INSTALL_LIBEXECDIR="lib/$(DEB_HOST_MULTIARCH)/mir"\ |
694 | 24 | |||
695 | 25 | ifeq ($(filter noopt,$(DEB_BUILD_OPTIONS)),noopt) | ||
696 | 26 | COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF | ||
697 | 27 | else | ||
698 | 28 | COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=ON | ||
699 | 29 | endif | ||
700 | 24 | 30 | ||
701 | 25 | override_dh_auto_configure: | 31 | override_dh_auto_configure: |
702 | 26 | ifeq ($(DEB_HOST_ARCH),armhf) | 32 | ifeq ($(DEB_HOST_ARCH),armhf) |
703 | @@ -47,7 +53,7 @@ | |||
704 | 47 | 53 | ||
705 | 48 | # TODO: we'll use a symbol file once mir is abi stable | 54 | # TODO: we'll use a symbol file once mir is abi stable |
706 | 49 | override_dh_makeshlibs: | 55 | override_dh_makeshlibs: |
708 | 50 | dh_makeshlibs -V | 56 | dh_makeshlibs -V -Nmir-test-tools |
709 | 51 | 57 | ||
710 | 52 | override_dh_install: | 58 | override_dh_install: |
711 | 53 | # Nothing outside Mir should link to libmirprotobuf directly. | 59 | # Nothing outside Mir should link to libmirprotobuf directly. |
712 | @@ -56,3 +62,11 @@ | |||
713 | 56 | -rm debian/tmp/usr/lib/*/libmirprotobuf.so | 62 | -rm debian/tmp/usr/lib/*/libmirprotobuf.so |
714 | 57 | dh_install -p libmirplatform-dev -Xmesa --fail-missing | 63 | dh_install -p libmirplatform-dev -Xmesa --fail-missing |
715 | 58 | dh_install --remaining-packages --fail-missing -Xjquery.js | 64 | dh_install --remaining-packages --fail-missing -Xjquery.js |
716 | 65 | |||
717 | 66 | # Don't try to strip libraries used as test data | ||
718 | 67 | override_dh_strip: | ||
719 | 68 | dh_strip -Xmir-test-data | ||
720 | 69 | |||
721 | 70 | # Don't try to find dependencies of libraries used as test data | ||
722 | 71 | override_dh_shlibdeps: | ||
723 | 72 | dh_shlibdeps -Xmir-test-data | ||
724 | 59 | 73 | ||
725 | === removed file 'deploy-and-test.sh' | |||
726 | --- deploy-and-test.sh 2015-04-28 07:54:10 +0000 | |||
727 | +++ deploy-and-test.sh 1970-01-01 00:00:00 +0000 | |||
728 | @@ -1,26 +0,0 @@ | |||
729 | 1 | #!/bin/sh | ||
730 | 2 | # WARNING: This script is slow. See: doc/avoid_deploy-and-test.md | ||
731 | 3 | |||
732 | 4 | if [ ! -d build-android-arm ] ; then | ||
733 | 5 | echo "Built tree not found in $(pwd)/build-android-arm" | ||
734 | 6 | exit 1 | ||
735 | 7 | fi | ||
736 | 8 | |||
737 | 9 | # Unpack umockdev requirements | ||
738 | 10 | ( cd build-android-arm ; | ||
739 | 11 | apt-get download umockdev:armhf libumockdev0:armhf ; | ||
740 | 12 | dpkg -x umockdev_*armhf*.deb . ; | ||
741 | 13 | dpkg -x libumockdev0_*armhf*.deb . | ||
742 | 14 | ) | ||
743 | 15 | |||
744 | 16 | rundir=/home/phablet/mir/testing | ||
745 | 17 | adb push build-android-arm/bin $rundir/bin | ||
746 | 18 | adb push build-android-arm/lib $rundir/lib | ||
747 | 19 | adb push build-android-arm/usr $rundir/usr | ||
748 | 20 | |||
749 | 21 | libpath=$rundir/usr/lib/arm-linux-gnueabihf/:$rundir/lib | ||
750 | 22 | run_with_env="LD_LIBRARY_PATH=$libpath $rundir/usr/bin/umockdev-run $rundir/bin/" | ||
751 | 23 | |||
752 | 24 | adb shell "${run_with_env}mir_unit_tests" | ||
753 | 25 | adb shell "${run_with_env}mir_integration_tests" | ||
754 | 26 | adb shell "${run_with_env}mir_acceptance_tests" | ||
755 | 27 | 0 | ||
756 | === modified file 'doc/abi_compatibility_tools.md' | |||
757 | --- doc/abi_compatibility_tools.md 2014-10-02 13:04:47 +0000 | |||
758 | +++ doc/abi_compatibility_tools.md 2016-03-30 00:11:41 +0000 | |||
759 | @@ -1,82 +1,26 @@ | |||
761 | 1 | Tools to track ABI compatibility {#abi_compatibility_tools} | 1 | Tracking ABI compatibility {#abi_compatibility_tools} |
762 | 2 | ================================ | 2 | ================================ |
763 | 3 | 3 | ||
767 | 4 | We have created a few build targets to help us track ABI compatibility across | 4 | A few make targets exist to help us track ABI compatibility across |
768 | 5 | different Mir versions and ensure we increase the ABI version properly. These | 5 | different Mir versions and ensure we increase the ABI version properly. |
769 | 6 | target use the abi-compliance-checker tool to create and check the ABI dumps. | 6 | These targets invoke the abi-compliance-checker tool for the actual ABI check. |
770 | 7 | 7 | ||
771 | 8 | The targets are: | 8 | The targets are: |
772 | 9 | 9 | ||
811 | 10 | * **make abi-dump** (or abi-dump-<library> for a specific library, e.g., abi-dump-mirclient) | 10 | * **make abi-check** |
812 | 11 | 11 | ||
813 | 12 | Produces ABI dumps for the public versioned libraries shipped by Mir. The | 12 | Compiles all the public libraries in the current tree and checks their ABI against the latest released archive version |
814 | 13 | resulting ABI dump for each library is saved as | 13 | |
815 | 14 | <build-dir>/abi_dumps/<arch>/<libname>_next.abi.tar.gz. | 14 | * **make abi-check-<library>** |
816 | 15 | 15 | ||
817 | 16 | By default, this target also builds the libraries needed for create the | 16 | Compiles only the specified library in the current tree and checks its ABI against the latest released archive version |
818 | 17 | requested ABI dumps. The environment variable `MIR_ABI_DUMP_PREBUILT_LIBDIR` | 17 | |
819 | 18 | can be set **at configuration time** (i.e., when invoking cmake) to a path | 18 | - *library* can be any of the public library targets such as mirclient, mirserver, mirplatform, mircommon, etc. |
782 | 19 | containing pre-built libraries to use instead. | ||
783 | 20 | |||
784 | 21 | _N.B: the path set with MIR_ABI_DUMP_PREBUILT_LIBDIR is expected to contain | ||
785 | 22 | *.so files, not only *.so.X files._ | ||
786 | 23 | |||
787 | 24 | * **make abi-dump-base** (or abi-dump-base-<library> for a specific library, | ||
788 | 25 | e.g., abi-dump-base-mirclient) | ||
789 | 26 | |||
790 | 27 | Similar to make abi-dump, but saves the ABI dump as | ||
791 | 28 | <build-dir>/abi_dumps/<arch>/<libname>_base.abi.tar.gz (note the 'base' vs | ||
792 | 29 | 'next' in the file name). | ||
793 | 30 | |||
794 | 31 | * **make abi-check** (or abi-check-<library>, for a specific library) | ||
795 | 32 | e.g., abi-check-mirclient) | ||
796 | 33 | |||
797 | 34 | Produces ABI dumps (this target depends on the abi-dump target), and checks | ||
798 | 35 | them against a set of base ABI dumps. The base ABI dumps are assumed to be | ||
799 | 36 | located in <build-dir>/abi_dumps/<arch>/, i.e., where make abi-dump-base | ||
800 | 37 | would normally place the files. | ||
801 | 38 | |||
802 | 39 | The environment variable `MIR_ABI_CHECK_BASE_DIR` can be set **at | ||
803 | 40 | configuration time** (i.e., when invoking cmake) to set a different directory | ||
804 | 41 | for the base ABI dumps. The supplied directory must **not** contain the | ||
805 | 42 | <arch> portion of the path (e.g., just build_dir/abi_dumps, not | ||
806 | 43 | build_dir/abi_dumps/x86_64-linux-gnu). | ||
807 | 44 | |||
808 | 45 | Since this target depends on the abi-dump target, the | ||
809 | 46 | `MIR_ABI_DUMP_PREBUILT_LIBDIR` environment variable can be set to use | ||
810 | 47 | pre-built libraries instead of building them. | ||
820 | 48 | 19 | ||
821 | 49 | Sample usage | 20 | Sample usage |
822 | 50 | ------------ | 21 | ------------ |
823 | 51 | 22 | ||
836 | 52 | A common scenario is to check the ABI of the development version against the | 23 | $ bzr branch lp:mir && cd mir |
825 | 53 | latest archive version. This is one way to perform the check: | ||
826 | 54 | |||
827 | 55 | ### Step 1: Produce the ABI dumps for the installed version | ||
828 | 56 | |||
829 | 57 | Start by download the source corresponding to the installed version: | ||
830 | 58 | |||
831 | 59 | $ apt-get source mir | ||
832 | 60 | $ cd mir-<version> | ||
833 | 61 | |||
834 | 62 | At this point we can select whether to build the libraries from scratch: | ||
835 | 63 | |||
837 | 64 | $ debian/rules override_dh_auto_configure | 24 | $ debian/rules override_dh_auto_configure |
838 | 65 | |||
839 | 66 | ... or to reuse the pre-built libraries, assuming they are installed (we | ||
840 | 67 | need their -dev packages too!): | ||
841 | 68 | |||
842 | 69 | $ MIR_ABI_DUMP_PREBUILT_LIBDIR=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) debian/rules override_dh_auto_configure | ||
843 | 70 | |||
844 | 71 | Now we can create the ABI dumps: | ||
845 | 72 | |||
846 | 73 | $ cd <build-dir> && make abi-dump-base | ||
847 | 74 | |||
848 | 75 | This will create base ABI dump files which we can use in the next step. | ||
849 | 76 | |||
850 | 77 | ### Step 2: Check the ABI of the development version against the produced base ABI dumps | ||
851 | 78 | |||
852 | 79 | $ bzr branch lp:mir && cd mir | ||
853 | 80 | $ MIR_ABI_CHECK_BASE_DIR=/path/to/base/abi/dumps debian/rules override_dh_auto_configure | ||
854 | 81 | $ cd <build-dir> | 25 | $ cd <build-dir> |
855 | 82 | $ make abi-check | 26 | $ make abi-check |
856 | 83 | 27 | ||
857 | === modified file 'doc/android_new_device_bringup.md' | |||
858 | --- doc/android_new_device_bringup.md 2015-07-16 07:03:19 +0000 | |||
859 | +++ doc/android_new_device_bringup.md 2016-03-30 00:11:41 +0000 | |||
860 | @@ -7,42 +7,50 @@ | |||
861 | 7 | team diagnose and fix the issues that are seen. | 7 | team diagnose and fix the issues that are seen. |
862 | 8 | 8 | ||
863 | 9 | ##Mir Tests## | 9 | ##Mir Tests## |
868 | 10 | The android platform of Mir has a variety of tests and tools that help the Mir | 10 | Mir has a test suite available in the package mir-test-tools that checks the |
869 | 11 | team troubleshoot new devices. There are thousands of tests, but certain tests | 11 | operation of Mir. |
870 | 12 | exercise the driver and have proven useful in diagnosing driver problems. These | 12 | Mir also provides a test suite in mir-android-diagnostics that is helpful in |
871 | 13 | tests are available in the 'mir-test-tools' debian package. | 13 | checking how a new device will work with Mir. |
872 | 14 | |||
873 | 15 | ##Mir and libhybris## | ||
874 | 16 | Vendor provided drivers are compiled against Android's bionic libc. | ||
875 | 17 | Mir runs against glibc. To make the two libc's work together, Mir uses | ||
876 | 18 | libhybris. | ||
877 | 19 | |||
878 | 20 | libhybris has some internal tests (e.g., test_egl), but these are insufficient | ||
879 | 21 | tests to see if mir will run on the device. The tests are aimed checking | ||
880 | 22 | the operation of hybris on non-Mir graphics stacks. Furthermore, they test a | ||
881 | 23 | more limited range of hardware module capabilities (e.g. they don't test HWC | ||
882 | 24 | overlay capability) | ||
883 | 14 | 25 | ||
884 | 15 | ###Mir Client Software Rendering### | 26 | ###Mir Client Software Rendering### |
885 | 16 | 27 | ||
887 | 17 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.client_can_draw_with_cpu" | 28 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.client_can_draw_with_cpu" |
888 | 18 | 29 | ||
892 | 19 | This test checks that a buffer can travel from the server to the client accross | 30 | This test checks that the CPU can render pixels using software |
893 | 20 | the interprocess communication channel. It then renders some pixels using | 31 | and checks that the pixels can be read back. |
891 | 21 | software and the server will check that the pixels are present in the buffer. | ||
894 | 22 | 32 | ||
895 | 23 | ###Mir Client OpenGLES 2.0 Rendering (Android EGLNativeWindowType test)### | 33 | ###Mir Client OpenGLES 2.0 Rendering (Android EGLNativeWindowType test)### |
896 | 24 | 34 | ||
898 | 25 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.client_can_draw_with_gpu" | 35 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.client_can_draw_with_gpu" |
899 | 26 | 36 | ||
904 | 27 | This test checks that a buffer can travel from the server to the client accross | 37 | This test checks that the GL api can be used to glClear() a buffer, and checks |
905 | 28 | the interprocess communication channel. It then renders some pixels using | 38 | that the content is correct after render. |
902 | 29 | OpenGLES 2.0 and the server will check that the pixels are present in the | ||
903 | 30 | buffer. | ||
906 | 31 | 39 | ||
907 | 32 | ###Mir Display posting (HWC tests)### | 40 | ###Mir Display posting (HWC tests)### |
908 | 33 | 41 | ||
911 | 34 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.display_can_post" | 42 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.display_can_post" |
912 | 35 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.display_can_post_overlay" | 43 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.display_can_post_overlay" |
913 | 36 | 44 | ||
914 | 37 | This test checks that the display can post content to the screen. It should | 45 | This test checks that the display can post content to the screen. It should |
915 | 38 | flash the screen briefly and run without error. Since it is important that | 46 | flash the screen briefly and run without error. Since it is important that |
916 | 39 | screen looks flawless, a visual inspection should also be perfomed using | 47 | screen looks flawless, a visual inspection should also be perfomed using |
918 | 40 | mir_demo_standalone_render_to_fb | 48 | mir_demo_standalone_render_to_fb and mir_demo_standalone_render_overlays |
919 | 41 | 49 | ||
920 | 42 | ###Mir GPU buffer allocations (gralloc tests)### | 50 | ###Mir GPU buffer allocations (gralloc tests)### |
921 | 43 | 51 | ||
924 | 44 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.can_allocate_sw_buffer" | 52 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.can_allocate_sw_buffer" |
925 | 45 | mir_integration_tests --gtest-filter="AndroidHardwareSanity.can_allocate_hw_buffer" | 53 | mir_android_diagnostics --gtest_filter="AndroidMirDiagnostics.can_allocate_hw_buffer" |
926 | 46 | 54 | ||
927 | 47 | This will test that Mir can access the gralloc module and allocate GPU buffers. | 55 | This will test that Mir can access the gralloc module and allocate GPU buffers. |
928 | 48 | 56 | ||
929 | @@ -85,7 +93,7 @@ | |||
930 | 85 | and display to the screen. | 93 | and display to the screen. |
931 | 86 | In one terminal, run | 94 | In one terminal, run |
932 | 87 | 95 | ||
934 | 88 | mir_proving_server | 96 | mir_demo_server |
935 | 89 | 97 | ||
936 | 90 | and in another terminal, run | 98 | and in another terminal, run |
937 | 91 | 99 | ||
938 | @@ -138,6 +146,12 @@ | |||
939 | 138 | MIR_SERVER_HWC_REPORT=log to the environment of the running server will give | 146 | MIR_SERVER_HWC_REPORT=log to the environment of the running server will give |
940 | 139 | the hwc report on stdout. | 147 | the hwc report on stdout. |
941 | 140 | 148 | ||
942 | 149 | ###Android platform quirks### | ||
943 | 150 | If a driver has a bug that can be fixed, its best to fix the bug in the driver. | ||
944 | 151 | However, if workarounds are needed due to source unavailability, they can be | ||
945 | 152 | experimented with via quicks that can be activated via the command line. | ||
946 | 153 | The list of quirks is printed with the --help flag on a mir_demo_server. | ||
947 | 154 | |||
948 | 141 | ###Note on HWC versions### | 155 | ###Note on HWC versions### |
949 | 142 | The "--hwc-report log" will log the HWC version at the beginning of the report, | 156 | The "--hwc-report log" will log the HWC version at the beginning of the report, |
950 | 143 | e.g. | 157 | e.g. |
951 | @@ -149,8 +163,8 @@ | |||
952 | 149 | HWC version unknown (<version>) | 163 | HWC version unknown (<version>) |
953 | 150 | 164 | ||
954 | 151 | This means that Mir does not support the version of hwc on the device. | 165 | This means that Mir does not support the version of hwc on the device. |
957 | 152 | As of Dec 2014, Mir supports the legacy FB module, as well as HWC versions | 166 | As of Feb 2016, Mir supports the legacy FB module, as well as HWC versions |
958 | 153 | 1.0, 1.1, 1.2, and 1.3. | 167 | 1.0, 1.1, 1.2, 1.3, and 1.4. |
959 | 154 | 168 | ||
960 | 155 | If you run | 169 | If you run |
961 | 156 | 170 | ||
962 | 157 | 171 | ||
963 | === removed file 'doc/avoid_deploy-and-test.md' | |||
964 | --- doc/avoid_deploy-and-test.md 2015-01-22 05:40:40 +0000 | |||
965 | +++ doc/avoid_deploy-and-test.md 1970-01-01 00:00:00 +0000 | |||
966 | @@ -1,29 +0,0 @@ | |||
967 | 1 | How to avoid deploy-and-test.sh | ||
968 | 2 | =============================== | ||
969 | 3 | |||
970 | 4 | If you're running tests regularly from different branches on a remote | ||
971 | 5 | Ubuntu touch device, you should avoid deploy-and-test.sh because it's very | ||
972 | 6 | slow to complete. Particularly if you're making code changes and need to | ||
973 | 7 | repeat the script each time. Instead, you can set up your device for rapid | ||
974 | 8 | iteration like so: | ||
975 | 9 | |||
976 | 10 | One-time setup | ||
977 | 11 | -------------- | ||
978 | 12 | adb push ~/.ssh/id_rsa.pub /home/phablet/.ssh/authorized_keys | ||
979 | 13 | adb shell | ||
980 | 14 | chown phablet ~/.ssh | ||
981 | 15 | chmod -R go-w ~/.ssh | ||
982 | 16 | mkdir ~/testrundir | ||
983 | 17 | sudo start ssh | ||
984 | 18 | sudo mount -o remount,rw / | ||
985 | 19 | sudo apt-get install umockdev | ||
986 | 20 | |||
987 | 21 | Now for each branch you want to deploy and test | ||
988 | 22 | ----------------------------------------------- | ||
989 | 23 | device=<ip-or-hostname-of-your-device> | ||
990 | 24 | cd build-android-arm | ||
991 | 25 | rsync -avH lib bin phablet@$device:testrundir/ | ||
992 | 26 | adb shell (or ssh phablet@$device) | ||
993 | 27 | cd testrundir | ||
994 | 28 | umockdev-run bin/mir_unit-tests | ||
995 | 29 | ... | ||
996 | 30 | 0 | ||
997 | === removed file 'doc/snappy_appliances.md' | |||
998 | --- doc/snappy_appliances.md 2015-03-20 08:43:03 +0000 | |||
999 | +++ doc/snappy_appliances.md 1970-01-01 00:00:00 +0000 | |||
1000 | @@ -1,76 +0,0 @@ | |||
1001 | 1 | Mir As An Appliance | ||
1002 | 2 | =================== | ||
1003 | 3 | |||
1004 | 4 | How to build a Mir-based appliance/kiosk using Ubuntu Core and Snappy | ||
1005 | 5 | packaging. | ||
1006 | 6 | |||
1007 | 7 | Selection of hardware | ||
1008 | 8 | --------------------- | ||
1009 | 9 | |||
1010 | 10 | Mir as an appliance presently supports Mesa/DRM drivers. So almost any | ||
1011 | 11 | hardware that supports Mir on Ubuntu desktop will suffice. Virtual machines | ||
1012 | 12 | are generally NOT supported by Mir yet. So cannot be used here. | ||
1013 | 13 | |||
1014 | 14 | Your chosen machine must be plugged into ethernet by cable (wifi not | ||
1015 | 15 | supported), and that cable must be able to reach a DHCP server | ||
1016 | 16 | (e.g. a typical home router). For more details see: | ||
1017 | 17 | <https://bugs.launchpad.net/snappy-ubuntu/+bugs?field.tag=wontboot> | ||
1018 | 18 | |||
1019 | 19 | Getting the operating system | ||
1020 | 20 | ---------------------------- | ||
1021 | 21 | |||
1022 | 22 | Ubuntu Core is a new product still and effectively pre-release. So you cannot | ||
1023 | 23 | download usable disk images yet. You need to make your own. | ||
1024 | 24 | |||
1025 | 25 | 1. Use an Ubuntu desktop running 15.04 or later. | ||
1026 | 26 | 2. Install package: `ubuntu-device-flash` | ||
1027 | 27 | 3. Make a disk image: | ||
1028 | 28 | |||
1029 | 29 | $ sudo ubuntu-device-flash core --enable-ssh -o mysnappy.img | ||
1030 | 30 | |||
1031 | 31 | You now have a 20GB (by default) disk image to dump on your machine's drive. | ||
1032 | 32 | This part and variations on it are left as an exercise for the reader. | ||
1033 | 33 | |||
1034 | 34 | Booting the operating system | ||
1035 | 35 | ---------------------------- | ||
1036 | 36 | |||
1037 | 37 | This can be troublesome. For known issues refer to: | ||
1038 | 38 | <https://bugs.launchpad.net/snappy-ubuntu/+bugs?field.tag=wontboot> | ||
1039 | 39 | |||
1040 | 40 | Once booted you log in as user `ubuntu` with password `ubuntu`. | ||
1041 | 41 | |||
1042 | 42 | Learn the basics of snappy | ||
1043 | 43 | -------------------------- | ||
1044 | 44 | |||
1045 | 45 | If you haven't already, learn here: <https://developer.ubuntu.com/en/snappy/> | ||
1046 | 46 | |||
1047 | 47 | Building snap packages of Mir | ||
1048 | 48 | ----------------------------- | ||
1049 | 49 | |||
1050 | 50 | 1. Build Mir per normal. But if you want the quickest result then try: | ||
1051 | 51 | |||
1052 | 52 | $ mkdir build | ||
1053 | 53 | $ cd build | ||
1054 | 54 | $ cmake .. -DMIR_ENABLE_TESTS=OFF -DMIR_PLATFORM=mesa | ||
1055 | 55 | $ make -j8 | ||
1056 | 56 | |||
1057 | 57 | 2. Build the .snap files: | ||
1058 | 58 | |||
1059 | 59 | $ make snap | ||
1060 | 60 | |||
1061 | 61 | 3. Copy the .snap files from the location displayed at the end of step 2. | ||
1062 | 62 | |||
1063 | 63 | Running the mir/mir-demos snap packages | ||
1064 | 64 | --------------------------------------- | ||
1065 | 65 | |||
1066 | 66 | Once installed you will have two new snappy `/apps`: mir and mir-demos | ||
1067 | 67 | |||
1068 | 68 | Presently only server and standalone binaries work. To run them with the | ||
1069 | 69 | full environment, libraries and drivers they require, use: | ||
1070 | 70 | |||
1071 | 71 | sudo /apps/bin/mir-run /apps/mir-demos/current/mir_proving_server | ||
1072 | 72 | sudo /apps/bin/mir-run /apps/mir-demos/current/mir_demo_standalone_render_surfaces | ||
1073 | 73 | etc | ||
1074 | 74 | |||
1075 | 75 | Automatic setting of privileges to avoid "sudo" is not yet implemented. | ||
1076 | 76 | |||
1077 | 77 | 0 | ||
1078 | === modified file 'examples/CMakeLists.txt' | |||
1079 | --- examples/CMakeLists.txt 2016-01-29 08:18:22 +0000 | |||
1080 | +++ examples/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
1081 | @@ -41,8 +41,6 @@ | |||
1082 | 41 | xcursor.h | 41 | xcursor.h |
1083 | 42 | ) | 42 | ) |
1084 | 43 | 43 | ||
1085 | 44 | SET_SOURCE_FILES_PROPERTIES(xcursor.c PROPERTIES COMPILE_FLAGS -D_GNU_SOURCE) | ||
1086 | 45 | |||
1087 | 46 | target_link_libraries(eglapp | 44 | target_link_libraries(eglapp |
1088 | 47 | mirclient | 45 | mirclient |
1089 | 48 | ${EGL_LIBRARIES} | 46 | ${EGL_LIBRARIES} |
1090 | @@ -73,6 +71,12 @@ | |||
1091 | 73 | target_link_libraries(mir_demo_client_target | 71 | target_link_libraries(mir_demo_client_target |
1092 | 74 | eglapp | 72 | eglapp |
1093 | 75 | ) | 73 | ) |
1094 | 74 | mir_add_wrapped_executable(mir_demo_client_camera | ||
1095 | 75 | camera.c | ||
1096 | 76 | ) | ||
1097 | 77 | target_link_libraries(mir_demo_client_camera | ||
1098 | 78 | eglapp | ||
1099 | 79 | ) | ||
1100 | 76 | mir_add_wrapped_executable(mir_demo_client_eglcounter | 80 | mir_add_wrapped_executable(mir_demo_client_eglcounter |
1101 | 77 | eglcounter.cpp | 81 | eglcounter.cpp |
1102 | 78 | ) | 82 | ) |
1103 | @@ -225,15 +229,6 @@ | |||
1104 | 225 | mir_add_wrapped_executable(mir_demo_server_minimal server_minimal.cpp) | 229 | mir_add_wrapped_executable(mir_demo_server_minimal server_minimal.cpp) |
1105 | 226 | target_link_libraries(mir_demo_server_minimal mirserver) | 230 | target_link_libraries(mir_demo_server_minimal mirserver) |
1106 | 227 | 231 | ||
1107 | 228 | mir_add_wrapped_executable(mir_demo_standalone_render_overlays | ||
1108 | 229 | render_overlays.cpp | ||
1109 | 230 | ) | ||
1110 | 231 | |||
1111 | 232 | target_link_libraries(mir_demo_standalone_render_overlays | ||
1112 | 233 | mirserver | ||
1113 | 234 | mircommon | ||
1114 | 235 | ) | ||
1115 | 236 | |||
1116 | 237 | if (MIR_ENABLE_TESTS) | 232 | if (MIR_ENABLE_TESTS) |
1117 | 238 | add_executable(mir_symbol_test | 233 | add_executable(mir_symbol_test |
1118 | 239 | uses_non_client_symbol.cpp | 234 | uses_non_client_symbol.cpp |
1119 | @@ -255,7 +250,7 @@ | |||
1120 | 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)" |
1121 | 256 | ) | 251 | ) |
1122 | 257 | 252 | ||
1124 | 258 | # We use a slightly weaker version of the test with clang as that generates spurious NEEDED | 253 | # We can't use this test with clang as that generates spurious NEEDED |
1125 | 259 | if (NOT "${CMAKE_CXX_COMPILER}" MATCHES "clang") | 254 | if (NOT "${CMAKE_CXX_COMPILER}" MATCHES "clang") |
1126 | 260 | # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI | 255 | # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI |
1127 | 261 | mir_add_test(NAME Clients-only-use-client-ABI | 256 | mir_add_test(NAME Clients-only-use-client-ABI |
1128 | @@ -267,17 +262,6 @@ | |||
1129 | 267 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | 262 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin |
1130 | 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)" |
1131 | 269 | ) | 264 | ) |
1132 | 270 | else() | ||
1133 | 271 | # To see reasons for failure: ctest -V -R Clients-only-use-client-ABI | ||
1134 | 272 | mir_add_test(NAME Clients-only-use-client-ABI | ||
1135 | 273 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | ||
1136 | 274 | COMMAND /bin/sh -c "!(nm -u mir_demo_client* | grep -v @@MIR_CLIENT | grep @@MIR_)" | ||
1137 | 275 | ) | ||
1138 | 276 | # Again, test the testcase... | ||
1139 | 277 | mir_add_test(NAME Client-using-ABI-from-mircommon-fails-check | ||
1140 | 278 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | ||
1141 | 279 | COMMAND /bin/sh -c "(nm -u mir_symbol_test | grep -v @@MIR_CLIENT | grep @@MIR_)" | ||
1142 | 280 | ) | ||
1143 | 281 | endif () | 265 | endif () |
1144 | 282 | endif () | 266 | endif () |
1145 | 283 | 267 | ||
1146 | 284 | 268 | ||
1147 | === modified file 'examples/animated_cursor_demo_client.c' | |||
1148 | --- examples/animated_cursor_demo_client.c 2016-01-29 08:18:22 +0000 | |||
1149 | +++ examples/animated_cursor_demo_client.c 2016-03-30 00:11:41 +0000 | |||
1150 | @@ -16,12 +16,11 @@ | |||
1151 | 16 | * Author: Robert Carr <robert.carr@canonical.com> | 16 | * Author: Robert Carr <robert.carr@canonical.com> |
1152 | 17 | */ | 17 | */ |
1153 | 18 | 18 | ||
1154 | 19 | #define _GNU_SOURCE // for nanosleep | ||
1155 | 20 | |||
1156 | 21 | #include "eglapp.h" | 19 | #include "eglapp.h" |
1157 | 22 | 20 | ||
1158 | 23 | #include "mir_toolkit/mir_client_library.h" | 21 | #include "mir_toolkit/mir_client_library.h" |
1159 | 24 | 22 | ||
1160 | 23 | #include <math.h> | ||
1161 | 25 | #include <stdio.h> | 24 | #include <stdio.h> |
1162 | 26 | #include <stdlib.h> | 25 | #include <stdlib.h> |
1163 | 27 | #include <string.h> | 26 | #include <string.h> |
1164 | @@ -33,19 +32,38 @@ | |||
1165 | 33 | 32 | ||
1166 | 34 | void animate_cursor(MirBufferStream *stream) | 33 | void animate_cursor(MirBufferStream *stream) |
1167 | 35 | { | 34 | { |
1171 | 36 | static double alpha = 0.0; | 35 | // mir_pixel_format_argb_8888 as set below |
1172 | 37 | char fill_color = 0xff * alpha; | 36 | int const bpp = 4; |
1173 | 38 | 37 | uint32_t const background = 0x00000000; | |
1174 | 38 | uint32_t const foreground = 0xffffffff; | ||
1175 | 39 | |||
1176 | 39 | MirGraphicsRegion region; | 40 | MirGraphicsRegion region; |
1177 | 40 | mir_buffer_stream_get_graphics_region(stream, ®ion); | 41 | mir_buffer_stream_get_graphics_region(stream, ®ion); |
1178 | 41 | 42 | ||
1180 | 42 | memset(region.vaddr, fill_color, region.stride*region.height); | 43 | for (int y = 0; y < region.height; ++y) |
1181 | 44 | { | ||
1182 | 45 | for (int x = 0; x < region.width; ++x) | ||
1183 | 46 | { | ||
1184 | 47 | uint32_t* pixel = (uint32_t*) | ||
1185 | 48 | (region.vaddr + y * region.stride + x * bpp); | ||
1186 | 49 | *pixel = background; | ||
1187 | 50 | } | ||
1188 | 51 | } | ||
1189 | 52 | |||
1190 | 53 | static float theta = 0.0f; | ||
1191 | 54 | theta += 0.000234567f; | ||
1192 | 55 | |||
1193 | 56 | char* origin = region.vaddr + (region.height/2)*region.stride; | ||
1194 | 57 | |||
1195 | 58 | for (int x = 0; x < region.width; ++x) | ||
1196 | 59 | { | ||
1197 | 60 | int const magnitude = region.height / 3; | ||
1198 | 61 | int y = magnitude * sinf(theta + x * 2 * M_PI / region.width); | ||
1199 | 62 | uint32_t* pixel = (uint32_t*)(origin + x*bpp + y*region.stride); | ||
1200 | 63 | *pixel = foreground; | ||
1201 | 64 | } | ||
1202 | 43 | 65 | ||
1203 | 44 | mir_buffer_stream_swap_buffers_sync(stream); | 66 | mir_buffer_stream_swap_buffers_sync(stream); |
1204 | 45 | alpha += 0.01; | ||
1205 | 46 | if (alpha >= 1.0) | ||
1206 | 47 | alpha = 0.0; | ||
1207 | 48 | |||
1208 | 49 | } | 67 | } |
1209 | 50 | 68 | ||
1210 | 51 | MirBufferStream* make_cursor_stream(MirConnection *connection, MirSurface *surface) | 69 | MirBufferStream* make_cursor_stream(MirConnection *connection, MirSurface *surface) |
1211 | @@ -76,13 +94,8 @@ | |||
1212 | 76 | MirBufferStream* stream = make_cursor_stream(mir_eglapp_native_connection(), | 94 | MirBufferStream* stream = make_cursor_stream(mir_eglapp_native_connection(), |
1213 | 77 | mir_eglapp_native_surface()); | 95 | mir_eglapp_native_surface()); |
1214 | 78 | 96 | ||
1215 | 79 | struct timespec onehundred_millis = { | ||
1216 | 80 | 0, 100*1000000 | ||
1217 | 81 | }; | ||
1218 | 82 | |||
1219 | 83 | while (mir_eglapp_running()) | 97 | while (mir_eglapp_running()) |
1220 | 84 | { | 98 | { |
1221 | 85 | nanosleep(&onehundred_millis, &onehundred_millis); | ||
1222 | 86 | animate_cursor(stream); | 99 | animate_cursor(stream); |
1223 | 87 | } | 100 | } |
1224 | 88 | 101 | ||
1225 | 89 | 102 | ||
1226 | === added file 'examples/camera.c' | |||
1227 | --- examples/camera.c 1970-01-01 00:00:00 +0000 | |||
1228 | +++ examples/camera.c 2016-03-30 00:11:41 +0000 | |||
1229 | @@ -0,0 +1,541 @@ | |||
1230 | 1 | /* | ||
1231 | 2 | * Copyright © 2015-2016 Canonical Ltd. | ||
1232 | 3 | * | ||
1233 | 4 | * This program is free software: you can redistribute it and/or modify | ||
1234 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
1235 | 6 | * published by the Free Software Foundation. | ||
1236 | 7 | * | ||
1237 | 8 | * This program is distributed in the hope that it will be useful, | ||
1238 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1239 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1240 | 11 | * GNU General Public License for more details. | ||
1241 | 12 | * | ||
1242 | 13 | * You should have received a copy of the GNU General Public License | ||
1243 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1244 | 15 | * | ||
1245 | 16 | * Author: Daniel van Vugt <daniel.van.vugt@canonical.com> | ||
1246 | 17 | */ | ||
1247 | 18 | |||
1248 | 19 | #include "eglapp.h" | ||
1249 | 20 | #include <assert.h> | ||
1250 | 21 | #include <stdio.h> | ||
1251 | 22 | #include <math.h> | ||
1252 | 23 | #include <fcntl.h> | ||
1253 | 24 | #include <GLES2/gl2.h> | ||
1254 | 25 | #include <mir_toolkit/mir_surface.h> | ||
1255 | 26 | #include <pthread.h> | ||
1256 | 27 | #include <stdlib.h> | ||
1257 | 28 | #include <signal.h> | ||
1258 | 29 | #include <sys/ioctl.h> | ||
1259 | 30 | #include <sys/mman.h> | ||
1260 | 31 | #include <linux/videodev2.h> | ||
1261 | 32 | #include <unistd.h> | ||
1262 | 33 | #include <string.h> | ||
1263 | 34 | #include <errno.h> | ||
1264 | 35 | #include <poll.h> | ||
1265 | 36 | |||
1266 | 37 | typedef struct | ||
1267 | 38 | { | ||
1268 | 39 | pthread_mutex_t mutex; | ||
1269 | 40 | bool resized; | ||
1270 | 41 | } State; | ||
1271 | 42 | |||
1272 | 43 | enum CameraPref | ||
1273 | 44 | { | ||
1274 | 45 | camera_pref_defaults, | ||
1275 | 46 | camera_pref_speed, | ||
1276 | 47 | camera_pref_resolution | ||
1277 | 48 | }; | ||
1278 | 49 | |||
1279 | 50 | typedef struct | ||
1280 | 51 | { | ||
1281 | 52 | void *start; | ||
1282 | 53 | size_t length; | ||
1283 | 54 | } Buffer; | ||
1284 | 55 | |||
1285 | 56 | typedef struct | ||
1286 | 57 | { | ||
1287 | 58 | int fd; | ||
1288 | 59 | struct v4l2_pix_format pix; | ||
1289 | 60 | unsigned buffers; | ||
1290 | 61 | Buffer buffer[]; | ||
1291 | 62 | } Camera; | ||
1292 | 63 | |||
1293 | 64 | static GLuint load_shader(const char *src, GLenum type) | ||
1294 | 65 | { | ||
1295 | 66 | GLuint shader = glCreateShader(type); | ||
1296 | 67 | if (shader) | ||
1297 | 68 | { | ||
1298 | 69 | GLint compiled; | ||
1299 | 70 | glShaderSource(shader, 1, &src, NULL); | ||
1300 | 71 | glCompileShader(shader); | ||
1301 | 72 | glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); | ||
1302 | 73 | if (!compiled) | ||
1303 | 74 | { | ||
1304 | 75 | GLchar log[1024]; | ||
1305 | 76 | glGetShaderInfoLog(shader, sizeof log - 1, NULL, log); | ||
1306 | 77 | log[sizeof log - 1] = '\0'; | ||
1307 | 78 | printf("load_shader compile failed: %s\n", log); | ||
1308 | 79 | glDeleteShader(shader); | ||
1309 | 80 | shader = 0; | ||
1310 | 81 | } | ||
1311 | 82 | } | ||
1312 | 83 | return shader; | ||
1313 | 84 | } | ||
1314 | 85 | |||
1315 | 86 | static void on_event(MirSurface *surface, const MirEvent *event, void *context) | ||
1316 | 87 | { | ||
1317 | 88 | (void)surface; | ||
1318 | 89 | State *state = (State*)context; | ||
1319 | 90 | |||
1320 | 91 | // FIXME: We presently need to know that events come in on a different | ||
1321 | 92 | // thread to main (LP: #1194384). When that's resolved, simple | ||
1322 | 93 | // single-threaded apps like this won't need pthread. | ||
1323 | 94 | pthread_mutex_lock(&state->mutex); | ||
1324 | 95 | |||
1325 | 96 | switch (mir_event_get_type(event)) | ||
1326 | 97 | { | ||
1327 | 98 | case mir_event_type_input: | ||
1328 | 99 | break; | ||
1329 | 100 | case mir_event_type_resize: | ||
1330 | 101 | state->resized = true; | ||
1331 | 102 | break; | ||
1332 | 103 | case mir_event_type_close_surface: | ||
1333 | 104 | // TODO: eglapp.h needs a quit() function or different behaviour of | ||
1334 | 105 | // mir_eglapp_shutdown(). | ||
1335 | 106 | raise(SIGTERM); // handled by eglapp | ||
1336 | 107 | break; | ||
1337 | 108 | default: | ||
1338 | 109 | break; | ||
1339 | 110 | } | ||
1340 | 111 | |||
1341 | 112 | pthread_mutex_unlock(&state->mutex); | ||
1342 | 113 | } | ||
1343 | 114 | |||
1344 | 115 | static void fourcc_string(__u32 x, char str[5]) | ||
1345 | 116 | { | ||
1346 | 117 | str[0] = (char)(x & 0xff); | ||
1347 | 118 | str[1] = (char)(x >> 8 & 0xff); | ||
1348 | 119 | str[2] = (char)(x >> 16 & 0xff); | ||
1349 | 120 | str[3] = (char)(x >> 24); | ||
1350 | 121 | str[4] = '\0'; | ||
1351 | 122 | } | ||
1352 | 123 | |||
1353 | 124 | static void close_camera(Camera *cam) | ||
1354 | 125 | { | ||
1355 | 126 | if (!cam) return; | ||
1356 | 127 | |||
1357 | 128 | for (unsigned b = 0; b < cam->buffers; ++b) | ||
1358 | 129 | if (cam->buffer[b].start) | ||
1359 | 130 | munmap(cam->buffer[b].start, cam->buffer[b].length); | ||
1360 | 131 | if (cam->fd >= 0) | ||
1361 | 132 | close(cam->fd); | ||
1362 | 133 | free(cam); | ||
1363 | 134 | } | ||
1364 | 135 | |||
1365 | 136 | static Camera *open_camera(const char *path, enum CameraPref pref, | ||
1366 | 137 | unsigned nbuffers) | ||
1367 | 138 | { | ||
1368 | 139 | Camera *cam = calloc(1, sizeof(*cam) + nbuffers*sizeof(cam->buffer[0])); | ||
1369 | 140 | if (cam == NULL) | ||
1370 | 141 | { | ||
1371 | 142 | perror("malloc"); | ||
1372 | 143 | goto fail; | ||
1373 | 144 | } | ||
1374 | 145 | |||
1375 | 146 | printf("Opening device: %s\n", path); | ||
1376 | 147 | cam->fd = open(path, O_RDWR); | ||
1377 | 148 | if (cam->fd < 0) | ||
1378 | 149 | { | ||
1379 | 150 | perror("open"); | ||
1380 | 151 | goto fail; | ||
1381 | 152 | } | ||
1382 | 153 | |||
1383 | 154 | struct v4l2_capability cap; | ||
1384 | 155 | int ret = ioctl(cam->fd, VIDIOC_QUERYCAP, &cap); | ||
1385 | 156 | if (ret == 0) | ||
1386 | 157 | { | ||
1387 | 158 | printf("Driver: %s\n", cap.driver); | ||
1388 | 159 | printf("Card: %s\n", cap.card); | ||
1389 | 160 | printf("Bus: %s\n", cap.bus_info); | ||
1390 | 161 | printf("Capture: %s\n", | ||
1391 | 162 | cap.capabilities & V4L2_CAP_VIDEO_CAPTURE ? "Yes" : "No"); | ||
1392 | 163 | printf("Streaming: %s\n", | ||
1393 | 164 | cap.capabilities & V4L2_CAP_STREAMING ? "Yes" : "No"); | ||
1394 | 165 | |||
1395 | 166 | } | ||
1396 | 167 | |||
1397 | 168 | const unsigned required = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; | ||
1398 | 169 | if (ret || (cap.capabilities & required) != required) | ||
1399 | 170 | { | ||
1400 | 171 | fprintf(stderr, "Can't get sufficient capabilities\n"); | ||
1401 | 172 | goto fail; | ||
1402 | 173 | } | ||
1403 | 174 | |||
1404 | 175 | struct v4l2_format format; | ||
1405 | 176 | memset(&format, 0, sizeof(format)); | ||
1406 | 177 | format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1407 | 178 | struct v4l2_pix_format *pix = &format.fmt.pix; | ||
1408 | 179 | // Driver will choose the best match | ||
1409 | 180 | if (pref == camera_pref_speed) | ||
1410 | 181 | { | ||
1411 | 182 | pix->width = 1; | ||
1412 | 183 | pix->height = 1; | ||
1413 | 184 | } | ||
1414 | 185 | else if (pref == camera_pref_resolution) | ||
1415 | 186 | { | ||
1416 | 187 | pix->width = 9999; | ||
1417 | 188 | pix->height = 9999; | ||
1418 | 189 | } | ||
1419 | 190 | // But we really only need it to honour these: | ||
1420 | 191 | pix->pixelformat = V4L2_PIX_FMT_YUYV; | ||
1421 | 192 | pix->field = V4L2_FIELD_NONE; | ||
1422 | 193 | // Just try, best effort. This may fail. | ||
1423 | 194 | if (ioctl(cam->fd, VIDIOC_S_FMT, &format) && | ||
1424 | 195 | ioctl(cam->fd, VIDIOC_G_FMT, &format)) | ||
1425 | 196 | { | ||
1426 | 197 | perror("VIDIOC_[SG]_FMT"); | ||
1427 | 198 | goto fail; | ||
1428 | 199 | } | ||
1429 | 200 | char str[5]; | ||
1430 | 201 | fourcc_string(pix->pixelformat, str); | ||
1431 | 202 | printf("Pixel format: %ux%u fmt %s, stride %u\n", | ||
1432 | 203 | (unsigned)pix->width, (unsigned)pix->height, | ||
1433 | 204 | str, (unsigned)pix->bytesperline); | ||
1434 | 205 | cam->pix = *pix; | ||
1435 | 206 | |||
1436 | 207 | // Always choose the highest frame rate. Although what you will get | ||
1437 | 208 | // depends on the resolution vs speed set above. | ||
1438 | 209 | struct v4l2_streamparm parm; | ||
1439 | 210 | memset(&parm, 0, sizeof(parm)); | ||
1440 | 211 | parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1441 | 212 | parm.parm.capture.timeperframe.numerator = 1; | ||
1442 | 213 | parm.parm.capture.timeperframe.denominator = 1000; | ||
1443 | 214 | if (ioctl(cam->fd, VIDIOC_S_PARM, &parm)) | ||
1444 | 215 | { | ||
1445 | 216 | fprintf(stderr, "Setting frame rate is not supported.\n"); | ||
1446 | 217 | } | ||
1447 | 218 | else | ||
1448 | 219 | { | ||
1449 | 220 | unsigned hz = parm.parm.capture.timeperframe.denominator / | ||
1450 | 221 | parm.parm.capture.timeperframe.numerator; | ||
1451 | 222 | printf("Maximum frame rate requested: %u Hz (may be less)\n", hz); | ||
1452 | 223 | } | ||
1453 | 224 | |||
1454 | 225 | struct v4l2_requestbuffers req = | ||
1455 | 226 | { | ||
1456 | 227 | nbuffers, | ||
1457 | 228 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||
1458 | 229 | V4L2_MEMORY_MMAP, | ||
1459 | 230 | {0,0} | ||
1460 | 231 | }; | ||
1461 | 232 | if (-1 == ioctl(cam->fd, VIDIOC_REQBUFS, &req)) | ||
1462 | 233 | { | ||
1463 | 234 | perror("VIDIOC_REQBUFS"); | ||
1464 | 235 | goto fail; | ||
1465 | 236 | } | ||
1466 | 237 | |||
1467 | 238 | cam->buffers = req.count; | ||
1468 | 239 | |||
1469 | 240 | for (unsigned b = 0; b < req.count; ++b) | ||
1470 | 241 | { | ||
1471 | 242 | struct v4l2_buffer buf; | ||
1472 | 243 | memset(&buf, 0, sizeof(buf)); | ||
1473 | 244 | buf.index = b; | ||
1474 | 245 | buf.type = req.type; | ||
1475 | 246 | if (-1 == ioctl(cam->fd, VIDIOC_QUERYBUF, &buf)) | ||
1476 | 247 | { | ||
1477 | 248 | perror("VIDIOC_QUERYBUF"); | ||
1478 | 249 | goto fail; | ||
1479 | 250 | } | ||
1480 | 251 | cam->buffer[b].length = buf.length; | ||
1481 | 252 | cam->buffer[b].start = mmap(NULL, buf.length, | ||
1482 | 253 | PROT_READ | PROT_WRITE, | ||
1483 | 254 | MAP_SHARED, | ||
1484 | 255 | cam->fd, buf.m.offset); | ||
1485 | 256 | |||
1486 | 257 | if (MAP_FAILED == cam->buffer[b].start) | ||
1487 | 258 | { | ||
1488 | 259 | perror("mmap"); | ||
1489 | 260 | goto fail; | ||
1490 | 261 | } | ||
1491 | 262 | } | ||
1492 | 263 | |||
1493 | 264 | for (unsigned b = 0; b < req.count; ++b) | ||
1494 | 265 | { | ||
1495 | 266 | struct v4l2_buffer buf; | ||
1496 | 267 | memset(&buf, 0, sizeof(buf)); | ||
1497 | 268 | buf.index = b; | ||
1498 | 269 | buf.type = req.type; | ||
1499 | 270 | buf.memory = V4L2_MEMORY_MMAP; | ||
1500 | 271 | if (-1 == ioctl(cam->fd, VIDIOC_QBUF, &buf)) | ||
1501 | 272 | { | ||
1502 | 273 | perror("VIDIOC_QBUF"); | ||
1503 | 274 | goto fail; | ||
1504 | 275 | } | ||
1505 | 276 | } | ||
1506 | 277 | |||
1507 | 278 | int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1508 | 279 | if (-1 == ioctl(cam->fd, VIDIOC_STREAMON, &type)) | ||
1509 | 280 | { | ||
1510 | 281 | perror("VIDIOC_STREAMON"); | ||
1511 | 282 | goto fail; | ||
1512 | 283 | } | ||
1513 | 284 | |||
1514 | 285 | return cam; | ||
1515 | 286 | fail: | ||
1516 | 287 | close_camera(cam); | ||
1517 | 288 | return NULL; | ||
1518 | 289 | } | ||
1519 | 290 | |||
1520 | 291 | static bool frame_ready(Camera *cam) | ||
1521 | 292 | { | ||
1522 | 293 | struct pollfd pollfd = {cam->fd, POLLIN, 0}; | ||
1523 | 294 | return poll(&pollfd, 1, 0) == 1 && (pollfd.revents & POLLIN); | ||
1524 | 295 | } | ||
1525 | 296 | |||
1526 | 297 | static const Buffer *acquire_frame(Camera *cam) | ||
1527 | 298 | { | ||
1528 | 299 | struct v4l2_buffer frame; | ||
1529 | 300 | memset(&frame, 0, sizeof(frame)); | ||
1530 | 301 | frame.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1531 | 302 | frame.memory = V4L2_MEMORY_MMAP; | ||
1532 | 303 | if (ioctl(cam->fd, VIDIOC_DQBUF, &frame)) | ||
1533 | 304 | { | ||
1534 | 305 | perror("VIDIOC_DQBUF"); | ||
1535 | 306 | return NULL; | ||
1536 | 307 | } | ||
1537 | 308 | return cam->buffer + frame.index; | ||
1538 | 309 | } | ||
1539 | 310 | |||
1540 | 311 | static void release_frame(Camera *cam, const Buffer *buf) | ||
1541 | 312 | { | ||
1542 | 313 | struct v4l2_buffer frame; | ||
1543 | 314 | memset(&frame, 0, sizeof(frame)); | ||
1544 | 315 | frame.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
1545 | 316 | frame.memory = V4L2_MEMORY_MMAP; | ||
1546 | 317 | frame.index = buf - cam->buffer; | ||
1547 | 318 | if (ioctl(cam->fd, VIDIOC_QBUF, &frame)) | ||
1548 | 319 | perror("VIDIOC_QBUF"); | ||
1549 | 320 | } | ||
1550 | 321 | |||
1551 | 322 | int main(int argc, char *argv[]) | ||
1552 | 323 | { | ||
1553 | 324 | const char vshadersrc[] = | ||
1554 | 325 | "attribute vec2 position;\n" | ||
1555 | 326 | "attribute vec2 texcoord;\n" | ||
1556 | 327 | "uniform mat4 projection;\n" | ||
1557 | 328 | "varying vec2 v_texcoord;\n" | ||
1558 | 329 | "\n" | ||
1559 | 330 | "void main()\n" | ||
1560 | 331 | "{\n" | ||
1561 | 332 | " gl_Position = projection *\n" | ||
1562 | 333 | " vec4(position, 0.0, 1.0);\n" | ||
1563 | 334 | " v_texcoord = texcoord;\n" | ||
1564 | 335 | "}\n"; | ||
1565 | 336 | |||
1566 | 337 | const char raw_fshadersrc[] = | ||
1567 | 338 | "precision mediump float;\n" | ||
1568 | 339 | "varying vec2 v_texcoord;\n" | ||
1569 | 340 | "uniform sampler2D texture;\n" | ||
1570 | 341 | "\n" | ||
1571 | 342 | "void main()\n" | ||
1572 | 343 | "{\n" | ||
1573 | 344 | " vec4 f = texture2D(texture, v_texcoord);\n" | ||
1574 | 345 | " gl_FragColor = vec4(f.rgb, 1.0);\n" | ||
1575 | 346 | "}\n"; | ||
1576 | 347 | |||
1577 | 348 | const char * const yuyv_greyscale_fshadersrc = raw_fshadersrc; | ||
1578 | 349 | |||
1579 | 350 | // This is the Android YUV to RGB calculation. | ||
1580 | 351 | // TODO: Vary the shader to match the camera's reported colour space | ||
1581 | 352 | const char yuyv_quickcolour_fshadersrc[] = | ||
1582 | 353 | "precision mediump float;\n" | ||
1583 | 354 | "varying vec2 v_texcoord;\n" | ||
1584 | 355 | "uniform sampler2D texture;\n" | ||
1585 | 356 | "\n" | ||
1586 | 357 | "void main()\n" | ||
1587 | 358 | "{\n" | ||
1588 | 359 | " vec4 f = texture2D(texture, v_texcoord);\n" | ||
1589 | 360 | " float y = (f.r + f.b) / 2.0;\n" // Y unsigned (from two pixels) | ||
1590 | 361 | " float u = f.g - 0.5;\n" // U signed (same for both pixels) | ||
1591 | 362 | " float v = f.a - 0.5;\n" // V signed (same for both pixels) | ||
1592 | 363 | " float r = clamp(y + 1.370705*v, 0.0, 1.0);\n" | ||
1593 | 364 | " float g = clamp(y - 0.698001*v - 0.337633*u, 0.0, 1.0);\n" | ||
1594 | 365 | " float b = clamp(y + 1.732446*u, 0.0, 1.0);\n" | ||
1595 | 366 | " gl_FragColor = vec4(r, g, b, 1.0);\n" | ||
1596 | 367 | "}\n"; | ||
1597 | 368 | |||
1598 | 369 | // TODO: Selectable between high-res grey vs half-res colour? | ||
1599 | 370 | const char * const fshadersrc = yuyv_quickcolour_fshadersrc; | ||
1600 | 371 | |||
1601 | 372 | Camera *cam = open_camera("/dev/video0", camera_pref_resolution, 1); | ||
1602 | 373 | if (!cam) | ||
1603 | 374 | { | ||
1604 | 375 | fprintf(stderr, "Failed to set up camera device\n"); | ||
1605 | 376 | return 0; | ||
1606 | 377 | } | ||
1607 | 378 | |||
1608 | 379 | unsigned int win_width = cam->pix.width; | ||
1609 | 380 | unsigned int win_height = cam->pix.height; | ||
1610 | 381 | if (!mir_eglapp_init(argc, argv, &win_width, &win_height)) | ||
1611 | 382 | return 1; | ||
1612 | 383 | |||
1613 | 384 | GLuint vshader = load_shader(vshadersrc, GL_VERTEX_SHADER); | ||
1614 | 385 | assert(vshader); | ||
1615 | 386 | GLuint fshader = load_shader(fshadersrc, GL_FRAGMENT_SHADER); | ||
1616 | 387 | assert(fshader); | ||
1617 | 388 | GLuint prog = glCreateProgram(); | ||
1618 | 389 | assert(prog); | ||
1619 | 390 | glAttachShader(prog, vshader); | ||
1620 | 391 | glAttachShader(prog, fshader); | ||
1621 | 392 | glLinkProgram(prog); | ||
1622 | 393 | |||
1623 | 394 | GLint linked; | ||
1624 | 395 | glGetProgramiv(prog, GL_LINK_STATUS, &linked); | ||
1625 | 396 | if (!linked) | ||
1626 | 397 | { | ||
1627 | 398 | GLchar log[1024]; | ||
1628 | 399 | glGetProgramInfoLog(prog, sizeof log - 1, NULL, log); | ||
1629 | 400 | log[sizeof log - 1] = '\0'; | ||
1630 | 401 | printf("Link failed: %s\n", log); | ||
1631 | 402 | return 2; | ||
1632 | 403 | } | ||
1633 | 404 | |||
1634 | 405 | glUseProgram(prog); | ||
1635 | 406 | |||
1636 | 407 | const GLfloat camw = cam->pix.width, camh = cam->pix.height; | ||
1637 | 408 | const GLfloat box[] = | ||
1638 | 409 | { // position texcoord | ||
1639 | 410 | 0.0f, camh, 0.0f, 1.0f, | ||
1640 | 411 | camw, camh, 1.0f, 1.0f, | ||
1641 | 412 | camw, 0.0f, 1.0f, 0.0f, | ||
1642 | 413 | 0.0f, 0.0f, 0.0f, 0.0f, | ||
1643 | 414 | }; | ||
1644 | 415 | GLint position = glGetAttribLocation(prog, "position"); | ||
1645 | 416 | GLint texcoord = glGetAttribLocation(prog, "texcoord"); | ||
1646 | 417 | glVertexAttribPointer(position, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat), | ||
1647 | 418 | box); | ||
1648 | 419 | glVertexAttribPointer(texcoord, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat), | ||
1649 | 420 | box+2); | ||
1650 | 421 | glEnableVertexAttribArray(position); | ||
1651 | 422 | glEnableVertexAttribArray(texcoord); | ||
1652 | 423 | |||
1653 | 424 | GLint projection = glGetUniformLocation(prog, "projection"); | ||
1654 | 425 | |||
1655 | 426 | GLuint tex; | ||
1656 | 427 | glGenTextures(1, &tex); | ||
1657 | 428 | glBindTexture(GL_TEXTURE_2D, tex); | ||
1658 | 429 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | ||
1659 | 430 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | ||
1660 | 431 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | ||
1661 | 432 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | ||
1662 | 433 | |||
1663 | 434 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); | ||
1664 | 435 | glViewport(0, 0, win_width, win_height); | ||
1665 | 436 | |||
1666 | 437 | State state = | ||
1667 | 438 | { | ||
1668 | 439 | PTHREAD_MUTEX_INITIALIZER, | ||
1669 | 440 | true | ||
1670 | 441 | }; | ||
1671 | 442 | MirSurface *surface = mir_eglapp_native_surface(); | ||
1672 | 443 | mir_surface_set_event_handler(surface, on_event, &state); | ||
1673 | 444 | |||
1674 | 445 | bool first_frame = true; | ||
1675 | 446 | while (mir_eglapp_running()) | ||
1676 | 447 | { | ||
1677 | 448 | bool wait_for_new_frame = true; | ||
1678 | 449 | pthread_mutex_lock(&state.mutex); | ||
1679 | 450 | |||
1680 | 451 | if (state.resized) | ||
1681 | 452 | { | ||
1682 | 453 | // mir_eglapp_swap_buffers updates the viewport for us... | ||
1683 | 454 | GLint viewport[4]; | ||
1684 | 455 | glGetIntegerv(GL_VIEWPORT, viewport); | ||
1685 | 456 | GLfloat scalex = 2.0f / viewport[2]; | ||
1686 | 457 | GLfloat scaley = -2.0f / viewport[3]; | ||
1687 | 458 | |||
1688 | 459 | // Expand image to fit: | ||
1689 | 460 | GLfloat scalew = (GLfloat)viewport[2] / cam->pix.width; | ||
1690 | 461 | GLfloat scaleh = (GLfloat)viewport[3] / cam->pix.height; | ||
1691 | 462 | |||
1692 | 463 | GLfloat scale; | ||
1693 | 464 | GLfloat offsetx = -1.0f, offsety = 1.0f; | ||
1694 | 465 | if (scalew <= scaleh) | ||
1695 | 466 | { | ||
1696 | 467 | scale = scalew; | ||
1697 | 468 | offsety -= (GLfloat)(viewport[3] - scale*cam->pix.height) / | ||
1698 | 469 | viewport[3]; | ||
1699 | 470 | } | ||
1700 | 471 | else | ||
1701 | 472 | { | ||
1702 | 473 | scale = scaleh; | ||
1703 | 474 | offsetx += (GLfloat)(viewport[2] - scale*cam->pix.width) / | ||
1704 | 475 | viewport[2]; | ||
1705 | 476 | } | ||
1706 | 477 | |||
1707 | 478 | scalex *= scale; | ||
1708 | 479 | scaley *= scale; | ||
1709 | 480 | |||
1710 | 481 | // TRANSPOSED projection matrix to convert from the Mir input | ||
1711 | 482 | // rectangle {{0,0},{w,h}} to GL screen rectangle {{-1,1},{2,2}}. | ||
1712 | 483 | GLfloat matrix[16] = {scalex, 0.0f, 0.0f, 0.0f, | ||
1713 | 484 | 0.0f, scaley, 0.0f, 0.0f, | ||
1714 | 485 | 0.0f, 0.0f, 1.0f, 0.0f, | ||
1715 | 486 | offsetx,offsety,0.0f, 1.0f}; | ||
1716 | 487 | |||
1717 | 488 | // Note GL_FALSE: GLES does not support the transpose option | ||
1718 | 489 | glUniformMatrix4fv(projection, 1, GL_FALSE, matrix); | ||
1719 | 490 | state.resized = false; | ||
1720 | 491 | wait_for_new_frame = first_frame; | ||
1721 | 492 | first_frame = false; | ||
1722 | 493 | } | ||
1723 | 494 | |||
1724 | 495 | if (wait_for_new_frame || frame_ready(cam)) | ||
1725 | 496 | { | ||
1726 | 497 | const Buffer *buf = acquire_frame(cam); | ||
1727 | 498 | if (cam->pix.pixelformat == V4L2_PIX_FMT_YUYV) | ||
1728 | 499 | { | ||
1729 | 500 | if (fshadersrc == yuyv_greyscale_fshadersrc) | ||
1730 | 501 | { | ||
1731 | 502 | // Greyscale, full resolution: | ||
1732 | 503 | glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, | ||
1733 | 504 | cam->pix.width, cam->pix.height, 0, | ||
1734 | 505 | GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, | ||
1735 | 506 | buf->start); | ||
1736 | 507 | } | ||
1737 | 508 | else if (fshadersrc == yuyv_quickcolour_fshadersrc) | ||
1738 | 509 | { | ||
1739 | 510 | // Colour, half resolution: | ||
1740 | 511 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, | ||
1741 | 512 | cam->pix.width/2, cam->pix.height, 0, | ||
1742 | 513 | GL_RGBA, GL_UNSIGNED_BYTE, | ||
1743 | 514 | buf->start); | ||
1744 | 515 | } | ||
1745 | 516 | // TODO: Colour, full resolution. But it will be slow :( | ||
1746 | 517 | } | ||
1747 | 518 | else | ||
1748 | 519 | { | ||
1749 | 520 | char str[5]; | ||
1750 | 521 | fourcc_string(cam->pix.pixelformat, str); | ||
1751 | 522 | fprintf(stderr, "FIXME: Unsupported camera pixel format 0x%08lx: %s\n", | ||
1752 | 523 | (long)cam->pix.pixelformat, str); | ||
1753 | 524 | } | ||
1754 | 525 | release_frame(cam, buf); | ||
1755 | 526 | } | ||
1756 | 527 | |||
1757 | 528 | glClear(GL_COLOR_BUFFER_BIT); | ||
1758 | 529 | glDrawArrays(GL_TRIANGLE_FAN, 0, 4); | ||
1759 | 530 | |||
1760 | 531 | pthread_mutex_unlock(&state.mutex); | ||
1761 | 532 | |||
1762 | 533 | mir_eglapp_swap_buffers(); | ||
1763 | 534 | } | ||
1764 | 535 | |||
1765 | 536 | mir_surface_set_event_handler(surface, NULL, NULL); | ||
1766 | 537 | mir_eglapp_shutdown(); | ||
1767 | 538 | close_camera(cam); | ||
1768 | 539 | |||
1769 | 540 | return 0; | ||
1770 | 541 | } | ||
1771 | 0 | 542 | ||
1772 | === modified file 'examples/client_helpers.h' | |||
1773 | --- examples/client_helpers.h 2016-01-29 08:18:22 +0000 | |||
1774 | +++ examples/client_helpers.h 2016-03-30 00:11:41 +0000 | |||
1775 | @@ -16,8 +16,8 @@ | |||
1776 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1777 | 17 | */ | 17 | */ |
1778 | 18 | 18 | ||
1781 | 19 | #ifndef MIR_EXAMLPES_CLIENT_HELPERS_H_ | 19 | #ifndef MIR_EXAMPLES_CLIENT_HELPERS_H_ |
1782 | 20 | #define MIR_EXAMLPES_CLIENT_HELPERS_H_ | 20 | #define MIR_EXAMPLES_CLIENT_HELPERS_H_ |
1783 | 21 | 21 | ||
1784 | 22 | #include "mir_toolkit/mir_client_library.h" | 22 | #include "mir_toolkit/mir_client_library.h" |
1785 | 23 | #include <EGL/egl.h> | 23 | #include <EGL/egl.h> |
1786 | 24 | 24 | ||
1787 | === modified file 'examples/cursors_demo_client.c' | |||
1788 | --- examples/cursors_demo_client.c 2016-01-29 08:18:22 +0000 | |||
1789 | +++ examples/cursors_demo_client.c 2016-03-30 00:11:41 +0000 | |||
1790 | @@ -16,6 +16,8 @@ | |||
1791 | 16 | * Author: Robert Carr <robert.carr@canonical.com> | 16 | * Author: Robert Carr <robert.carr@canonical.com> |
1792 | 17 | */ | 17 | */ |
1793 | 18 | 18 | ||
1794 | 19 | #define _BSD_SOURCE /* for usleep() */ | ||
1795 | 20 | |||
1796 | 19 | #include "mir_toolkit/mir_client_library.h" | 21 | #include "mir_toolkit/mir_client_library.h" |
1797 | 20 | 22 | ||
1798 | 21 | #include "eglapp.h" | 23 | #include "eglapp.h" |
1799 | @@ -26,7 +28,6 @@ | |||
1800 | 26 | void configure_cursor(MirSurface *surface, unsigned int cursor_index) | 28 | void configure_cursor(MirSurface *surface, unsigned int cursor_index) |
1801 | 27 | { | 29 | { |
1802 | 28 | char const *const cursors[] = { | 30 | char const *const cursors[] = { |
1803 | 29 | mir_arrow_cursor_name, | ||
1804 | 30 | mir_busy_cursor_name, | 31 | mir_busy_cursor_name, |
1805 | 31 | mir_caret_cursor_name, | 32 | mir_caret_cursor_name, |
1806 | 32 | mir_pointing_hand_cursor_name, | 33 | mir_pointing_hand_cursor_name, |
1807 | @@ -67,7 +68,7 @@ | |||
1808 | 67 | while (mir_eglapp_running()) | 68 | while (mir_eglapp_running()) |
1809 | 68 | { | 69 | { |
1810 | 69 | configure_cursor(mir_eglapp_native_surface(), cursor_index++); | 70 | configure_cursor(mir_eglapp_native_surface(), cursor_index++); |
1812 | 70 | sleep(1); | 71 | usleep(100000); |
1813 | 71 | } | 72 | } |
1814 | 72 | 73 | ||
1815 | 73 | mir_eglapp_shutdown(); | 74 | mir_eglapp_shutdown(); |
1816 | 74 | 75 | ||
1817 | === modified file 'examples/flicker.c' | |||
1818 | --- examples/flicker.c 2016-01-29 08:18:22 +0000 | |||
1819 | +++ examples/flicker.c 2016-03-30 00:11:41 +0000 | |||
1820 | @@ -90,6 +90,18 @@ | |||
1821 | 90 | }; | 90 | }; |
1822 | 91 | } | 91 | } |
1823 | 92 | 92 | ||
1824 | 93 | static volatile sig_atomic_t running = 1; | ||
1825 | 94 | |||
1826 | 95 | static void shutdown(int signum) | ||
1827 | 96 | { | ||
1828 | 97 | if (running) | ||
1829 | 98 | { | ||
1830 | 99 | running = 0; | ||
1831 | 100 | printf("Signal %d received. Good night.\n", signum); | ||
1832 | 101 | } | ||
1833 | 102 | } | ||
1834 | 103 | |||
1835 | 104 | |||
1836 | 93 | int main(int argc, char* argv[]) | 105 | int main(int argc, char* argv[]) |
1837 | 94 | { | 106 | { |
1838 | 95 | MirConnection *connection = 0; | 107 | MirConnection *connection = 0; |
1839 | @@ -164,7 +176,11 @@ | |||
1840 | 164 | int i=0; | 176 | int i=0; |
1841 | 165 | MirBufferStream *bs = mir_surface_get_buffer_stream(surface); | 177 | MirBufferStream *bs = mir_surface_get_buffer_stream(surface); |
1842 | 166 | 178 | ||
1844 | 167 | while (1) | 179 | signal(SIGINT, shutdown); |
1845 | 180 | signal(SIGTERM, shutdown); | ||
1846 | 181 | signal(SIGHUP, shutdown); | ||
1847 | 182 | |||
1848 | 183 | while (running) | ||
1849 | 168 | { | 184 | { |
1850 | 169 | mir_buffer_stream_get_graphics_region(bs, &graphics_region); | 185 | mir_buffer_stream_get_graphics_region(bs, &graphics_region); |
1851 | 170 | i++; | 186 | i++; |
1852 | 171 | 187 | ||
1853 | === modified file 'examples/mir_demo_server_loader.cpp' | |||
1854 | --- examples/mir_demo_server_loader.cpp 2016-01-29 08:18:22 +0000 | |||
1855 | +++ examples/mir_demo_server_loader.cpp 2016-03-30 00:11:41 +0000 | |||
1856 | @@ -19,11 +19,25 @@ | |||
1857 | 19 | #include <dlfcn.h> | 19 | #include <dlfcn.h> |
1858 | 20 | #include <stdexcept> | 20 | #include <stdexcept> |
1859 | 21 | #include <iostream> | 21 | #include <iostream> |
1860 | 22 | #include <pthread.h> | ||
1861 | 22 | 23 | ||
1862 | 23 | namespace | 24 | namespace |
1863 | 24 | { | 25 | { |
1864 | 25 | const char* const library = "libmir_demo_server_loadable.so"; | 26 | const char* const library = "libmir_demo_server_loadable.so"; |
1865 | 26 | const char* const entry = "main"; | 27 | const char* const entry = "main"; |
1866 | 28 | |||
1867 | 29 | // Work around gold (or gcc/libstdc++-4.9 bug, it's not yet clear) bug | ||
1868 | 30 | // https://sourceware.org/bugzilla/show_bug.cgi?id=16417 by ensuring the | ||
1869 | 31 | // executable links with libpthread. | ||
1870 | 32 | struct GoldBug16417Workaround | ||
1871 | 33 | { | ||
1872 | 34 | GoldBug16417Workaround() | ||
1873 | 35 | { | ||
1874 | 36 | pthread_attr_t attr; | ||
1875 | 37 | pthread_attr_init(&attr); | ||
1876 | 38 | pthread_attr_destroy(&attr); | ||
1877 | 39 | } | ||
1878 | 40 | } gold_bug_16417_workaround; | ||
1879 | 27 | } | 41 | } |
1880 | 28 | 42 | ||
1881 | 29 | int main(int argc, char const* argv[]) | 43 | int main(int argc, char const* argv[]) |
1882 | 30 | 44 | ||
1883 | === modified file 'examples/render_surfaces.cpp' | |||
1884 | --- examples/render_surfaces.cpp 2016-01-29 08:18:22 +0000 | |||
1885 | +++ examples/render_surfaces.cpp 2016-03-30 00:11:41 +0000 | |||
1886 | @@ -317,6 +317,10 @@ | |||
1887 | 317 | set_command_line(argc, argv); | 317 | set_command_line(argc, argv); |
1888 | 318 | setenv("MIR_SERVER_NO_FILE", "", 1); | 318 | setenv("MIR_SERVER_NO_FILE", "", 1); |
1889 | 319 | 319 | ||
1890 | 320 | // If there's a server available, try connecting to it | ||
1891 | 321 | if (auto const socket = getenv("MIR_SOCKET")) | ||
1892 | 322 | setenv("MIR_SERVER_HOST_SOCKET", socket, 0); | ||
1893 | 323 | |||
1894 | 320 | // Unless the compositor starts before we create the surfaces it won't respond to | 324 | // Unless the compositor starts before we create the surfaces it won't respond to |
1895 | 321 | // the change notification that causes. | 325 | // the change notification that causes. |
1896 | 322 | callback_when_started(*this, [this] { create_surfaces(); }); | 326 | callback_when_started(*this, [this] { create_surfaces(); }); |
1897 | 323 | 327 | ||
1898 | === modified file 'examples/render_to_fb.cpp' | |||
1899 | --- examples/render_to_fb.cpp 2016-01-29 08:18:22 +0000 | |||
1900 | +++ examples/render_to_fb.cpp 2016-03-30 00:11:41 +0000 | |||
1901 | @@ -86,6 +86,13 @@ | |||
1902 | 86 | int main(int argc, char const** argv) | 86 | int main(int argc, char const** argv) |
1903 | 87 | try | 87 | try |
1904 | 88 | { | 88 | { |
1905 | 89 | // We don't want to act as a server by providing an endpoint | ||
1906 | 90 | setenv("MIR_SERVER_NO_FILE", "", 1); | ||
1907 | 91 | |||
1908 | 92 | // If there's a server available, try connecting to it | ||
1909 | 93 | if (auto const socket = getenv("MIR_SOCKET")) | ||
1910 | 94 | setenv("MIR_SERVER_HOST_SOCKET", socket, 0); | ||
1911 | 95 | |||
1912 | 89 | mir::Server server; | 96 | mir::Server server; |
1913 | 90 | server.set_command_line(argc, argv); | 97 | server.set_command_line(argc, argv); |
1914 | 91 | server.apply_settings(); | 98 | server.apply_settings(); |
1915 | 92 | 99 | ||
1916 | === modified file 'examples/scroll.cpp' | |||
1917 | --- examples/scroll.cpp 2016-01-29 08:18:22 +0000 | |||
1918 | +++ examples/scroll.cpp 2016-03-30 00:11:41 +0000 | |||
1919 | @@ -122,6 +122,15 @@ | |||
1920 | 122 | puts("Surface released"); | 122 | puts("Surface released"); |
1921 | 123 | } | 123 | } |
1922 | 124 | 124 | ||
1923 | 125 | static void shutdown(int signum) | ||
1924 | 126 | { | ||
1925 | 127 | // Exiting without closing surfaces and connection is impolite but should | ||
1926 | 128 | // not kill the server. It actually did kill the server prior to -r 3385. | ||
1927 | 129 | // Running this example in CI acts as a smoke test for that failure. | ||
1928 | 130 | printf("Signal %d received. Good night.\n", signum); | ||
1929 | 131 | exit(EXIT_SUCCESS); | ||
1930 | 132 | } | ||
1931 | 133 | |||
1932 | 125 | int main(int argc, char* argv[]) | 134 | int main(int argc, char* argv[]) |
1933 | 126 | { | 135 | { |
1934 | 127 | MirConnection *connection = 0; | 136 | MirConnection *connection = 0; |
1935 | @@ -152,6 +161,10 @@ | |||
1936 | 152 | 161 | ||
1937 | 153 | puts("Starting"); | 162 | puts("Starting"); |
1938 | 154 | 163 | ||
1939 | 164 | signal(SIGINT, shutdown); | ||
1940 | 165 | signal(SIGTERM, shutdown); | ||
1941 | 166 | signal(SIGHUP, shutdown); | ||
1942 | 167 | |||
1943 | 155 | connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__); | 168 | connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__); |
1944 | 156 | assert(connection != NULL); | 169 | assert(connection != NULL); |
1945 | 157 | assert(mir_connection_is_valid(connection)); | 170 | assert(mir_connection_is_valid(connection)); |
1946 | 158 | 171 | ||
1947 | === modified file 'examples/server_example.cpp' | |||
1948 | --- examples/server_example.cpp 2016-01-29 08:18:22 +0000 | |||
1949 | +++ examples/server_example.cpp 2016-03-30 00:11:41 +0000 | |||
1950 | @@ -29,6 +29,7 @@ | |||
1951 | 29 | 29 | ||
1952 | 30 | #include "mir/server.h" | 30 | #include "mir/server.h" |
1953 | 31 | #include "mir/main_loop.h" | 31 | #include "mir/main_loop.h" |
1954 | 32 | #include "mir/fd.h" | ||
1955 | 32 | 33 | ||
1956 | 33 | #include "mir/report_exception.h" | 34 | #include "mir/report_exception.h" |
1957 | 34 | #include "mir/options/option.h" | 35 | #include "mir/options/option.h" |
1958 | @@ -43,6 +44,16 @@ | |||
1959 | 43 | 44 | ||
1960 | 44 | namespace | 45 | namespace |
1961 | 45 | { | 46 | { |
1962 | 47 | auto connection(int fd) -> std::string | ||
1963 | 48 | { | ||
1964 | 49 | char connect_string[64] = {0}; | ||
1965 | 50 | // We can't have both the server and the client owning the same fd, since | ||
1966 | 51 | // that will result in a double-close(). We give the client a duplicate which | ||
1967 | 52 | // the client can safely own (and should close when done). | ||
1968 | 53 | sprintf(connect_string, "fd://%d", dup(fd)); | ||
1969 | 54 | return connect_string; | ||
1970 | 55 | } | ||
1971 | 56 | |||
1972 | 46 | void add_launcher_option_to(mir::Server& server) | 57 | void add_launcher_option_to(mir::Server& server) |
1973 | 47 | { | 58 | { |
1974 | 48 | static const char* const launch_child_opt = "launch-client"; | 59 | static const char* const launch_child_opt = "launch-client"; |
1975 | @@ -54,8 +65,19 @@ | |||
1976 | 54 | const auto options = server.get_options(); | 65 | const auto options = server.get_options(); |
1977 | 55 | if (options->is_set(launch_child_opt)) | 66 | if (options->is_set(launch_child_opt)) |
1978 | 56 | { | 67 | { |
1981 | 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); |
1982 | 58 | (void)(ignore); | 69 | |
1983 | 70 | for (auto i = begin(value); i != end(value); ) | ||
1984 | 71 | { | ||
1985 | 72 | auto const j = find(i, end(value), '&'); | ||
1986 | 73 | |||
1987 | 74 | auto const cmd = "MIR_SOCKET=" + connection(server.open_client_socket()) + " " + std::string{i, j} + "&"; | ||
1988 | 75 | |||
1989 | 76 | auto ignore = std::system(cmd.c_str()); | ||
1990 | 77 | (void)(ignore); | ||
1991 | 78 | |||
1992 | 79 | if ((i = j) != end(value)) ++i; | ||
1993 | 80 | } | ||
1994 | 59 | } | 81 | } |
1995 | 60 | }); | 82 | }); |
1996 | 61 | } | 83 | } |
1997 | 62 | 84 | ||
1998 | === modified file 'examples/server_example_test_client.cpp' | |||
1999 | --- examples/server_example_test_client.cpp 2016-01-29 08:18:22 +0000 | |||
2000 | +++ examples/server_example_test_client.cpp 2016-03-30 00:11:41 +0000 | |||
2001 | @@ -17,9 +17,11 @@ | |||
2002 | 17 | */ | 17 | */ |
2003 | 18 | 18 | ||
2004 | 19 | #include "server_example_test_client.h" | 19 | #include "server_example_test_client.h" |
2005 | 20 | #include "mir/fd.h" | ||
2006 | 20 | #include "mir/server.h" | 21 | #include "mir/server.h" |
2007 | 21 | #include "mir/main_loop.h" | 22 | #include "mir/main_loop.h" |
2008 | 22 | #include "mir/logging/logger.h" | 23 | #include "mir/logging/logger.h" |
2009 | 24 | #include "mir/log.h" | ||
2010 | 23 | #include "mir/options/option.h" | 25 | #include "mir/options/option.h" |
2011 | 24 | 26 | ||
2012 | 25 | #include <csignal> | 27 | #include <csignal> |
2013 | @@ -100,13 +102,24 @@ | |||
2014 | 100 | { | 102 | { |
2015 | 101 | context.test_failed = true; | 103 | context.test_failed = true; |
2016 | 102 | 104 | ||
2017 | 105 | auto const client_fd = server.open_client_socket(); | ||
2018 | 106 | |||
2019 | 103 | auto const pid = fork(); | 107 | auto const pid = fork(); |
2020 | 104 | 108 | ||
2021 | 105 | if (pid == 0) | 109 | if (pid == 0) |
2022 | 106 | { | 110 | { |
2023 | 111 | char connect_string[64] = {0}; | ||
2024 | 112 | // We can't have both the server and the client owning the same fd, since | ||
2025 | 113 | // that will result in a double-close(). We give the client a duplicate which | ||
2026 | 114 | // the client can safely own (and should close when done). | ||
2027 | 115 | sprintf(connect_string, "fd://%d", dup(client_fd)); | ||
2028 | 116 | |||
2029 | 117 | setenv("MIR_SOCKET", connect_string, 1); | ||
2030 | 118 | |||
2031 | 107 | auto const client = options->get<std::string>(test_client_opt); | 119 | auto const client = options->get<std::string>(test_client_opt); |
2034 | 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)); |
2035 | 109 | ml::log(ml::Severity::critical, "Failed to execute client", component); | 121 | log(logging::Severity::critical, "mir::examples", |
2036 | 122 | "Failed to execute client (%s) error: %s", client.c_str(), strerror(errno)); | ||
2037 | 110 | abort(); // If execl() returns then something is badly wrong | 123 | abort(); // If execl() returns then something is badly wrong |
2038 | 111 | } | 124 | } |
2039 | 112 | else if (pid > 0) | 125 | else if (pid > 0) |
2040 | 113 | 126 | ||
2041 | === modified file 'examples/server_example_window_management.cpp' | |||
2042 | --- examples/server_example_window_management.cpp 2016-01-29 08:18:22 +0000 | |||
2043 | +++ examples/server_example_window_management.cpp 2016-03-30 00:11:41 +0000 | |||
2044 | @@ -58,14 +58,14 @@ | |||
2045 | 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) : |
2046 | 59 | display_layout{display_layout} {} | 59 | display_layout{display_layout} {} |
2047 | 60 | 60 | ||
2049 | 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 {} |
2050 | 62 | 62 | ||
2052 | 63 | void handle_displays_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) {} | 63 | void handle_displays_updated(SessionInfoMap& /*session_info*/, Rectangles const& /*displays*/) override {} |
2053 | 64 | 64 | ||
2054 | 65 | auto handle_place_new_surface( | 65 | auto handle_place_new_surface( |
2055 | 66 | std::shared_ptr<ms::Session> const& /*session*/, | 66 | std::shared_ptr<ms::Session> const& /*session*/, |
2056 | 67 | ms::SurfaceCreationParameters const& request_parameters) | 67 | ms::SurfaceCreationParameters const& request_parameters) |
2058 | 68 | -> ms::SurfaceCreationParameters | 68 | -> ms::SurfaceCreationParameters override |
2059 | 69 | { | 69 | { |
2060 | 70 | auto placed_parameters = request_parameters; | 70 | auto placed_parameters = request_parameters; |
2061 | 71 | 71 | ||
2062 | @@ -78,29 +78,29 @@ | |||
2063 | 78 | void handle_modify_surface( | 78 | void handle_modify_surface( |
2064 | 79 | std::shared_ptr<ms::Session> const& /*session*/, | 79 | std::shared_ptr<ms::Session> const& /*session*/, |
2065 | 80 | std::shared_ptr<ms::Surface> const& /*surface*/, | 80 | std::shared_ptr<ms::Surface> const& /*surface*/, |
2075 | 81 | msh::SurfaceSpecification const& /*modifications*/) | 81 | msh::SurfaceSpecification const& /*modifications*/) override |
2076 | 82 | { | 82 | { |
2077 | 83 | } | 83 | } |
2078 | 84 | 84 | ||
2079 | 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 |
2080 | 86 | { | 86 | { |
2081 | 87 | } | 87 | } |
2082 | 88 | 88 | ||
2083 | 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 |
2084 | 90 | { session->destroy_surface(surface); } | 90 | { session->destroy_surface(surface); } |
2085 | 91 | 91 | ||
2087 | 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 |
2088 | 93 | { return value; } | 93 | { return value; } |
2089 | 94 | 94 | ||
2095 | 95 | bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) { return false; } | 95 | bool handle_keyboard_event(MirKeyboardEvent const* /*event*/) override { return false; } |
2096 | 96 | 96 | ||
2097 | 97 | bool handle_touch_event(MirTouchEvent const* /*event*/) { return false; } | 97 | bool handle_touch_event(MirTouchEvent const* /*event*/) override { return false; } |
2098 | 98 | 98 | ||
2099 | 99 | bool handle_pointer_event(MirPointerEvent const* /*event*/) { return false; } | 99 | bool handle_pointer_event(MirPointerEvent const* /*event*/) override { return false; } |
2100 | 100 | 100 | ||
2101 | 101 | void handle_raise_surface( | 101 | void handle_raise_surface( |
2102 | 102 | std::shared_ptr<ms::Session> const& /*session*/, | 102 | std::shared_ptr<ms::Session> const& /*session*/, |
2104 | 103 | std::shared_ptr<ms::Surface> const& /*surface*/) | 103 | std::shared_ptr<ms::Surface> const& /*surface*/) override |
2105 | 104 | { | 104 | { |
2106 | 105 | } | 105 | } |
2107 | 106 | 106 | ||
2108 | @@ -108,7 +108,7 @@ | |||
2109 | 108 | std::shared_ptr<ms::Session> const&, | 108 | std::shared_ptr<ms::Session> const&, |
2110 | 109 | std::shared_ptr<ms::Surface> const&, | 109 | std::shared_ptr<ms::Surface> const&, |
2111 | 110 | SurfaceInfoMap&, | 110 | SurfaceInfoMap&, |
2113 | 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 |
2114 | 112 | { | 112 | { |
2115 | 113 | } | 113 | } |
2116 | 114 | private: | 114 | private: |
2117 | 115 | 115 | ||
2118 | === modified file 'examples/xcursor_loader.cpp' | |||
2119 | --- examples/xcursor_loader.cpp 2016-01-29 08:18:22 +0000 | |||
2120 | +++ examples/xcursor_loader.cpp 2016-03-30 00:11:41 +0000 | |||
2121 | @@ -27,7 +27,7 @@ | |||
2122 | 27 | 27 | ||
2123 | 28 | #include <mir_toolkit/cursors.h> | 28 | #include <mir_toolkit/cursors.h> |
2124 | 29 | 29 | ||
2126 | 30 | // Unforunately this can not be compiled as C++...so we can not namespace | 30 | // Unfortunately this can not be compiled as C++...so we can not namespace |
2127 | 31 | // these symbols. In order to differentiate from internal symbols | 31 | // these symbols. In order to differentiate from internal symbols |
2128 | 32 | // we refer to them via their _ prefixed version, i.e. _XcursorImage | 32 | // we refer to them via their _ prefixed version, i.e. _XcursorImage |
2129 | 33 | extern "C" | 33 | extern "C" |
2130 | 34 | 34 | ||
2131 | === modified file 'include/client/mir_toolkit/client_types.h' | |||
2132 | --- include/client/mir_toolkit/client_types.h 2016-01-29 08:18:22 +0000 | |||
2133 | +++ include/client/mir_toolkit/client_types.h 2016-03-30 00:11:41 +0000 | |||
2134 | @@ -45,6 +45,15 @@ | |||
2135 | 45 | typedef struct MirBufferStream MirBufferStream; | 45 | typedef struct MirBufferStream MirBufferStream; |
2136 | 46 | typedef struct MirPersistentId MirPersistentId; | 46 | typedef struct MirPersistentId MirPersistentId; |
2137 | 47 | typedef struct MirBlob MirBlob; | 47 | typedef struct MirBlob MirBlob; |
2138 | 48 | typedef struct MirDisplayConfig MirDisplayConfig; | ||
2139 | 49 | |||
2140 | 50 | /** | ||
2141 | 51 | * Descriptor for an output connection. | ||
2142 | 52 | * | ||
2143 | 53 | * Each MirOutput corresponds to a video output. This may be a physical connection on the system, | ||
2144 | 54 | * like HDMI or DisplayPort, or may be a virtual output such as a remote display or screencast display. | ||
2145 | 55 | */ | ||
2146 | 56 | typedef struct MirOutput MirOutput; | ||
2147 | 48 | 57 | ||
2148 | 49 | /** | 58 | /** |
2149 | 50 | * Returned by asynchronous functions. Must not be free'd by | 59 | * Returned by asynchronous functions. Must not be free'd by |
2150 | @@ -272,6 +281,32 @@ | |||
2151 | 272 | mir_display_output_type_edp | 281 | mir_display_output_type_edp |
2152 | 273 | } MirDisplayOutputType; | 282 | } MirDisplayOutputType; |
2153 | 274 | 283 | ||
2154 | 284 | typedef enum MirOutputType | ||
2155 | 285 | { | ||
2156 | 286 | mir_output_type_unknown, | ||
2157 | 287 | mir_output_type_vga, | ||
2158 | 288 | mir_output_type_dvii, | ||
2159 | 289 | mir_output_type_dvid, | ||
2160 | 290 | mir_output_type_dvia, | ||
2161 | 291 | mir_output_type_composite, | ||
2162 | 292 | mir_output_type_svideo, | ||
2163 | 293 | mir_output_type_lvds, | ||
2164 | 294 | mir_output_type_component, | ||
2165 | 295 | mir_output_type_ninepindin, | ||
2166 | 296 | mir_output_type_displayport, | ||
2167 | 297 | mir_output_type_hdmia, | ||
2168 | 298 | mir_output_type_hdmib, | ||
2169 | 299 | mir_output_type_tv, | ||
2170 | 300 | mir_output_type_edp | ||
2171 | 301 | } MirOutputType; | ||
2172 | 302 | |||
2173 | 303 | typedef enum MirOutputConnectionState | ||
2174 | 304 | { | ||
2175 | 305 | mir_output_connection_state_disconnected = 0, | ||
2176 | 306 | mir_output_connection_state_connected, | ||
2177 | 307 | mir_output_connection_state_unknown | ||
2178 | 308 | } MirOutputConnectionState; | ||
2179 | 309 | |||
2180 | 275 | typedef struct MirDisplayMode | 310 | typedef struct MirDisplayMode |
2181 | 276 | { | 311 | { |
2182 | 277 | uint32_t vertical_resolution; | 312 | uint32_t vertical_resolution; |
2183 | @@ -335,6 +370,9 @@ | |||
2184 | 335 | unsigned int height; | 370 | unsigned int height; |
2185 | 336 | } MirRectangle; | 371 | } MirRectangle; |
2186 | 337 | 372 | ||
2187 | 373 | typedef struct MirInputConfig MirInputConfig; | ||
2188 | 374 | typedef struct MirInputDevice MirInputDevice; | ||
2189 | 375 | |||
2190 | 338 | /** | 376 | /** |
2191 | 339 | * MirScreencastParameters is the structure of required information that | 377 | * MirScreencastParameters is the structure of required information that |
2192 | 340 | * you must provide to Mir in order to create a MirScreencast. | 378 | * you must provide to Mir in order to create a MirScreencast. |
2193 | @@ -395,6 +433,16 @@ | |||
2194 | 395 | typedef void (*mir_platform_operation_callback)( | 433 | typedef void (*mir_platform_operation_callback)( |
2195 | 396 | MirConnection* connection, MirPlatformMessage* reply, void* context); | 434 | MirConnection* connection, MirPlatformMessage* reply, void* context); |
2196 | 397 | 435 | ||
2197 | 436 | /** | ||
2198 | 437 | * Callback called when a change of input devices has occurred | ||
2199 | 438 | * \param [in] connection The connection associated with the input device | ||
2200 | 439 | * change | ||
2201 | 440 | * \param [in,out] context The context provided by client | ||
2202 | 441 | */ | ||
2203 | 442 | |||
2204 | 443 | typedef void (*mir_input_config_callback)( | ||
2205 | 444 | MirConnection* connection, void* context); | ||
2206 | 445 | |||
2207 | 398 | #ifdef __cplusplus | 446 | #ifdef __cplusplus |
2208 | 399 | } | 447 | } |
2209 | 400 | /**@}*/ | 448 | /**@}*/ |
2210 | 401 | 449 | ||
2211 | === modified file 'include/client/mir_toolkit/events/event.h' | |||
2212 | --- include/client/mir_toolkit/events/event.h 2016-01-29 08:18:22 +0000 | |||
2213 | +++ include/client/mir_toolkit/events/event.h 2016-03-30 00:11:41 +0000 | |||
2214 | @@ -84,7 +84,7 @@ | |||
2215 | 84 | extern "C" { | 84 | extern "C" { |
2216 | 85 | #endif | 85 | #endif |
2217 | 86 | 86 | ||
2219 | 87 | /* | 87 | /** |
2220 | 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. |
2221 | 89 | * In particular ev->type will never be mir_event_type_input and mir_event_get_type | 89 | * In particular ev->type will never be mir_event_type_input and mir_event_get_type |
2222 | 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. |
2223 | @@ -94,7 +94,7 @@ | |||
2224 | 94 | */ | 94 | */ |
2225 | 95 | MirEventType mir_event_get_type(MirEvent const* ev); | 95 | MirEventType mir_event_get_type(MirEvent const* ev); |
2226 | 96 | 96 | ||
2228 | 97 | /* | 97 | /** |
2229 | 98 | * Retrieve the MirInputEvent associated with a MirEvent of | 98 | * Retrieve the MirInputEvent associated with a MirEvent of |
2230 | 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> |
2231 | 100 | * for accessors. | 100 | * for accessors. |
2232 | @@ -104,7 +104,7 @@ | |||
2233 | 104 | */ | 104 | */ |
2234 | 105 | MirInputEvent const* mir_event_get_input_event(MirEvent const* ev); | 105 | MirInputEvent const* mir_event_get_input_event(MirEvent const* ev); |
2235 | 106 | 106 | ||
2237 | 107 | /* | 107 | /** |
2238 | 108 | * Retrieve the MirSurfaceEvent associated with a MirEvent of | 108 | * Retrieve the MirSurfaceEvent associated with a MirEvent of |
2239 | 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> |
2240 | 110 | * for accessors. | 110 | * for accessors. |
2241 | @@ -114,7 +114,7 @@ | |||
2242 | 114 | */ | 114 | */ |
2243 | 115 | MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev); | 115 | MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* ev); |
2244 | 116 | 116 | ||
2246 | 117 | /* | 117 | /** |
2247 | 118 | * Retrieve the MirResizeEvent associated with a MirEvent of | 118 | * Retrieve the MirResizeEvent associated with a MirEvent of |
2248 | 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> |
2249 | 120 | * for accessors. | 120 | * for accessors. |
2250 | @@ -124,7 +124,7 @@ | |||
2251 | 124 | */ | 124 | */ |
2252 | 125 | MirResizeEvent const* mir_event_get_resize_event(MirEvent const* ev); | 125 | MirResizeEvent const* mir_event_get_resize_event(MirEvent const* ev); |
2253 | 126 | 126 | ||
2255 | 127 | /* | 127 | /** |
2256 | 128 | * Retrieve the MirPromptSessionEvent associated with a MirEvent of | 128 | * Retrieve the MirPromptSessionEvent associated with a MirEvent of |
2257 | 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> |
2258 | 130 | * for accessors. | 130 | * for accessors. |
2259 | @@ -134,7 +134,7 @@ | |||
2260 | 134 | */ | 134 | */ |
2261 | 135 | MirPromptSessionEvent const* mir_event_get_prompt_session_event(MirEvent const* ev); | 135 | MirPromptSessionEvent const* mir_event_get_prompt_session_event(MirEvent const* ev); |
2262 | 136 | 136 | ||
2264 | 137 | /* | 137 | /** |
2265 | 138 | * Retrieve the MirOrientationEvent associated with a MirEvent of | 138 | * Retrieve the MirOrientationEvent associated with a MirEvent of |
2266 | 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> |
2267 | 140 | * for accessors. | 140 | * for accessors. |
2268 | @@ -144,7 +144,7 @@ | |||
2269 | 144 | */ | 144 | */ |
2270 | 145 | MirOrientationEvent const* mir_event_get_orientation_event(MirEvent const* ev); | 145 | MirOrientationEvent const* mir_event_get_orientation_event(MirEvent const* ev); |
2271 | 146 | 146 | ||
2273 | 147 | /* | 147 | /** |
2274 | 148 | * Retrieve the MirCloseSurfaceEvent associated with a MirEvent of | 148 | * Retrieve the MirCloseSurfaceEvent associated with a MirEvent of |
2275 | 149 | * type mir_event_type_close_surface. The event is a request to close | 149 | * type mir_event_type_close_surface. The event is a request to close |
2276 | 150 | * the surface it is delivered to and has no accessors. | 150 | * the surface it is delivered to and has no accessors. |
2277 | @@ -160,7 +160,7 @@ | |||
2278 | 160 | __attribute__ ((deprecated)) | 160 | __attribute__ ((deprecated)) |
2279 | 161 | MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev); | 161 | MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* ev); |
2280 | 162 | 162 | ||
2282 | 163 | /* | 163 | /** |
2283 | 164 | * Retrieve the MirKeymapEvent associated with a MirEvent of | 164 | * Retrieve the MirKeymapEvent associated with a MirEvent of |
2284 | 165 | * type mir_event_type_keymap. The event signifies that the keymap | 165 | * type mir_event_type_keymap. The event signifies that the keymap |
2285 | 166 | * applied for the relevant surface has changed. | 166 | * applied for the relevant surface has changed. |
2286 | @@ -170,7 +170,7 @@ | |||
2287 | 170 | */ | 170 | */ |
2288 | 171 | MirKeymapEvent const* mir_event_get_keymap_event(MirEvent const* ev); | 171 | MirKeymapEvent const* mir_event_get_keymap_event(MirEvent const* ev); |
2289 | 172 | 172 | ||
2291 | 173 | /* | 173 | /** |
2292 | 174 | * Retrieve the MirInputConfiguration associated with a MirEvent of | 174 | * Retrieve the MirInputConfiguration associated with a MirEvent of |
2293 | 175 | * type mir_event_type_input_configuration. The event signifies that the | 175 | * type mir_event_type_input_configuration. The event signifies that the |
2294 | 176 | * input device configuration has changed. | 176 | * input device configuration has changed. |
2295 | @@ -213,7 +213,7 @@ | |||
2296 | 213 | * | 213 | * |
2297 | 214 | */ | 214 | */ |
2298 | 215 | 215 | ||
2300 | 216 | /* | 216 | /** |
2301 | 217 | * Reference this MirEvent and return a pointer to the | 217 | * Reference this MirEvent and return a pointer to the |
2302 | 218 | * newly referenced instance | 218 | * newly referenced instance |
2303 | 219 | * | 219 | * |
2304 | @@ -222,7 +222,7 @@ | |||
2305 | 222 | */ | 222 | */ |
2306 | 223 | MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result)); | 223 | MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result)); |
2307 | 224 | 224 | ||
2309 | 225 | /* | 225 | /** |
2310 | 226 | * Release a reference to a MirEvent. | 226 | * Release a reference to a MirEvent. |
2311 | 227 | * | 227 | * |
2312 | 228 | * \param[in] The event to un-reference | 228 | * \param[in] The event to un-reference |
2313 | 229 | 229 | ||
2314 | === modified file 'include/client/mir_toolkit/events/input/input_event.h' | |||
2315 | --- include/client/mir_toolkit/events/input/input_event.h 2016-01-29 08:18:22 +0000 | |||
2316 | +++ include/client/mir_toolkit/events/input/input_event.h 2016-03-30 00:11:41 +0000 | |||
2317 | @@ -82,7 +82,7 @@ | |||
2318 | 82 | extern "C" { | 82 | extern "C" { |
2319 | 83 | #endif | 83 | #endif |
2320 | 84 | 84 | ||
2322 | 85 | /* | 85 | /** |
2323 | 86 | * Retrieves the device id responsible for generating an input event. | 86 | * Retrieves the device id responsible for generating an input event. |
2324 | 87 | * | 87 | * |
2325 | 88 | * \param [in] event The input event | 88 | * \param [in] event The input event |
2326 | @@ -90,23 +90,23 @@ | |||
2327 | 90 | */ | 90 | */ |
2328 | 91 | MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* ev); | 91 | MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* ev); |
2329 | 92 | 92 | ||
2332 | 93 | /* | 93 | /** |
2333 | 94 | * Retrieve the time at which an input event occured. | 94 | * Retrieve the time at which an input event occurred. |
2334 | 95 | * | 95 | * |
2335 | 96 | * \param [in] event The input event | 96 | * \param [in] event The input event |
2336 | 97 | * \return A timestamp in nanoseconds-since-epoch | 97 | * \return A timestamp in nanoseconds-since-epoch |
2337 | 98 | */ | 98 | */ |
2338 | 99 | int64_t mir_input_event_get_event_time(MirInputEvent const* ev); | 99 | int64_t mir_input_event_get_event_time(MirInputEvent const* ev); |
2339 | 100 | 100 | ||
2342 | 101 | /* | 101 | /** |
2343 | 102 | * Retrieve the type of an input event (e.g. key, touch...) | 102 | * Retrieve the type of an input event. E.g. key, touch... |
2344 | 103 | * | 103 | * |
2345 | 104 | * \param [in] event The input event | 104 | * \param [in] event The input event |
2346 | 105 | * \return The input event type | 105 | * \return The input event type |
2347 | 106 | */ | 106 | */ |
2348 | 107 | MirInputEventType mir_input_event_get_type(MirInputEvent const* ev); | 107 | MirInputEventType mir_input_event_get_type(MirInputEvent const* ev); |
2349 | 108 | 108 | ||
2351 | 109 | /* | 109 | /** |
2352 | 110 | * Retrieve the MirKeyboardEvent associated with a given input event. | 110 | * Retrieve the MirKeyboardEvent associated with a given input event. |
2353 | 111 | * | 111 | * |
2354 | 112 | * \param[in] event The input event | 112 | * \param[in] event The input event |
2355 | @@ -115,7 +115,7 @@ | |||
2356 | 115 | */ | 115 | */ |
2357 | 116 | MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* ev); | 116 | MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* ev); |
2358 | 117 | 117 | ||
2360 | 118 | /* | 118 | /** |
2361 | 119 | * Retrieve the MirTouchEvent associated with a given input event. | 119 | * Retrieve the MirTouchEvent associated with a given input event. |
2362 | 120 | * | 120 | * |
2363 | 121 | * \param[in] event The input event | 121 | * \param[in] event The input event |
2364 | @@ -124,7 +124,7 @@ | |||
2365 | 124 | */ | 124 | */ |
2366 | 125 | MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* ev); | 125 | MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* ev); |
2367 | 126 | 126 | ||
2369 | 127 | /* | 127 | /** |
2370 | 128 | * Retrieve the MirPointerEvent associated with a given input event. | 128 | * Retrieve the MirPointerEvent associated with a given input event. |
2371 | 129 | * | 129 | * |
2372 | 130 | * \param[in] event The input event | 130 | * \param[in] event The input event |
2373 | @@ -133,14 +133,16 @@ | |||
2374 | 133 | */ | 133 | */ |
2375 | 134 | MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* ev); | 134 | MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* ev); |
2376 | 135 | 135 | ||
2378 | 136 | /* Query if an input event contains a cookie | 136 | /** |
2379 | 137 | * Query if an input event contains a cookie | ||
2380 | 137 | * | 138 | * |
2381 | 138 | * \params[in] ev The input event | 139 | * \params[in] ev The input event |
2382 | 139 | * \return True if the input event contains a cookie | 140 | * \return True if the input event contains a cookie |
2383 | 140 | */ | 141 | */ |
2384 | 141 | bool mir_input_event_has_cookie(MirInputEvent const* ev); | 142 | bool mir_input_event_has_cookie(MirInputEvent const* ev); |
2385 | 142 | 143 | ||
2387 | 143 | /* Returns the cookie associated with an input event. | 144 | /** |
2388 | 145 | * Returns the cookie associated with an input event. | ||
2389 | 144 | * | 146 | * |
2390 | 145 | * \pre The input event must have a MirCookie | 147 | * \pre The input event must have a MirCookie |
2391 | 146 | * \params[in] ev An input event | 148 | * \params[in] ev An input event |
2392 | 147 | 149 | ||
2393 | === modified file 'include/client/mir_toolkit/events/input/keyboard_event.h' | |||
2394 | --- include/client/mir_toolkit/events/input/keyboard_event.h 2016-01-29 08:18:22 +0000 | |||
2395 | +++ include/client/mir_toolkit/events/input/keyboard_event.h 2016-03-30 00:11:41 +0000 | |||
2396 | @@ -87,7 +87,7 @@ | |||
2397 | 87 | */ | 87 | */ |
2398 | 88 | MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const* event); | 88 | MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const* event); |
2399 | 89 | 89 | ||
2401 | 90 | /* | 90 | /** |
2402 | 91 | * Retrieve the corresponding input event. | 91 | * Retrieve the corresponding input event. |
2403 | 92 | * | 92 | * |
2404 | 93 | * \param [in] event The keyboard event | 93 | * \param [in] event The keyboard event |
2405 | 94 | 94 | ||
2406 | === modified file 'include/client/mir_toolkit/events/input/pointer_event.h' | |||
2407 | --- include/client/mir_toolkit/events/input/pointer_event.h 2016-02-24 13:04:14 +0000 | |||
2408 | +++ include/client/mir_toolkit/events/input/pointer_event.h 2016-03-30 00:11:41 +0000 | |||
2409 | @@ -130,7 +130,7 @@ | |||
2410 | 130 | float mir_pointer_event_axis_value(MirPointerEvent const* event, | 130 | float mir_pointer_event_axis_value(MirPointerEvent const* event, |
2411 | 131 | MirPointerAxis axis); | 131 | MirPointerAxis axis); |
2412 | 132 | 132 | ||
2414 | 133 | /* | 133 | /** |
2415 | 134 | * Retrieve the corresponding input event. | 134 | * Retrieve the corresponding input event. |
2416 | 135 | * | 135 | * |
2417 | 136 | * \param [in] event The pointer event | 136 | * \param [in] event The pointer event |
2418 | 137 | 137 | ||
2419 | === modified file 'include/client/mir_toolkit/events/input/touch_event.h' | |||
2420 | --- include/client/mir_toolkit/events/input/touch_event.h 2016-01-29 08:18:22 +0000 | |||
2421 | +++ include/client/mir_toolkit/events/input/touch_event.h 2016-03-30 00:11:41 +0000 | |||
2422 | @@ -141,7 +141,7 @@ | |||
2423 | 141 | float mir_touch_event_axis_value(MirTouchEvent const* event, | 141 | float mir_touch_event_axis_value(MirTouchEvent const* event, |
2424 | 142 | size_t touch_index, MirTouchAxis axis); | 142 | size_t touch_index, MirTouchAxis axis); |
2425 | 143 | 143 | ||
2427 | 144 | /* | 144 | /** |
2428 | 145 | * Retrieve the corresponding input event. | 145 | * Retrieve the corresponding input event. |
2429 | 146 | * | 146 | * |
2430 | 147 | * \param [in] event The touch event | 147 | * \param [in] event The touch event |
2431 | 148 | 148 | ||
2432 | === modified file 'include/client/mir_toolkit/events/input_configuration_event.h' | |||
2433 | --- include/client/mir_toolkit/events/input_configuration_event.h 2015-05-19 21:34:34 +0000 | |||
2434 | +++ include/client/mir_toolkit/events/input_configuration_event.h 2016-03-30 00:11:41 +0000 | |||
2435 | @@ -46,7 +46,7 @@ | |||
2436 | 46 | mir_input_configuration_action_device_reset | 46 | mir_input_configuration_action_device_reset |
2437 | 47 | } MirInputConfigurationAction; | 47 | } MirInputConfigurationAction; |
2438 | 48 | 48 | ||
2440 | 49 | /* | 49 | /** |
2441 | 50 | * Retrieve the input configuration action which occurred. | 50 | * Retrieve the input configuration action which occurred. |
2442 | 51 | * | 51 | * |
2443 | 52 | * \param[in] ev The input configuration event | 52 | * \param[in] ev The input configuration event |
2444 | @@ -54,7 +54,7 @@ | |||
2445 | 54 | */ | 54 | */ |
2446 | 55 | MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev); | 55 | MirInputConfigurationAction mir_input_configuration_event_get_action(MirInputConfigurationEvent const* ev); |
2447 | 56 | 56 | ||
2449 | 57 | /* | 57 | /** |
2450 | 58 | * Retreive the time associated with a MirInputConfiguration event | 58 | * Retreive the time associated with a MirInputConfiguration event |
2451 | 59 | 59 | ||
2452 | 60 | * \param[in] ev The input configuration event | 60 | * \param[in] ev The input configuration event |
2453 | @@ -62,7 +62,7 @@ | |||
2454 | 62 | */ | 62 | */ |
2455 | 63 | int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev); | 63 | int64_t mir_input_configuration_event_get_time(MirInputConfigurationEvent const* ev); |
2456 | 64 | 64 | ||
2458 | 65 | /* | 65 | /** |
2459 | 66 | * Retreive the device id associated with a MirInputConfiguration event | 66 | * Retreive the device id associated with a MirInputConfiguration event |
2460 | 67 | 67 | ||
2461 | 68 | * \param[in] ev The input configuration event | 68 | * \param[in] ev The input configuration event |
2462 | 69 | 69 | ||
2463 | === modified file 'include/client/mir_toolkit/events/keymap_event.h' | |||
2464 | --- include/client/mir_toolkit/events/keymap_event.h 2016-01-22 17:12:31 +0000 | |||
2465 | +++ include/client/mir_toolkit/events/keymap_event.h 2016-03-30 00:11:41 +0000 | |||
2466 | @@ -31,7 +31,7 @@ | |||
2467 | 31 | extern "C" { | 31 | extern "C" { |
2468 | 32 | #endif | 32 | #endif |
2469 | 33 | 33 | ||
2471 | 34 | /* | 34 | /** |
2472 | 35 | * Retrieve the new keymap reported by this MirKeymapEvent | 35 | * Retrieve the new keymap reported by this MirKeymapEvent |
2473 | 36 | * | 36 | * |
2474 | 37 | * \deprecated keymap credentials are no longer available use | 37 | * \deprecated keymap credentials are no longer available use |
2475 | @@ -44,7 +44,7 @@ | |||
2476 | 44 | struct xkb_rule_names* names) | 44 | struct xkb_rule_names* names) |
2477 | 45 | __attribute__ ((deprecated)); | 45 | __attribute__ ((deprecated)); |
2478 | 46 | 46 | ||
2480 | 47 | /* | 47 | /** |
2481 | 48 | * Retrieve the new keymap reported by this MirKeymapEvent | 48 | * Retrieve the new keymap reported by this MirKeymapEvent |
2482 | 49 | * | 49 | * |
2483 | 50 | * The keymap buffer is only valid while the MirKeymapEvent is valid. | 50 | * The keymap buffer is only valid while the MirKeymapEvent is valid. |
2484 | @@ -56,7 +56,7 @@ | |||
2485 | 56 | void mir_keymap_event_get_keymap_buffer(MirKeymapEvent const* ev, | 56 | void mir_keymap_event_get_keymap_buffer(MirKeymapEvent const* ev, |
2486 | 57 | char const** buffer, size_t *length); | 57 | char const** buffer, size_t *length); |
2487 | 58 | 58 | ||
2489 | 59 | /* | 59 | /** |
2490 | 60 | * Retrieve the device id the keymap reported by this MirKeymapEvent applies to | 60 | * Retrieve the device id the keymap reported by this MirKeymapEvent applies to |
2491 | 61 | * | 61 | * |
2492 | 62 | * \param[in] ev The keymap event | 62 | * \param[in] ev The keymap event |
2493 | 63 | 63 | ||
2494 | === modified file 'include/client/mir_toolkit/events/orientation_event.h' | |||
2495 | --- include/client/mir_toolkit/events/orientation_event.h 2014-12-09 00:43:43 +0000 | |||
2496 | +++ include/client/mir_toolkit/events/orientation_event.h 2016-03-30 00:11:41 +0000 | |||
2497 | @@ -29,7 +29,7 @@ | |||
2498 | 29 | extern "C" { | 29 | extern "C" { |
2499 | 30 | #endif | 30 | #endif |
2500 | 31 | 31 | ||
2502 | 32 | /* | 32 | /** |
2503 | 33 | * Retrieve the new orientation reported by this MirOrientationEvent | 33 | * Retrieve the new orientation reported by this MirOrientationEvent |
2504 | 34 | * | 34 | * |
2505 | 35 | * \param[in] ev The orientation event | 35 | * \param[in] ev The orientation event |
2506 | 36 | 36 | ||
2507 | === modified file 'include/client/mir_toolkit/events/prompt_session_event.h' | |||
2508 | --- include/client/mir_toolkit/events/prompt_session_event.h 2014-12-11 17:49:31 +0000 | |||
2509 | +++ include/client/mir_toolkit/events/prompt_session_event.h 2016-03-30 00:11:41 +0000 | |||
2510 | @@ -29,7 +29,7 @@ | |||
2511 | 29 | extern "C" { | 29 | extern "C" { |
2512 | 30 | #endif | 30 | #endif |
2513 | 31 | 31 | ||
2515 | 32 | /* | 32 | /** |
2516 | 33 | * Retrieve the new prompt session state reported by a given MirPromptSessionEvent | 33 | * Retrieve the new prompt session state reported by a given MirPromptSessionEvent |
2517 | 34 | * | 34 | * |
2518 | 35 | * \param [in] event The prompt session event | 35 | * \param [in] event The prompt session event |
2519 | 36 | 36 | ||
2520 | === modified file 'include/client/mir_toolkit/events/resize_event.h' | |||
2521 | --- include/client/mir_toolkit/events/resize_event.h 2014-12-11 17:49:31 +0000 | |||
2522 | +++ include/client/mir_toolkit/events/resize_event.h 2016-03-30 00:11:41 +0000 | |||
2523 | @@ -29,7 +29,7 @@ | |||
2524 | 29 | extern "C" { | 29 | extern "C" { |
2525 | 30 | #endif | 30 | #endif |
2526 | 31 | 31 | ||
2528 | 32 | /* | 32 | /** |
2529 | 33 | * Retrieve the new width reported by a given MirResizeEvent | 33 | * Retrieve the new width reported by a given MirResizeEvent |
2530 | 34 | * | 34 | * |
2531 | 35 | * \param[in] ev The resize event | 35 | * \param[in] ev The resize event |
2532 | @@ -37,7 +37,7 @@ | |||
2533 | 37 | */ | 37 | */ |
2534 | 38 | int mir_resize_event_get_width(MirResizeEvent const* ev); | 38 | int mir_resize_event_get_width(MirResizeEvent const* ev); |
2535 | 39 | 39 | ||
2537 | 40 | /* | 40 | /** |
2538 | 41 | * Retrieve the new height reported by a given MirResizeEvent | 41 | * Retrieve the new height reported by a given MirResizeEvent |
2539 | 42 | * | 42 | * |
2540 | 43 | * \param[in] ev The resize event | 43 | * \param[in] ev The resize event |
2541 | 44 | 44 | ||
2542 | === modified file 'include/client/mir_toolkit/events/surface_event.h' | |||
2543 | --- include/client/mir_toolkit/events/surface_event.h 2014-12-09 00:43:43 +0000 | |||
2544 | +++ include/client/mir_toolkit/events/surface_event.h 2016-03-30 00:11:41 +0000 | |||
2545 | @@ -29,7 +29,7 @@ | |||
2546 | 29 | extern "C" { | 29 | extern "C" { |
2547 | 30 | #endif | 30 | #endif |
2548 | 31 | 31 | ||
2550 | 32 | /* | 32 | /** |
2551 | 33 | * Retrieve the attribute index configured with a given MirSurfaceEvent | 33 | * Retrieve the attribute index configured with a given MirSurfaceEvent |
2552 | 34 | * | 34 | * |
2553 | 35 | * \param [in] Event The event | 35 | * \param [in] Event The event |
2554 | @@ -37,7 +37,7 @@ | |||
2555 | 37 | */ | 37 | */ |
2556 | 38 | MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev); | 38 | MirSurfaceAttrib mir_surface_event_get_attribute(MirSurfaceEvent const* ev); |
2557 | 39 | 39 | ||
2559 | 40 | /* | 40 | /** |
2560 | 41 | * Retrieve the new value of the associated attribute for a given MirSurfaceEvent | 41 | * Retrieve the new value of the associated attribute for a given MirSurfaceEvent |
2561 | 42 | * | 42 | * |
2562 | 43 | * \param [in] Event The event | 43 | * \param [in] Event The event |
2563 | 44 | 44 | ||
2564 | === modified file 'include/client/mir_toolkit/mir_client_library.h' | |||
2565 | --- include/client/mir_toolkit/mir_client_library.h 2016-01-22 05:26:25 +0000 | |||
2566 | +++ include/client/mir_toolkit/mir_client_library.h 2016-03-30 00:11:41 +0000 | |||
2567 | @@ -26,5 +26,7 @@ | |||
2568 | 26 | #include <mir_toolkit/mir_platform_message.h> | 26 | #include <mir_toolkit/mir_platform_message.h> |
2569 | 27 | #include <mir_toolkit/cursors.h> | 27 | #include <mir_toolkit/cursors.h> |
2570 | 28 | #include <mir_toolkit/mir_cookie.h> | 28 | #include <mir_toolkit/mir_cookie.h> |
2571 | 29 | #include <mir_toolkit/mir_display_configuration.h> | ||
2572 | 30 | #include <mir_toolkit/mir_input_device.h> | ||
2573 | 29 | 31 | ||
2574 | 30 | #endif /* MIR_CLIENT_LIBRARY_H */ | 32 | #endif /* MIR_CLIENT_LIBRARY_H */ |
2575 | 31 | 33 | ||
2576 | === modified file 'include/client/mir_toolkit/mir_connection.h' | |||
2577 | --- include/client/mir_toolkit/mir_connection.h 2016-01-29 08:18:22 +0000 | |||
2578 | +++ include/client/mir_toolkit/mir_connection.h 2016-03-30 00:11:41 +0000 | |||
2579 | @@ -145,6 +145,9 @@ | |||
2580 | 145 | 145 | ||
2581 | 146 | /** | 146 | /** |
2582 | 147 | * Query the display | 147 | * Query the display |
2583 | 148 | * | ||
2584 | 149 | * \deprecated Use mir_connection_create_display_configuration() instead. | ||
2585 | 150 | * | ||
2586 | 148 | * \warning return value must be destroyed via mir_display_config_destroy() | 151 | * \warning return value must be destroyed via mir_display_config_destroy() |
2587 | 149 | * \warning may return null if connection is invalid | 152 | * \warning may return null if connection is invalid |
2588 | 150 | * \param [in] connection The connection | 153 | * \param [in] connection The connection |
2589 | @@ -153,9 +156,20 @@ | |||
2590 | 153 | MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection); | 156 | MirDisplayConfiguration* mir_connection_create_display_config(MirConnection *connection); |
2591 | 154 | 157 | ||
2592 | 155 | /** | 158 | /** |
2593 | 159 | * Query the display | ||
2594 | 160 | * | ||
2595 | 161 | * \pre mir_connection_is_valid(connection) == true | ||
2596 | 162 | * \warning return value must be destroyed via mir_display_config_release() | ||
2597 | 163 | * | ||
2598 | 164 | * \param [in] connection The connection | ||
2599 | 165 | * \return structure that describes the display configuration | ||
2600 | 166 | */ | ||
2601 | 167 | MirDisplayConfig* mir_connection_create_display_configuration(MirConnection* connection); | ||
2602 | 168 | |||
2603 | 169 | /** | ||
2604 | 156 | * Register a callback to be called when the hardware display configuration changes | 170 | * Register a callback to be called when the hardware display configuration changes |
2605 | 157 | * | 171 | * |
2607 | 158 | * Once a change has occurred, you can use mir_connection_create_display_config to see | 172 | * Once a change has occurred, you can use mir_connection_create_display_configuration to see |
2608 | 159 | * the new configuration. | 173 | * the new configuration. |
2609 | 160 | * | 174 | * |
2610 | 161 | * \param [in] connection The connection | 175 | * \param [in] connection The connection |
2611 | @@ -266,6 +280,38 @@ | |||
2612 | 266 | MirPlatformMessage const* request, | 280 | MirPlatformMessage const* request, |
2613 | 267 | mir_platform_operation_callback callback, void* context); | 281 | mir_platform_operation_callback callback, void* context); |
2614 | 268 | 282 | ||
2615 | 283 | /** | ||
2616 | 284 | * Create a snapshot of the attached input devices and device configurations. | ||
2617 | 285 | * \warning return value must be destroyed via mir_input_config_destroy() | ||
2618 | 286 | * \warning may return null if connection is invalid | ||
2619 | 287 | * \param [in] connection The connection | ||
2620 | 288 | * \return structure that describes the input configuration | ||
2621 | 289 | */ | ||
2622 | 290 | MirInputConfig* mir_connection_create_input_config(MirConnection *connection); | ||
2623 | 291 | |||
2624 | 292 | /** | ||
2625 | 293 | * Release this snapshot of the input configuration. | ||
2626 | 294 | * This invalidates any pointers retrieved from this structure. | ||
2627 | 295 | * | ||
2628 | 296 | * \param [in] devices The input configuration | ||
2629 | 297 | */ | ||
2630 | 298 | void mir_input_config_destroy(MirInputConfig const* config); | ||
2631 | 299 | |||
2632 | 300 | /** | ||
2633 | 301 | * Register a callback to be called when the input devices change. | ||
2634 | 302 | * | ||
2635 | 303 | * Once a change has occurred, you can use mir_connection_create_input_config | ||
2636 | 304 | * to get an updated snapshot of the input device configuration. | ||
2637 | 305 | * | ||
2638 | 306 | * \param [in] connection The connection | ||
2639 | 307 | * \param [in] callback The function to be called when a change occurs | ||
2640 | 308 | * \param [in,out] context User data passed to the callback function | ||
2641 | 309 | */ | ||
2642 | 310 | void mir_connection_set_input_config_change_callback( | ||
2643 | 311 | MirConnection* connection, | ||
2644 | 312 | mir_input_config_callback callback, void* context); | ||
2645 | 313 | |||
2646 | 314 | |||
2647 | 269 | #ifdef __cplusplus | 315 | #ifdef __cplusplus |
2648 | 270 | } | 316 | } |
2649 | 271 | /**@}*/ | 317 | /**@}*/ |
2650 | 272 | 318 | ||
2651 | === modified file 'include/client/mir_toolkit/mir_cookie.h' | |||
2652 | --- include/client/mir_toolkit/mir_cookie.h 2016-01-25 13:41:23 +0000 | |||
2653 | +++ include/client/mir_toolkit/mir_cookie.h 2016-03-30 00:11:41 +0000 | |||
2654 | @@ -29,14 +29,16 @@ | |||
2655 | 29 | extern "C" { | 29 | extern "C" { |
2656 | 30 | #endif | 30 | #endif |
2657 | 31 | 31 | ||
2659 | 32 | /* Queries the size needed to serialize a given cookie | 32 | /** |
2660 | 33 | * Queries the size needed to serialize a given cookie | ||
2661 | 33 | * | 34 | * |
2662 | 34 | * \params[in] cookie A cookie instance | 35 | * \params[in] cookie A cookie instance |
2663 | 35 | * \return The size of the serialized representation of the given cookie | 36 | * \return The size of the serialized representation of the given cookie |
2664 | 36 | */ | 37 | */ |
2665 | 37 | size_t mir_cookie_buffer_size(MirCookie const* cookie); | 38 | size_t mir_cookie_buffer_size(MirCookie const* cookie); |
2666 | 38 | 39 | ||
2668 | 39 | /* Serializes a cookie into the given buffer | 40 | /** |
2669 | 41 | * Serializes a cookie into the given buffer | ||
2670 | 40 | * | 42 | * |
2671 | 41 | * \pre The size must be equal to mir_cookie_size | 43 | * \pre The size must be equal to mir_cookie_size |
2672 | 42 | * \params[in] cookie A cookie instance | 44 | * \params[in] cookie A cookie instance |
2673 | @@ -46,7 +48,8 @@ | |||
2674 | 46 | */ | 48 | */ |
2675 | 47 | void mir_cookie_to_buffer(MirCookie const* cookie, void* buffer, size_t size); | 49 | void mir_cookie_to_buffer(MirCookie const* cookie, void* buffer, size_t size); |
2676 | 48 | 50 | ||
2678 | 49 | /* Create a cookie from a serialized representation | 51 | /** |
2679 | 52 | * Create a cookie from a serialized representation | ||
2680 | 50 | * | 53 | * |
2681 | 51 | * \params[in] buffer The buffer containing a serialized cookie. | 54 | * \params[in] buffer The buffer containing a serialized cookie. |
2682 | 52 | * The buffer may be freed immediately after this call. | 55 | * The buffer may be freed immediately after this call. |
2683 | @@ -57,7 +60,8 @@ | |||
2684 | 57 | */ | 60 | */ |
2685 | 58 | MirCookie const* mir_cookie_from_buffer(void const* buffer, size_t size); | 61 | MirCookie const* mir_cookie_from_buffer(void const* buffer, size_t size); |
2686 | 59 | 62 | ||
2688 | 60 | /* Release the MirCookie | 63 | /** |
2689 | 64 | * Release the MirCookie | ||
2690 | 61 | * | 65 | * |
2691 | 62 | * \params[in] cookie The cookie to release | 66 | * \params[in] cookie The cookie to release |
2692 | 63 | */ | 67 | */ |
2693 | 64 | 68 | ||
2694 | === added file 'include/client/mir_toolkit/mir_display_configuration.h' | |||
2695 | --- include/client/mir_toolkit/mir_display_configuration.h 1970-01-01 00:00:00 +0000 | |||
2696 | +++ include/client/mir_toolkit/mir_display_configuration.h 2016-03-30 00:11:41 +0000 | |||
2697 | @@ -0,0 +1,386 @@ | |||
2698 | 1 | /* | ||
2699 | 2 | * Copyright © 2016 Canonical Ltd. | ||
2700 | 3 | * | ||
2701 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2702 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
2703 | 6 | * as published by the Free Software Foundation. | ||
2704 | 7 | * | ||
2705 | 8 | * This program is distributed in the hope that it will be useful, | ||
2706 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2707 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2708 | 11 | * GNU Lesser General Public License for more details. | ||
2709 | 12 | * | ||
2710 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
2711 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2712 | 15 | * | ||
2713 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
2714 | 17 | */ | ||
2715 | 18 | |||
2716 | 19 | #ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_ | ||
2717 | 20 | #define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_ | ||
2718 | 21 | |||
2719 | 22 | #include "client_types.h" | ||
2720 | 23 | |||
2721 | 24 | #ifdef __cplusplus | ||
2722 | 25 | extern "C" { | ||
2723 | 26 | #endif | ||
2724 | 27 | |||
2725 | 28 | /** | ||
2726 | 29 | * \addtogroup mir_toolkit | ||
2727 | 30 | * @{ | ||
2728 | 31 | */ | ||
2729 | 32 | |||
2730 | 33 | /** | ||
2731 | 34 | * A descriptor for a display mode. | ||
2732 | 35 | * | ||
2733 | 36 | * A display mode contains all the information necessary to drive a display. It | ||
2734 | 37 | * includes resolution and refresh rate, but also pixel clock, vsync and hsync | ||
2735 | 38 | * timings, and so on. | ||
2736 | 39 | */ | ||
2737 | 40 | typedef struct MirOutputMode MirOutputMode; | ||
2738 | 41 | |||
2739 | 42 | /** | ||
2740 | 43 | * Release resources associated with a MirDisplayConfig handle. | ||
2741 | 44 | * | ||
2742 | 45 | * \param [in] config The handle to release | ||
2743 | 46 | */ | ||
2744 | 47 | void mir_display_config_release(MirDisplayConfig* config); | ||
2745 | 48 | |||
2746 | 49 | /** | ||
2747 | 50 | * Get the maximum possible number of simultaneously active outputs this system | ||
2748 | 51 | * supports. | ||
2749 | 52 | * | ||
2750 | 53 | * \note There may be restrictions on the configuration required to achieve this | ||
2751 | 54 | * many active outputs. Typically the achievable number of simultaneously active | ||
2752 | 55 | * outputs is lower than this number. | ||
2753 | 56 | * | ||
2754 | 57 | * \param [in] config The configuration to query | ||
2755 | 58 | * \returns The maximum number of simultaneously active outputs | ||
2756 | 59 | * supportable at this time. | ||
2757 | 60 | */ | ||
2758 | 61 | int mir_display_config_get_max_simultaneous_outputs( | ||
2759 | 62 | MirDisplayConfig const* config); | ||
2760 | 63 | |||
2761 | 64 | /** | ||
2762 | 65 | * Get the number of outputs available in this display configuration. | ||
2763 | 66 | * | ||
2764 | 67 | * This returns the total number of outputs the system has. This includes both | ||
2765 | 68 | * enabled and disabled output connections, and is typically larger than the | ||
2766 | 69 | * value returned from mir_display_config_get_max_simultaneous_outputs(). | ||
2767 | 70 | * | ||
2768 | 71 | * Typically this will be constant over the lifetime of a client as devices | ||
2769 | 72 | * usually do not gain extra physical ports at runtime. However, hotpluggable | ||
2770 | 73 | * display devices exist and the number of virtual outputs may change at | ||
2771 | 74 | * runtime, so this should always be called to determine the number of outputs | ||
2772 | 75 | * to iterate over. | ||
2773 | 76 | * | ||
2774 | 77 | * \param [in] config The configuration to query | ||
2775 | 78 | * \returns The number of outputs available in this configuration. | ||
2776 | 79 | */ | ||
2777 | 80 | int mir_display_config_get_num_outputs(MirDisplayConfig const* config); | ||
2778 | 81 | |||
2779 | 82 | /** | ||
2780 | 83 | * Get a read-only handle to the index 'th output of this configuration | ||
2781 | 84 | * | ||
2782 | 85 | * \note The MirOutput handle is only valid while config is valid. | ||
2783 | 86 | * \pre 0 <= index < mir_display_config_get_num_outputs(config) | ||
2784 | 87 | * \param [in] config The configuration to query | ||
2785 | 88 | * \param [in] index The index of the output to get | ||
2786 | 89 | * \returns A read-only handle to a MirOutput within config which is valid | ||
2787 | 90 | * until mir_display_config_release(config) is called. | ||
2788 | 91 | */ | ||
2789 | 92 | MirOutput const* mir_display_config_get_output(MirDisplayConfig const* config, | ||
2790 | 93 | size_t index); | ||
2791 | 94 | |||
2792 | 95 | /** | ||
2793 | 96 | * Get the number of modes in the supported mode list of this output. | ||
2794 | 97 | * | ||
2795 | 98 | * The list of supported modes is retrieved from the hardware, possibly modified | ||
2796 | 99 | * by any applicable quirk tables, and may not be exhaustive. | ||
2797 | 100 | * | ||
2798 | 101 | * \param [in] output The MirOutput to query | ||
2799 | 102 | * \returns The number of modes in the supported mode list of output. | ||
2800 | 103 | */ | ||
2801 | 104 | int mir_output_get_num_modes(MirOutput const* output); | ||
2802 | 105 | |||
2803 | 106 | /** | ||
2804 | 107 | * Get a handle for a mode descriptor from the list of supported modes. | ||
2805 | 108 | * | ||
2806 | 109 | * The list of supported modes is retrieved from the hardware, possibly modified | ||
2807 | 110 | * by any applicable quirk tables, and may not be exhaustive. | ||
2808 | 111 | * | ||
2809 | 112 | * \pre 0 <= index < mir_output_get_num_modes(output) | ||
2810 | 113 | * \note The handle remains valid as long as output is valid. | ||
2811 | 114 | * | ||
2812 | 115 | * \param [in] output The MirOutput to query | ||
2813 | 116 | * \param [in] index The index of the mode to retrieve. | ||
2814 | 117 | * \returns A handle for a description of the supported mode. This is valid | ||
2815 | 118 | * for as long as output is valid. The return value is never null. | ||
2816 | 119 | */ | ||
2817 | 120 | MirOutputMode const* mir_output_get_mode(MirOutput const* output, size_t index); | ||
2818 | 121 | |||
2819 | 122 | /** | ||
2820 | 123 | * Get a handle to the output's preferred mode. | ||
2821 | 124 | * | ||
2822 | 125 | * This is provided by the output itself. For modern displays (LCD, OLED, etc) | ||
2823 | 126 | * it is typically a mode with the native resolution. | ||
2824 | 127 | * | ||
2825 | 128 | * An output may not have a preferred mode, in which case this call will return | ||
2826 | 129 | * NULL. | ||
2827 | 130 | * | ||
2828 | 131 | * \note The handle remains valid as long as output is valid. | ||
2829 | 132 | * | ||
2830 | 133 | * \param [in] output The MirOutput to query | ||
2831 | 134 | * \returns A handle for a description of the supported mode. This is valid | ||
2832 | 135 | * for as long as output is valid. If the output does not have a | ||
2833 | 136 | * preferred mode, it returns NULL. | ||
2834 | 137 | */ | ||
2835 | 138 | MirOutputMode const* mir_output_get_preferred_mode(MirOutput const* output); | ||
2836 | 139 | |||
2837 | 140 | /** | ||
2838 | 141 | * Get a handle to the output's current mode. | ||
2839 | 142 | * | ||
2840 | 143 | * An output may not have a current mode (for example, if it is disabled), in | ||
2841 | 144 | * which case this call will return NULL. | ||
2842 | 145 | * | ||
2843 | 146 | * \note The handle remains valid as long as output is valid. | ||
2844 | 147 | * | ||
2845 | 148 | * \param [in] output The MirOutput to query | ||
2846 | 149 | * \returns A handle for a description of the supported mode. This is valid | ||
2847 | 150 | * for as long as output is valid. If the output does not have a | ||
2848 | 151 | * current mode, it returns NULL. | ||
2849 | 152 | */ | ||
2850 | 153 | MirOutputMode const* mir_output_get_current_mode(MirOutput const* output); | ||
2851 | 154 | |||
2852 | 155 | /** | ||
2853 | 156 | * Get the number of pixel formats supported by this output | ||
2854 | 157 | * | ||
2855 | 158 | * \param [in] output The MirOutput to query | ||
2856 | 159 | * \returns The number of pixel formats for output. | ||
2857 | 160 | */ | ||
2858 | 161 | int mir_output_get_num_pixel_formats(MirOutput const* output); | ||
2859 | 162 | |||
2860 | 163 | /** | ||
2861 | 164 | * Get a pixel format from the list of supported formats | ||
2862 | 165 | * | ||
2863 | 166 | * \pre 0 <= index < mir_output_get_num_pixel_formats(output) | ||
2864 | 167 | * | ||
2865 | 168 | * \param [in] output The MirOutput to query | ||
2866 | 169 | * \param [in] index The index of the format to query | ||
2867 | 170 | * \returns The index 'th supported pixel format. | ||
2868 | 171 | */ | ||
2869 | 172 | MirPixelFormat mir_output_get_pixel_format(MirOutput const* output, | ||
2870 | 173 | size_t index); | ||
2871 | 174 | |||
2872 | 175 | /** | ||
2873 | 176 | * Get the current pixel format. | ||
2874 | 177 | * | ||
2875 | 178 | * \param [in] output The MirOutput to query | ||
2876 | 179 | * \returns The current pixel format. This may be mir_pixel_format_invalid | ||
2877 | 180 | * (for example, if the output is not currently enabled). | ||
2878 | 181 | */ | ||
2879 | 182 | MirPixelFormat mir_output_get_current_pixel_format(MirOutput const* output); | ||
2880 | 183 | |||
2881 | 184 | /** | ||
2882 | 185 | * Set the output format | ||
2883 | 186 | * | ||
2884 | 187 | * \param [in] output The MirOutput to modify | ||
2885 | 188 | * \param [in] format The MirPixelFormat to set | ||
2886 | 189 | */ | ||
2887 | 190 | void mir_output_set_pixel_format(MirOutput* output, MirPixelFormat format); | ||
2888 | 191 | |||
2889 | 192 | /** | ||
2890 | 193 | * Get the ID of an output | ||
2891 | 194 | * | ||
2892 | 195 | * This can be used to refer to the output in other parts of the API, such as | ||
2893 | 196 | * mir_surface_spec_set_fullscreen_on_output(). | ||
2894 | 197 | * | ||
2895 | 198 | * \param [in] output The MirOutput to query. | ||
2896 | 199 | * \returns The ID of output, which may be used to refer to it in other | ||
2897 | 200 | * parts of the API. | ||
2898 | 201 | */ | ||
2899 | 202 | int mir_output_get_id(MirOutput const* output); | ||
2900 | 203 | |||
2901 | 204 | /** | ||
2902 | 205 | * Get the physical connection type of an output. | ||
2903 | 206 | * | ||
2904 | 207 | * This is a best-effort determination, and may be incorrect. | ||
2905 | 208 | * | ||
2906 | 209 | * \param [in] output The MirOutput to query | ||
2907 | 210 | * \returns The type of the display connection, or mir_output_type_unknown | ||
2908 | 211 | * if it cannot be determined. | ||
2909 | 212 | */ | ||
2910 | 213 | MirOutputType mir_output_get_type(MirOutput const* output); | ||
2911 | 214 | |||
2912 | 215 | /** | ||
2913 | 216 | * Get the x coordinate of the top-left point of the output in the virtual | ||
2914 | 217 | * display space. | ||
2915 | 218 | * | ||
2916 | 219 | * Outputs can be thought of as viewports into a virtual display space. They may | ||
2917 | 220 | * freely overlap, coincide, or be disjoint as desired. | ||
2918 | 221 | * | ||
2919 | 222 | * Output orientation changes the orientation of the output rectangle in virtual | ||
2920 | 223 | * display space, but does not change its top-left corner. | ||
2921 | 224 | * | ||
2922 | 225 | * \param [in] output The MirOutput to query | ||
2923 | 226 | * \returns The x coordinate of the top-left point of the output in the | ||
2924 | 227 | * virtual display space. | ||
2925 | 228 | */ | ||
2926 | 229 | int mir_output_get_position_x(MirOutput const* output); | ||
2927 | 230 | |||
2928 | 231 | /** | ||
2929 | 232 | * Get the y coordinate of the top-left point of the output in the virtual | ||
2930 | 233 | * display space. | ||
2931 | 234 | * | ||
2932 | 235 | * Outputs can be thought of as viewports into a virtual display space. They may | ||
2933 | 236 | * freely overlap, coincide, or be disjoint as desired. | ||
2934 | 237 | * | ||
2935 | 238 | * Output orientation changes the orientation of the output rectangle in virtual | ||
2936 | 239 | * display space, but does not change its top-left corner. | ||
2937 | 240 | * | ||
2938 | 241 | * \param [in] output The MirOutput to query | ||
2939 | 242 | * \returns The y coordinate of the top-left point of the output in the | ||
2940 | 243 | * virtual display space. | ||
2941 | 244 | */ | ||
2942 | 245 | int mir_output_get_position_y(MirOutput const* output); | ||
2943 | 246 | |||
2944 | 247 | /** | ||
2945 | 248 | * Get whether there is a display physically connected to the output. | ||
2946 | 249 | * | ||
2947 | 250 | * This gives a best-effort determination of whether or not enabling this output | ||
2948 | 251 | * will result in an image being displayed to the user. | ||
2949 | 252 | * | ||
2950 | 253 | * The accuracy of this determination varies with connection type - for example, | ||
2951 | 254 | * for DisplayPort and HDMI connections a return value of | ||
2952 | 255 | * mir_output_connection_state_connected is usually a reliable indicator that | ||
2953 | 256 | * there is a powered-on display connected. | ||
2954 | 257 | * | ||
2955 | 258 | * VGA and DVI connectors can usually determine whether or not there is a | ||
2956 | 259 | * physically connected display, but cannot distinguish between a powered or | ||
2957 | 260 | * unpowered display. | ||
2958 | 261 | * | ||
2959 | 262 | * It is not always possible to determine whether or not there is a display | ||
2960 | 263 | * connected; in such cases mir_output_connection_state_unknown is returned. | ||
2961 | 264 | * | ||
2962 | 265 | * \param [in] output The MirOutput to query | ||
2963 | 266 | * \returns Whether there is a display connected to this output. | ||
2964 | 267 | */ | ||
2965 | 268 | MirOutputConnectionState mir_output_get_connection_state( | ||
2966 | 269 | MirOutput const* output); | ||
2967 | 270 | |||
2968 | 271 | /** | ||
2969 | 272 | * Get whether this output is enabled in the current configuration. | ||
2970 | 273 | * | ||
2971 | 274 | * \param [in] output the MirOutput to query | ||
2972 | 275 | * \returns Whether the output is enabled. | ||
2973 | 276 | */ | ||
2974 | 277 | bool mir_output_is_enabled(MirOutput const* output); | ||
2975 | 278 | |||
2976 | 279 | /** | ||
2977 | 280 | * Get the physical width of the connected display, in millimetres. | ||
2978 | 281 | * | ||
2979 | 282 | * A best-effort report of the physical width of the display connected to this | ||
2980 | 283 | * output. This is retrieved from the display hardware, possibly modified by any | ||
2981 | 284 | * applicable quirk tables. | ||
2982 | 285 | * | ||
2983 | 286 | * Where this information is unavailable or inapplicable (for example, | ||
2984 | 287 | * projectors), 0 is returned. | ||
2985 | 288 | * | ||
2986 | 289 | * \param [in] output the MirOutput to query | ||
2987 | 290 | * \returns Physical width of the connected display, in mm. | ||
2988 | 291 | */ | ||
2989 | 292 | int mir_output_get_physical_width_mm(MirOutput const* output); | ||
2990 | 293 | |||
2991 | 294 | /** | ||
2992 | 295 | * Get the physical height of the connected display, in millimetres. | ||
2993 | 296 | * | ||
2994 | 297 | * A best-effort report of the physical height of the display connected to this | ||
2995 | 298 | * output. This is retrieved from the display hardware, possibly modified by any | ||
2996 | 299 | * applicable quirk tables. | ||
2997 | 300 | * | ||
2998 | 301 | * Where this information is unavailable or inapplicable (for example, | ||
2999 | 302 | * projectors), 0 is returned. | ||
3000 | 303 | * | ||
3001 | 304 | * \param [in] output the MirOutput to query | ||
3002 | 305 | * \returns Physical height of the connected display, in mm. | ||
3003 | 306 | */ | ||
3004 | 307 | int mir_output_get_physical_height_mm(MirOutput const* output); | ||
3005 | 308 | |||
3006 | 309 | /** | ||
3007 | 310 | * Get the power state of a connected display. | ||
3008 | 311 | * | ||
3009 | 312 | * It is undefined which power state is returned for an output which is not | ||
3010 | 313 | * connected. | ||
3011 | 314 | * | ||
3012 | 315 | * \param [in] output The MirOutput to query | ||
3013 | 316 | * \returns The power state of the display connected to output. | ||
3014 | 317 | */ | ||
3015 | 318 | MirPowerMode mir_output_get_power_mode(MirOutput const* output); | ||
3016 | 319 | |||
3017 | 320 | /** | ||
3018 | 321 | * Get the orientation of a display. | ||
3019 | 322 | * | ||
3020 | 323 | * \param [in] output The MirOutput to query | ||
3021 | 324 | * \returns The orientation of output | ||
3022 | 325 | */ | ||
3023 | 326 | MirOrientation mir_output_get_orientation(MirOutput const* output); | ||
3024 | 327 | |||
3025 | 328 | /** | ||
3026 | 329 | * Get the scale-factor of a display | ||
3027 | 330 | * | ||
3028 | 331 | * The scale-factor specifies the conversion between logical pixels and physical pixels on this output. | ||
3029 | 332 | * | ||
3030 | 333 | * A surface with dimensions 200×100 on an output with scale-factor 2.0 will display 400x200 pixels | ||
3031 | 334 | * on this output, will display 300x150 pixels on an output with scale-factor 1.5, and so on. | ||
3032 | 335 | * | ||
3033 | 336 | * Where this calculation would result in a fractional number of pixels the floor is used, so a surface with | ||
3034 | 337 | * dimensions 101x100 on an output with scale-factor of 1.5 will display 151x150 pixels, not 152x150. | ||
3035 | 338 | * | ||
3036 | 339 | * \param [in] output The MirOutput to query | ||
3037 | 340 | * \returns The scale-factor of this monitor | ||
3038 | 341 | */ | ||
3039 | 342 | float mir_output_get_scale_factor(MirOutput const* output); | ||
3040 | 343 | |||
3041 | 344 | /** | ||
3042 | 345 | * Get the form-factor of a connected output. | ||
3043 | 346 | * | ||
3044 | 347 | * This call succeeds even if the output is not connected, but may return nonsense values. | ||
3045 | 348 | * | ||
3046 | 349 | * \param [in] output The MirOutput to query | ||
3047 | 350 | * \returns The form factor of this output | ||
3048 | 351 | */ | ||
3049 | 352 | MirFormFactor mir_output_get_form_factor(MirOutput const* output); | ||
3050 | 353 | |||
3051 | 354 | /** | ||
3052 | 355 | * Get the width, in pixels, of a MirOutputMode | ||
3053 | 356 | * | ||
3054 | 357 | * \note This is unaffected by the orientation of the output | ||
3055 | 358 | * | ||
3056 | 359 | * \param [in] mode The MirOutputMode to query | ||
3057 | 360 | * \returns The width, in pixels, of mode. | ||
3058 | 361 | */ | ||
3059 | 362 | int mir_output_mode_get_width(MirOutputMode const* mode); | ||
3060 | 363 | |||
3061 | 364 | /** Get the height, in pixels, of a MirOutputMode | ||
3062 | 365 | * | ||
3063 | 366 | * \note This is unaffected by the orientation of the output | ||
3064 | 367 | * | ||
3065 | 368 | * \param [in] mode The MirOutputMode to query | ||
3066 | 369 | * \returns The height, in pixels, of mode. | ||
3067 | 370 | */ | ||
3068 | 371 | int mir_output_mode_get_height(MirOutputMode const* mode); | ||
3069 | 372 | |||
3070 | 373 | /** Get the refresh rate, in Hz, of a MirOutputMode | ||
3071 | 374 | * | ||
3072 | 375 | * \param [in] mode The MirOutputMode to query | ||
3073 | 376 | * \returns The refresh rate, in Hz, of mode | ||
3074 | 377 | */ | ||
3075 | 378 | double mir_output_mode_get_refresh_rate(MirOutputMode const* mode); | ||
3076 | 379 | |||
3077 | 380 | /**@}*/ | ||
3078 | 381 | |||
3079 | 382 | #ifdef __cplusplus | ||
3080 | 383 | } | ||
3081 | 384 | #endif | ||
3082 | 385 | |||
3083 | 386 | #endif //MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_ | ||
3084 | 0 | 387 | ||
3085 | === modified file 'include/client/mir_toolkit/mir_input_device.h' | |||
3086 | --- include/client/mir_toolkit/mir_input_device.h 2016-01-29 08:18:22 +0000 | |||
3087 | +++ include/client/mir_toolkit/mir_input_device.h 2016-03-30 00:11:41 +0000 | |||
3088 | @@ -1,5 +1,5 @@ | |||
3089 | 1 | /* | 1 | /* |
3091 | 2 | * Copyright © 2015 Canonical Ltd. | 2 | * Copyright © 2015-2016 Canonical Ltd. |
3092 | 3 | * | 3 | * |
3093 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3094 | 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, |
3095 | @@ -18,6 +18,8 @@ | |||
3096 | 18 | #ifndef MIR_TOOLKIT_MIR_INPUT_DEVICE_H_ | 18 | #ifndef MIR_TOOLKIT_MIR_INPUT_DEVICE_H_ |
3097 | 19 | #define MIR_TOOLKIT_MIR_INPUT_DEVICE_H_ | 19 | #define MIR_TOOLKIT_MIR_INPUT_DEVICE_H_ |
3098 | 20 | 20 | ||
3099 | 21 | #include "mir_toolkit/client_types.h" | ||
3100 | 22 | |||
3101 | 21 | /** | 23 | /** |
3102 | 22 | * \addtogroup mir_toolkit | 24 | * \addtogroup mir_toolkit |
3103 | 23 | * @{ | 25 | * @{ |
3104 | @@ -64,6 +66,134 @@ | |||
3105 | 64 | } MirTouchpadScrollMode; | 66 | } MirTouchpadScrollMode; |
3106 | 65 | typedef unsigned int MirTouchpadScrollModes; | 67 | typedef unsigned int MirTouchpadScrollModes; |
3107 | 66 | 68 | ||
3108 | 69 | enum MirInputDeviceCapability | ||
3109 | 70 | { | ||
3110 | 71 | mir_input_device_capability_none = 0, | ||
3111 | 72 | mir_input_device_capability_pointer = 1<<1, | ||
3112 | 73 | mir_input_device_capability_keyboard = 1<<2, | ||
3113 | 74 | mir_input_device_capability_touchpad = 1<<3, | ||
3114 | 75 | mir_input_device_capability_touchscreen = 1<<4, | ||
3115 | 76 | mir_input_device_capability_gamepad = 1<<5, | ||
3116 | 77 | mir_input_device_capability_joystick = 1<<6, | ||
3117 | 78 | mir_input_device_capability_switch = 1<<7, | ||
3118 | 79 | mir_input_device_capability_multitouch = 1<<8, //! capable to detect multiple contacts | ||
3119 | 80 | mir_input_device_capability_alpha_numeric = 1<<9 //! offers enough keys for text entry | ||
3120 | 81 | }; | ||
3121 | 82 | typedef unsigned int MirInputDeviceCapabilities; | ||
3122 | 83 | |||
3123 | 84 | /** | ||
3124 | 85 | * Retrieve the number of available input devices. | ||
3125 | 86 | * | ||
3126 | 87 | * \param [in] config The input configuration snapshot | ||
3127 | 88 | * | ||
3128 | 89 | * \return Number of input devices | ||
3129 | 90 | */ | ||
3130 | 91 | size_t mir_input_config_device_count(MirInputConfig const* config); | ||
3131 | 92 | |||
3132 | 93 | /** | ||
3133 | 94 | * Retrieve the input device at given \a index. | ||
3134 | 95 | * | ||
3135 | 96 | * The pointer returned stays valid until mir_input_config_destroy | ||
3136 | 97 | * is called with \a config. | ||
3137 | 98 | * | ||
3138 | 99 | * \param [in] config The input configuration snapshot | ||
3139 | 100 | * \param [in] index The index of the input device to return. | ||
3140 | 101 | * \return input device | ||
3141 | 102 | */ | ||
3142 | 103 | MirInputDevice const* mir_input_config_get_device( | ||
3143 | 104 | MirInputConfig const* config, | ||
3144 | 105 | size_t index); | ||
3145 | 106 | |||
3146 | 107 | /** | ||
3147 | 108 | * Retrieve the input device by \a id. | ||
3148 | 109 | * | ||
3149 | 110 | * The MirInputDevice returned stays valid until mir_input_config_destroy | ||
3150 | 111 | * is called with \a config. If no device with the given \a id is found | ||
3151 | 112 | * NULL will be returned. | ||
3152 | 113 | * | ||
3153 | 114 | * \param [in] config The input configuration snapshot | ||
3154 | 115 | * \param [in] id The input device id to search for | ||
3155 | 116 | * | ||
3156 | 117 | * \return input device | ||
3157 | 118 | */ | ||
3158 | 119 | MirInputDevice const* mir_input_config_get_device_by_id( | ||
3159 | 120 | MirInputConfig const* config, | ||
3160 | 121 | MirInputDeviceId id); | ||
3161 | 122 | |||
3162 | 123 | /** | ||
3163 | 124 | * Retrieve the input device at given \a index. | ||
3164 | 125 | * | ||
3165 | 126 | * The pointer returned stays valid until mir_input_config_destroy | ||
3166 | 127 | * is called with \a config. | ||
3167 | 128 | * | ||
3168 | 129 | * \param [in] config The input configuration snapshot | ||
3169 | 130 | * \param [in] index The index of the input device to return. | ||
3170 | 131 | * \return input device | ||
3171 | 132 | */ | ||
3172 | 133 | MirInputDevice* mir_input_config_get_mutable_device( | ||
3173 | 134 | MirInputConfig* config, | ||
3174 | 135 | size_t index); | ||
3175 | 136 | |||
3176 | 137 | /** | ||
3177 | 138 | * Retrieve the input device by \a id. | ||
3178 | 139 | * | ||
3179 | 140 | * The MirInputDevice returned stays valid until mir_input_config_destroy | ||
3180 | 141 | * is called with \a config. If no device with the given \a id is found | ||
3181 | 142 | * NULL will be returned. | ||
3182 | 143 | * | ||
3183 | 144 | * \param [in] config The input configuration snapshot | ||
3184 | 145 | * \param [in] id The input device id to search for | ||
3185 | 146 | * | ||
3186 | 147 | * \return input device | ||
3187 | 148 | */ | ||
3188 | 149 | MirInputDevice* mir_input_config_get_mutable_device_by_id( | ||
3189 | 150 | MirInputConfig* config, | ||
3190 | 151 | MirInputDeviceId id); | ||
3191 | 152 | |||
3192 | 153 | /** | ||
3193 | 154 | * Retrieve the capabilities of the input device at the given index. | ||
3194 | 155 | * | ||
3195 | 156 | * \param [in] device The input device | ||
3196 | 157 | * | ||
3197 | 158 | * \return The capability flags of the input device | ||
3198 | 159 | */ | ||
3199 | 160 | MirInputDeviceCapabilities mir_input_device_get_capabilities( | ||
3200 | 161 | MirInputDevice const* device); | ||
3201 | 162 | |||
3202 | 163 | /** | ||
3203 | 164 | * Retrieve the device id of the input device. | ||
3204 | 165 | * The device id is a unique integer value, only valid while the device is | ||
3205 | 166 | * attached. The device id matches the device id attached every input event. | ||
3206 | 167 | * | ||
3207 | 168 | * \param [in] device The input device | ||
3208 | 169 | * | ||
3209 | 170 | * \return The device id of the input device | ||
3210 | 171 | */ | ||
3211 | 172 | MirInputDeviceId mir_input_device_get_id(MirInputDevice const* device); | ||
3212 | 173 | |||
3213 | 174 | /** | ||
3214 | 175 | * Retrieve the name of the input device. | ||
3215 | 176 | * The string pointed to will be valid as long as MirInputDevice is valid. | ||
3216 | 177 | * The name may be empty but never NULL. | ||
3217 | 178 | * | ||
3218 | 179 | * \param [in] device The input device | ||
3219 | 180 | * | ||
3220 | 181 | * \return The name of the input device | ||
3221 | 182 | */ | ||
3222 | 183 | char const* mir_input_device_get_name(MirInputDevice const* device); | ||
3223 | 184 | |||
3224 | 185 | /** | ||
3225 | 186 | * Retrieve the unique id of the input device. | ||
3226 | 187 | * The string pointed to will be valid as long as \a device is valid. | ||
3227 | 188 | * The value of the unique id of a given device should be valid across mir | ||
3228 | 189 | * connections session and servers of the same version. | ||
3229 | 190 | * | ||
3230 | 191 | * \param [in] device The input device | ||
3231 | 192 | * | ||
3232 | 193 | * \return The unique id of the input device | ||
3233 | 194 | */ | ||
3234 | 195 | char const* mir_input_device_get_unique_id(MirInputDevice const* device); | ||
3235 | 196 | |||
3236 | 67 | #ifdef __cplusplus | 197 | #ifdef __cplusplus |
3237 | 68 | } | 198 | } |
3238 | 69 | #endif | 199 | #endif |
3239 | 70 | 200 | ||
3240 | === modified file 'include/client/mir_toolkit/mir_surface.h' | |||
3241 | --- include/client/mir_toolkit/mir_surface.h 2016-01-29 08:18:22 +0000 | |||
3242 | +++ include/client/mir_toolkit/mir_surface.h 2016-03-30 00:11:41 +0000 | |||
3243 | @@ -494,6 +494,17 @@ | |||
3244 | 494 | MirRectangle const *rectangles, | 494 | MirRectangle const *rectangles, |
3245 | 495 | size_t n_rects); | 495 | size_t n_rects); |
3246 | 496 | 496 | ||
3247 | 497 | /** | ||
3248 | 498 | * Set the event handler to be called when events arrive for a surface. | ||
3249 | 499 | * \warning event_handler could be called from another thread. You must do | ||
3250 | 500 | * any locking appropriate to protect your data accessed in the | ||
3251 | 501 | * callback. There is also a chance that different events will be | ||
3252 | 502 | * called back in different threads, for the same surface, | ||
3253 | 503 | * simultaneously. | ||
3254 | 504 | * \param [in] spec The spec to accumulate the request in. | ||
3255 | 505 | * \param [in] callback The callback function | ||
3256 | 506 | * \param [in] context Additional argument to be passed to callback | ||
3257 | 507 | */ | ||
3258 | 497 | void mir_surface_spec_set_event_handler( | 508 | void mir_surface_spec_set_event_handler( |
3259 | 498 | MirSurfaceSpec* spec, | 509 | MirSurfaceSpec* spec, |
3260 | 499 | mir_surface_event_callback callback, | 510 | mir_surface_event_callback callback, |
3261 | @@ -766,13 +777,13 @@ | |||
3262 | 766 | */ | 777 | */ |
3263 | 767 | MirPersistentId* mir_persistent_id_from_string(char const* string_representation); | 778 | MirPersistentId* mir_persistent_id_from_string(char const* string_representation); |
3264 | 768 | 779 | ||
3272 | 769 | /* | 780 | /** |
3273 | 770 | * Attempts to raise the surface to the front. | 781 | * Attempts to raise the surface to the front. |
3274 | 771 | * | 782 | * |
3275 | 772 | * \param [in] surface The surface to raise | 783 | * \param [in] surface The surface to raise |
3276 | 773 | * \param [in] cookie A cookie instance obtained from an input event. | 784 | * \param [in] cookie A cookie instance obtained from an input event. |
3277 | 774 | * An invalid cookie will terminate the client connection. | 785 | * An invalid cookie will terminate the client connection. |
3278 | 775 | */ | 786 | */ |
3279 | 776 | void mir_surface_raise(MirSurface* surface, MirCookie const* cookie); | 787 | void mir_surface_raise(MirSurface* surface, MirCookie const* cookie); |
3280 | 777 | 788 | ||
3281 | 778 | #ifdef __cplusplus | 789 | #ifdef __cplusplus |
3282 | 779 | 790 | ||
3283 | === modified file 'include/client/mir_toolkit/version.h' | |||
3284 | --- include/client/mir_toolkit/version.h 2016-01-29 08:18:22 +0000 | |||
3285 | +++ include/client/mir_toolkit/version.h 2016-03-30 00:11:41 +0000 | |||
3286 | @@ -43,7 +43,7 @@ | |||
3287 | 43 | * | 43 | * |
3288 | 44 | * See also: http://semver.org/ | 44 | * See also: http://semver.org/ |
3289 | 45 | */ | 45 | */ |
3291 | 46 | #define MIR_CLIENT_MINOR_VERSION (2) | 46 | #define MIR_CLIENT_MINOR_VERSION (3) |
3292 | 47 | 47 | ||
3293 | 48 | /** | 48 | /** |
3294 | 49 | * MIR_CLIENT_MICRO_VERSION | 49 | * MIR_CLIENT_MICRO_VERSION |
3295 | 50 | 50 | ||
3296 | === modified file 'include/common/mir/logging/logger.h' | |||
3297 | --- include/common/mir/logging/logger.h 2016-01-29 08:18:22 +0000 | |||
3298 | +++ include/common/mir/logging/logger.h 2016-03-30 00:11:41 +0000 | |||
3299 | @@ -45,7 +45,15 @@ | |||
3300 | 45 | const std::string& message, | 45 | const std::string& message, |
3301 | 46 | const std::string& component) = 0; | 46 | const std::string& component) = 0; |
3302 | 47 | 47 | ||
3304 | 48 | virtual void log(char const* component, Severity severity, char const* format, ...); | 48 | /* |
3305 | 49 | * Those playing at home may wonder why we're saying the 4th argument is the format string, | ||
3306 | 50 | * when it's the 3rd argument in the signature. | ||
3307 | 51 | * | ||
3308 | 52 | * The answer, of course, is that the attribute doesn't know about the implicit | ||
3309 | 53 | * 'this' first parameter of C++! | ||
3310 | 54 | */ | ||
3311 | 55 | virtual void log(char const* component, Severity severity, char const* format, ...) | ||
3312 | 56 | __attribute__ ((format (printf, 4, 5))); | ||
3313 | 49 | 57 | ||
3314 | 50 | protected: | 58 | protected: |
3315 | 51 | Logger() {} | 59 | Logger() {} |
3316 | 52 | 60 | ||
3317 | === modified file 'include/server/mir/input/input_device_hub.h' | |||
3318 | --- include/server/mir/input/input_device_hub.h 2015-05-19 21:34:34 +0000 | |||
3319 | +++ include/server/mir/input/input_device_hub.h 2016-03-30 00:11:41 +0000 | |||
3320 | @@ -25,6 +25,7 @@ | |||
3321 | 25 | { | 25 | { |
3322 | 26 | namespace input | 26 | namespace input |
3323 | 27 | { | 27 | { |
3324 | 28 | class Device; | ||
3325 | 28 | class InputDeviceInfo; | 29 | class InputDeviceInfo; |
3326 | 29 | class InputDeviceObserver; | 30 | class InputDeviceObserver; |
3327 | 30 | 31 | ||
3328 | @@ -36,6 +37,7 @@ | |||
3329 | 36 | 37 | ||
3330 | 37 | virtual void add_observer(std::shared_ptr<InputDeviceObserver> const&) = 0; | 38 | virtual void add_observer(std::shared_ptr<InputDeviceObserver> const&) = 0; |
3331 | 38 | virtual void remove_observer(std::weak_ptr<InputDeviceObserver> const&) = 0; | 39 | virtual void remove_observer(std::weak_ptr<InputDeviceObserver> const&) = 0; |
3332 | 40 | virtual void for_each_input_device(std::function<void(Device const& device)> const& callback) = 0; | ||
3333 | 39 | 41 | ||
3334 | 40 | InputDeviceHub(InputDeviceHub const&) = delete; | 42 | InputDeviceHub(InputDeviceHub const&) = delete; |
3335 | 41 | InputDeviceHub& operator=(InputDeviceHub const&) = delete; | 43 | InputDeviceHub& operator=(InputDeviceHub const&) = delete; |
3336 | 42 | 44 | ||
3337 | === modified file 'include/server/mir/input/input_manager.h' | |||
3338 | --- include/server/mir/input/input_manager.h 2015-06-17 05:20:42 +0000 | |||
3339 | +++ include/server/mir/input/input_manager.h 2016-03-30 00:11:41 +0000 | |||
3340 | @@ -1,5 +1,5 @@ | |||
3341 | 1 | /* | 1 | /* |
3343 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012, 2016 Canonical Ltd. |
3344 | 3 | * | 3 | * |
3345 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3346 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU General Public License version 3, |
3347 | @@ -32,6 +32,8 @@ | |||
3348 | 32 | class InputManager | 32 | class InputManager |
3349 | 33 | { | 33 | { |
3350 | 34 | public: | 34 | public: |
3351 | 35 | // TODO Remove add_platform() when we next break mirserver ABI | ||
3352 | 36 | __attribute__ ((deprecated)) | ||
3353 | 35 | virtual void add_platform(std::shared_ptr<Platform> const& platform) = 0; | 37 | virtual void add_platform(std::shared_ptr<Platform> const& platform) = 0; |
3354 | 36 | virtual void start() = 0; | 38 | virtual void start() = 0; |
3355 | 37 | virtual void stop() = 0; | 39 | virtual void stop() = 0; |
3356 | 38 | 40 | ||
3357 | === modified file 'include/test/mir/test/display_config_matchers.h' | |||
3358 | --- include/test/mir/test/display_config_matchers.h 2016-01-29 08:18:22 +0000 | |||
3359 | +++ include/test/mir/test/display_config_matchers.h 2016-03-30 00:11:41 +0000 | |||
3360 | @@ -54,31 +54,60 @@ | |||
3361 | 54 | namespace test | 54 | namespace test |
3362 | 55 | { | 55 | { |
3363 | 56 | 56 | ||
3385 | 57 | bool compare_display_configurations(graphics::DisplayConfiguration const& display_config1, | 57 | bool compare_display_configurations( |
3386 | 58 | graphics::DisplayConfiguration const& display_config2); | 58 | testing::MatchResultListener* listener, |
3387 | 59 | 59 | graphics::DisplayConfiguration const& display_config1, | |
3388 | 60 | bool compare_display_configurations(MirDisplayConfiguration const& client_config, | 60 | graphics::DisplayConfiguration const& display_config2); |
3389 | 61 | graphics::DisplayConfiguration const& display_config); | 61 | |
3390 | 62 | 62 | bool compare_display_configurations( | |
3391 | 63 | bool compare_display_configurations(protobuf::DisplayConfiguration const& protobuf_config, | 63 | testing::MatchResultListener* listener, |
3392 | 64 | graphics::DisplayConfiguration const& display_config); | 64 | MirDisplayConfiguration const& client_config, |
3393 | 65 | 65 | graphics::DisplayConfiguration const& display_config); | |
3394 | 66 | bool compare_display_configurations(MirDisplayConfiguration const* client_config1, | 66 | |
3395 | 67 | MirDisplayConfiguration const* client_config2); | 67 | bool compare_display_configurations( |
3396 | 68 | 68 | testing::MatchResultListener* listener, | |
3397 | 69 | bool compare_display_configurations(MirDisplayConfiguration const& client_config, | 69 | protobuf::DisplayConfiguration const& protobuf_config, |
3398 | 70 | protobuf::DisplayConfiguration const& protobuf_config); | 70 | graphics::DisplayConfiguration const& display_config); |
3399 | 71 | 71 | ||
3400 | 72 | bool compare_display_configurations(graphics::DisplayConfiguration const& display_config1, | 72 | bool compare_display_configurations( |
3401 | 73 | MirDisplayConfiguration const* display_config2); | 73 | testing::MatchResultListener* listener, |
3402 | 74 | 74 | MirDisplayConfiguration const* client_config1, | |
3403 | 75 | 75 | MirDisplayConfiguration const* client_config2); | |
3404 | 76 | bool compare_display_configurations(MirDisplayConfiguration const* display_config2, | 76 | |
3405 | 77 | graphics::DisplayConfiguration const& display_config1); | 77 | bool compare_display_configurations( |
3406 | 78 | testing::MatchResultListener* listener, | ||
3407 | 79 | MirDisplayConfiguration const& client_config, | ||
3408 | 80 | protobuf::DisplayConfiguration const& protobuf_config); | ||
3409 | 81 | |||
3410 | 82 | bool compare_display_configurations( | ||
3411 | 83 | testing::MatchResultListener* listener, | ||
3412 | 84 | graphics::DisplayConfiguration const& display_config1, | ||
3413 | 85 | MirDisplayConfiguration const* display_config2); | ||
3414 | 86 | |||
3415 | 87 | |||
3416 | 88 | bool compare_display_configurations( | ||
3417 | 89 | testing::MatchResultListener* listener, | ||
3418 | 90 | MirDisplayConfiguration const* display_config2, | ||
3419 | 91 | graphics::DisplayConfiguration const& display_config1); | ||
3420 | 92 | |||
3421 | 93 | bool compare_display_configurations( | ||
3422 | 94 | testing::MatchResultListener* listener, | ||
3423 | 95 | MirDisplayConfig const* client_config, | ||
3424 | 96 | graphics::DisplayConfiguration const& server_config); | ||
3425 | 97 | |||
3426 | 98 | bool compare_display_configurations( | ||
3427 | 99 | testing::MatchResultListener* listener, | ||
3428 | 100 | graphics::DisplayConfiguration const& server_config, | ||
3429 | 101 | MirDisplayConfig const* client_config); | ||
3430 | 102 | |||
3431 | 103 | bool compare_display_configurations( | ||
3432 | 104 | testing::MatchResultListener* listener, | ||
3433 | 105 | MirDisplayConfig const* config1, | ||
3434 | 106 | MirDisplayConfig const* config2); | ||
3435 | 78 | 107 | ||
3436 | 79 | MATCHER_P(DisplayConfigMatches, config, "") | 108 | MATCHER_P(DisplayConfigMatches, config, "") |
3437 | 80 | { | 109 | { |
3439 | 81 | return compare_display_configurations(arg, config); | 110 | return compare_display_configurations(result_listener, arg, config); |
3440 | 82 | } | 111 | } |
3441 | 83 | 112 | ||
3442 | 84 | } | 113 | } |
3443 | 85 | 114 | ||
3444 | === added file 'include/test/mir/test/doubles/mock_input_device_hub.h' | |||
3445 | --- include/test/mir/test/doubles/mock_input_device_hub.h 1970-01-01 00:00:00 +0000 | |||
3446 | +++ include/test/mir/test/doubles/mock_input_device_hub.h 2016-03-30 00:11:41 +0000 | |||
3447 | @@ -0,0 +1,43 @@ | |||
3448 | 1 | /* | ||
3449 | 2 | * Copyright © 2016 Canonical Ltd. | ||
3450 | 3 | * | ||
3451 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
3452 | 5 | * under the terms of the GNU General Public License version 3, | ||
3453 | 6 | * as published by the Free Software Foundation. | ||
3454 | 7 | * | ||
3455 | 8 | * This program is distributed in the hope that it will be useful, | ||
3456 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3457 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3458 | 11 | * GNU General Public License for more details. | ||
3459 | 12 | * | ||
3460 | 13 | * You should have received a copy of the GNU General Public License | ||
3461 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3462 | 15 | * | ||
3463 | 16 | * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> | ||
3464 | 17 | */ | ||
3465 | 18 | |||
3466 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_ | ||
3467 | 20 | #define MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_ | ||
3468 | 21 | |||
3469 | 22 | #include "mir/input/input_device_hub.h" | ||
3470 | 23 | |||
3471 | 24 | namespace mir | ||
3472 | 25 | { | ||
3473 | 26 | namespace test | ||
3474 | 27 | { | ||
3475 | 28 | namespace doubles | ||
3476 | 29 | { | ||
3477 | 30 | |||
3478 | 31 | struct MockInputDeviceHub : input::InputDeviceHub | ||
3479 | 32 | { | ||
3480 | 33 | MOCK_METHOD1(add_observer, void(std::shared_ptr<input::InputDeviceObserver> const&)); | ||
3481 | 34 | MOCK_METHOD1(remove_observer, void(std::weak_ptr<input::InputDeviceObserver> const&)); | ||
3482 | 35 | MOCK_METHOD1(for_each_input_device, void(std::function<void(input::Device const&)> const&)); | ||
3483 | 36 | |||
3484 | 37 | }; | ||
3485 | 38 | |||
3486 | 39 | } | ||
3487 | 40 | } | ||
3488 | 41 | } | ||
3489 | 42 | |||
3490 | 43 | #endif | ||
3491 | 0 | 44 | ||
3492 | === removed file 'include/test/mir/test/doubles/mock_input_device_hub.h' | |||
3493 | --- include/test/mir/test/doubles/mock_input_device_hub.h 2016-03-02 13:21:10 +0000 | |||
3494 | +++ include/test/mir/test/doubles/mock_input_device_hub.h 1970-01-01 00:00:00 +0000 | |||
3495 | @@ -1,43 +0,0 @@ | |||
3496 | 1 | /* | ||
3497 | 2 | * Copyright © 2016 Canonical Ltd. | ||
3498 | 3 | * | ||
3499 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
3500 | 5 | * under the terms of the GNU General Public License version 3, | ||
3501 | 6 | * as published by the Free Software Foundation. | ||
3502 | 7 | * | ||
3503 | 8 | * This program is distributed in the hope that it will be useful, | ||
3504 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3505 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3506 | 11 | * GNU General Public License for more details. | ||
3507 | 12 | * | ||
3508 | 13 | * You should have received a copy of the GNU General Public License | ||
3509 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3510 | 15 | * | ||
3511 | 16 | * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> | ||
3512 | 17 | */ | ||
3513 | 18 | |||
3514 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_ | ||
3515 | 20 | #define MIR_TEST_DOUBLES_MOCK_INPUT_DEVICE_HUB_H_ | ||
3516 | 21 | |||
3517 | 22 | #include "mir/input/input_device_hub.h" | ||
3518 | 23 | |||
3519 | 24 | namespace mir | ||
3520 | 25 | { | ||
3521 | 26 | namespace test | ||
3522 | 27 | { | ||
3523 | 28 | namespace doubles | ||
3524 | 29 | { | ||
3525 | 30 | |||
3526 | 31 | struct MockInputDeviceHub : input::InputDeviceHub | ||
3527 | 32 | { | ||
3528 | 33 | MOCK_METHOD1(add_observer, void(std::shared_ptr<input::InputDeviceObserver> const&)); | ||
3529 | 34 | MOCK_METHOD1(remove_observer, void(std::weak_ptr<input::InputDeviceObserver> const&)); | ||
3530 | 35 | MOCK_METHOD1(for_each_input_device, void(std::function<void(std::shared_ptr<input::Device>const&)> const&)); | ||
3531 | 36 | |||
3532 | 37 | }; | ||
3533 | 38 | |||
3534 | 39 | } | ||
3535 | 40 | } | ||
3536 | 41 | } | ||
3537 | 42 | |||
3538 | 43 | #endif | ||
3539 | 44 | 0 | ||
3540 | === modified file 'include/test/mir/test/doubles/stub_display_configuration.h' | |||
3541 | --- include/test/mir/test/doubles/stub_display_configuration.h 2016-01-29 08:18:22 +0000 | |||
3542 | +++ include/test/mir/test/doubles/stub_display_configuration.h 2016-03-30 00:11:41 +0000 | |||
3543 | @@ -22,6 +22,7 @@ | |||
3544 | 22 | #include "mir/graphics/display_configuration.h" | 22 | #include "mir/graphics/display_configuration.h" |
3545 | 23 | 23 | ||
3546 | 24 | #include <vector> | 24 | #include <vector> |
3547 | 25 | #include <mir_toolkit/client_types.h> | ||
3548 | 25 | 26 | ||
3549 | 26 | namespace mir | 27 | namespace mir |
3550 | 27 | { | 28 | { |
3551 | @@ -37,6 +38,9 @@ | |||
3552 | 37 | 38 | ||
3553 | 38 | StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id, | 39 | StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id, |
3554 | 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); |
3555 | 41 | |||
3556 | 42 | StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id, | ||
3557 | 43 | std::vector<graphics::DisplayConfigurationMode> modes, std::vector<MirPixelFormat> formats); | ||
3558 | 40 | }; | 44 | }; |
3559 | 41 | 45 | ||
3560 | 42 | class StubDisplayConfig : public graphics::DisplayConfiguration | 46 | class StubDisplayConfig : public graphics::DisplayConfiguration |
3561 | 43 | 47 | ||
3562 | === added file 'include/test/mir/test/doubles/stub_input_device.h' | |||
3563 | --- include/test/mir/test/doubles/stub_input_device.h 1970-01-01 00:00:00 +0000 | |||
3564 | +++ include/test/mir/test/doubles/stub_input_device.h 2016-03-30 00:11:41 +0000 | |||
3565 | @@ -0,0 +1,82 @@ | |||
3566 | 1 | /* | ||
3567 | 2 | * Copyright © 2016 Canonical Ltd. | ||
3568 | 3 | * | ||
3569 | 4 | * This program is free software: you can redistribute it and/or modify | ||
3570 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
3571 | 6 | * published by the Free Software Foundation. | ||
3572 | 7 | * | ||
3573 | 8 | * This program is distributed in the hope that it will be useful, | ||
3574 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3575 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3576 | 11 | * GNU General Public License for more details. | ||
3577 | 12 | * | ||
3578 | 13 | * You should have received a copy of the GNU General Public License | ||
3579 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3580 | 15 | * | ||
3581 | 16 | * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com> | ||
3582 | 17 | */ | ||
3583 | 18 | |||
3584 | 19 | #ifndef MIR_TEST_DOUBLES_STUB_INPUT_DEVICE_H_ | ||
3585 | 20 | #define MIR_TEST_DOUBLES_STUB_INPUT_DEVICE_H_ | ||
3586 | 21 | |||
3587 | 22 | #include "mir/input/device.h" | ||
3588 | 23 | #include "mir/input/device_capability.h" | ||
3589 | 24 | #include "mir/input/pointer_configuration.h" | ||
3590 | 25 | #include "mir/input/touchpad_configuration.h" | ||
3591 | 26 | #include "mir/optional_value.h" | ||
3592 | 27 | |||
3593 | 28 | namespace mir | ||
3594 | 29 | { | ||
3595 | 30 | namespace test | ||
3596 | 31 | { | ||
3597 | 32 | namespace doubles | ||
3598 | 33 | { | ||
3599 | 34 | |||
3600 | 35 | struct StubDevice : input::Device | ||
3601 | 36 | { | ||
3602 | 37 | StubDevice(MirInputDeviceId id, input::DeviceCapabilities caps, std::string const& name, std::string const& unique_id) | ||
3603 | 38 | : device_id(id), device_capabilities(caps), device_name(name), device_unique_id(unique_id) {} | ||
3604 | 39 | |||
3605 | 40 | MirInputDeviceId id() const override | ||
3606 | 41 | { | ||
3607 | 42 | return device_id; | ||
3608 | 43 | } | ||
3609 | 44 | input::DeviceCapabilities capabilities() const override | ||
3610 | 45 | { | ||
3611 | 46 | return device_capabilities; | ||
3612 | 47 | } | ||
3613 | 48 | std::string name() const override | ||
3614 | 49 | { | ||
3615 | 50 | return device_name; | ||
3616 | 51 | } | ||
3617 | 52 | std::string unique_id() const override | ||
3618 | 53 | { | ||
3619 | 54 | return device_unique_id; | ||
3620 | 55 | } | ||
3621 | 56 | mir::optional_value<input::PointerConfiguration> pointer_configuration() const override | ||
3622 | 57 | { | ||
3623 | 58 | return {}; | ||
3624 | 59 | } | ||
3625 | 60 | void apply_pointer_configuration(input::PointerConfiguration const&) override | ||
3626 | 61 | { | ||
3627 | 62 | } | ||
3628 | 63 | |||
3629 | 64 | mir::optional_value<input::TouchpadConfiguration> touchpad_configuration() const override | ||
3630 | 65 | { | ||
3631 | 66 | return {}; | ||
3632 | 67 | } | ||
3633 | 68 | void apply_touchpad_configuration(input::TouchpadConfiguration const&) override | ||
3634 | 69 | { | ||
3635 | 70 | } | ||
3636 | 71 | |||
3637 | 72 | MirInputDeviceId device_id; | ||
3638 | 73 | input::DeviceCapabilities device_capabilities; | ||
3639 | 74 | std::string device_name; | ||
3640 | 75 | std::string device_unique_id; | ||
3641 | 76 | }; | ||
3642 | 77 | |||
3643 | 78 | } | ||
3644 | 79 | } | ||
3645 | 80 | } | ||
3646 | 81 | #endif | ||
3647 | 82 | |||
3648 | 0 | 83 | ||
3649 | === modified file 'include/test/mir/test/wait_condition.h' | |||
3650 | --- include/test/mir/test/wait_condition.h 2016-01-29 08:18:22 +0000 | |||
3651 | +++ include/test/mir/test/wait_condition.h 2016-03-30 00:11:41 +0000 | |||
3652 | @@ -58,6 +58,12 @@ | |||
3653 | 58 | return woken_; | 58 | return woken_; |
3654 | 59 | } | 59 | } |
3655 | 60 | 60 | ||
3656 | 61 | void reset() | ||
3657 | 62 | { | ||
3658 | 63 | std::lock_guard<std::mutex> ul(guard); | ||
3659 | 64 | woken_ = false; | ||
3660 | 65 | } | ||
3661 | 66 | |||
3662 | 61 | std::mutex guard; | 67 | std::mutex guard; |
3663 | 62 | std::condition_variable condition; | 68 | std::condition_variable condition; |
3664 | 63 | bool woken_; | 69 | bool woken_; |
3665 | 64 | 70 | ||
3666 | === modified file 'include/test/mir_test_framework/declarative_placement_window_manage_policy.h' | |||
3667 | --- include/test/mir_test_framework/declarative_placement_window_manage_policy.h 2016-01-29 08:18:22 +0000 | |||
3668 | +++ include/test/mir_test_framework/declarative_placement_window_manage_policy.h 2016-03-30 00:11:41 +0000 | |||
3669 | @@ -1,5 +1,5 @@ | |||
3670 | 1 | /* | 1 | /* |
3672 | 2 | * Copyright © 2014 Canonical Ltd. | 2 | * Copyright © 2014-2016 Canonical Ltd. |
3673 | 3 | * | 3 | * |
3674 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3675 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU General Public License version 3, |
3676 | @@ -38,7 +38,7 @@ | |||
3677 | 38 | { | 38 | { |
3678 | 39 | public: | 39 | public: |
3679 | 40 | DeclarativePlacementWindowManagerPolicy( | 40 | DeclarativePlacementWindowManagerPolicy( |
3681 | 41 | Tools* const tools, | 41 | mir::shell::WindowManagerTools* const tools, |
3682 | 42 | SurfaceGeometries const& positions_by_name, | 42 | SurfaceGeometries const& positions_by_name, |
3683 | 43 | std::shared_ptr<mir::shell::DisplayLayout> const& display_layout); | 43 | std::shared_ptr<mir::shell::DisplayLayout> const& display_layout); |
3684 | 44 | 44 | ||
3685 | 45 | 45 | ||
3686 | === modified file 'include/test/mir_test_framework/executable_path.h' | |||
3687 | --- include/test/mir_test_framework/executable_path.h 2016-01-29 08:18:22 +0000 | |||
3688 | +++ include/test/mir_test_framework/executable_path.h 2016-03-30 00:11:41 +0000 | |||
3689 | @@ -27,7 +27,7 @@ | |||
3690 | 27 | 27 | ||
3691 | 28 | std::string library_path(); | 28 | std::string library_path(); |
3692 | 29 | std::string server_platform_path(); | 29 | std::string server_platform_path(); |
3694 | 30 | std::string udev_recordings_path(); | 30 | std::string test_data_path(); |
3695 | 31 | std::string server_platform(std::string const& name); | 31 | std::string server_platform(std::string const& name); |
3696 | 32 | std::string server_input_platform(std::string const& name); | 32 | std::string server_input_platform(std::string const& name); |
3697 | 33 | std::string client_platform(std::string const& name); | 33 | std::string client_platform(std::string const& name); |
3698 | 34 | 34 | ||
3699 | === modified file 'include/test/mir_test_framework/fake_input_device.h' | |||
3700 | --- include/test/mir_test_framework/fake_input_device.h 2016-01-29 08:18:22 +0000 | |||
3701 | +++ include/test/mir_test_framework/fake_input_device.h 2016-03-30 00:11:41 +0000 | |||
3702 | @@ -30,8 +30,8 @@ | |||
3703 | 30 | { | 30 | { |
3704 | 31 | public: | 31 | public: |
3705 | 32 | /** | 32 | /** |
3708 | 33 | * Valid value range of simulated touch coordinates. The simulated coordinates will be remapped to the | 33 | * Valid value range of simulated touch coordinates. The simulated coordinates will be remapped to |
3709 | 34 | * the coorindates of the given input sink. | 34 | * the coordinates of the given input sink. |
3710 | 35 | * \{ | 35 | * \{ |
3711 | 36 | */ | 36 | */ |
3712 | 37 | static const int maximum_touch_axis_value = 0xFFFF; | 37 | static const int maximum_touch_axis_value = 0xFFFF; |
3713 | @@ -41,6 +41,8 @@ | |||
3714 | 41 | FakeInputDevice() = default; | 41 | FakeInputDevice() = default; |
3715 | 42 | virtual ~FakeInputDevice() = default; | 42 | virtual ~FakeInputDevice() = default; |
3716 | 43 | 43 | ||
3717 | 44 | |||
3718 | 45 | virtual void emit_device_removal() = 0; | ||
3719 | 44 | virtual void emit_runtime_error() = 0; | 46 | virtual void emit_runtime_error() = 0; |
3720 | 45 | virtual void emit_event(synthesis::KeyParameters const& key) = 0; | 47 | virtual void emit_event(synthesis::KeyParameters const& key) = 0; |
3721 | 46 | virtual void emit_event(synthesis::ButtonParameters const& button) = 0; | 48 | virtual void emit_event(synthesis::ButtonParameters const& button) = 0; |
3722 | 47 | 49 | ||
3723 | === modified file 'include/test/mir_test_framework/placement_applying_shell.h' | |||
3724 | --- include/test/mir_test_framework/placement_applying_shell.h 2016-01-29 08:18:22 +0000 | |||
3725 | +++ include/test/mir_test_framework/placement_applying_shell.h 2016-03-30 00:11:41 +0000 | |||
3726 | @@ -29,6 +29,8 @@ | |||
3727 | 29 | #include <vector> | 29 | #include <vector> |
3728 | 30 | #include <string> | 30 | #include <string> |
3729 | 31 | #include <map> | 31 | #include <map> |
3730 | 32 | #include <mutex> | ||
3731 | 33 | #include <condition_variable> | ||
3732 | 32 | 34 | ||
3733 | 33 | namespace mir_test_framework | 35 | namespace mir_test_framework |
3734 | 34 | { | 36 | { |
3735 | @@ -42,13 +44,24 @@ | |||
3736 | 42 | ClientInputRegions const& client_input_regions, | 44 | ClientInputRegions const& client_input_regions, |
3737 | 43 | ClientPositions const& client_positions); | 45 | ClientPositions const& client_positions); |
3738 | 44 | 46 | ||
3739 | 47 | ~PlacementApplyingShell(); | ||
3740 | 45 | mir::frontend::SurfaceId create_surface( | 48 | mir::frontend::SurfaceId create_surface( |
3741 | 46 | std::shared_ptr<mir::scene::Session> const& session, | 49 | std::shared_ptr<mir::scene::Session> const& session, |
3742 | 47 | mir::scene::SurfaceCreationParameters const& params, | 50 | mir::scene::SurfaceCreationParameters const& params, |
3743 | 48 | std::shared_ptr<mir::frontend::EventSink> const& sink) override; | 51 | std::shared_ptr<mir::frontend::EventSink> const& sink) override; |
3744 | 52 | |||
3745 | 53 | void modify_surface( | ||
3746 | 54 | std::shared_ptr<mir::scene::Session> const& session, | ||
3747 | 55 | std::shared_ptr<mir::scene::Surface> const& surface, | ||
3748 | 56 | mir::shell::SurfaceSpecification const& modifications) override; | ||
3749 | 57 | |||
3750 | 58 | bool wait_for_modify_surface(std::chrono::seconds timeout); | ||
3751 | 49 | private: | 59 | private: |
3752 | 50 | ClientInputRegions const& client_input_regions; | 60 | ClientInputRegions const& client_input_regions; |
3753 | 51 | ClientPositions const& client_positions; | 61 | ClientPositions const& client_positions; |
3754 | 62 | std::mutex mutex; | ||
3755 | 63 | std::condition_variable cv; | ||
3756 | 64 | bool modified {false}; | ||
3757 | 52 | }; | 65 | }; |
3758 | 53 | 66 | ||
3759 | 54 | } | 67 | } |
3760 | 55 | 68 | ||
3761 | === modified file 'playground/CMakeLists.txt' | |||
3762 | --- playground/CMakeLists.txt 2016-01-29 15:44:15 +0000 | |||
3763 | +++ playground/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
3764 | @@ -20,10 +20,11 @@ | |||
3765 | 20 | add_subdirectory(demo-shell/) | 20 | add_subdirectory(demo-shell/) |
3766 | 21 | 21 | ||
3767 | 22 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") | 22 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") |
3770 | 23 | mir_add_wrapped_executable(mir_demo_prerendered_frames | 23 | mir_add_wrapped_executable(mir_demo_client_prerendered_frames |
3771 | 24 | mir_demo_prerendered_frames.c | 24 | mir_demo_client_prerendered_frames.c |
3772 | 25 | ) | 25 | ) |
3773 | 26 | 26 | ||
3775 | 27 | target_link_libraries(mir_demo_prerendered_frames | 27 | target_link_libraries(mir_demo_client_prerendered_frames |
3776 | 28 | mirclient | 28 | mirclient |
3777 | 29 | m | ||
3778 | 29 | ) | 30 | ) |
3779 | 30 | 31 | ||
3780 | === renamed file 'playground/mir_demo_prerendered_frames.c' => 'playground/mir_demo_client_prerendered_frames.c' | |||
3781 | --- playground/mir_demo_prerendered_frames.c 2016-02-04 18:15:50 +0000 | |||
3782 | +++ playground/mir_demo_client_prerendered_frames.c 2016-03-30 00:11:41 +0000 | |||
3783 | @@ -22,29 +22,45 @@ | |||
3784 | 22 | #include <mir_toolkit/mir_surface.h> | 22 | #include <mir_toolkit/mir_surface.h> |
3785 | 23 | #include <mir_toolkit/mir_presentation_chain.h> | 23 | #include <mir_toolkit/mir_presentation_chain.h> |
3786 | 24 | #include <mir_toolkit/mir_buffer.h> | 24 | #include <mir_toolkit/mir_buffer.h> |
3787 | 25 | #include <mir_toolkit/version.h> | ||
3788 | 25 | #include <sys/types.h> | 26 | #include <sys/types.h> |
3789 | 26 | #include <signal.h> | 27 | #include <signal.h> |
3790 | 27 | #include <string.h> | 28 | #include <string.h> |
3791 | 28 | #include <pthread.h> | 29 | #include <pthread.h> |
3799 | 29 | 30 | #include <math.h> | |
3800 | 30 | void fill_buffer(MirBuffer* buffer, int shade, int min, int max) | 31 | #include <stdlib.h> |
3801 | 31 | { | 32 | #include <getopt.h> |
3802 | 32 | unsigned char val = (unsigned char) (((float) shade / (max-min)) + min) * 0xFF; | 33 | |
3803 | 33 | 34 | float distance(int x0, int y0, int x1, int y1) | |
3804 | 34 | MirGraphicsRegion* region = mir_buffer_acquire_region(buffer, mir_read_write); | 35 | { |
3805 | 35 | if (!region) | 36 | float dx = x1 - x0; |
3806 | 37 | float dy = y1 - y0; | ||
3807 | 38 | return sqrt((dx * dx + dy * dy)); | ||
3808 | 39 | } | ||
3809 | 40 | |||
3810 | 41 | void fill_buffer_with_centered_circle_abgr( | ||
3811 | 42 | MirBuffer* buffer, float radius, unsigned int fg, unsigned int bg) | ||
3812 | 43 | { | ||
3813 | 44 | MirGraphicsRegion region = mir_buffer_get_graphics_region(buffer, mir_read_write); | ||
3814 | 45 | if ((!region.vaddr) || (region.pixel_format != mir_pixel_format_abgr_8888)) | ||
3815 | 36 | return; | 46 | return; |
3819 | 37 | 47 | int const center_x = region.width / 2; | |
3820 | 38 | unsigned char* px = (unsigned char*) region->vaddr; | 48 | int const center_y = region.height / 2; |
3821 | 39 | for(int i = 0; i < region->height; i++) | 49 | unsigned char* vaddr = (unsigned char*) region.vaddr; |
3822 | 50 | for(int i = 0; i < region.height; i++) | ||
3823 | 40 | { | 51 | { |
3826 | 41 | px += region->stride; | 52 | unsigned int* pixel = (unsigned int*) vaddr; |
3827 | 42 | for(int j = 0; j < region->width; j++) | 53 | for(int j = 0; j < region.width ; j++) |
3828 | 43 | { | 54 | { |
3830 | 44 | px[j] = val; | 55 | int const centered_i = i - center_y; |
3831 | 56 | int const centered_j = j - center_x; | ||
3832 | 57 | if (distance(0,0, centered_i, centered_j) > radius) | ||
3833 | 58 | pixel[j] = bg; | ||
3834 | 59 | else | ||
3835 | 60 | pixel[j] = fg; | ||
3836 | 45 | } | 61 | } |
3837 | 62 | vaddr += region.stride; | ||
3838 | 46 | } | 63 | } |
3839 | 47 | mir_buffer_release_region(region); | ||
3840 | 48 | } | 64 | } |
3841 | 49 | 65 | ||
3842 | 50 | typedef struct SubmissionInfo | 66 | typedef struct SubmissionInfo |
3843 | @@ -55,9 +71,9 @@ | |||
3844 | 55 | pthread_cond_t cv; | 71 | pthread_cond_t cv; |
3845 | 56 | } SubmissionInfo; | 72 | } SubmissionInfo; |
3846 | 57 | 73 | ||
3848 | 58 | static void available_callback(MirPresentationChain* stream, MirBuffer* buffer, void* client_context) | 74 | static void available_callback(MirPresentationChain* chain, MirBuffer* buffer, void* client_context) |
3849 | 59 | { | 75 | { |
3851 | 60 | (void) stream; | 76 | (void)chain; |
3852 | 61 | SubmissionInfo* info = (SubmissionInfo*) client_context; | 77 | SubmissionInfo* info = (SubmissionInfo*) client_context; |
3853 | 62 | pthread_mutex_lock(&info->lock); | 78 | pthread_mutex_lock(&info->lock); |
3854 | 63 | info->available = 1; | 79 | info->available = 1; |
3855 | @@ -75,35 +91,82 @@ | |||
3856 | 75 | 91 | ||
3857 | 76 | int main(int argc, char** argv) | 92 | int main(int argc, char** argv) |
3858 | 77 | { | 93 | { |
3861 | 78 | (void) argc; | 94 | static char const *socket_file = NULL; |
3862 | 79 | (void) argv; | 95 | int arg = -1; |
3863 | 96 | int width = 400; | ||
3864 | 97 | int height = 400; | ||
3865 | 98 | while ((arg = getopt (argc, argv, "m:s:h:")) != -1) | ||
3866 | 99 | { | ||
3867 | 100 | switch (arg) | ||
3868 | 101 | { | ||
3869 | 102 | case 'm': | ||
3870 | 103 | socket_file = optarg; | ||
3871 | 104 | break; | ||
3872 | 105 | case 's': | ||
3873 | 106 | { | ||
3874 | 107 | unsigned int w, h; | ||
3875 | 108 | if (sscanf(optarg, "%ux%u", &w, &h) == 2) | ||
3876 | 109 | { | ||
3877 | 110 | width = w; | ||
3878 | 111 | height = h; | ||
3879 | 112 | } | ||
3880 | 113 | else | ||
3881 | 114 | { | ||
3882 | 115 | printf("Invalid size: %s, using default size\n", optarg); | ||
3883 | 116 | } | ||
3884 | 117 | break; | ||
3885 | 118 | } | ||
3886 | 119 | case 'h': | ||
3887 | 120 | case '?': | ||
3888 | 121 | default: | ||
3889 | 122 | puts(argv[0]); | ||
3890 | 123 | printf("Usage:\n"); | ||
3891 | 124 | printf(" -m <Mir server socket>\n"); | ||
3892 | 125 | printf(" -s WIDTHxHEIGHT of window\n"); | ||
3893 | 126 | printf(" -h help dialog\n"); | ||
3894 | 127 | return -1; | ||
3895 | 128 | } | ||
3896 | 129 | } | ||
3897 | 80 | 130 | ||
3898 | 81 | signal(SIGTERM, shutdown); | 131 | signal(SIGTERM, shutdown); |
3899 | 82 | signal(SIGINT, shutdown); | 132 | signal(SIGINT, shutdown); |
3900 | 83 | 133 | ||
3903 | 84 | int width = 20; | 134 | int displacement_x = 0; |
3904 | 85 | int height = 25; | 135 | int displacement_y = 0; |
3905 | 136 | unsigned int fg = 0xFF1448DD; | ||
3906 | 137 | unsigned int bg = 0xFF6F2177; | ||
3907 | 86 | MirPixelFormat format = mir_pixel_format_abgr_8888; | 138 | MirPixelFormat format = mir_pixel_format_abgr_8888; |
3908 | 87 | 139 | ||
3915 | 88 | MirConnection* connection = mir_connect_sync(NULL, "prerendered_frames"); | 140 | MirConnection* connection = mir_connect_sync(socket_file, "prerendered_frames"); |
3916 | 89 | 141 | if (!mir_connection_is_valid(connection)) | |
3917 | 90 | MirSurfaceSpec* spec = | 142 | { |
3918 | 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); |
3919 | 92 | MirSurface* surface = mir_surface_create_sync(spec); | 144 | return -1; |
3920 | 93 | mir_surface_spec_release(spec); | 145 | } |
3921 | 94 | 146 | ||
3922 | 95 | MirPresentationChain* chain = mir_connection_create_presentation_chain_sync(connection); | 147 | MirPresentationChain* chain = mir_connection_create_presentation_chain_sync(connection); |
3923 | 96 | if (!mir_presentation_chain_is_valid(chain)) | 148 | if (!mir_presentation_chain_is_valid(chain)) |
3924 | 149 | { | ||
3925 | 150 | printf("could not create MirPresentationChain\n"); | ||
3926 | 151 | |||
3927 | 152 | // TODO this is a frig to pass smoke tests until we support NBS by default | ||
3928 | 153 | #if (MIR_CLIENT_VERSION <= MIR_VERSION_NUMBER(3, 3, 0)) | ||
3929 | 154 | printf("This is currently an unreleased API - likely server support is switched off\n"); | ||
3930 | 155 | return 0; | ||
3931 | 156 | #else | ||
3932 | 97 | return -1; | 157 | return -1; |
3933 | 158 | #endif | ||
3934 | 159 | } | ||
3935 | 160 | |||
3936 | 161 | MirSurfaceSpec* spec = mir_connection_create_spec_for_normal_surface(connection, width, height, format); | ||
3937 | 162 | MirSurface* surface = mir_surface_create_sync(spec); | ||
3938 | 163 | mir_surface_spec_release(spec); | ||
3939 | 98 | 164 | ||
3940 | 99 | //reassociate for advanced control | 165 | //reassociate for advanced control |
3941 | 100 | MirBufferStreamInfo info; | ||
3942 | 101 | info.displacement_x = 0; | ||
3943 | 102 | info.displacement_y = 0; | ||
3944 | 103 | //will make this a union. | ||
3945 | 104 | info.stream = (MirBufferStream*) chain; | ||
3946 | 105 | spec = mir_create_surface_spec(connection); | 166 | spec = mir_create_surface_spec(connection); |
3948 | 106 | mir_surface_spec_set_streams(spec, &info, 1); | 167 | mir_surface_spec_add_presentation_chain( |
3949 | 168 | spec, width, height, displacement_x, displacement_y, chain); | ||
3950 | 169 | mir_surface_apply_spec(surface, spec); | ||
3951 | 107 | mir_surface_spec_release(spec); | 170 | mir_surface_spec_release(spec); |
3952 | 108 | 171 | ||
3953 | 109 | int num_prerendered_frames = 20; | 172 | int num_prerendered_frames = 20; |
3954 | @@ -123,11 +186,16 @@ | |||
3955 | 123 | pthread_mutex_lock(&buffer_available[i].lock); | 186 | pthread_mutex_lock(&buffer_available[i].lock); |
3956 | 124 | while(!buffer_available[i].buffer) | 187 | while(!buffer_available[i].buffer) |
3957 | 125 | pthread_cond_wait(&buffer_available[i].cv, &buffer_available[i].lock); | 188 | pthread_cond_wait(&buffer_available[i].cv, &buffer_available[i].lock); |
3959 | 126 | fill_buffer(buffer_available[i].buffer, i, 0, num_prerendered_frames); | 189 | |
3960 | 190 | float max_radius = distance(0, 0, width, height) / 2.0f; | ||
3961 | 191 | float radius_i = ((float) i + 1) / num_prerendered_frames * max_radius; | ||
3962 | 192 | fill_buffer_with_centered_circle_abgr(buffer_available[i].buffer, radius_i, fg, bg); | ||
3963 | 193 | |||
3964 | 127 | pthread_mutex_unlock(&buffer_available[i].lock); | 194 | pthread_mutex_unlock(&buffer_available[i].lock); |
3965 | 128 | } | 195 | } |
3966 | 129 | 196 | ||
3967 | 130 | int i = 0; | 197 | int i = 0; |
3968 | 198 | int inc = -1; | ||
3969 | 131 | while (rendering) | 199 | while (rendering) |
3970 | 132 | { | 200 | { |
3971 | 133 | MirBuffer* b; | 201 | MirBuffer* b; |
3972 | @@ -138,10 +206,11 @@ | |||
3973 | 138 | b = buffer_available[i].buffer; | 206 | b = buffer_available[i].buffer; |
3974 | 139 | pthread_mutex_unlock(&buffer_available[i].lock); | 207 | pthread_mutex_unlock(&buffer_available[i].lock); |
3975 | 140 | 208 | ||
3978 | 141 | if (!mir_presentation_chain_submit_buffer(chain, b)) | 209 | mir_presentation_chain_submit_buffer(chain, b); |
3977 | 142 | rendering = false; | ||
3979 | 143 | 210 | ||
3981 | 144 | i = (i + 1) % num_prerendered_frames; | 211 | if ((i == num_prerendered_frames - 1) || (i == 0)) |
3982 | 212 | inc *= -1; | ||
3983 | 213 | i = i + inc; | ||
3984 | 145 | } | 214 | } |
3985 | 146 | 215 | ||
3986 | 147 | for (i = 0u; i < num_prerendered_frames; i++) | 216 | for (i = 0u; i < num_prerendered_frames; i++) |
3987 | 148 | 217 | ||
3988 | === removed directory 'snappy' | |||
3989 | === removed file 'snappy/CMakeLists.txt' | |||
3990 | --- snappy/CMakeLists.txt 2015-03-23 04:13:45 +0000 | |||
3991 | +++ snappy/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
3992 | @@ -1,57 +0,0 @@ | |||
3993 | 1 | set(MIR_PKG_ARCH ${CMAKE_SYSTEM_PROCESSOR}) | ||
3994 | 2 | # FIXME: This is blank on armhf cross-compiles. But don't care right now. | ||
3995 | 3 | if ("${MIR_PKG_ARCH}" STREQUAL x86_64) | ||
3996 | 4 | set(MIR_PKG_ARCH amd64) | ||
3997 | 5 | endif() | ||
3998 | 6 | |||
3999 | 7 | configure_file(mir.package.yaml.in mir.package.yaml) | ||
4000 | 8 | configure_file(mir.framework.in mir.framework) | ||
4001 | 9 | configure_file(mir-demos.package.yaml.in mir-demos.package.yaml) | ||
4002 | 10 | |||
4003 | 11 | set(ARCH_LIB_DIR /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}) | ||
4004 | 12 | set(MIR_IMAGE ${CMAKE_BINARY_DIR}/mir-image) | ||
4005 | 13 | set(MIR_DEMOS_IMAGE ${CMAKE_BINARY_DIR}/mir-demos-image) | ||
4006 | 14 | |||
4007 | 15 | add_custom_target(snap | ||
4008 | 16 | # Create a clean stripped install tree | ||
4009 | 17 | COMMAND rm -rf ${MIR_IMAGE} ${MIR_DEMOS_IMAGE} | ||
4010 | 18 | COMMAND make -j8 -C ${CMAKE_BINARY_DIR} DESTDIR=${MIR_IMAGE} install/strip | ||
4011 | 19 | |||
4012 | 20 | COMMAND mv -f ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX}/lib ${MIR_IMAGE}/ | ||
4013 | 21 | COMMAND mv -f ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX}/bin ${MIR_DEMOS_IMAGE}/ | ||
4014 | 22 | |||
4015 | 23 | COMMAND mkdir ${MIR_IMAGE}/meta | ||
4016 | 24 | COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir.package.yaml ${MIR_IMAGE}/meta/package.yaml | ||
4017 | 25 | COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir.framework ${MIR_IMAGE}/meta/ | ||
4018 | 26 | COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/readme.md ${MIR_IMAGE}/meta/ | ||
4019 | 27 | COMMAND mkdir ${MIR_IMAGE}/bin | ||
4020 | 28 | COMMAND cp -p ${CMAKE_CURRENT_SOURCE_DIR}/mir-run ${MIR_IMAGE}/bin/ | ||
4021 | 29 | |||
4022 | 30 | COMMAND mkdir -p ${MIR_DEMOS_IMAGE}/meta | ||
4023 | 31 | COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/mir-demos.package.yaml ${MIR_DEMOS_IMAGE}/meta/package.yaml | ||
4024 | 32 | COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/readme.md ${MIR_DEMOS_IMAGE}/meta/ | ||
4025 | 33 | |||
4026 | 34 | # Remove bits of Mir we don't need | ||
4027 | 35 | COMMAND rm -rf ${MIR_IMAGE}/${CMAKE_INSTALL_PREFIX} | ||
4028 | 36 | |||
4029 | 37 | # Copy in the DRM libraries needed by Mesa | ||
4030 | 38 | COMMAND cp -vdp ${ARCH_LIB_DIR}/libdrm_*.so* ${MIR_IMAGE}/lib/ | ||
4031 | 39 | |||
4032 | 40 | # Search all the binaries and copy more libraries they need | ||
4033 | 41 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/copy-external-libs.sh ${MIR_IMAGE}/lib/ ${MIR_DEMOS_IMAGE}/bin/* ${MIR_IMAGE}/lib/* | ||
4034 | 42 | |||
4035 | 43 | # Copy in the Mesa DRI drivers | ||
4036 | 44 | COMMAND cp -Rdvp ${ARCH_LIB_DIR}/dri ${MIR_IMAGE}/ | ||
4037 | 45 | |||
4038 | 46 | # Remove duplicate libs already built-in to Ubuntu Core | ||
4039 | 47 | COMMAND rm -f ${MIR_IMAGE}/lib/libboost_program_options.so.1.55.0 | ||
4040 | 48 | COMMAND rm -f ${MIR_IMAGE}/lib/libstdc++.so.6 | ||
4041 | 49 | COMMAND rm -f ${MIR_IMAGE}/lib/libfreetype.so.6 | ||
4042 | 50 | COMMAND rm -f ${MIR_IMAGE}/lib/libunwind.so.8 | ||
4043 | 51 | COMMAND rm -f ${MIR_IMAGE}/lib/libffi.so.6 | ||
4044 | 52 | |||
4045 | 53 | COMMAND snappy build ${MIR_IMAGE} | ||
4046 | 54 | COMMAND snappy build ${MIR_DEMOS_IMAGE} | ||
4047 | 55 | COMMAND ls -l ${CMAKE_CURRENT_BINARY_DIR}/*.snap | ||
4048 | 56 | ) | ||
4049 | 57 | |||
4050 | 58 | 0 | ||
4051 | === removed file 'snappy/copy-external-libs.sh' | |||
4052 | --- snappy/copy-external-libs.sh 2015-03-20 09:22:35 +0000 | |||
4053 | +++ snappy/copy-external-libs.sh 1970-01-01 00:00:00 +0000 | |||
4054 | @@ -1,17 +0,0 @@ | |||
4055 | 1 | #!/bin/sh | ||
4056 | 2 | |||
4057 | 3 | dest=$1 | ||
4058 | 4 | shift | ||
4059 | 5 | paths=$* | ||
4060 | 6 | externs=`ldd $paths | | ||
4061 | 7 | awk '/.* => \/usr\/lib\// {print $3;}' | | ||
4062 | 8 | sort | | ||
4063 | 9 | grep -v libmir | | ||
4064 | 10 | uniq` | ||
4065 | 11 | |||
4066 | 12 | echo "External libs:" | ||
4067 | 13 | echo "~~~~~~~~~~~~~~~~~~~~" | ||
4068 | 14 | ls $externs | ||
4069 | 15 | echo "~~~~~~~~~~~~~~~~~~~~" | ||
4070 | 16 | |||
4071 | 17 | cp $externs $dest | ||
4072 | 18 | 0 | ||
4073 | === removed file 'snappy/mir-demos.package.yaml.in' | |||
4074 | --- snappy/mir-demos.package.yaml.in 2015-03-18 09:46:40 +0000 | |||
4075 | +++ snappy/mir-demos.package.yaml.in 1970-01-01 00:00:00 +0000 | |||
4076 | @@ -1,5 +0,0 @@ | |||
4077 | 1 | name: mir-demos | ||
4078 | 2 | version: @MIR_VERSION@ | ||
4079 | 3 | architecture: @MIR_PKG_ARCH@ | ||
4080 | 4 | # frameworks: mir # FIXME: LP: #1433489 | ||
4081 | 5 | |||
4082 | 6 | 0 | ||
4083 | === removed file 'snappy/mir-run' | |||
4084 | --- snappy/mir-run 2015-03-18 09:46:40 +0000 | |||
4085 | +++ snappy/mir-run 1970-01-01 00:00:00 +0000 | |||
4086 | @@ -1,14 +0,0 @@ | |||
4087 | 1 | #!/bin/sh | ||
4088 | 2 | |||
4089 | 3 | MIR_DIR=$SNAP_APP_PATH | ||
4090 | 4 | if [ -z "$MIR_DIR" ] ; then | ||
4091 | 5 | MIR_DIR=/apps/mir/current | ||
4092 | 6 | fi | ||
4093 | 7 | export MIR_DIR | ||
4094 | 8 | |||
4095 | 9 | export LIBGL_DRIVERS_PATH=$MIR_DIR/dri | ||
4096 | 10 | export MIR_SERVER_PLATFORM_PATH=$MIR_DIR/lib/mir/server-platform | ||
4097 | 11 | export MIR_CLIENT_PLATFORM_PATH=$MIR_DIR/lib/mir/client-platform | ||
4098 | 12 | export LD_LIBRARY_PATH=$MIR_DIR/lib | ||
4099 | 13 | |||
4100 | 14 | exec $* | ||
4101 | 15 | 0 | ||
4102 | === removed file 'snappy/mir.framework.in' | |||
4103 | --- snappy/mir.framework.in 2015-03-18 08:42:06 +0000 | |||
4104 | +++ snappy/mir.framework.in 1970-01-01 00:00:00 +0000 | |||
4105 | @@ -1,2 +0,0 @@ | |||
4106 | 1 | Base-Name: mir | ||
4107 | 2 | Base-Version: 0 | ||
4108 | 3 | 0 | ||
4109 | === removed file 'snappy/mir.package.yaml.in' | |||
4110 | --- snappy/mir.package.yaml.in 2015-03-18 09:46:40 +0000 | |||
4111 | +++ snappy/mir.package.yaml.in 1970-01-01 00:00:00 +0000 | |||
4112 | @@ -1,9 +0,0 @@ | |||
4113 | 1 | name: mir | ||
4114 | 2 | version: @MIR_VERSION@ | ||
4115 | 3 | architecture: @MIR_PKG_ARCH@ | ||
4116 | 4 | type: framework | ||
4117 | 5 | integration: | ||
4118 | 6 | framework: | ||
4119 | 7 | framework: meta/mir.framework | ||
4120 | 8 | mir-run: | ||
4121 | 9 | bin-path: bin/mir-run | ||
4122 | 10 | 0 | ||
4123 | === removed file 'snappy/readme.md' | |||
4124 | --- snappy/readme.md 2015-03-20 09:43:39 +0000 | |||
4125 | +++ snappy/readme.md 1970-01-01 00:00:00 +0000 | |||
4126 | @@ -1,3 +0,0 @@ | |||
4127 | 1 | Mir | ||
4128 | 2 | |||
4129 | 3 | This is an experimental Mir package. | ||
4130 | 4 | 0 | ||
4131 | === modified file 'src/CMakeLists.txt' | |||
4132 | --- src/CMakeLists.txt 2016-01-29 08:18:22 +0000 | |||
4133 | +++ src/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
4134 | @@ -28,10 +28,10 @@ | |||
4135 | 28 | add_subdirectory(gl/) | 28 | add_subdirectory(gl/) |
4136 | 29 | 29 | ||
4137 | 30 | add_executable(wrapper wrapper.c) | 30 | add_executable(wrapper wrapper.c) |
4142 | 31 | set_property(TARGET wrapper | 31 | target_compile_definitions(wrapper PUBLIC |
4143 | 32 | APPEND_STRING PROPERTY COMPILE_FLAGS " -DEXECUTABLE_FORMAT=\\\"%s.bin\\\"") | 32 | EXECUTABLE_FORMAT=\"%s.bin\" |
4144 | 33 | set_property(TARGET wrapper | 33 | _DEFAULT_SOURCE |
4145 | 34 | APPEND_STRING PROPERTY COMPILE_FLAGS " -D_DEFAULT_SOURCE -D_BSD_SOURCE") | 34 | _BSD_SOURCE) |
4146 | 35 | 35 | ||
4147 | 36 | set( | 36 | set( |
4148 | 37 | MIR_GENERATED_INCLUDE_DIRECTORIES | 37 | MIR_GENERATED_INCLUDE_DIRECTORIES |
4149 | 38 | 38 | ||
4150 | === modified file 'src/client/CMakeLists.txt' | |||
4151 | --- src/client/CMakeLists.txt 2016-02-12 04:02:11 +0000 | |||
4152 | +++ src/client/CMakeLists.txt 2016-03-30 00:11:41 +0000 | |||
4153 | @@ -52,6 +52,7 @@ | |||
4154 | 52 | mir_cookie.cpp | 52 | mir_cookie.cpp |
4155 | 53 | mir_connection.cpp | 53 | mir_connection.cpp |
4156 | 54 | mir_connection_api.cpp | 54 | mir_connection_api.cpp |
4157 | 55 | mir_input_device_api.cpp | ||
4158 | 55 | mir_wait_handle.cpp | 56 | mir_wait_handle.cpp |
4159 | 56 | mir_wait_api.cpp | 57 | mir_wait_api.cpp |
4160 | 57 | mir_surface.cpp | 58 | mir_surface.cpp |
4161 | @@ -76,12 +77,17 @@ | |||
4162 | 76 | buffer_vault.cpp | 77 | buffer_vault.cpp |
4163 | 77 | mir_buffer_stream_api.cpp | 78 | mir_buffer_stream_api.cpp |
4164 | 78 | error_stream.cpp | 79 | error_stream.cpp |
4165 | 80 | error_chain.cpp | ||
4166 | 79 | buffer.cpp | 81 | buffer.cpp |
4167 | 80 | presentation_chain.cpp | 82 | presentation_chain.cpp |
4168 | 81 | mir_presentation_chain_api.cpp | 83 | mir_presentation_chain_api.cpp |
4169 | 82 | mir_buffer_api.cpp | 84 | mir_buffer_api.cpp |
4170 | 85 | display_configuration_api.cpp | ||
4171 | 86 | protobuf_to_native_buffer.cpp | ||
4172 | 87 | buffer_factory.cpp | ||
4173 | 83 | ${MIR_CLIENT_SOURCES} | 88 | ${MIR_CLIENT_SOURCES} |
4174 | 84 | ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/events/surface_output_event.h | 89 | ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/events/surface_output_event.h |
4175 | 90 | ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/mir_display_configuration.h | ||
4176 | 85 | ) | 91 | ) |
4177 | 86 | 92 | ||
4178 | 87 | # Ensure protobuf C++ headers have been produced before | 93 | # Ensure protobuf C++ headers have been produced before |
4179 | 88 | 94 | ||
4180 | === modified file 'src/client/buffer.cpp' | |||
4181 | --- src/client/buffer.cpp 2016-02-10 18:44:17 +0000 | |||
4182 | +++ src/client/buffer.cpp 2016-03-30 00:11:41 +0000 | |||
4183 | @@ -16,6 +16,7 @@ | |||
4184 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4185 | 17 | */ | 17 | */ |
4186 | 18 | 18 | ||
4187 | 19 | #include "mir/client_buffer.h" | ||
4188 | 19 | #include "buffer.h" | 20 | #include "buffer.h" |
4189 | 20 | #include <boost/throw_exception.hpp> | 21 | #include <boost/throw_exception.hpp> |
4190 | 21 | 22 | ||
4191 | @@ -24,12 +25,16 @@ | |||
4192 | 24 | mcl::Buffer::Buffer( | 25 | mcl::Buffer::Buffer( |
4193 | 25 | mir_buffer_callback cb, void* context, | 26 | mir_buffer_callback cb, void* context, |
4194 | 26 | int buffer_id, | 27 | int buffer_id, |
4196 | 27 | std::shared_ptr<ClientBuffer> const& buffer) : | 28 | std::shared_ptr<ClientBuffer> const& buffer, |
4197 | 29 | MirPresentationChain* chain, | ||
4198 | 30 | MirBufferUsage usage) : | ||
4199 | 28 | cb(cb), | 31 | cb(cb), |
4200 | 29 | cb_context(context), | 32 | cb_context(context), |
4201 | 30 | buffer_id(buffer_id), | 33 | buffer_id(buffer_id), |
4202 | 31 | buffer(buffer), | 34 | buffer(buffer), |
4204 | 32 | owned(true) | 35 | owned(true), |
4205 | 36 | chain(chain), | ||
4206 | 37 | usage(usage) | ||
4207 | 33 | { | 38 | { |
4208 | 34 | cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context); | 39 | cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context); |
4209 | 35 | } | 40 | } |
4210 | @@ -41,16 +46,73 @@ | |||
4211 | 41 | 46 | ||
4212 | 42 | void mcl::Buffer::submitted() | 47 | void mcl::Buffer::submitted() |
4213 | 43 | { | 48 | { |
4214 | 49 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
4215 | 44 | if (!owned) | 50 | if (!owned) |
4216 | 45 | BOOST_THROW_EXCEPTION(std::logic_error("cannot submit unowned buffer")); | 51 | BOOST_THROW_EXCEPTION(std::logic_error("cannot submit unowned buffer")); |
4217 | 52 | mapped_region.reset(); | ||
4218 | 46 | owned = false; | 53 | owned = false; |
4219 | 47 | } | 54 | } |
4220 | 48 | 55 | ||
4222 | 49 | void mcl::Buffer::received() | 56 | void mcl::Buffer::received(MirBufferPackage const& update_package) |
4223 | 50 | { | 57 | { |
4224 | 58 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
4225 | 51 | if (!owned) | 59 | if (!owned) |
4226 | 52 | { | 60 | { |
4227 | 53 | owned = true; | 61 | owned = true; |
4228 | 62 | buffer->update_from(update_package); | ||
4229 | 54 | cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context); | 63 | cb(nullptr, reinterpret_cast<MirBuffer*>(this), cb_context); |
4230 | 55 | } | 64 | } |
4231 | 56 | } | 65 | } |
4232 | 66 | |||
4233 | 67 | MirGraphicsRegion mcl::Buffer::map_region() | ||
4234 | 68 | { | ||
4235 | 69 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
4236 | 70 | mapped_region = buffer->secure_for_cpu_write(); | ||
4237 | 71 | return MirGraphicsRegion { | ||
4238 | 72 | mapped_region->width.as_int(), | ||
4239 | 73 | mapped_region->height.as_int(), | ||
4240 | 74 | mapped_region->stride.as_int(), | ||
4241 | 75 | mapped_region->format, | ||
4242 | 76 | mapped_region->vaddr.get() | ||
4243 | 77 | }; | ||
4244 | 78 | } | ||
4245 | 79 | |||
4246 | 80 | MirNativeBuffer* mcl::Buffer::as_mir_native_buffer() const | ||
4247 | 81 | { | ||
4248 | 82 | return buffer->as_mir_native_buffer(); | ||
4249 | 83 | } | ||
4250 | 84 | |||
4251 | 85 | void mcl::Buffer::set_fence(MirNativeFence* native_fence, MirBufferAccess access) | ||
4252 | 86 | { | ||
4253 | 87 | buffer->set_fence(native_fence, access); | ||
4254 | 88 | } | ||
4255 | 89 | |||
4256 | 90 | MirNativeFence* mcl::Buffer::get_fence() const | ||
4257 | 91 | { | ||
4258 | 92 | return buffer->get_fence(); | ||
4259 | 93 | } | ||
4260 | 94 | |||
4261 | 95 | bool mcl::Buffer::wait_fence(MirBufferAccess access, std::chrono::nanoseconds timeout) | ||
4262 | 96 | { | ||
4263 | 97 | return buffer->wait_fence(access, timeout); | ||
4264 | 98 | } | ||
4265 | 99 | |||
4266 | 100 | MirPresentationChain* mcl::Buffer::allocating_chain() const | ||
4267 | 101 | { | ||
4268 | 102 | return chain; | ||
4269 | 103 | } | ||
4270 | 104 | |||
4271 | 105 | MirBufferUsage mcl::Buffer::buffer_usage() const | ||
4272 | 106 | { | ||
4273 | 107 | return usage; | ||
4274 | 108 | } | ||
4275 | 109 | |||
4276 | 110 | MirPixelFormat mcl::Buffer::pixel_format() const | ||
4277 | 111 | { | ||
4278 | 112 | return buffer->pixel_format(); | ||
4279 | 113 | } | ||
4280 | 114 | |||
4281 | 115 | mir::geometry::Size mcl::Buffer::size() const | ||
4282 | 116 | { | ||
4283 | 117 | return buffer->size(); | ||
4284 | 118 | } | ||
4285 | 57 | 119 | ||
4286 | === modified file 'src/client/buffer.h' | |||
4287 | --- src/client/buffer.h 2016-02-11 03:04:05 +0000 | |||
4288 | +++ src/client/buffer.h 2016-03-30 00:11:41 +0000 | |||
4289 | @@ -21,12 +21,15 @@ | |||
4290 | 21 | 21 | ||
4291 | 22 | #include "mir_toolkit/mir_buffer.h" | 22 | #include "mir_toolkit/mir_buffer.h" |
4292 | 23 | #include <memory> | 23 | #include <memory> |
4293 | 24 | #include <chrono> | ||
4294 | 25 | #include <mutex> | ||
4295 | 24 | 26 | ||
4296 | 25 | namespace mir | 27 | namespace mir |
4297 | 26 | { | 28 | { |
4298 | 27 | namespace client | 29 | namespace client |
4299 | 28 | { | 30 | { |
4300 | 29 | class ClientBuffer; | 31 | class ClientBuffer; |
4301 | 32 | class MemoryRegion; | ||
4302 | 30 | //this is the type backing MirBuffer* | 33 | //this is the type backing MirBuffer* |
4303 | 31 | class Buffer | 34 | class Buffer |
4304 | 32 | { | 35 | { |
4305 | @@ -34,17 +37,37 @@ | |||
4306 | 34 | Buffer( | 37 | Buffer( |
4307 | 35 | mir_buffer_callback cb, void* context, | 38 | mir_buffer_callback cb, void* context, |
4308 | 36 | int buffer_id, | 39 | int buffer_id, |
4310 | 37 | std::shared_ptr<ClientBuffer> const& buffer); | 40 | std::shared_ptr<ClientBuffer> const& buffer, |
4311 | 41 | MirPresentationChain* chain, | ||
4312 | 42 | MirBufferUsage usage); | ||
4313 | 38 | int rpc_id() const; | 43 | int rpc_id() const; |
4314 | 39 | 44 | ||
4315 | 40 | void submitted(); | 45 | void submitted(); |
4317 | 41 | void received(); | 46 | void received(MirBufferPackage const& update_message); |
4318 | 47 | |||
4319 | 48 | MirNativeBuffer* as_mir_native_buffer() const; | ||
4320 | 49 | MirGraphicsRegion map_region(); | ||
4321 | 50 | |||
4322 | 51 | void set_fence(MirNativeFence*, MirBufferAccess); | ||
4323 | 52 | MirNativeFence* get_fence() const; | ||
4324 | 53 | bool wait_fence(MirBufferAccess, std::chrono::nanoseconds); | ||
4325 | 54 | |||
4326 | 55 | MirBufferUsage buffer_usage() const; | ||
4327 | 56 | MirPixelFormat pixel_format() const; | ||
4328 | 57 | geometry::Size size() const; | ||
4329 | 58 | |||
4330 | 59 | MirPresentationChain* allocating_chain() const; | ||
4331 | 42 | private: | 60 | private: |
4332 | 43 | mir_buffer_callback cb; | 61 | mir_buffer_callback cb; |
4333 | 44 | void* cb_context; | 62 | void* cb_context; |
4334 | 45 | int const buffer_id; | 63 | int const buffer_id; |
4335 | 46 | std::shared_ptr<ClientBuffer> buffer; | 64 | std::shared_ptr<ClientBuffer> buffer; |
4336 | 65 | |||
4337 | 66 | std::mutex mutex; | ||
4338 | 47 | bool owned; | 67 | bool owned; |
4339 | 68 | std::shared_ptr<MemoryRegion> mapped_region; | ||
4340 | 69 | MirPresentationChain* const chain; | ||
4341 | 70 | MirBufferUsage const usage; | ||
4342 | 48 | }; | 71 | }; |
4343 | 49 | } | 72 | } |
4344 | 50 | } | 73 | } |
4345 | 51 | 74 | ||
4346 | === added file 'src/client/buffer_factory.cpp' | |||
4347 | --- src/client/buffer_factory.cpp 1970-01-01 00:00:00 +0000 | |||
4348 | +++ src/client/buffer_factory.cpp 2016-03-30 00:11:41 +0000 | |||
4349 | @@ -0,0 +1,79 @@ | |||
4350 | 1 | /* | ||
4351 | 2 | * Copyright © 2016 Canonical Ltd. | ||
4352 | 3 | * | ||
4353 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4354 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4355 | 6 | * as published by the Free Software Foundation. | ||
4356 | 7 | * | ||
4357 | 8 | * This program is distributed in the hope that it will be useful, | ||
4358 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4359 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4360 | 11 | * GNU Lesser General Public License for more details. | ||
4361 | 12 | * | ||
4362 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4363 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4364 | 15 | * | ||
4365 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
4366 | 17 | */ | ||
4367 | 18 | |||
4368 | 19 | #include "mir/client_buffer_factory.h" | ||
4369 | 20 | #include "buffer_factory.h" | ||
4370 | 21 | #include <algorithm> | ||
4371 | 22 | #include <boost/throw_exception.hpp> | ||
4372 | 23 | #include "protobuf_to_native_buffer.h" | ||
4373 | 24 | |||
4374 | 25 | namespace mcl = mir::client; | ||
4375 | 26 | namespace geom = mir::geometry; | ||
4376 | 27 | |||
4377 | 28 | mcl::BufferFactory::AllocationRequest::AllocationRequest( | ||
4378 | 29 | std::shared_ptr<mcl::ClientBufferFactory> const& native_buffer_factory, | ||
4379 | 30 | MirPresentationChain* chain, | ||
4380 | 31 | geom::Size size, MirPixelFormat format, MirBufferUsage usage, | ||
4381 | 32 | mir_buffer_callback cb, void* cb_context) : | ||
4382 | 33 | native_buffer_factory(native_buffer_factory), | ||
4383 | 34 | chain(chain), | ||
4384 | 35 | size(size), | ||
4385 | 36 | format(format), | ||
4386 | 37 | usage(usage), | ||
4387 | 38 | cb(cb), | ||
4388 | 39 | cb_context(cb_context) | ||
4389 | 40 | { | ||
4390 | 41 | } | ||
4391 | 42 | |||
4392 | 43 | void mcl::BufferFactory::expect_buffer( | ||
4393 | 44 | std::shared_ptr<mcl::ClientBufferFactory> const& factory, | ||
4394 | 45 | MirPresentationChain* chain, | ||
4395 | 46 | geometry::Size size, | ||
4396 | 47 | MirPixelFormat format, | ||
4397 | 48 | MirBufferUsage usage, | ||
4398 | 49 | mir_buffer_callback cb, | ||
4399 | 50 | void* cb_context) | ||
4400 | 51 | { | ||
4401 | 52 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
4402 | 53 | allocation_requests.emplace_back( | ||
4403 | 54 | std::make_unique<AllocationRequest>(factory, chain, size, format, usage, cb, cb_context)); | ||
4404 | 55 | } | ||
4405 | 56 | |||
4406 | 57 | std::unique_ptr<mcl::Buffer> mcl::BufferFactory::generate_buffer(mir::protobuf::Buffer const& buffer) | ||
4407 | 58 | { | ||
4408 | 59 | std::lock_guard<decltype(mutex)> lk(mutex); | ||
4409 | 60 | auto request_it = std::find_if(allocation_requests.begin(), allocation_requests.end(), | ||
4410 | 61 | [&buffer](std::unique_ptr<AllocationRequest> const& it) | ||
4411 | 62 | { | ||
4412 | 63 | return geom::Size{buffer.width(), buffer.height()} == it->size; | ||
4413 | 64 | }); | ||
4414 | 65 | |||
4415 | 66 | if (request_it == allocation_requests.end()) | ||
4416 | 67 | BOOST_THROW_EXCEPTION(std::logic_error("unrequested buffer received")); | ||
4417 | 68 | |||
4418 | 69 | auto b = std::make_unique<Buffer>( | ||
4419 | 70 | (*request_it)->cb, (*request_it)->cb_context, | ||
4420 | 71 | buffer.buffer_id(), | ||
4421 | 72 | (*request_it)->native_buffer_factory->create_buffer( | ||
4422 | 73 | mcl::protobuf_to_native_buffer(buffer), | ||
4423 | 74 | (*request_it)->size, (*request_it)->format), | ||
4424 | 75 | (*request_it)->chain, (*request_it)->usage); | ||
4425 | 76 | |||
4426 | 77 | allocation_requests.erase(request_it); | ||
4427 | 78 | return std::move(b); | ||
4428 | 79 | } | ||
4429 | 0 | 80 | ||
4430 | === added file 'src/client/buffer_factory.h' | |||
4431 | --- src/client/buffer_factory.h 1970-01-01 00:00:00 +0000 | |||
4432 | +++ src/client/buffer_factory.h 2016-03-30 00:11:41 +0000 | |||
4433 | @@ -0,0 +1,91 @@ | |||
4434 | 1 | /* | ||
4435 | 2 | * Copyright © 2016 Canonical Ltd. | ||
4436 | 3 | * | ||
4437 | 4 | * This program is free software: you can redistribute it and/or modify | ||
4438 | 5 | * it under the terms of the GNU Lesser General Public License version 3 as | ||
4439 | 6 | * published by the Free Software Foundation. | ||
4440 | 7 | * | ||
4441 | 8 | * This program is distributed in the hope that it will be useful, | ||
4442 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4443 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4444 | 11 | * GNU Lesser General Public License for more details. | ||
4445 | 12 | * | ||
4446 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4447 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4448 | 15 | * | ||
4449 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
4450 | 17 | */ | ||
4451 | 18 | |||
4452 | 19 | #ifndef MIR_CLIENT_MIR_BUFFER_FACTORY_H | ||
4453 | 20 | #define MIR_CLIENT_MIR_BUFFER_FACTORY_H | ||
4454 | 21 | |||
4455 | 22 | #include "mir/geometry/size.h" | ||
4456 | 23 | #include "mir_protobuf.pb.h" | ||
4457 | 24 | #include "buffer.h" | ||
4458 | 25 | #include <mutex> | ||
4459 | 26 | #include <memory> | ||
4460 | 27 | |||
4461 | 28 | namespace mir | ||
4462 | 29 | { | ||
4463 | 30 | namespace client | ||
4464 | 31 | { | ||
4465 | 32 | class ClientBufferFactory; | ||
4466 | 33 | class AsyncBufferFactory | ||
4467 | 34 | { | ||
4468 | 35 | public: | ||
4469 | 36 | virtual ~AsyncBufferFactory() = default; | ||
4470 | 37 | AsyncBufferFactory() = default; | ||
4471 | 38 | |||
4472 | 39 | virtual std::unique_ptr<Buffer> generate_buffer(mir::protobuf::Buffer const& buffer) = 0; | ||
4473 | 40 | virtual void expect_buffer( | ||
4474 | 41 | std::shared_ptr<ClientBufferFactory> const& native_buffer_factory, | ||
4475 | 42 | MirPresentationChain* chain, | ||
4476 | 43 | geometry::Size size, | ||
4477 | 44 | MirPixelFormat format, | ||
4478 | 45 | MirBufferUsage usage, | ||
4479 | 46 | mir_buffer_callback cb, | ||
4480 | 47 | void* cb_context) = 0; | ||
4481 | 48 | private: | ||
4482 | 49 | AsyncBufferFactory(AsyncBufferFactory const&) = delete; | ||
4483 | 50 | AsyncBufferFactory& operator=(AsyncBufferFactory const&) = delete; | ||
4484 | 51 | }; | ||
4485 | 52 | |||
4486 | 53 | class BufferFactory : public AsyncBufferFactory | ||
4487 | 54 | { | ||
4488 | 55 | public: | ||
4489 | 56 | std::unique_ptr<Buffer> generate_buffer(mir::protobuf::Buffer const& buffer) override; | ||
4490 | 57 | void expect_buffer( | ||
4491 | 58 | std::shared_ptr<ClientBufferFactory> const& native_buffer_factory, | ||
4492 | 59 | MirPresentationChain* chain, | ||
4493 | 60 | geometry::Size size, | ||
4494 | 61 | MirPixelFormat format, | ||
4495 | 62 | MirBufferUsage usage, | ||
4496 | 63 | mir_buffer_callback cb, | ||
4497 | 64 | void* cb_context) override; | ||
4498 | 65 | |||
4499 | 66 | private: | ||
4500 | 67 | std::mutex mutex; | ||
4501 | 68 | struct AllocationRequest | ||
4502 | 69 | { | ||
4503 | 70 | AllocationRequest( | ||
4504 | 71 | std::shared_ptr<ClientBufferFactory> const& native_buffer_factory, | ||
4505 | 72 | MirPresentationChain* chain, | ||
4506 | 73 | geometry::Size size, | ||
4507 | 74 | MirPixelFormat format, | ||
4508 | 75 | MirBufferUsage usage, | ||
4509 | 76 | mir_buffer_callback cb, | ||
4510 | 77 | void* cb_context); | ||
4511 | 78 | |||
4512 | 79 | std::shared_ptr<ClientBufferFactory> const native_buffer_factory; | ||
4513 | 80 | MirPresentationChain* chain; | ||
4514 | 81 | geometry::Size size; | ||
4515 | 82 | MirPixelFormat format; | ||
4516 | 83 | MirBufferUsage usage; | ||
4517 | 84 | mir_buffer_callback cb; | ||
4518 | 85 | void* cb_context; | ||
4519 | 86 | }; | ||
4520 | 87 | std::vector<std::unique_ptr<AllocationRequest>> allocation_requests; | ||
4521 | 88 | }; | ||
4522 | 89 | } | ||
4523 | 90 | } | ||
4524 | 91 | #endif /* MIR_CLIENT_MIR_BUFFER_FACTORY_H_ */ | ||
4525 | 0 | 92 | ||
4526 | === modified file 'src/client/buffer_stream.cpp' | |||
4527 | --- src/client/buffer_stream.cpp 2016-01-29 15:44:15 +0000 | |||
4528 | +++ src/client/buffer_stream.cpp 2016-03-30 00:11:41 +0000 | |||
4529 | @@ -26,6 +26,7 @@ | |||
4530 | 26 | #include "rpc/mir_display_server.h" | 26 | #include "rpc/mir_display_server.h" |
4531 | 27 | #include "mir_protobuf.pb.h" | 27 | #include "mir_protobuf.pb.h" |
4532 | 28 | #include "buffer_vault.h" | 28 | #include "buffer_vault.h" |
4533 | 29 | #include "protobuf_to_native_buffer.h" | ||
4534 | 29 | 30 | ||
4535 | 30 | #include "mir/log.h" | 31 | #include "mir/log.h" |
4536 | 31 | #include "mir/client_platform.h" | 32 | #include "mir/client_platform.h" |
4537 | @@ -73,42 +74,6 @@ | |||
4538 | 73 | namespace | 74 | namespace |
4539 | 74 | { | 75 | { |
4540 | 75 | 76 | ||
4541 | 76 | void populate_buffer_package( | ||
4542 | 77 | MirBufferPackage& buffer_package, | ||
4543 | 78 | mir::protobuf::Buffer const& protobuf_buffer) | ||
4544 | 79 | { | ||
4545 | 80 | if (!protobuf_buffer.has_error()) | ||
4546 | 81 | { | ||
4547 | 82 | buffer_package.data_items = protobuf_buffer.data_size(); | ||
4548 | 83 | for (int i = 0; i != protobuf_buffer.data_size(); ++i) | ||
4549 | 84 | { | ||
4550 | 85 | buffer_package.data[i] = protobuf_buffer.data(i); | ||
4551 | 86 | } | ||
4552 | 87 | |||
4553 | 88 | buffer_package.fd_items = protobuf_buffer.fd_size(); | ||
4554 | 89 | |||
4555 | 90 | for (int i = 0; i != protobuf_buffer.fd_size(); ++i) | ||
4556 | 91 | { | ||
4557 | 92 | buffer_package.fd[i] = protobuf_buffer.fd(i); | ||
4558 | 93 | } | ||
4559 | 94 | |||
4560 | 95 | buffer_package.stride = protobuf_buffer.stride(); | ||
4561 | 96 | buffer_package.flags = protobuf_buffer.flags(); | ||
4562 | 97 | buffer_package.width = protobuf_buffer.width(); | ||
4563 | 98 | buffer_package.height = protobuf_buffer.height(); | ||
4564 | 99 | } | ||
4565 | 100 | else | ||
4566 | 101 | { | ||
4567 | 102 | buffer_package.data_items = 0; | ||
4568 | 103 | buffer_package.fd_items = 0; | ||
4569 | 104 | buffer_package.stride = 0; | ||
4570 | 105 | buffer_package.flags = 0; | ||
4571 | 106 | buffer_package.width = 0; | ||
4572 | 107 | buffer_package.height = 0; | ||
4573 | 108 | } | ||
4574 | 109 | } | ||
4575 | 110 | |||
4576 | 111 | |||
4577 | 112 | struct ExchangeSemantics : mcl::ServerBufferSemantics | 77 | struct ExchangeSemantics : mcl::ServerBufferSemantics |
4578 | 113 | { | 78 | { |
4579 | 114 | ExchangeSemantics( | 79 | ExchangeSemantics( |
4580 | @@ -118,9 +83,9 @@ | |||
4581 | 118 | wrapped{factory, max_buffers}, | 83 | wrapped{factory, max_buffers}, |
4582 | 119 | display_server(server) | 84 | display_server(server) |
4583 | 120 | { | 85 | { |
4587 | 121 | auto buffer_package = std::make_shared<MirBufferPackage>(); | 86 | wrapped.deposit_package( |
4588 | 122 | populate_buffer_package(*buffer_package, first_buffer); | 87 | mcl::protobuf_to_native_buffer(first_buffer), |
4589 | 123 | wrapped.deposit_package(buffer_package, first_buffer.buffer_id(), first_size, first_pf); | 88 | first_buffer.buffer_id(), first_size, first_pf); |
4590 | 124 | } | 89 | } |
4591 | 125 | 90 | ||
4592 | 126 | void deposit(mp::Buffer const& buffer, geom::Size size, MirPixelFormat pf) override | 91 | void deposit(mp::Buffer const& buffer, geom::Size size, MirPixelFormat pf) override |
4593 | @@ -128,9 +93,9 @@ | |||
4594 | 128 | std::unique_lock<std::mutex> lock(mutex); | 93 | std::unique_lock<std::mutex> lock(mutex); |
4595 | 129 | if (on_incoming_buffer) | 94 | if (on_incoming_buffer) |
4596 | 130 | { | 95 | { |
4600 | 131 | auto buffer_package = std::make_shared<MirBufferPackage>(); | 96 | wrapped.deposit_package( |
4601 | 132 | populate_buffer_package(*buffer_package, buffer); | 97 | mcl::protobuf_to_native_buffer(buffer), |
4602 | 133 | wrapped.deposit_package(buffer_package, buffer.buffer_id(), size, pf); | 98 | buffer.buffer_id(), size, pf); |
4603 | 134 | if (on_incoming_buffer) | 99 | if (on_incoming_buffer) |
4604 | 135 | { | 100 | { |
4605 | 136 | on_incoming_buffer(); | 101 | on_incoming_buffer(); |
4606 | @@ -186,9 +151,9 @@ | |||
4607 | 186 | } | 151 | } |
4608 | 187 | else | 152 | else |
4609 | 188 | { | 153 | { |
4613 | 189 | auto buffer_package = std::make_shared<MirBufferPackage>(); | 154 | wrapped.deposit_package( |
4614 | 190 | populate_buffer_package(*buffer_package, incoming_buffers.front()); | 155 | mcl::protobuf_to_native_buffer(incoming_buffers.front()), |
4615 | 191 | wrapped.deposit_package(buffer_package, incoming_buffers.front().buffer_id(), sz, pf); | 156 | incoming_buffers.front().buffer_id(), sz, pf); |
4616 | 192 | incoming_buffers.pop(); | 157 | incoming_buffers.pop(); |
4617 | 193 | done(); | 158 | done(); |
4618 | 194 | } | 159 | } |
4619 | @@ -261,8 +226,11 @@ | |||
4620 | 261 | buf_params->set_height(size.height.as_int()); | 226 | buf_params->set_height(size.height.as_int()); |
4621 | 262 | buf_params->set_pixel_format(format); | 227 | buf_params->set_pixel_format(format); |
4622 | 263 | buf_params->set_buffer_usage(usage); | 228 | buf_params->set_buffer_usage(usage); |
4625 | 264 | server.allocate_buffers(&request, &protobuf_void, | 229 | |
4626 | 265 | google::protobuf::NewCallback(google::protobuf::DoNothing)); | 230 | //note, NewCallback will trigger on exception, deleting this object there |
4627 | 231 | auto protobuf_void = new mp::Void; | ||
4628 | 232 | server.allocate_buffers(&request, protobuf_void, | ||
4629 | 233 | google::protobuf::NewCallback(Requests::ignore_response, protobuf_void)); | ||
4630 | 266 | } | 234 | } |
4631 | 267 | 235 | ||
4632 | 268 | void free_buffer(int buffer_id) override | 236 | void free_buffer(int buffer_id) override |
4633 | @@ -270,8 +238,11 @@ | |||
4634 | 270 | mp::BufferRelease request; | 238 | mp::BufferRelease request; |
4635 | 271 | request.mutable_id()->set_value(stream_id); | 239 | request.mutable_id()->set_value(stream_id); |
4636 | 272 | request.add_buffers()->set_buffer_id(buffer_id); | 240 | request.add_buffers()->set_buffer_id(buffer_id); |
4639 | 273 | server.release_buffers(&request, &protobuf_void, | 241 | |
4640 | 274 | google::protobuf::NewCallback(google::protobuf::DoNothing)); | 242 | //note, NewCallback will trigger on exception, deleting this object there |
4641 | 243 | auto protobuf_void = new mp::Void; | ||
4642 | 244 | server.release_buffers(&request, protobuf_void, | ||
4643 | 245 | google::protobuf::NewCallback(Requests::ignore_response, protobuf_void)); | ||
4644 | 275 | } | 246 | } |
4645 | 276 | 247 | ||
4646 | 277 | void submit_buffer(int id, mcl::ClientBuffer&) override | 248 | void submit_buffer(int id, mcl::ClientBuffer&) override |
4647 | @@ -279,8 +250,16 @@ | |||
4648 | 279 | mp::BufferRequest request; | 250 | mp::BufferRequest request; |
4649 | 280 | request.mutable_id()->set_value(stream_id); | 251 | request.mutable_id()->set_value(stream_id); |
4650 | 281 | request.mutable_buffer()->set_buffer_id(id); | 252 | request.mutable_buffer()->set_buffer_id(id); |
4653 | 282 | server.submit_buffer(&request, &protobuf_void, | 253 | |
4654 | 283 | google::protobuf::NewCallback(google::protobuf::DoNothing)); | 254 | //note, NewCallback will trigger on exception, deleting this object there |
4655 | 255 | auto protobuf_void = new mp::Void; | ||
4656 | 256 | server.submit_buffer(&request, protobuf_void, | ||
4657 | 257 | google::protobuf::NewCallback(Requests::ignore_response, protobuf_void)); | ||
4658 | 258 | } | ||
4659 | 259 | |||
4660 | 260 | static void ignore_response(mp::Void* void_response) | ||
4661 | 261 | { | ||
4662 | 262 | delete void_response; | ||
4663 | 284 | } | 263 | } |
4664 | 285 | 264 | ||
4665 | 286 | private: | 265 | private: |
4666 | @@ -425,10 +404,12 @@ | |||
4667 | 425 | } | 404 | } |
4668 | 426 | else | 405 | else |
4669 | 427 | { | 406 | { |
4670 | 407 | cached_buffer_size = ideal_buffer_size; | ||
4671 | 428 | buffer_depository = std::make_unique<NewBufferSemantics>( | 408 | buffer_depository = std::make_unique<NewBufferSemantics>( |
4672 | 429 | client_platform->create_buffer_factory(), | 409 | client_platform->create_buffer_factory(), |
4673 | 430 | std::make_shared<Requests>(display_server, protobuf_bs->id().value()), | 410 | std::make_shared<Requests>(display_server, protobuf_bs->id().value()), |
4675 | 431 | ideal_buffer_size, static_cast<MirPixelFormat>(protobuf_bs->pixel_format()), 0, nbuffers); | 411 | ideal_buffer_size, static_cast<MirPixelFormat>(protobuf_bs->pixel_format()), |
4676 | 412 | protobuf_bs->buffer_usage(), nbuffers); | ||
4677 | 432 | } | 413 | } |
4678 | 433 | 414 | ||
4679 | 434 | 415 | ||
4680 | @@ -552,8 +533,9 @@ | |||
4681 | 552 | 533 | ||
4682 | 553 | MirWaitHandle* mcl::BufferStream::next_buffer(std::function<void()> const& done) | 534 | MirWaitHandle* mcl::BufferStream::next_buffer(std::function<void()> const& done) |
4683 | 554 | { | 535 | { |
4684 | 536 | auto id = buffer_depository->current_buffer_id(); | ||
4685 | 555 | std::unique_lock<decltype(mutex)> lock(mutex); | 537 | std::unique_lock<decltype(mutex)> lock(mutex); |
4687 | 556 | perf_report->end_frame(buffer_depository->current_buffer_id()); | 538 | perf_report->end_frame(id); |
4688 | 557 | 539 | ||
4689 | 558 | secured_region.reset(); | 540 | secured_region.reset(); |
4690 | 559 | 541 | ||
4691 | @@ -572,7 +554,7 @@ | |||
4692 | 572 | EGLNativeWindowType mcl::BufferStream::egl_native_window() | 554 | EGLNativeWindowType mcl::BufferStream::egl_native_window() |
4693 | 573 | { | 555 | { |
4694 | 574 | std::unique_lock<decltype(mutex)> lock(mutex); | 556 | std::unique_lock<decltype(mutex)> lock(mutex); |
4696 | 575 | return *egl_native_window_; | 557 | return static_cast<EGLNativeWindowType>(egl_native_window_.get()); |
4697 | 576 | } | 558 | } |
4698 | 577 | 559 | ||
4699 | 578 | void mcl::BufferStream::release_cpu_region() | 560 | void mcl::BufferStream::release_cpu_region() |
4700 | @@ -633,7 +615,6 @@ | |||
4701 | 633 | 615 | ||
4702 | 634 | uint32_t mcl::BufferStream::get_current_buffer_id() | 616 | uint32_t mcl::BufferStream::get_current_buffer_id() |
4703 | 635 | { | 617 | { |
4704 | 636 | std::unique_lock<decltype(mutex)> lock(mutex); | ||
4705 | 637 | return buffer_depository->current_buffer_id(); | 618 | return buffer_depository->current_buffer_id(); |
4706 | 638 | } | 619 | } |
4707 | 639 | 620 | ||
4708 | 640 | 621 | ||
4709 | === modified file 'src/client/buffer_stream.h' | |||
4710 | --- src/client/buffer_stream.h 2016-01-29 15:44:15 +0000 | |||
4711 | +++ src/client/buffer_stream.h 2016-03-30 00:11:41 +0000 | |||
4712 | @@ -147,7 +147,7 @@ | |||
4713 | 147 | float scale_; | 147 | float scale_; |
4714 | 148 | 148 | ||
4715 | 149 | std::shared_ptr<mir::client::PerfReport> const perf_report; | 149 | std::shared_ptr<mir::client::PerfReport> const perf_report; |
4717 | 150 | std::shared_ptr<EGLNativeWindowType> egl_native_window_; | 150 | std::shared_ptr<void> egl_native_window_; |
4718 | 151 | 151 | ||
4719 | 152 | MirWaitHandle interval_wait_handle; | 152 | MirWaitHandle interval_wait_handle; |
4720 | 153 | std::unique_ptr<mir::protobuf::Void> protobuf_void; | 153 | std::unique_ptr<mir::protobuf::Void> protobuf_void; |
4721 | 154 | 154 | ||
4722 | === modified file 'src/client/buffer_vault.cpp' | |||
4723 | --- src/client/buffer_vault.cpp 2016-01-29 08:18:22 +0000 | |||
4724 | +++ src/client/buffer_vault.cpp 2016-03-30 00:11:41 +0000 | |||
4725 | @@ -20,6 +20,7 @@ | |||
4726 | 20 | #include "mir/client_buffer.h" | 20 | #include "mir/client_buffer.h" |
4727 | 21 | #include "buffer_vault.h" | 21 | #include "buffer_vault.h" |
4728 | 22 | #include "mir_protobuf.pb.h" | 22 | #include "mir_protobuf.pb.h" |
4729 | 23 | #include "protobuf_to_native_buffer.h" | ||
4730 | 23 | #include <algorithm> | 24 | #include <algorithm> |
4731 | 24 | #include <boost/throw_exception.hpp> | 25 | #include <boost/throw_exception.hpp> |
4732 | 25 | 26 | ||
4733 | @@ -118,31 +119,33 @@ | |||
4734 | 118 | 119 | ||
4735 | 119 | void mcl::BufferVault::wire_transfer_inbound(mp::Buffer const& protobuf_buffer) | 120 | void mcl::BufferVault::wire_transfer_inbound(mp::Buffer const& protobuf_buffer) |
4736 | 120 | { | 121 | { |
4748 | 121 | auto package = std::make_shared<MirBufferPackage>(); | 122 | std::shared_ptr<MirBufferPackage> package = mcl::protobuf_to_native_buffer(protobuf_buffer); |
4738 | 122 | package->data_items = protobuf_buffer.data_size(); | ||
4739 | 123 | package->fd_items = protobuf_buffer.fd_size(); | ||
4740 | 124 | for (int i = 0; i != protobuf_buffer.data_size(); ++i) | ||
4741 | 125 | package->data[i] = protobuf_buffer.data(i); | ||
4742 | 126 | for (int i = 0; i != protobuf_buffer.fd_size(); ++i) | ||
4743 | 127 | package->fd[i] = protobuf_buffer.fd(i); | ||
4744 | 128 | package->stride = protobuf_buffer.stride(); | ||
4745 | 129 | package->flags = protobuf_buffer.flags(); | ||
4746 | 130 | package->width = protobuf_buffer.width(); | ||
4747 | 131 | package->height = protobuf_buffer.height(); | ||
4749 | 132 | 123 | ||
4750 | 133 | std::unique_lock<std::mutex> lk(mutex); | 124 | std::unique_lock<std::mutex> lk(mutex); |
4751 | 134 | auto it = buffers.find(protobuf_buffer.buffer_id()); | 125 | auto it = buffers.find(protobuf_buffer.buffer_id()); |
4752 | 135 | if (it == buffers.end()) | 126 | if (it == buffers.end()) |
4753 | 136 | { | 127 | { |
4756 | 137 | auto buffer = factory->create_buffer(package, geom::Size{package->width, package->height}, format); | 128 | geom::Size sz{package->width, package->height}; |
4757 | 138 | buffers[protobuf_buffer.buffer_id()] = BufferEntry{ buffer, Owner::Self }; | 129 | if (sz != size) |
4758 | 130 | { | ||
4759 | 131 | lk.unlock(); | ||
4760 | 132 | server_requests->free_buffer(protobuf_buffer.buffer_id()); | ||
4761 | 133 | for (int i = 0; i != package->fd_items; ++i) | ||
4762 | 134 | close(package->fd[i]); | ||
4763 | 135 | |||
4764 | 136 | server_requests->allocate_buffer(size, format, usage); | ||
4765 | 137 | return; | ||
4766 | 138 | } | ||
4767 | 139 | |||
4768 | 140 | buffers[protobuf_buffer.buffer_id()] = | ||
4769 | 141 | BufferEntry{ factory->create_buffer(package, sz, format), Owner::Self }; | ||
4770 | 139 | } | 142 | } |
4771 | 140 | else | 143 | else |
4772 | 141 | { | 144 | { |
4773 | 145 | it->second.buffer->update_from(*package); | ||
4774 | 142 | if (size == it->second.buffer->size()) | 146 | if (size == it->second.buffer->size()) |
4775 | 143 | { | 147 | { |
4776 | 144 | it->second.owner = Owner::Self; | 148 | it->second.owner = Owner::Self; |
4777 | 145 | it->second.buffer->update_from(*package); | ||
4778 | 146 | } | 149 | } |
4779 | 147 | else | 150 | else |
4780 | 148 | { | 151 | { |
4781 | 149 | 152 | ||
4782 | === modified file 'src/client/client_buffer_stream.h' | |||
4783 | --- src/client/client_buffer_stream.h 2016-02-12 04:02:11 +0000 | |||
4784 | +++ src/client/client_buffer_stream.h 2016-03-30 00:11:41 +0000 | |||
4785 | @@ -27,10 +27,33 @@ | |||
4786 | 27 | #include "mir_toolkit/mir_native_buffer.h" | 27 | #include "mir_toolkit/mir_native_buffer.h" |
4787 | 28 | #include "mir_wait_handle.h" | 28 | #include "mir_wait_handle.h" |
4788 | 29 | 29 | ||
4789 | 30 | #include <EGL/eglplatform.h> | ||
4790 | 31 | |||
4791 | 32 | #include <memory> | 30 | #include <memory> |
4792 | 33 | #include <functional> | 31 | #include <functional> |
4793 | 32 | #include <EGL/eglplatform.h> | ||
4794 | 33 | |||
4795 | 34 | /* | ||
4796 | 35 | * ClientBufferStream::egl_native_window() returns EGLNativeWindowType. | ||
4797 | 36 | * | ||
4798 | 37 | * EGLNativeWindowType is an EGL platform-specific type that is typically a | ||
4799 | 38 | * (possibly slightly obfuscated) pointer. This makes our client module ABI | ||
4800 | 39 | * technically EGL-platform dependent, which is awkward because we support | ||
4801 | 40 | * multiple EGL platforms. | ||
4802 | 41 | * | ||
4803 | 42 | * On both the Mesa and the Android EGL platforms EGLNativeWindow is a | ||
4804 | 43 | * pointer or a uintptr_t. | ||
4805 | 44 | * | ||
4806 | 45 | * In practise EGLNativeWindowType is always a typedef to a pointer-ish, but | ||
4807 | 46 | * for paranoia's sake make sure the build will fail if we ever encounter a | ||
4808 | 47 | * strange EGL platform where this isn't the case. | ||
4809 | 48 | */ | ||
4810 | 49 | #include <type_traits> | ||
4811 | 50 | static_assert( | ||
4812 | 51 | sizeof(EGLNativeWindowType) == sizeof(void*) && | ||
4813 | 52 | std::is_pod<EGLNativeWindowType>::value, | ||
4814 | 53 | "The ClientBufferStream requires that EGLNativeWindowType be no-op convertible to void*"); | ||
4815 | 54 | |||
4816 | 55 | #undef EGLNativeWindowType | ||
4817 | 56 | #define EGLNativeWindowType void* | ||
4818 | 34 | 57 | ||
4819 | 35 | namespace mir | 58 | namespace mir |
4820 | 36 | { | 59 | { |
4821 | 37 | 60 | ||
4822 | === modified file 'src/client/connection_configuration.h' | |||
4823 | --- src/client/connection_configuration.h 2016-01-29 08:18:22 +0000 | |||
4824 | +++ src/client/connection_configuration.h 2016-03-30 00:11:41 +0000 | |||
4825 | @@ -52,6 +52,7 @@ | |||
4826 | 52 | class DisplayConfiguration; | 52 | class DisplayConfiguration; |
4827 | 53 | class EventSink; | 53 | class EventSink; |
4828 | 54 | class EventHandlerRegister; | 54 | class EventHandlerRegister; |
4829 | 55 | class AsyncBufferFactory; | ||
4830 | 55 | 56 | ||
4831 | 56 | class ConnectionConfiguration | 57 | class ConnectionConfiguration |
4832 | 57 | { | 58 | { |
4833 | @@ -69,6 +70,7 @@ | |||
4834 | 69 | virtual std::shared_ptr<PingHandler> the_ping_handler() = 0; | 70 | virtual std::shared_ptr<PingHandler> the_ping_handler() = 0; |
4835 | 70 | virtual std::shared_ptr<EventSink> the_event_sink() = 0; | 71 | virtual std::shared_ptr<EventSink> the_event_sink() = 0; |
4836 | 71 | virtual std::shared_ptr<EventHandlerRegister> the_event_handler_register() = 0; | 72 | virtual std::shared_ptr<EventHandlerRegister> the_event_handler_register() = 0; |
4837 | 73 | virtual std::shared_ptr<mir::client::AsyncBufferFactory> the_buffer_factory() = 0; | ||
4838 | 72 | 74 | ||
4839 | 73 | protected: | 75 | protected: |
4840 | 74 | ConnectionConfiguration() = default; | 76 | ConnectionConfiguration() = default; |
4841 | 75 | 77 | ||
4842 | === modified file 'src/client/connection_surface_map.h' | |||
4843 | --- src/client/connection_surface_map.h 2016-02-12 04:02:11 +0000 | |||
4844 | +++ src/client/connection_surface_map.h 2016-03-30 00:11:41 +0000 | |||
4845 | @@ -28,6 +28,7 @@ | |||
4846 | 28 | { | 28 | { |
4847 | 29 | namespace client | 29 | namespace client |
4848 | 30 | { | 30 | { |
4849 | 31 | class Buffer; | ||
4850 | 31 | class PresentationChain; | 32 | class PresentationChain; |
4851 | 32 | class ConnectionSurfaceMap : public SurfaceMap | 33 | class ConnectionSurfaceMap : public SurfaceMap |
4852 | 33 | { | 34 | { |
4853 | @@ -42,10 +43,16 @@ | |||
4854 | 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); |
4855 | 43 | void erase(frontend::BufferStreamId surface_id); | 44 | void erase(frontend::BufferStreamId surface_id); |
4856 | 44 | 45 | ||
4857 | 46 | //TODO: should have a mf::BufferID | ||
4858 | 47 | void insert(int buffer_id, std::shared_ptr<Buffer> const& buffer) override; | ||
4859 | 48 | void erase(int buffer_id) override; | ||
4860 | 49 | std::shared_ptr<Buffer> buffer(int buffer_id) const override; | ||
4861 | 50 | |||
4862 | 45 | private: | 51 | private: |
4863 | 46 | std::shared_timed_mutex mutable guard; | 52 | std::shared_timed_mutex mutable guard; |
4864 | 47 | std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces; | 53 | std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces; |
4865 | 48 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<BufferReceiver>> streams; | 54 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<BufferReceiver>> streams; |
4866 | 55 | std::unordered_map<int, std::shared_ptr<Buffer>> buffers; | ||
4867 | 49 | }; | 56 | }; |
4868 | 50 | 57 | ||
4869 | 51 | } | 58 | } |
4870 | 52 | 59 | ||
4871 | === modified file 'src/client/default_connection_configuration.cpp' | |||
4872 | --- src/client/default_connection_configuration.cpp 2016-01-29 08:18:22 +0000 | |||
4873 | +++ src/client/default_connection_configuration.cpp 2016-03-30 00:11:41 +0000 | |||
4874 | @@ -21,7 +21,7 @@ | |||
4875 | 21 | #include "display_configuration.h" | 21 | #include "display_configuration.h" |
4876 | 22 | #include "rpc/make_rpc_channel.h" | 22 | #include "rpc/make_rpc_channel.h" |
4877 | 23 | #include "rpc/null_rpc_report.h" | 23 | #include "rpc/null_rpc_report.h" |
4879 | 24 | #include "mir/logging/dumb_console_logger.h" | 24 | #include "mir/logging/logger.h" |
4880 | 25 | #include "mir/input/input_platform.h" | 25 | #include "mir/input/input_platform.h" |
4881 | 26 | #include "mir/input/input_devices.h" | 26 | #include "mir/input/input_devices.h" |
4882 | 27 | #include "mir/input/null_input_receiver_report.h" | 27 | #include "mir/input/null_input_receiver_report.h" |
4883 | @@ -37,6 +37,7 @@ | |||
4884 | 37 | #include "mir/client_platform_factory.h" | 37 | #include "mir/client_platform_factory.h" |
4885 | 38 | #include "probing_client_platform_factory.h" | 38 | #include "probing_client_platform_factory.h" |
4886 | 39 | #include "mir_event_distributor.h" | 39 | #include "mir_event_distributor.h" |
4887 | 40 | #include "buffer_factory.h" | ||
4888 | 40 | 41 | ||
4889 | 41 | namespace mcl = mir::client; | 42 | namespace mcl = mir::client; |
4890 | 42 | 43 | ||
4891 | @@ -69,18 +70,24 @@ | |||
4892 | 69 | [this] | 70 | [this] |
4893 | 70 | { | 71 | { |
4894 | 71 | return mcl::rpc::make_rpc_channel( | 72 | return mcl::rpc::make_rpc_channel( |
4896 | 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(), |
4897 | 74 | the_display_configuration(), the_input_devices(), the_rpc_report(), | ||
4898 | 75 | the_lifecycle_control(), the_ping_handler(), the_event_sink()); | ||
4899 | 73 | }); | 76 | }); |
4900 | 74 | } | 77 | } |
4901 | 75 | 78 | ||
4902 | 76 | std::shared_ptr<mir::logging::Logger> | 79 | std::shared_ptr<mir::logging::Logger> |
4903 | 77 | mcl::DefaultConnectionConfiguration::the_logger() | 80 | mcl::DefaultConnectionConfiguration::the_logger() |
4904 | 78 | { | 81 | { |
4907 | 79 | return logger( | 82 | class ProxyLogger : public mir::logging::Logger |
4908 | 80 | [] | 83 | { |
4909 | 84 | void log(mir::logging::Severity severity, const std::string& message, const std::string& component) override | ||
4910 | 81 | { | 85 | { |
4913 | 82 | return std::make_shared<mir::logging::DumbConsoleLogger>(); | 86 | mir::logging::log(severity, message, component); |
4914 | 83 | }); | 87 | } |
4915 | 88 | }; | ||
4916 | 89 | |||
4917 | 90 | return logger([]{ return std::make_shared<ProxyLogger>(); }); | ||
4918 | 84 | } | 91 | } |
4919 | 85 | 92 | ||
4920 | 86 | std::shared_ptr<mcl::ClientPlatformFactory> | 93 | std::shared_ptr<mcl::ClientPlatformFactory> |
4921 | @@ -228,3 +235,12 @@ | |||
4922 | 228 | return std::make_shared<mir::logging::NullSharedLibraryProberReport>(); | 235 | return std::make_shared<mir::logging::NullSharedLibraryProberReport>(); |
4923 | 229 | }); | 236 | }); |
4924 | 230 | } | 237 | } |
4925 | 238 | |||
4926 | 239 | std::shared_ptr<mir::client::AsyncBufferFactory> mir::client::DefaultConnectionConfiguration::the_buffer_factory() | ||
4927 | 240 | { | ||
4928 | 241 | return async_buffer_factory( | ||
4929 | 242 | [this] () -> std::shared_ptr<mir::client::AsyncBufferFactory> | ||
4930 | 243 | { | ||
4931 | 244 | return std::make_shared<mir::client::BufferFactory>(); | ||
4932 | 245 | }); | ||
4933 | 246 | } | ||
4934 | 231 | 247 | ||
4935 | === modified file 'src/client/default_connection_configuration.h' | |||
4936 | --- src/client/default_connection_configuration.h 2016-01-29 08:18:22 +0000 | |||
4937 | +++ src/client/default_connection_configuration.h 2016-03-30 00:11:41 +0000 | |||
4938 | @@ -62,6 +62,7 @@ | |||
4939 | 62 | std::shared_ptr<EventSink> the_event_sink() override; | 62 | std::shared_ptr<EventSink> the_event_sink() override; |
4940 | 63 | std::shared_ptr<EventHandlerRegister> the_event_handler_register() override; | 63 | std::shared_ptr<EventHandlerRegister> the_event_handler_register() override; |
4941 | 64 | std::shared_ptr<mir::SharedLibraryProberReport> the_shared_library_prober_report(); | 64 | std::shared_ptr<mir::SharedLibraryProberReport> the_shared_library_prober_report(); |
4942 | 65 | std::shared_ptr<mir::client::AsyncBufferFactory> the_buffer_factory() override; | ||
4943 | 65 | 66 | ||
4944 | 66 | virtual std::string the_socket_file(); | 67 | virtual std::string the_socket_file(); |
4945 | 67 | virtual std::shared_ptr<rpc::RpcReport> the_rpc_report(); | 68 | virtual std::shared_ptr<rpc::RpcReport> the_rpc_report(); |
4946 | @@ -82,6 +83,7 @@ | |||
4947 | 82 | CachedPtr<rpc::RpcReport> rpc_report; | 83 | CachedPtr<rpc::RpcReport> rpc_report; |
4948 | 83 | CachedPtr<input::receiver::InputReceiverReport> input_receiver_report; | 84 | CachedPtr<input::receiver::InputReceiverReport> input_receiver_report; |
4949 | 84 | CachedPtr<mir::SharedLibraryProberReport> shared_library_prober_report; | 85 | CachedPtr<mir::SharedLibraryProberReport> shared_library_prober_report; |
4950 | 86 | CachedPtr<mir::client::AsyncBufferFactory> async_buffer_factory; | ||
4951 | 85 | 87 | ||
4952 | 86 | private: | 88 | private: |
4953 | 87 | std::string const socket_file; | 89 | std::string const socket_file; |
4954 | 88 | 90 | ||
4955 | === modified file 'src/client/display_configuration.cpp' | |||
4956 | --- src/client/display_configuration.cpp 2016-01-29 08:18:22 +0000 | |||
4957 | +++ src/client/display_configuration.cpp 2016-03-30 00:11:41 +0000 | |||
4958 | @@ -53,6 +53,13 @@ | |||
4959 | 53 | output_formats = new MirPixelFormat[num_formats]; | 53 | output_formats = new MirPixelFormat[num_formats]; |
4960 | 54 | } | 54 | } |
4961 | 55 | 55 | ||
4962 | 56 | mcl::DisplayOutput::DisplayOutput(DisplayOutput&& rhs) | ||
4963 | 57 | { | ||
4964 | 58 | std::memcpy(this, &rhs, sizeof(*this)); | ||
4965 | 59 | rhs.modes = nullptr; | ||
4966 | 60 | rhs.output_formats = nullptr; | ||
4967 | 61 | } | ||
4968 | 62 | |||
4969 | 56 | mcl::DisplayOutput::~DisplayOutput() | 63 | mcl::DisplayOutput::~DisplayOutput() |
4970 | 57 | { | 64 | { |
4971 | 58 | delete[] modes; | 65 | delete[] modes; |
4972 | @@ -74,6 +81,8 @@ | |||
4973 | 74 | output.output_id = msg.output_id(); | 81 | output.output_id = msg.output_id(); |
4974 | 75 | output.type = static_cast<MirDisplayOutputType>(msg.type()); | 82 | output.type = static_cast<MirDisplayOutputType>(msg.type()); |
4975 | 76 | 83 | ||
4976 | 84 | output.num_modes = msg.mode_size(); | ||
4977 | 85 | output.modes = new MirDisplayMode[output.num_modes]; | ||
4978 | 77 | for (auto i = 0u; i < output.num_modes; i++) | 86 | for (auto i = 0u; i < output.num_modes; i++) |
4979 | 78 | { | 87 | { |
4980 | 79 | auto mode = msg.mode(i); | 88 | auto mode = msg.mode(i); |
4981 | @@ -84,6 +93,8 @@ | |||
4982 | 84 | output.preferred_mode = msg.preferred_mode(); | 93 | output.preferred_mode = msg.preferred_mode(); |
4983 | 85 | output.current_mode = msg.current_mode(); | 94 | output.current_mode = msg.current_mode(); |
4984 | 86 | 95 | ||
4985 | 96 | output.num_output_formats = msg.pixel_format_size(); | ||
4986 | 97 | output.output_formats = new MirPixelFormat[output.num_output_formats]; | ||
4987 | 87 | for (auto i = 0u; i < output.num_output_formats; i++) | 98 | for (auto i = 0u; i < output.num_output_formats; i++) |
4988 | 88 | { | 99 | { |
4989 | 89 | output.output_formats[i] = static_cast<MirPixelFormat>(msg.pixel_format(i)); | 100 | output.output_formats[i] = static_cast<MirPixelFormat>(msg.pixel_format(i)); |
4990 | @@ -113,25 +124,8 @@ | |||
4991 | 113 | 124 | ||
4992 | 114 | void mcl::DisplayConfiguration::set_configuration(mp::DisplayConfiguration const& msg) | 125 | void mcl::DisplayConfiguration::set_configuration(mp::DisplayConfiguration const& msg) |
4993 | 115 | { | 126 | { |
4994 | 116 | std::lock_guard<std::mutex> lk(guard); | ||
4995 | 117 | |||
4996 | 118 | cards.clear(); | ||
4997 | 119 | for (auto i = 0; i < msg.display_card_size(); i++) | ||
4998 | 120 | { | ||
4999 | 121 | auto const& msg_card = msg.display_card(i); | ||
5000 | 122 | MirDisplayCard card; |
PASSED: Continuous integration, rev:3410 /mir-jenkins. ubuntu. com/job/ mir-ubuntu- ci/7/ /mir-jenkins. ubuntu. com/job/ build-mir/ 527 /mir-jenkins. ubuntu. com/job/ build-0- fetch/557 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 549 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 549 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= vivid+overlay/ 537 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= vivid+overlay/ 537/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial/ 537 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial/ 537/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 537 /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 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 537 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 537/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 537 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 537/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ubuntu- ci/7/rebuild
https:/