Merge lp:~andreas-pokorny/mir/nbs-resize-first-stream-of-surface into lp:mir
| Status: | Rejected |
|---|---|
| Rejected by: | Andreas Pokorny on 2016-09-12 |
| Proposed branch: | lp:~andreas-pokorny/mir/nbs-resize-first-stream-of-surface |
| Merge into: | lp:mir |
| Prerequisite: | lp:~andreas-pokorny/mir/avoid-static-library-ordering-problems |
| Diff against target: |
277 lines (+98/-7) 9 files modified
src/client/connection_surface_map.h (+1/-0) src/client/mir_connection.cpp (+10/-0) src/client/mir_connection.h (+1/-0) src/client/mir_surface.cpp (+12/-0) src/client/mir_surface.h (+2/-1) src/client/surface_map.cpp (+14/-0) src/client/surface_map.h (+2/-0) tests/unit-tests/client/test_client_mir_surface.cpp (+50/-6) tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+6/-0) |
| To merge this branch: | bzr merge lp:~andreas-pokorny/mir/nbs-resize-first-stream-of-surface |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Daniel van Vugt | Abstain on 2016-08-19 | ||
| Alan Griffiths | 2016-07-27 | Abstain on 2016-08-03 | |
| Mir CI Bot | continuous-integration | Approve on 2016-08-01 | |
| Mir development team | 2016-08-25 | Pending | |
|
Review via email:
|
|||
Commit Message
Make NBS behave like OBS - resize the first buffer stream
With OBS mir::scene:
Since we deprecate using mir_surface_
Description of the Change
With presentation chains the client handles resizes by submitting buffers in an adjusted size. With BufferStream there is no way a client can resize an existing stream. With OBS the server made sure that upcoming allocations adapt to the window size. Since the BufferStreams functionality moved to mirclient with NBS, the resize is forwarded to the 'default' BufferStream.
This change makes sure that even when the caller uses mir_surface_
- 3616. By Andreas Pokorny on 2016-07-27
-
spell out the actual expectation: no exception when attempting to resize a presentation chain
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3616
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3616
https:/
Executed test runs:
SUCCESS: https:/
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:/
| Alan Griffiths (alan-griffiths) wrote : | # |
I'm not sure enough of the implications to know if this is a good idea. What user visible feature does it effect?
Also "with_potential
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> I'm not sure enough of the implications to know if this is a good idea. What
> user visible feature does it effect?
>
> Also "with_potential
Created a bug (lp:1608457) for the problem I observerd with gtk+
- 3617. By Andreas Pokorny on 2016-08-01
-
rename new method
| Kevin DuBois (kdub) wrote : | # |
I think this is fine as a workaround while the definitions are improved in this area.
The physical buffer size is something the client sets, and the onscreen size is something server/shell sets.
The legacy problem has to do with how the sizes (physical and on-screen) were assumed to be the same. The default stream used to just be resized, and now the 1st stream will just be resized.
A function like:
mir_buffer_
might be what's needed to make things in the non-legacy world a bit nicer and clearer.
| Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3617
https:/
Executed test runs:
SUCCESS: https:/
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:/
| Alan Griffiths (alan-griffiths) wrote : | # |
*Needs Discussion*
It seems that the client API lacks a mir_buffer_
But I'm concerned that clients might want to make an atomic update of size and scale. Is the "correct" approach to create a new buffer stream?
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> *Needs Discussion*
>
> It seems that the client API lacks a mir_buffer_
> that would be a better fix than this proposal.
>
> But I'm concerned that clients might want to make an atomic update of size and
> scale. Is the "correct" approach to create a new buffer stream?
Existing behavior with and without mir_surface_
The release-
lp:~andreas-pokorny/mir/fix-buffer-release-requests-after-buffer-stream-destruction
The recreate approach has the advantage that it is immediately clear that the first buffer you get from the buffer stream will have the right size. Additionally the screen update would be tied to the necessary mir_surface_
But a current implementation detail makes the recreate approach a bit more resource intense since on creation three buffers are allocated. With a sequence of resize events two thirds of all created buffers are just allocated and freed without use. I assume that problem can be solved through an implementation change in mirclient.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> I think this is fine as a workaround while the definitions are improved in
> this area.
>
> The physical buffer size is something the client sets, and the onscreen size
> is something server/shell sets.
>
> The legacy problem has to do with how the sizes (physical and on-screen) were
> assumed to be the same. The default stream used to just be resized, and now
> the 1st stream will just be resized.
>
> A function like:
> mir_buffer_
> might be what's needed to make things in the non-legacy world a bit nicer and
> clearer.
What is the unit of the physical size? Is this related to the existing mir_buffer_
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> Do we need to hold 0.23.5 for this?
We discussed that yesterday. The combination in which resize does not happen is not used by qt, gtk or sdl. So no need to hold 0.23.5 for now.
| Daniel van Vugt (vanvugt) wrote : | # |
Sorry, I don't remember having that discussion. Only asking a few times. Maybe I didn't understand the answer.
| Alan Griffiths (alan-griffiths) wrote : | # |
The current special treatment of the first buffer seems inconsistent. So, as it is unused in practice, I'd rather not add this code to replicate it.
> The recreate approach has the advantage that it is immediately clear that the
> first buffer you get from the buffer stream will have the right size.
> Additionally the screen update would be tied to the necessary
> mir_surface_
> arguments to have it happen instantly or only after the next buffer swap..
>
> But a current implementation detail makes the recreate approach a bit more
> resource intense since on creation three buffers are allocated. With a
> sequence of resize events two thirds of all created buffers are just allocated
> and freed without use. I assume that problem can be solved through an
> implementation change in mirclient.
My *preference* would be to make the recreate approach (1) work and (2) work efficiently.
But I don't feel strongly about it today.
| Kevin DuBois (kdub) wrote : | # |
> The current special treatment of the first buffer seems inconsistent. So, as
> it is unused in practice, I'd rather not add this code to replicate it.
Right, it is inconsistent, but it is used, iirc. The surface that gets resized by the server has to respond by resizing the 'default' buffer stream. It seemed better to just keep the auto-resizing around for the 'default/legacy' case, instead saying that the first stream gets resized to the size of the surface (as it is in this MP).
Auto-resizing the 1st stream, as opposed to the only a 'legacy' stream, makes it a bit harder to arrange a scene. Like, if I wanted a 200x200 surface with 4 100x100 windows, and then the server resizes the surface to 500x500, the 1st stream would fill the space after the resize message. The current design is a bit broken for other reasons (no atomic scene arrangements), but I think this might complicate the matter (esp if we're going to use 'tips' for this intented purpose).
This region is due for a bit of cleanup with the atomic updates topic that's coming around soon, maybe we WIP the branch until then, and then roll it into a larger fix to make the scene arrangement and sizes more consistent?
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> > The current special treatment of the first buffer seems inconsistent. So, as
> > it is unused in practice, I'd rather not add this code to replicate it.
>
> Right, it is inconsistent, but it is used, iirc. The surface that gets resized
> by the server has to respond by resizing the 'default' buffer stream. It
> seemed better to just keep the auto-resizing around for the 'default/legacy'
> case, instead saying that the first stream gets resized to the size of the
> surface (as it is in this MP).
>
> Auto-resizing the 1st stream, as opposed to the only a 'legacy' stream, makes
> it a bit harder to arrange a scene. Like, if I wanted a 200x200 surface with 4
> 100x100 windows, and then the server resizes the surface to 500x500, the 1st
> stream would fill the space after the resize message. The current design is a
> bit broken for other reasons (no atomic scene arrangements), but I think this
> might complicate the matter (esp if we're going to use 'tips' for this
> intented purpose).
>
> This region is due for a bit of cleanup with the atomic updates topic that's
> coming around soon, maybe we WIP the branch until then, and then roll it into
> a larger fix to make the scene arrangement and sizes more consistent?
The reason why I proposed this is because we resized the first stream when old buffer semantics were used. But not without another "but". It only did so for the initial configuration - if the users switches to different "first" stream with another spec update it stopped working
We have so many wrong behaviors that I wasnt sure what to expect when changing gtk+.
I also do not like the auto resizing.. So I guess we should focus on making client driven resizes nicer then.
| Daniel van Vugt (vanvugt) wrote : | # |
I don't want to be a blocker here. I didn't realize mir_surface_
All toolkits want is a:
mir_
which they currently have to do via:
mir_
It's already annoying enough. I don't endorse us making it worse. But that's not the fault of this branch.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
Rejecting - the fact that OBS with set_streams would resize buffer stream is fishy for the more interesting use cases.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
*would resize the first buffer stream*
Unmerged revisions
- 3617. By Andreas Pokorny on 2016-08-01
-
rename new method
- 3616. By Andreas Pokorny on 2016-07-27
-
spell out the actual expectation: no exception when attempting to resize a presentation chain
- 3615. By Andreas Pokorny on 2016-07-27
-
Tests and additional changes to handle the PresentationChain case
- 3614. By Andreas Pokorny on 2016-07-27
-
Make NBS behave like OBS - resize the first buffer stream
With OBS mir::scene:
:BasicSurface would pull out the first stream as the 'default' stream and forward all resizes to that stream. With NBS this is done by the client library. So if no buffer stream is configured via the mir_surface_ spec_add_ buffer_ stream or mir_surface_ spec_set_ streams API the client side surface will forward the content of resize events to the 'default' stream. Since we deprecate using mir_surface_
get_buffer_ stream users are forces to specify the streams or presentation queues they want for display. But streams buffers lack a resize functionality so switching to the new function would not be a viable option.

FAILED: Continuous integration, rev:3615 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1357/ /mir-jenkins. ubuntu. com/job/ build-mir/ 1617/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/1670 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 1661 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 1661 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 1661 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= vivid+overlay/ 1632 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= vivid+overlay/ 1632/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 1632/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 1632/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 1632/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 1632 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 1632/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 1632 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 1632/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1357/rebuild
https:/