Mir

Merge lp://qastaging/~mir-team/mir/introduce-buffer-stream into lp://qastaging/mir

Proposed by Robert Carr
Status: Work in progress
Proposed branch: lp://qastaging/~mir-team/mir/introduce-buffer-stream
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~mir-team/mir/remove-buffer-writer
Diff against target: 5106 lines (+2369/-268)
102 files modified
benchmarks/frame-uniformity/touch_measuring_client.cpp (+1/-1)
client-ABI-sha1sums (+6/-5)
common-ABI-sha1sums (+1/-1)
examples/CMakeLists.txt (+9/-0)
examples/animated_cursor_demo_client.c (+82/-0)
examples/basic.c (+11/-6)
examples/eglapp.c (+1/-1)
examples/fingerpaint.c (+3/-2)
examples/flicker.c (+3/-2)
examples/multiwin.c (+3/-2)
examples/progressbar.c (+4/-2)
examples/scroll.cpp (+2/-1)
include/client/mir_toolkit/mir_buffer_stream.h (+150/-0)
include/client/mir_toolkit/mir_client_library.h (+1/-0)
include/client/mir_toolkit/mir_cursor_configuration.h (+14/-0)
include/client/mir_toolkit/mir_screencast.h (+1/-16)
include/client/mir_toolkit/mir_surface.h (+20/-6)
include/common/mir_toolkit/client_types.h (+13/-8)
include/platform/mir/graphics/buffer.h (+1/-0)
include/server/mir/frontend/buffer_stream.h (+65/-0)
include/server/mir/frontend/session.h (+6/-0)
include/server/mir/frontend/session_mediator_report.h (+4/-0)
include/server/mir/frontend/surface.h (+7/-2)
include/server/mir/frontend/surface_id.h (+1/-0)
platform-ABI-sha1sums (+2/-2)
server-ABI-sha1sums (+7/-6)
src/client/CMakeLists.txt (+2/-0)
src/client/cursor_configuration.h (+6/-0)
src/client/mir_buffer_stream.h (+68/-0)
src/client/mir_buffer_stream_api.cpp (+178/-0)
src/client/mir_cursor_api.cpp (+26/-1)
src/client/mir_screencast.cpp (+59/-9)
src/client/mir_screencast.h (+26/-12)
src/client/mir_screencast_api.cpp (+3/-13)
src/client/mir_surface.cpp (+21/-6)
src/client/mir_surface.h (+12/-5)
src/client/mir_surface_api.cpp (+30/-15)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+7/-0)
src/client/surfaceless_buffer_stream.cpp (+296/-0)
src/client/surfaceless_buffer_stream.h (+120/-0)
src/platforms/android/buffer.cpp (+27/-1)
src/platforms/android/buffer.h (+3/-0)
src/platforms/mesa/gbm_buffer.cpp (+5/-0)
src/platforms/mesa/gbm_buffer.h (+1/-0)
src/platforms/mesa/shm_buffer.cpp (+5/-0)
src/platforms/mesa/shm_buffer.h (+2/-1)
src/protobuf/mir_protobuf.proto (+27/-1)
src/server/compositor/temporary_buffers.cpp (+5/-0)
src/server/compositor/temporary_buffers.h (+1/-0)
src/server/frontend/CMakeLists.txt (+1/-1)
src/server/frontend/buffer_stream_tracker.cpp (+6/-6)
src/server/frontend/buffer_stream_tracker.h (+13/-13)
src/server/frontend/protobuf_message_processor.cpp (+17/-0)
src/server/frontend/protobuf_message_processor.h (+1/-0)
src/server/frontend/session_mediator.cpp (+114/-17)
src/server/frontend/session_mediator.h (+14/-4)
src/server/graphics/nested/mir_client_host_connection.cpp (+1/-1)
src/server/report/logging/session_mediator_report.cpp (+10/-0)
src/server/report/logging/session_mediator_report.h (+4/-0)
src/server/report/lttng/session_mediator_report.cpp (+2/-0)
src/server/report/lttng/session_mediator_report.h (+2/-0)
src/server/report/lttng/session_mediator_report_tp.h (+2/-0)
src/server/report/null/session_mediator_report.cpp (+8/-0)
src/server/report/null/session_mediator_report.h (+4/-0)
src/server/scene/application_session.cpp (+109/-8)
src/server/scene/application_session.h (+18/-1)
src/server/scene/basic_surface.cpp (+134/-4)
src/server/scene/basic_surface.h (+8/-0)
src/server/scene/default_configuration.cpp (+1/-0)
src/server/scene/session_manager.cpp (+6/-4)
src/server/scene/session_manager.h (+3/-0)
src/utils/screencast.cpp (+3/-3)
tests/acceptance-tests/test_client_library.cpp (+23/-22)
tests/acceptance-tests/test_client_surface_swap_buffers.cpp (+3/-2)
tests/acceptance-tests/test_client_surface_visibility.cpp (+2/-2)
tests/acceptance-tests/test_nested_mir.cpp (+2/-0)
tests/acceptance-tests/test_server_disconnect.cpp (+1/-1)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+53/-2)
tests/acceptance-tests/throwback/test_client_input.cpp (+2/-1)
tests/include/mir_test_doubles/mock_buffer.h (+1/-0)
tests/include/mir_test_doubles/mock_frontend_surface.h (+7/-0)
tests/include/mir_test_doubles/mock_scene_session.h (+4/-0)
tests/include/mir_test_doubles/stub_buffer.h (+2/-0)
tests/include/mir_test_doubles/stub_buffer_stream_factory.h (+44/-0)
tests/include/mir_test_doubles/stub_scene_session.h (+12/-0)
tests/include/mir_test_doubles/stub_scene_surface.h (+3/-0)
tests/include/mir_test_doubles/stub_session.h (+11/-0)
tests/integration-tests/CMakeLists.txt (+1/-0)
tests/integration-tests/frontend/test_session_mediator_report.cpp (+2/-0)
tests/integration-tests/test_client_buffer_stream.cpp (+213/-0)
tests/integration-tests/test_client_screencast.cpp (+4/-4)
tests/integration-tests/test_server_shutdown.cpp (+3/-3)
tests/integration-tests/test_session.cpp (+2/-0)
tests/integration-tests/test_session_manager.cpp (+5/-0)
tests/integration-tests/test_stale_frames.cpp (+6/-6)
tests/integration-tests/test_surface_first_frame_sync.cpp (+1/-1)
tests/unit-tests/client/test_client_mir_surface.cpp (+9/-5)
tests/unit-tests/client/test_mir_screencast.cpp (+18/-3)
tests/unit-tests/frontend/test_client_buffer_tracker.cpp (+18/-18)
tests/unit-tests/frontend/test_session_mediator.cpp (+6/-1)
tests/unit-tests/scene/test_application_session.cpp (+75/-8)
tests/unit-tests/scene/test_session_manager.cpp (+7/-0)
To merge this branch: bzr merge lp://qastaging/~mir-team/mir/introduce-buffer-stream
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Alan Griffiths Needs Information
Daniel van Vugt Needs Fixing
Review via email: mp+245048@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2014-12-10.

Commit message

Introduce MirBufferStream

Description of the change

This branch introduces a client side MirBufferStream as an abstraction for uploading raw image data to the cursor. BufferStream is also used to replace the swap_bufffers, native_window, etc functions on MirSurface and Screencast.

A method is provided for creating a buffer stream not attached to a surface (see mir_toolkit/mir_buffer_stream.h>. These streams may be used with mir_cursor_configuration_from_buffer_stream.

In the future these streams may be useful to represent other things, e.g. decoration 'surfaces'.

========

Resubmit dep on remove-buffer-writer due to many conflict points + shared test hw access fix

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

I guess Ill set as work in progress until I finish manual testing so I don't end up wasting anyones time.

I'm concerned some areas re not covered well by automated test, e.g. screencast EGL window integration

Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

Did some manual testing seems solid.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

It wasn't too long ago we were talking about removing BufferStream because it served no purpose. Now it has a purpose, that's a good thing in theory.

I'm wondering if it makes any sense to push the concept up to the session/frontend level though. I would not have thought that high level things should care about buffer streams, only surfaces.

Perhaps the issue is the reverse of what's presented here (I think... I haven't review it in detail). Perhaps what you call a BufferStream is actually the correct role for BasicSurface, because it's utterly basic compared to a window. I have a branch coming very soon that more clearly separates BasicSurface from more complicated windowing things...

I think there's a good case not against this idea, but against using the more confusing word "BufferStream" everywhere. I think it might be clearer to define different levels of "Surface" instead. But I have a branch (hopefully today) that will demonstrate that.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

Got some comments from chris going to iterate a little

Revision history for this message
Robert Carr (robertcarr) wrote :

Some movement from chris's suggestions namely the removal of the MirScreencast client facing type.

depends on:
https://code.launchpad.net/~mir-team/mir/log-exceptions-at-client-boundary/+merge/245165

as well as remove-buffer-writer (specified on LP)

and diff will shrink as that lands

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2159. By Robert Carr

 Merge log exceptions

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2160. By Robert Carr

Merge trunk

2161. By Robert Carr

MErge log-exceptions-at-cleint-boundary

2162. By Robert Carr

Ensure MIR_LOG_COMPONENT is defined

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2163. By Robert Carr <racarr@ocelot>

Merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2164. By Robert Carr <racarr@ocelot>

Merge lp:~mir-team/mir/log-exceptions-at-client-boundary

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2165. By Robert Carr <racarr@ocelot>

Cleanup install

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2166. By Daniel van Vugt

Merge latest trunk and fix a trivial conflict.

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

I can't reproduce the failure Jenkins got on mako. But I am familiar with TestClientInput failing on a semi-regular basis. Also related - I noticed recently helgrind reports some races in the input code.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I don't fully understand the value added by all this new code. Most pressingly I'd like to get an clear definition of what the difference between a BufferStream and Surface is. Is a BufferStream a window/surface minus position, state and type information? If so then, Needs fixing: "Surfaceless" is superfluous and should be removed in "SurfacelessBufferStream".

So I think I kind of understand the intention, but I'm concerned for future maintenance by the fact that we need to add two thousand lines of code for this and gain no new functionality. There should be more overlap (lines of code removed/replaced) if a BufferStream represents a significant part of what we already call a Surface.

If we're going to generalize "BufferStream" from "Surface" then I think we must subtract that functionality from Surface at the same time, because duplicating the functionality first and assuming someone will or can unduplicate it later is a dangerous assumption. Left unchecked, the maintainability of the Mir codebase will suffer.

I'm also concerned this makes "Surface" mean something more specialized like "Window", but that's an adjustment we can all make mentally, and I think many people have already.

review: Needs Fixing
Revision history for this message
Robert Carr (robertcarr) wrote :

>> Is a BufferStream a window/surface minus position, state and type information? If so then,
>> Needs fixing: "Surfaceless" is superfluous and should be removed in "SurfacelessBufferStream".

I've been thinking BufferStream is an interface to an object. you can use to exchange buffers with the server. SurfacelessBufferStream is then an implementation name (with Screencast and Surface also implementing BufferStream). I could remove the Surfaceless on the private impl class though...don't have strong feelings.

>> If we're going to generalize "BufferStream" from "Surface" then I think we must subtract that
>> functionality from Surface at the same time, because duplicating the functionality first and >> assuming someone will or can unduplicate it later is a dangerous assumption.
>>

There's some work at code sharing and deduplication... e.g. mir_buffer_stream_ api functions deprecating mir_surface_ and mir_screencast_ functions (not necessarily removed yet due to ABI). Surface and BufferStream share SessionMediator exchange_buffer impls...it would be nice to pull screencast in to this fold.

I think the main area left to deduplicate is the client machinery impl e.g. SurfacelessBufferStream and MirScreencast...I can't find a compelling way to do that...though I could certainly take another look. Do you have any ideas?

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

It does look a lot like the chunks of green are "new" functionality that's actually copied from existing functionality. And that's OK, but I'm not comfortable with the existing functionality staying then (the absence of red), because it's now duplicated.

Re-using the BufferStream logic for surfaces instead of duplicating it would also provide a very credible proof that the BufferStream stuff works, because we could then verify and trust it easily by both the current test suite and in manual testing of existing clients. It might sound simplistic to say "too much green and not enough red", but that's a definite symptom of insufficient code reuse here...

Actually BufferStream sounds a lot like what was being discussed for auxiliary surfaces (and I had planned it that way in my mind). So I think we could continue down this path using the term "Surface" instead of "BufferStream". That would allow clients to use the existing API for primitive buffer streams (e.g. cursors, decorations, indicators, icons, whatever) instead of needing to duplicate logic with new terminology.

If you need to distinguish between a primitive ("BufferStream") Surface and a desktop-style Surface then call the latter a "Window" :)

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

If we simply added a "mir_surface_type_cursor" and modified the server logic to distinguish between surface types, then clients could use the existing API. I think that would be nicer than doubling the number of client API functions...

Revision history for this message
Robert Carr (robertcarr) wrote :

>> I think that would be nicer than doubling the number of client API function

The old functions are deprecated.

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

395 + * DEPRECATED: Prefer mir_surface_get_buffer_stream and the corresponding

or

__attribute__((__deprecated__(...)))

review: Needs Information
2167. By Robert Carr

Merge trunk

2168. By Robert Carr

Use __attribute__(deprecated)

Revision history for this message
Robert Carr (robertcarr) wrote :

Switched to __attribute__((__deprecated__ and finished porting intree code.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, deprecation is a small improvement. Although we're talking about the client API so deprecated stuff won't go away quickly. Ideally we don't want client ABI breaks more than once a year or so. Preferably less.

The terminology feels convoluted and inelegant still. I'm not convinced "Surface" ever had a clear enough definition that it's a word we need to stop using in favour of "BufferStream". Not only is "surface" more concise, but it allows us to avoid code duplication, avoid growing the client API again, and avoid changing the protocol.

It's not that something is functionally broken. It's just that I feel Mir's future adoption, usability and maintainability will suffer as a result of this.

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

Also, the suggested alternative of a "mir_surface_type_cursor" has none of the disadvantages this branch has. It creates zero duplication, zero change in the client API, zero protocol change and zero future ABI break required. All while solving the same problems more elegantly using our existing logic. I think it should be considered.

Unmerged revisions

2168. By Robert Carr

Use __attribute__(deprecated)

2167. By Robert Carr

Merge trunk

2166. By Daniel van Vugt

Merge latest trunk and fix a trivial conflict.

2165. By Robert Carr <racarr@ocelot>

Cleanup install

2164. By Robert Carr <racarr@ocelot>

Merge lp:~mir-team/mir/log-exceptions-at-client-boundary

2163. By Robert Carr <racarr@ocelot>

Merge trunk

2162. By Robert Carr

Ensure MIR_LOG_COMPONENT is defined

2161. By Robert Carr

MErge log-exceptions-at-cleint-boundary

2160. By Robert Carr

Merge trunk

2159. By Robert Carr

 Merge log exceptions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches