[enhancement] Mir protocol design prevents clients from ever being more than double-buffered
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
High
|
Unassigned |
Bug Description
The Mir protocol design prevents clients from ever being able to gain a performance advantage beyond double-buffering. This means clients which do a lot of rendering need to keep up with double-buffering deadlines to meet the compositor's frame rate. And they can never take advantage of the catch-up that triple (or more) buffers should provide to eliminate missed frames.
The problem is:
rpc next_buffer(
When a client tells the server that SurfaceId is ready for rendering, it must then wait synchronously for a single Buffer in return. Thus even if the surface has more than two buffers, the protocol design forces clients to only be able to handle two at once.
This causes a performance bottleneck where even though the server might have free buffers ready to send to the client, it can't do so until the client calls next_buffer a sufficient number of times.
The solution would be to not make next_buffer return a Buffer. Instead have buffers arrive from the server asynchronously, as soon as they can. Much like the way we deliver MirEvent's.
Related branches
- Cemil Azizoglu (community): Approve
- PS Jenkins bot (community): Approve (continuous-integration)
- Robert Carr (community): Approve
- Alan Griffiths: Approve
-
Diff: 118 lines (+53/-0)5 files modifiedsrc/protobuf/mir_protobuf.proto (+1/-0)
src/server/frontend/protobuf_message_processor.cpp (+4/-0)
src/server/frontend/session_mediator.cpp (+9/-0)
src/server/frontend/session_mediator.h (+6/-0)
tests/integration-tests/test_exchange_buffer.cpp (+33/-0)
- PS Jenkins bot (community): Approve (continuous-integration)
- Chris Halse Rogers: Approve
- Andreas Pokorny (community): Approve
- Alexandros Frantzis (community): Approve
- Alan Griffiths: Approve
- Alberto Aguirre (community): Approve
-
Diff: 559 lines (+253/-10)15 files modifiedsrc/client/buffer_stream.cpp (+54/-1)
src/client/buffer_stream.h (+11/-0)
src/client/client_buffer_stream.h (+2/-1)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+8/-0)
src/include/server/mir/frontend/event_sink.h (+3/-0)
src/protobuf/mir_protobuf.proto (+2/-0)
src/server/frontend/event_sender.cpp (+11/-0)
src/server/frontend/event_sender.h (+1/-0)
src/server/scene/global_event_sender.cpp (+4/-0)
src/server/scene/global_event_sender.h (+1/-0)
tests/include/mir_test_doubles/mock_client_buffer_stream.h (+1/-0)
tests/include/mir_test_doubles/mock_event_sink.h (+1/-0)
tests/include/mir_test_doubles/null_event_sink.h (+1/-0)
tests/integration-tests/test_exchange_buffer.cpp (+86/-3)
tests/unit-tests/client/test_client_buffer_stream.cpp (+67/-5)
tags: | added: enhancement |
summary: |
- Mir protocol design prevents clients from ever being more than double- - buffered + [enhancement] Mir protocol design prevents clients from ever being more + than double-buffered |
Changed in mir: | |
milestone: | none → 0.14.0 |
assignee: | nobody → Kevin DuBois (kdub) |
status: | Triaged → In Progress |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
milestone: | 0.15.0 → 0.16.0 |
I just noticed the new callback/completion stuff in SwitchingBundle prevents clients from holding multiple buffers. We've gone backwards a little on this one.