A scaled (not panned or clipped) mirror/clone mode is desired
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mir |
Fix Released
|
High
|
Daniel van Vugt |
Bug Description
Unity8 wants the ability to configure the displays to clone mode.
That is, unity8 has a single surface, which then USC composites on all displays - scaling the surface so that unity8 is fullscreen (or with minimal black borders) on all displays.
Currently all Unity8 can do is configure all displays to view position (0,0), so that all displays render the surface at that position. But for displays of differing resolution, that surface can be clipped/bordered. This is not ideal.
Related branches
- Mir CI Bot: Approve (continuous-integration) on 2017-01-31
- Daniel van Vugt: Approve on 2017-01-31
- Cemil Azizoglu (community): Approve on 2017-01-30
- Alan Griffiths: Approve on 2017-01-30
-
Diff: 960 lines (+174/-210)29 files modifiedinclude/platform/mir/graphics/display_buffer.h (+9/-20)
include/renderer/mir/renderer/renderer.h (+2/-2)
include/test/mir/test/doubles/null_display_buffer.h (+1/-2)
playground/demo-shell/demo_compositor.cpp (+1/-1)
src/include/platform/mir/graphics/transformation.h (+52/-0)
src/platforms/android/server/display_buffer.cpp (+8/-15)
src/platforms/android/server/display_buffer.h (+2/-2)
src/platforms/eglstream-kms/server/display.cpp (+3/-8)
src/platforms/mesa/server/kms/display_buffer.cpp (+9/-13)
src/platforms/mesa/server/kms/display_buffer.h (+2/-3)
src/platforms/mesa/server/x11/graphics/display_buffer.cpp (+6/-8)
src/platforms/mesa/server/x11/graphics/display_buffer.h (+2/-2)
src/renderers/gl/renderer.cpp (+3/-58)
src/renderers/gl/renderer.h (+1/-3)
src/server/compositor/default_display_buffer_compositor.cpp (+1/-1)
src/server/compositor/screencast_display_buffer.cpp (+6/-9)
src/server/compositor/screencast_display_buffer.h (+2/-4)
src/server/graphics/nested/display_buffer.cpp (+3/-12)
src/server/graphics/nested/display_buffer.h (+1/-2)
tests/include/mir/test/doubles/mock_display_buffer.h (+1/-2)
tests/include/mir/test/doubles/mock_renderer.h (+1/-1)
tests/include/mir/test/doubles/stub_renderer.h (+1/-1)
tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+21/-26)
tests/unit-tests/compositor/test_screencast_display_buffer.cpp (+3/-1)
tests/unit-tests/platforms/android/server/test_display.cpp (+11/-4)
tests/unit-tests/platforms/android/server/test_display_buffer.cpp (+14/-6)
tests/unit-tests/platforms/android/server/test_display_group.cpp (+1/-2)
tests/unit-tests/platforms/mesa/kms/test_display.cpp (+3/-1)
tests/unit-tests/platforms/mesa/kms/test_display_buffer.cpp (+4/-1)
- Mir CI Bot: Approve (continuous-integration) on 2017-02-15
- Daniel van Vugt: Approve on 2017-02-15
- Chris Halse Rogers: Approve on 2017-02-14
-
Diff: 775 lines (+119/-98)29 files modifieddebian/control (+6/-8)
debian/mir-platform-graphics-android13.install (+1/-1)
debian/mir-platform-graphics-mesa-kms13.install (+1/-1)
debian/mir-platform-graphics-mesa-x13.install (+1/-1)
include/platform/mir/graphics/display.h (+1/-2)
include/test/mir/test/doubles/null_display.h (+1/-1)
src/platforms/CMakeLists.txt (+2/-2)
src/platforms/android/server/display.cpp (+1/-1)
src/platforms/android/server/display.h (+1/-1)
src/platforms/eglstream-kms/server/display.cpp (+1/-2)
src/platforms/eglstream-kms/server/display.h (+1/-1)
src/platforms/mesa/server/kms/cursor.cpp (+14/-11)
src/platforms/mesa/server/kms/cursor.h (+2/-2)
src/platforms/mesa/server/kms/display.cpp (+2/-3)
src/platforms/mesa/server/kms/display.h (+1/-1)
src/platforms/mesa/server/kms/kms_output.h (+2/-2)
src/platforms/mesa/server/kms/real_kms_output.cpp (+11/-5)
src/platforms/mesa/server/kms/real_kms_output.h (+2/-2)
src/platforms/mesa/server/x11/graphics/display.cpp (+1/-1)
src/platforms/mesa/server/x11/graphics/display.h (+1/-1)
src/server/graphics/default_configuration.cpp (+17/-17)
src/server/graphics/nested/cursor.cpp (+0/-1)
src/server/graphics/nested/display.cpp (+2/-2)
src/server/graphics/nested/display.h (+1/-1)
tests/include/mir/test/doubles/mock_display.h (+1/-1)
tests/mir_test_framework/stubbed_graphics_platform.cpp (+2/-2)
tests/unit-tests/platforms/mesa/kms/mock_kms_output.h (+2/-2)
tests/unit-tests/platforms/mesa/kms/test_cursor.cpp (+38/-22)
tests/unit-tests/platforms/nested/test_nested_cursor.cpp (+3/-1)
- Brandon Schaefer (community): Approve on 2017-02-15
- Mir CI Bot: Approve (continuous-integration) on 2017-02-15
-
Diff: 157 lines (+132/-0)2 files modifiedsrc/renderers/gl/renderer.cpp (+31/-0)
tests/unit-tests/renderers/gl/test_gl_renderer.cpp (+101/-0)
- Mir CI Bot: Approve (continuous-integration) on 2017-05-17
- Alan Griffiths: Approve on 2017-05-16
-
Diff: 749 lines (+273/-7)23 files modifiedinclude/client/mir_toolkit/mir_display_configuration.h (+23/-0)
include/platform/mir/graphics/display_configuration.h (+4/-0)
src/client/display_configuration_api.cpp (+20/-0)
src/client/symbols.map (+2/-0)
src/platform/graphics/display_configuration.cpp (+29/-3)
src/platforms/mesa/server/kms/real_kms_display_configuration.cpp (+1/-0)
src/platforms/mesa/server/x11/graphics/display_configuration.cpp (+1/-0)
src/protobuf/mir_protobuf.proto (+7/-0)
src/server/frontend/protobuf_buffer_packer.cpp (+1/-0)
src/server/frontend/session_mediator.cpp (+14/-0)
src/server/graphics/nested/nested_display_configuration.cpp (+9/-1)
src/server/graphics/offscreen/display_configuration.cpp (+1/-0)
src/utils/out.c (+19/-0)
tests/acceptance-tests/test_latency.cpp (+1/-0)
tests/acceptance-tests/test_new_display_configuration.cpp (+57/-0)
tests/mir_test/display_config_matchers.cpp (+27/-2)
tests/mir_test_doubles/stub_display_configuration.cpp (+4/-0)
tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+4/-1)
tests/unit-tests/graphics/test_display_configuration.cpp (+28/-0)
tests/unit-tests/graphics/test_overlapping_output_grouping.cpp (+1/-0)
tests/unit-tests/platforms/mesa/kms/test_cursor.cpp (+3/-0)
tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp (+9/-0)
tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp (+8/-0)
- Mir CI Bot: Approve (continuous-integration) on 2017-02-17
- Daniel van Vugt: Approve on 2017-02-17
- Brandon Schaefer (community): Approve on 2017-02-16
- Andreas Pokorny (community): Approve on 2017-02-16
-
Diff: 162 lines (+67/-14)7 files modifiedinclude/client/mir_toolkit/mir_display_configuration.h (+22/-0)
src/client/display_configuration_api.cpp (+10/-0)
src/client/symbols.map (+2/-0)
src/protobuf/mir_protobuf.proto (+2/-0)
src/server/frontend/protobuf_buffer_packer.cpp (+4/-0)
src/utils/out.c (+3/-14)
tests/acceptance-tests/test_new_display_configuration.cpp (+24/-0)
- Mir CI Bot: Approve (continuous-integration) on 2017-03-22
- Alan Griffiths: Approve on 2017-03-21
- Alexandros Frantzis (community): Approve on 2017-03-21
-
Diff: 111 lines (+65/-1)3 files modifiedsrc/renderers/gl/renderer.cpp (+12/-1)
src/renderers/gl/renderer.h (+2/-0)
tests/unit-tests/renderers/gl/test_gl_renderer.cpp (+51/-0)
- Alberto Aguirre (community): Approve on 2017-04-13
- Alexandros Frantzis (community): Abstain on 2017-04-11
- Mir CI Bot: Approve (continuous-integration) on 2017-04-06
-
Diff: 354 lines (+47/-53)4 files modifiedsrc/platforms/mesa/server/kms/display.cpp (+15/-8)
src/platforms/mesa/server/kms/display_buffer.cpp (+7/-20)
src/platforms/mesa/server/kms/display_buffer.h (+3/-3)
tests/unit-tests/platforms/mesa/kms/test_display_buffer.cpp (+22/-22)
- Alexandros Frantzis (community): Approve on 2017-03-30
- Mir CI Bot: Approve (continuous-integration) on 2017-03-28
-
Diff: 136 lines (+21/-25)3 files modifiedsrc/platforms/mesa/server/x11/graphics/display.cpp (+5/-2)
src/platforms/mesa/server/x11/graphics/display_buffer.cpp (+12/-18)
src/platforms/mesa/server/x11/graphics/display_buffer.h (+4/-5)
- Chris Halse Rogers: Approve on 2017-04-03
- Kevin DuBois (community): Approve on 2017-04-03
- Mir CI Bot: Approve (continuous-integration) on 2017-03-29
-
Diff: 38 lines (+5/-2)1 file modifiedsrc/platforms/eglstream-kms/server/display.cpp (+5/-2)
- Kevin DuBois (community): Approve on 2017-04-03
- Mir CI Bot: Approve (continuous-integration) on 2017-03-29
-
Diff: 294 lines (+36/-33)8 files modifiedsrc/platforms/android/server/configurable_display_buffer.h (+1/-1)
src/platforms/android/server/display.cpp (+6/-3)
src/platforms/android/server/display_buffer.cpp (+6/-6)
src/platforms/android/server/display_buffer.h (+2/-3)
src/platforms/android/server/display_group.cpp (+2/-2)
src/platforms/android/server/display_group.h (+2/-1)
tests/unit-tests/platforms/android/server/test_display_buffer.cpp (+16/-16)
tests/unit-tests/platforms/android/server/test_display_group.cpp (+1/-1)
- Mir CI Bot: Approve (continuous-integration) on 2017-04-04
- Alan Griffiths: Approve on 2017-04-03
-
Diff: 385 lines (+54/-56)9 files modifiedsrc/platforms/android/server/configurable_display_buffer.h (+1/-1)
src/platforms/android/server/display.cpp (+3/-9)
src/platforms/android/server/display.h (+0/-1)
src/platforms/android/server/display_buffer.cpp (+8/-16)
src/platforms/android/server/display_buffer.h (+3/-3)
src/platforms/android/server/display_group.cpp (+2/-2)
src/platforms/android/server/display_group.h (+1/-1)
tests/unit-tests/platforms/android/server/test_display_buffer.cpp (+35/-22)
tests/unit-tests/platforms/android/server/test_display_group.cpp (+1/-1)
- Alberto Aguirre (community): Approve on 2017-04-22
- Mir CI Bot: Approve (continuous-integration) on 2017-04-21
-
Diff: 160 lines (+36/-13)7 files modifiedinclude/platform/mir/graphics/display_configuration.h (+12/-0)
src/platform/graphics/display_configuration.cpp (+6/-0)
src/platform/graphics/overlapping_output_grouping.cpp (+2/-2)
src/platform/symbols.map (+7/-0)
src/platforms/eglstream-kms/server/display.cpp (+1/-1)
src/platforms/mesa/server/kms/display.cpp (+5/-9)
src/platforms/mesa/server/x11/graphics/display.cpp (+3/-1)
summary: |
- Mirror mode desired + Mirror/clone mode desired |
tags: | added: enhancement multimonitor |
summary: |
- Mirror/clone mode desired + A scaled (not panned or clipped) mirror/clone mode is desired |
Changed in mir: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Gerry Boland (gerboland) wrote : | #2 |
> (1) The title suggests Mir doesn't have a clone mode, but it does and
> has done for years.
My definition of clone/mirror apparently does not match yours - and I'll argue that without scaling, clone mode is not useful.
> (2) The suggested solution of scaling is probably significantly more
> work (and possibly less desirable) than another solution I was thinking
> about...
What I have asked for is what design has requested.
Changed in mir: | |
assignee: | nobody → Daniel van Vugt (vanvugt) |
Nick Dedekind (nick-dedekind) wrote : | #3 |
I think we need to at least duplicate what X does. It seems to choose the highest common resolution. But then xrandr is spitting out a bunch more modes than mir is picking up for internal displays, so perhaps it's actually scaling?
Daniel van Vugt (vanvugt) wrote : | #4 |
Nick,
You've got your bugs mixed up. That comment belongs in bug 1196239 and the comment in that bug belongs here.
Daniel van Vugt (vanvugt) wrote : | #5 |
OK, I've got a basic plan for this...
Give outputs A and B of arbitrary differing resolutions, if you want to clone A to B then B will simply display a potentially scaled and letterboxed image of A. To achieve this you would simply set B's logical position and logical size to that of A.
In Xorg you can already do something like that:
xrandr --output B -pos (A.X)x(A.Y) --scale-from (A.WIDTH)
So then you have arbitrary cloning of any display to any display even if they have different physical resolutions.
What's missing in Mir right now is the API for setting the arbitrary logical size for an output. Although our default GL renderer already supports arbitrary logical sizes it might still be missing letterbox support to avoid distortion.
Gerry Boland (gerboland) wrote : | #6 |
I was thinking of a simpler setup, having 2 displays, you could just configure DisplayB to clone DisplayA, and Mir would handle the scaling/
Your proposal is more flexible than that, but I don't see the value in that flexibility. For what would I use your proposal that is not clone-related?
Daniel van Vugt (vanvugt) wrote : | #7 |
It's the same thing really. Indeed we should provide simpler helper functions for "clone A onto B". I was really just describing the underlying implementation.
Daniel van Vugt (vanvugt) wrote : | #9 |
It's on my queue of work, immediately behind finishing (proposing) the first part of client-side vsync to solve our the latency problems in time for Mir 0.26.
Changed in mir: | |
milestone: | none → 1.0.0 |
Changed in mir: | |
status: | Triaged → In Progress |
Mir CI Bot (mir-ci-bot) wrote : | #10 |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 1.0.0
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Daniel van Vugt (vanvugt) wrote : | #11 |
Still attacking this bug from multiple angles, and some angles require multiple branches. So you'll see a bunch of branches attached to the bug before it's resolved.
Mir CI Bot (mir-ci-bot) wrote : | #12 |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 1.0.0
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Mir CI Bot (mir-ci-bot) wrote : | #16 |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.27.0
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
milestone: | 0.27.0 → 0.28.0 |
Mir CI Bot (mir-ci-bot) wrote : | #17 |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.28.0
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Daniel van Vugt (vanvugt) wrote : | #21 |
See above. 10 branches landed and at least 2 or 3 more required before this feature is complete. But it's getting very close.
I might decide to declare it complete without finishing up hardware cursor support to work with it. Not sure yet.
Changed in mir: | |
status: | Fix Committed → In Progress |
Mir CI Bot (mir-ci-bot) wrote : | #22 |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.28.0
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
status: | Fix Committed → In Progress |
Changed in mir: | |
status: | In Progress → Fix Committed |
Changed in mir: | |
milestone: | 0.28.0 → 0.27.0 |
Daniel van Vugt (vanvugt) wrote : | #24 |
The feature only exists mostly complete in the 0.28 series (lp:mir).
http://
It's missing in lp:mir/0.27
Changed in mir: | |
milestone: | 0.27.0 → 0.28.0 |
Changed in mir: | |
milestone: | 0.28.0 → 0.27.0 |
Changed in mir: | |
status: | Fix Committed → Fix Released |
A couple of things:
(1) The title suggests Mir doesn't have a clone mode, but it does and has done for years.
(2) The suggested solution of scaling is probably significantly more work (and possibly less desirable) than another solution I was thinking about...
We could simply solve the clipping bug on displays of lower resolution by panning that display to follow the hardware cursor when it touches the edge of the screen. That's how Xorg has handled it traditionally and it's rather nice. Only problem is the prerequisite to that is for Unity8 to start using USC's hardware cursor. Panning has the extra advantage of us being able to do it without having to GL re-composite the smaller display (hence I figured that will be more work).