Description of interfaces for automatic resolution change and desktop layout
(multimon) in a virtualized environment:

Note that these properties were first implemented by the qxl driver and have 
just
recently been implemented also by VMware but in any case they could probably be
viewed as some type of evolving standard for virtualized environments.
Gnome-shell works with the below interfaces both in the Xorg- and in the
wayland / DRM configurations.

The DRM KMS interface:
Each connector exposes the following properties:

*) hotplug_mode_update - if 1 indicates that the mode list and preferred mode 
may
change following an uevent.
*) suggested X, suggested Y - (note the spaces instead of underscore). In a 
multimon
environment, suggests the X and Y desktop coordinate for a connector.

Following a uevent, the client should, for all connectors
- Check if the connector is connected, in that case enable the connector, read 
the
preferred mode, set the mode and set the connector to scan out starting at the
suggested desktop origin.
- Disable the connector if not connected.

Future extensions: The above interface is racy as a new uevent may be triggered 
and
values updated while the client is reading the values. With atomic modesetting 
it
should be possible to assign each suggested configuration a sequence number and
have the modesetting operation back off if the sequence numbers don't match.
Similar to how XRandR works. This has not been discussed yet on the DRM list, 
though,
and in practice races are more theorectial than they seem to have an effect on 
the
user's experience.


The Xorg interface:

The Xorg XRandR interface (if Xorg is used as a backend for the compositor) is 
pretty
identical except that the sequence is triggered by (IIRC) an
XRRScreenChangeNotifyEvent.


VMware implementation:
For this to work with VMware a relatively new kernel version is needed, an
xf86-video-vmware driver 13.2.1 or later needs to be installed (but not
necessarily running) and a patched version of open-vm-tools present (the patch 
is
to appear on the open-vm-tools GitHub webpage quite soon, or can be obtained 
from me
on request.

Note that if running Xorg, the xf86-video-vmware driver 13.2.1 and later will, 
if
running, try to perform the automatic screen resizing and output placement if it
detects a uevent from DRM, so any Xorg client trying to do the same thing will
actually try to race with the Xorg driver. However XRandR will make sure that 
the
client will see the configuration set by the Xorg driver before it reacts on the
new property values.

/Thomas <[email protected]>


Below is a typical output of running xrandr --props on a VMware VM with the new
interface active:


xrandr --props
Screen 0: minimum 1 x 1, current 3200 x 1200, maximum 16384 x 16384
Virtual1 connected primary 1600x1200+1600+0 (normal left inverted right x axis 
y axis) 0mm x 0mm
        _MUTTER_PRESENTATION_OUTPUT: 0 
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 1600 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
   1600x1200     60.00*+  60.00  
   2560x1600     59.99  
   1920x1440     60.00  
   1856x1392     60.00  
   1792x1344     60.00  
   1920x1200     59.88  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.81  
   1152x864      75.00  
   1280x768      59.87  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
Virtual2 connected 1600x900+0+0 (normal left inverted right x axis y axis) 0mm 
x 0mm
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
   1600x900      60.00*+
   2560x1600     59.99  
   1920x1440     60.00  
   1856x1392     60.00  
   1792x1344     60.00  
   1920x1200     59.88  
   1600x1200     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.81  
   1152x864      75.00  
   1280x768      59.87  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
Virtual3 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
Virtual4 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
Virtual5 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
Virtual6 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
Virtual7 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
Virtual8 disconnected (normal left inverted right x axis y axis)
        implicit_placement: 0 
                range: (0, 1)
        suggested Y: 0 
                range: (0, -1)
        suggested X: 0 
                range: (0, -1)
        hotplug_mode_update: 1 
                range: (0, 1)
[thomas@vmf25template ~]$ 


** Description changed:

- TODO
+ Below see the information from Thomas Hellstrom <[email protected]>.

** Description changed:

- Below see the information from Thomas Hellstrom <[email protected]>.
+ Currently in when you resize the virtual display in qemu (with QXL/spice
+ display) the unity8 screen resolution stays the same. However in e.g.
+ Gnome3, the shell is informed of a suggestion to change size, and
+ complies.
+ 
+ There appears to be an emerging de-facto standard in virtual displays as
+ described below by Thomas Hellstrom <[email protected]> from VMware.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1670713

Title:
  Automatic screen resizing for virtual machines

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1670713/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to