From d1f5753c897a7730bcc97c215dcc091acc6bebe3 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 5 Mar 2020 22:01:12 +0100 Subject: [PATCH] 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). --- pmb/qemu/run.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 79cc2c58..4f01d43a 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -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