]> git.proxmox.com Git - qemu-server.git/commitdiff
vga: add virtio-gl display type for VIRGL
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 22 Apr 2022 12:28:09 +0000 (14:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 22 Apr 2022 12:28:09 +0000 (14:28 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 0be6be909ae21336252cdcdae6839a5147f6e638..1d1761655be1a5157d794574823b3f2fcea79b1e 100644 (file)
@@ -181,7 +181,7 @@ my $vga_fmt = {
        default => 'std',
        optional => 1,
        default_key => 1,
-       enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio vmware)],
+       enum => [qw(cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio virtio-gl vmware)],
     },
     memory => {
        description => "Sets the VGA memory (in MiB). Has no effect with serial display.",
@@ -1821,6 +1821,7 @@ my $vga_map = {
     'std' => 'VGA',
     'vmware' => 'vmware-svga',
     'virtio' => 'virtio-vga',
+    'virtio-gl' => 'virtio-vga-gl',
 };
 
 sub print_vga_device {
@@ -1848,7 +1849,7 @@ sub print_vga_device {
 
     my $memory = "";
     if ($vgamem_mb) {
-       if ($vga->{type} eq 'virtio') {
+       if ($vga->{type} =~ /^virtio/) {
            my $bytes = PVE::Tools::convert_size($vgamem_mb, "mb" => "b");
            $memory = ",max_hostmem=$bytes";
        } elsif ($qxlnum) {
@@ -3762,6 +3763,9 @@ sub config_to_command {
     if ($vga->{type} && $vga->{type} !~ m/^serial\d+$/ && $vga->{type} ne 'none'){
        push @$devices, '-device', print_vga_device(
            $conf, $vga, $arch, $machine_version, $machine_type, undef, $qxlnum, $bridges);
+
+       push @$cmd, '-display', 'egl-headless,gl=core' if $vga->{type} eq 'virtio-gl'; # VIRGL
+
        my $socket = PVE::QemuServer::Helpers::vnc_socket($vmid);
        push @$cmd,  '-vnc', "unix:$socket,password=on";
     } else {