[enhancement] need fd (file descriptor) and dispatch function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Won't Fix
|
Wishlist
|
Chris Halse Rogers | ||
mir (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
A long-standing request only ever made in person (I think) so let's write it down:
We need a way to get a pollable object out of the mir client library and a dispatch function to call so that we can integrate mir into the mainloop of the toolkit that is trying to use it.
The thread-based delivery mechanism is inconvenient for most toolkits.
The fd would ideally be the mir socket itself, but it could also be an eventfd that gets signalled from another thread. In the name of efficiency we should try to cut out the extra threads entirely, though.
The dispatch function would dispatch events to the registered delegate, directly from the thread in which it was called.
Alternatively (or perhaps additionally), we could also use a function to manually dequeue events.
Related branches
- PS Jenkins bot (community): Approve (continuous-integration)
- Daniel van Vugt: Abstain
- Robert Carr (community): Approve
- Andreas Pokorny (community): Needs Information
- Alexandros Frantzis (community): Approve
- Cemil Azizoglu (community): Approve
-
Diff: 2044 lines (+1169/-266)33 files modifiedcommon-ABI-sha1sums (+2/-0)
include/common/mir/dispatch/dispatchable.h (+78/-0)
include/common/mir/dispatch/simple_dispatch_thread.h (+48/-0)
platform-ABI-sha1sums (+2/-0)
server-ABI-sha1sums (+2/-0)
src/client/mir_connection.cpp (+5/-1)
src/client/mir_connection.h (+7/-0)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+16/-0)
src/client/rpc/mir_protobuf_rpc_channel.h (+9/-1)
src/client/rpc/stream_socket_transport.cpp (+30/-111)
src/client/rpc/stream_socket_transport.h (+3/-4)
src/client/rpc/stream_transport.h (+4/-5)
src/common/CMakeLists.txt (+2/-0)
src/common/dispatch/CMakeLists.txt (+22/-0)
src/common/dispatch/simple_dispatch_thread.cpp (+158/-0)
src/common/symbols.map (+6/-2)
tests/CMakeLists.txt (+1/-0)
tests/include/mir_test/fd_utils.h (+69/-0)
tests/include/mir_test/pipe.h (+8/-4)
tests/include/mir_test/test_dispatchable.h (+60/-0)
tests/include/mir_test/test_protobuf_client.h (+5/-0)
tests/integration-tests/client/test_screencast.cpp (+7/-0)
tests/mir_test/CMakeLists.txt (+2/-0)
tests/mir_test/fd_utils.cpp (+40/-0)
tests/mir_test/pipe.cpp (+21/-18)
tests/mir_test/test_dispatchable.cpp (+98/-0)
tests/mir_test_doubles/test_protobuf_client.cpp (+6/-1)
tests/unit-tests/CMakeLists.txt (+1/-0)
tests/unit-tests/client/test_mir_connection.cpp (+13/-1)
tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+4/-0)
tests/unit-tests/client/test_stream_transport.cpp (+250/-118)
tests/unit-tests/dispatch/CMakeLists.txt (+5/-0)
tests/unit-tests/dispatch/test_simple_dispatch_thread.cpp (+185/-0)
- PS Jenkins bot (community): Needs Fixing (continuous-integration)
- Alexandros Frantzis (community): Needs Fixing
- Andreas Pokorny (community): Approve
- Robert Carr (community): Approve
- Kevin DuBois (community): Approve
-
Diff: 7460 lines (+4248/-373) (has conflicts)87 files modifiedbenchmarks/benchmark_multiplexing_dispatchable.cpp (+1/-0)
debian/control (+1/-0)
examples/chain_jumping_buffers.c (+6/-0)
examples/prerendered_frames.c (+5/-0)
examples/render_surface.cpp (+20/-4)
include/client/mir_toolkit/mir_connection.h (+70/-0)
include/client/mir_toolkit/mir_wait.h (+1/-0)
include/client/mir_toolkit/rs/mir_render_surface.h (+69/-5)
include/common/mir/dispatch/threaded_dispatcher.h.moved (+75/-0)
include/test/mir/test/validity_matchers.h (+8/-0)
playground/egldiamond_render_surface.c (+5/-0)
playground/mir_egl_platform_shim.c (+9/-0)
src/client/CMakeLists.txt (+9/-0)
src/client/buffer_factory.cpp (+11/-1)
src/client/buffer_stream.cpp (+146/-38)
src/client/buffer_stream.h (+27/-3)
src/client/buffer_stream_configuration.cpp (+8/-0)
src/client/buffer_stream_configuration.h (+1/-0)
src/client/buffer_vault.cpp (+22/-5)
src/client/client_buffer_stream_factory.h.THIS (+66/-0)
src/client/connection_configuration.h (+11/-0)
src/client/connection_surface_map.cpp (+53/-1)
src/client/connection_surface_map.h (+32/-0)
src/client/default_client_buffer_stream_factory.cpp.THIS (+87/-0)
src/client/default_client_buffer_stream_factory.h.THIS (+70/-0)
src/client/default_connection_configuration.cpp (+15/-2)
src/client/default_connection_configuration.h (+2/-0)
src/client/error_render_surface.cpp (+1/-4)
src/client/error_render_surface.h (+6/-3)
src/client/mir_buffer_stream_api.cpp (+29/-14)
src/client/mir_connection.cpp (+194/-50)
src/client/mir_connection.h (+37/-11)
src/client/mir_connection_api.cpp (+159/-0)
src/client/mir_prompt_session_api.cpp (+13/-0)
src/client/mir_render_surface_api.cpp (+104/-4)
src/client/mir_screencast.cpp (+13/-2)
src/client/mir_screencast.h (+2/-1)
src/client/mir_screencast_api.cpp (+20/-3)
src/client/mir_surface.cpp (+30/-2)
src/client/mir_surface.h (+5/-2)
src/client/mir_surface_api.cpp (+25/-0)
src/client/mir_wait_api.cpp (+9/-0)
src/client/no_tls_future-inl.h (+1/-0)
src/client/render_surface.cpp (+34/-14)
src/client/render_surface.h (+6/-3)
src/client/rpc/make_rpc_channel.h (+1/-0)
src/client/rpc/mir_basic_rpc_channel.h (+8/-0)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+10/-1)
src/client/rpc/mir_protobuf_rpc_channel.h (+3/-3)
src/client/symbols.map (+21/-0)
src/client/synchronous_helper.cpp (+33/-0)
src/client/synchronous_helper.h (+160/-0)
src/common/dispatch/threaded_dispatcher.cpp.moved (+294/-0)
src/include/client/mir/mir_render_surface.h (+6/-3)
src/server/scene/mediating_display_changer.cpp (+1/-1)
tests/acceptance-tests/CMakeLists.txt (+8/-0)
tests/acceptance-tests/test_client_library.cpp (+494/-0)
tests/acceptance-tests/test_client_surfaces.cpp (+40/-0)
tests/acceptance-tests/test_render_surface.cpp (+235/-20)
tests/acceptance-tests/test_server_shutdown.cpp (+1/-1)
tests/include/mir/test/doubles/mock_client_buffer_stream_factory.h.THIS (+59/-0)
tests/include/mir/test/doubles/mock_mir_buffer_stream.h (+1/-0)
tests/include/mir/test/doubles/stub_buffer_stream_factory.h (+18/-2)
tests/include/mir/test/doubles/stub_client_buffer_stream_factory.h.THIS (+66/-0)
tests/integration-tests/test_buffer_scheduling.cpp (+3/-1)
tests/integration-tests/test_surfaceloop.cpp (+60/-35)
tests/integration-tests/test_swapinterval.cpp (+2/-2)
tests/mir_test/CMakeLists.txt (+5/-1)
tests/mir_test/validity_matchers.cpp (+31/-0)
tests/mir_test_doubles/stub_buffer.cpp.THIS (+39/-0)
tests/mir_test_doubles/test_protobuf_client.cpp (+2/-1)
tests/mir_test_framework/CMakeLists.txt (+1/-0)
tests/mir_test_framework/udev_environment.cpp (+12/-4)
tests/unit-tests/client/test_buffer_vault.cpp (+2/-1)
tests/unit-tests/client/test_client_buffer_stream.cpp (+158/-82)
tests/unit-tests/client/test_client_mir_surface.cpp (+22/-0)
tests/unit-tests/client/test_connection_resource_map.cpp (+71/-5)
tests/unit-tests/client/test_mir_connection.cpp (+206/-7)
tests/unit-tests/client/test_mir_render_surface.cpp (+182/-20)
tests/unit-tests/compositor/test_stream.cpp (+1/-1)
tests/unit-tests/dispatch/CMakeLists.txt (+1/-0)
tests/unit-tests/dispatch/test_multiplexing_dispatchable.cpp (+7/-8)
tests/unit-tests/dispatch/test_threaded_dispatcher.cpp.moved (+403/-0)
tests/unit-tests/frontend/stress_protobuf_communicator.cpp (+4/-1)
tests/unit-tests/scene/test_application_session.cpp (+3/-1)
tests/unit-tests/scene/test_surface_stack.cpp (+11/-0)
tools/valgrind_suppressions_generic (+45/-0)
Changed in mir: | |
status: | Triaged → In Progress |
assignee: | nobody → Chris Halse Rogers (raof) |
Changed in mir: | |
milestone: | none → 0.10.0 |
Changed in mir: | |
milestone: | 0.10.0 → 0.11.0 |
Changed in mir: | |
milestone: | 0.11.0 → 0.12.0 |
milestone: | 0.12.0 → 0.11.0 |
status: | New → Fix Committed |
milestone: | 0.11.0 → 0.12.0 |
status: | Fix Committed → In Progress |
Changed in mir: | |
milestone: | 0.12.0 → 0.13.0 |
summary: |
- need fd (file descriptor) and dispatch function + [enhancement] need fd (file descriptor) and dispatch function |
Changed in mir (Ubuntu): | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in mir: | |
milestone: | 0.13.0 → 0.14.0 |
Changed in mir: | |
milestone: | 0.14.0 → 0.15.0 |
This is part of bug 1194384. We can keep it separate though, so as to remember the additional requirement for an fd here.