]> git.proxmox.com Git - qemu-server.git/commitdiff
cfg2cmd: vga: fix #2749: disable edid for Win+BIOS+VGA machines
authorAaron Lauterer <a.lauterer@proxmox.com>
Mon, 27 Jul 2020 13:55:25 +0000 (15:55 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Aug 2020 16:22:43 +0000 (18:22 +0200)
Edid support was added with Qemu 5. Windows guests seem to not be able
to get all possible resolutions if the default std VGA device is used as
GPU and the VM boots in BIOS mode. The result is that only one of the
following three resolutions can be configured:

800x600
1024x768
1920x1080

It is important to note that just booting a Windows VM with the edid=off
parameter will not make the large list of resolutions available. It
seems that Windows is caching the list of possible resolutions
somewhere [0].

Uninstalling the 'Microsoft Basic Display Adapter' in the device manager
and rebooting the VM is one way I found to force Windows to recreate the
list of possible resolutions.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
[0] https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg07128.html

PVE/QemuServer.pm
test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd
test/cfg2cmd/custom-cpu-model.conf.cmd

index a9c0dac0fd7d7b79b4e8b7bf8958260e27bfc686..d41f1621b21ac6de05d2aad685a675934dcfe4c7 100644 (file)
@@ -1648,6 +1648,11 @@ sub print_vga_device {
        $memory = ",ram_size=67108864,vram_size=33554432";
     }
 
+    my $edidoff = "";
+    if ($type eq 'VGA' && windows_version($conf->{ostype})) {
+       $edidoff=",edid=off" if $conf->{bios} ne 'ovmf';
+    }
+
     my $q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf);
     my $vgaid = "vga" . ($id // '');
     my $pciaddr;
@@ -1659,7 +1664,7 @@ sub print_vga_device {
        $pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine);
     }
 
-    return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}";
+    return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}";
 }
 
 sub parse_number_sets {
index d8fa254465fb777b35e8cf74a9ca5555d4890a84..fb6e8c8f54ad17757062f4669cc5c25eb763bcaf 100644 (file)
@@ -19,7 +19,7 @@
   -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \
   -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \
   -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
-  -device 'VGA,id=vga,bus=pci.0,addr=0x2' \
+  -device 'VGA,id=vga,bus=pci.0,addr=0x2,edid=off' \
   -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \
   -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
   -rtc 'driftfix=slew,base=localtime' \
index 193140f174a7005d5a6469ad5a2ea843a62b34b8..b30163c4d3f3a786fcf235ac14b588c3805777a6 100644 (file)
@@ -19,7 +19,7 @@
   -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \
   -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \
   -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
-  -device 'VGA,id=vga,bus=pci.0,addr=0x2' \
+  -device 'VGA,id=vga,bus=pci.0,addr=0x2,edid=off' \
   -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \
   -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
   -rtc 'driftfix=slew,base=localtime' \