Bug 78131 - Multiple monitors broken in desktops other than gnome3
Summary: Multiple monitors broken in desktops other than gnome3
Alias: None
Product: Spice
Classification: Unclassified
Component: xorg qxl (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Spice Bug List
QA Contact:
Depends on:
Reported: 2014-04-30 19:26 UTC by Greg Sheremeta
Modified: 2014-06-04 17:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

use surface_id 0 for primary surface on all monitors (473 bytes, patch)
2014-05-27 14:14 UTC, David Mansfield
Details | Splinter Review

Description Greg Sheremeta 2014-04-30 19:26:15 UTC
Gnome3 and Cinnamon work in dual head setup, but other desktops don't (eg. mate, lxde, fluxbox).

Steps to reproduce:
use remote-viewer to connect to a vm running lxde. Try to open a second monitor.

Actual results:
The second remote-viewer window opens, but never connects.

Expected results:
The second remote-viewer should open and connect, showing me the desktop.

Additional info:
use remote-viewer to connect to a vm running gnome3 or cinnamon works as expected. 2D vs 3D problem?

More info, including debugging:
Comment 1 David Mansfield 2014-05-27 14:14:13 UTC
Created attachment 99946 [details] [review]
use surface_id 0 for primary surface on all monitors

spice-server and downstream code expect that the primary surface will always have surface_id = 0.  In a dual head environment, all monitors render portions of the primary surface.

However, when the monitor config events are generated and sent, the primary surface (which has an actual id which is NEVER 0 once it is allocated), is only mapped to the correct identifier (0) for the primary head (where crtc index is 0).

The fix is to look at the "primary" flag in the bo and always use id 0, irrespective of which head is being configured.
Comment 2 David Mansfield 2014-05-27 14:16:41 UTC
Oh, and by the way, the reason it works for GNOME3 is a coincidence.

As mentioned in the description, all surfaces have id > 0 _once allocated_.  In GNOME3, the order of the ioctl to resize the monitors is slightly different and the monitor change events are generated before the surface has been "allocated".  Unallocated surfaces have an internal id of '0' so it just works by coincidence.
Comment 3 David Mansfield 2014-06-04 17:32:26 UTC
This fix was committed into drm-next:


So it's problably just a matter of time before the fixed kernel is available at stores near you.

I have been using the patched qxl.ko for a while and it works for me.  

So with that, I think RESOLVED is in order.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.