From: Mirko Günther <renegart@gmx.de>
Subject: Do not restore the saved mode on virtual outputs

On virtual outputs (e.g. virtio-gpu in a VM) the host announces the size
of the viewer window as the preferred mode and signals a hotplug. The
saved mode of the output, identified by its EDID, is restored on every
configuration change, though. As the EDID stays the same and the saved
mode is usually one of the standard modes the output always offers, the
resolution never follows the window.

Keep the mode chosen by the wrapped policy for virtual outputs. Other
saved options are still applied.

--- a/src/platforms/mirserver/miroil/src/persist_display_config.cpp
+++ b/src/platforms/mirserver/miroil/src/persist_display_config.cpp
@@ -200,7 +200,7 @@
             miroil::DisplayConfigurationOptions config;
             if (storage->load(display_id, config)) {
 
-                if (config.mode.is_set()) {
+                if (config.mode.is_set() && output.type != mg::DisplayConfigurationOutputType::virt) {
                     int mode_index = output.current_mode_index;
                     int i = 0;
                     // Find the mode index which supports the saved size.
