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