[multimonitor] nested server surface positioning incorrect

Bug #1506846 reported by Gerry Boland
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alan Griffiths
Unity System Compositor
Confirmed
Undecided
Unassigned
mir (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Flo and Mir 0.17.

For multimonitor, it appears USC often positions the 2 nested server surfaces on the same screen, as if noth surfaces are positioned at (0,0) in the virtual desktop space - and not side-by-side. This screenshot may not be the clearest:
https://chinstrap.canonical.com/~gerboland/mm2.jpg
but I got it through moving the egltriangle surface to the right, and it appeared on the left!

Steps to repro:
1. SSH into device and do: sudo stop lightdm
2. You'll want your backllight back, mirbacklight didn't work for me, so I called this as root:
    echo 255 > /sys/devices/platform/msm_fb.591617/leds/lcd-backlight/brightness
3. Run
sudo unity-system-compositor --debug-without-dm --disable-inactivity-policy true --enable-hardware-cursor=true --debug-active-session-name=Test
    sudo chmod 777 /tmp/mir_socket
4. Start nested server
    mir_demo_server --host /tmp/mir_socket --display-config sidebyside --launch-client /usr/bin/mir_demo_client_egltriangle
You should see the spinny triangle.
5. Now plug in the slimport cable. The display will flicker while the external display is being incorporated.
6. Use 3 fingers, move the triangle surface to the right.

Expected result:
It should appear on the external display

Actual result:
It pops in on the left of the internal display. See screenshot above.

Related branches

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

Replugging screen positioning doesn't reflect the chosen display-config. (USC defaults to --display-config sidebyside)

Can reproduce in Mir:

$ sudo bin/mir_demo_server --display-config sidebyside --vt 1 --arw-file

And after a replug the nested mir reports:

[1445009243.254725] mirserver: New display configuration:
[1445009243.254824] mirserver: 0.30: LVDS 13.9" 310x170mm
[1445009243.254874] mirserver: Current mode 1600x900 59.97Hz
[1445009243.254900] mirserver: Preferred mode 1600x900 59.97Hz
[1445009243.254924] mirserver: Logical position +0+0
[1445009243.254951] mirserver: 0.36: unused VGA
[1445009243.254979] mirserver: 0.39: unused HDMI-A
[1445009243.255014] mirserver: 0.44: DisplayPort 19.1" 410x260mm
[1445009243.255040] mirserver: Current mode 1440x900 59.88Hz
[1445009243.255065] mirserver: Preferred mode 1440x900 59.88Hz
[1445009243.255087] mirserver: Logical position +0+0
Surface occluded

Changed in mir:
status: New → Confirmed
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Alan Griffiths (alan-griffiths)
Gerry Boland (gerboland)
tags: added: multimonitor
Changed in mir:
milestone: none → 0.18.0
tags: added: nested
Revision history for this message
kevin gunn (kgunn72) wrote :

just adding reference to bug 1511538 in case it's related

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

Related problems working on laptop with external monitor attached:

1. $ sudo bin/mir_demo_server --window-manager system-compositor --arw-file --display-config clone --vt 1
2. $ bin/mir_demo_server --host /tmp/mir_socket --display-config sidebyside --shell-report log

expected: display config switches to sidebyside
observed: display config remains clone

(because the nested server doesn't have focus because it hasn't painted a surface - is this wrong for system-compositor?)

3. $ bin/mir_demo_client_egltriangle

expected: spinning triangle appears
observed: triangle doesn't appear, but display config switches to sidebyside

4. ^C triangle and restart

expected: spinning triangle appears
observed: spinning triangle appears

5. Drag triangle off right of screen

expected: spinning triangle moves to second monitor
observed: spinning triangle clipped before reaching edge of monitor

6. Drag triangle off left of screen

expected: spinning triangle clipped at reaching edge of monitor
observed: spinning triangle clipped "wraps" to right of monitor

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

OK, this is what is happening here:

The host Mir doesn't apply the nested display config until after a frame is posted and the surface becomes active. So the two "fullscreen" surfaces created by the nested server are positioned on the only active screen.

While not allowing surfaces to become active (and have focus) until they've been painted is correct for most scenarios it is wrong for a system compositor. The creation of a (nested) session ought to be enough to make it active.

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

Hmm. As noted by Alexandros in lp:~alan-griffiths/mir/fix-1506846/+merge/277022/comments/700729 we don't always want shells to be "active" until they have drawn something.

The deeper problem is that we want our surfaces to be positions according to the display config we've set for the session, not for the display config that's active at the time the surface is created/modified as fullscreen. That could apply to some "normal shell" scenarios too.

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

There are a bunch of display configuration issues that affect this. The scenario described above is fixed currently fixed on trunk with a couple of additional fixes:

    lp:~alan-griffiths/mir/fix-1463873
    lp:~alan-griffiths/mir/fullscreen-sticks

Changed in mir:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.3 KiB)

This bug was fixed in the package mir - 0.18.0+16.04.20151216.1-0ubuntu1

---------------
mir (0.18.0+16.04.20151216.1-0ubuntu1) xenial; urgency=medium

  [ Kevin DuBois ]
  * New upstream release 0.18.0 (https://launchpad.net/mir/+milestone/0.18.0)
    - ABI summary: Only servers need rebuilding;
      . Mirclient ABI unchanged at 9
      . Mirserver ABI bumped to 36
      . Mircommon ABI unchanged at 5
      . Mirplatform ABI unchanged at 11
      . Mirprotobuf ABI unchanged at 3
      . Mirplatformgraphics ABI bumped to 7
      . Mirclientplatform ABI unchanged at 3
      . Mirinputplatform ABI added. Current version is 4
    - Enhancements:
      . Use libinput by default, and remove the android input stack
      . Add x11 input probing
      . Add alternative buffer swapping mechanism internally, available with
        --nbuffers 0
      . Automatic searching and selection of input platforms
      . Better support for themed cursors
      . Add demo client that uses multiple buffer streams in one surface
      . Improve fingerpaint demo to use touch pressure
      . Allow for configuring cursor acceleration, scroll speed and left or
        right handed mice
      . Allow for setting a base display configuration via client api
      . Various nested server multimonitor fixes and stability improvements
      . Remove DepthId from the SurfaceStack
    - Bug fixes:
      . Unit test failures in Display.* on Android (LP: #1519276)
      . Build failure due to missing dependency of client rpc code on mir
        protobuf (LP: #1518372)
      . Test failure in
        NestedServer.display_configuration_reset_when_application_exits
        (LP: #1517990)
      . CI test failures in various NesterServer tests (LP: #1517781)
      . FTBFS with -DMIR_PLATFORM=android (LP: #1517532)
      . Nesting Mir servers with assorted display configs causes lockup
        (LP: #1516670)
      . [testsfail] RaiseSurfaces.motion_events_dont_prevent_raise
        (LP: #1515931)
      . CI test failures in GLMark2Test (LP: #1515660)
      . Shells that inject user input events need to agree with the system
        compositor on the clock to use (LP: #1515515)
      . mircookie-dev is missing nettle-dev dependency (LP: #1514391)
      . Segmentation fault on server shutdown with mesa-kms (LP: #1513901)
      . mircookie requires nettle but libmircookie-dev doesn't depend on it
        (LP: #1513792)
      . libmircookie1 package does not list libnettle as dependency
        (LP: #1513225)
      . display configuration not reset when application exits (LP: #1511798)
      . unplugging external monitor causes nested server to throttle client
        (LP: #1511723)
      . 1/2 screen on external monitor (LP: #1511538)
      . unity-system-compositor crash, no interaction on windowed mode
        (LP: #1511095)
      . [regression] arm64/powerpc cross compile doesn't build any more
        (LP: #1510778)
      . mir_connection_get_egl_pixel_format() crashes if libEGL is loaded
        RTLD_LAZY (LP: #1510218)
      . [multimonitor] nested server surface positioning incorrect
        (LP: #1506846)
      . unity-system-compositor fails to build against lp:mir r3027
   ...

Read more...

Changed in mir (Ubuntu):
status: New → Fix Released
Kevin DuBois (kdub)
Changed in mir:
status: Fix Committed → Fix Released
Changed in unity-system-compositor:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.