pmb.qemu: always use virtio-gpu (!1886)

So far we tried to configure virtio-gpu using "-vga virtio" only
when the target architecture matches the host architecture.
But that's actually not what it depends on.

virtio-gpu and virgl can be also used when emulating a foreign
architecture. In fact, we already force usage of virtio-gpu for
aarch64 through "-device virtio-gpu-pci".

However, the "-vga virtio" parameter does not exist on aarch64,
no matter if we run QEMU natively on aarch64 or emulate it on x86_64.

(Apparently, -vga is mainly about legacy VGA framebuffer stuff that
we don't necessarily need. This is quite visible since the display
stays uninitialized on aarch64 until the kernel driver loads,
whereas on x86_64 it is initialized by the BIOS...)

In other words, "-vga virtio" belongs to the parameters specific to x86_64.

Now that we have removed the setup question for the Mesa driver to use
(since it was ineffective), it would still be nice to have some way to
choose if you want to use virtio-gpu/virgl or not.

But actually virtio-gpu can be also used with swrast, without virgl.
This happens automatically when QEMU is started without GL support.
We already have a --display parameter for this, so it is possible to
force swrast by using "--display sdl" (instead of the default sdl,gl=on).

Overall this allows simplifying the QEMU package setup because there is
only a single GPU driver in use (virtio-gpu) instead of the 3 we had before
(virtio, qxl, bochs).
This commit is contained in:
Minecrell 2020-03-05 22:01:12 +01:00 committed by Oliver Smith
parent 320b2faa4c
commit d1f5753c89
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 1 additions and 3 deletions

View File

@ -138,6 +138,7 @@ def command_qemu(args, arch, device, img_path):
smp = os.cpu_count()
if arch == "x86_64":
command += ["-vga", "virtio"]
command += ["-serial", "stdio"]
command += ["-drive", "file=" + img_path + ",format=raw"]
command += ["-device", "e1000,netdev=net0"]
@ -176,9 +177,6 @@ def command_qemu(args, arch, device, img_path):
else:
logging.info("WARNING: QEMU is not using KVM and will run slower!")
# 2D acceleration support via virtio
if native:
command += ["-vga", "virtio"]
command += ["-display", args.qemu_display]
# Audio support