Skip to contentSkip to conversation

machine/qemuarm*: use virtio graphics

PATCH In review Jon Mason 2 participants 3 messages Sep 16, 2021 – Sep 20, 2021

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 machine/qemuarm*: use virtio graphics

Switch to using virtio graphics for the Arm QEMU machines. You will noticed the difference in the dmesg by seeing:

[    2.693337] [drm] pci: virtio-gpu-pci detected at 0000:00:10.0
---
 meta/conf/machine/qemuarm.conf   | 2 +-
 meta/conf/machine/qemuarm64.conf | 2 +-
 meta/conf/machine/qemuarmv5.conf | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
meta/conf/machine/qemuarm.conf +1 -1
index 93d855b6e1e2..d71a793edf05 100644
@@ -20,7 +20,7 @@ QB_SMP = "-smp 4"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarm64.conf +1 -1
index ea7fae2722a0..3b08dedddc86 100644
@@ -19,7 +19,7 @@ QB_CPU = "-cpu cortex-a57"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarmv5.conf +2 -1
index 6c99a5296589..252d6286d8ec 100644
@@ -13,7 +13,8 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1"
 QB_SYSTEM_NAME = "qemu-system-arm"
 QB_MACHINE = "-machine versatilepb"
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
-QB_OPT_APPEND = "-usb -device usb-tablet"
+QB_GRAPHICS = "-device virtio-gpu-pci"
+QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 PREFERRED_VERSION_linux-yocto ??= "5.13%"
 QB_DTB = "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}"
 
Signature · 1 line
2.20.1
#1 lore raw

Have you investigated (optionally) enabling virgl as well on ARM hosts? On x86, currently -vga virtio is used
and will be switched to -device virtio-vga-gl with qemu 6.1, according to
https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/

On ARM... I don't know, as I do not have an ARM host with a GPU.

Alex

Quoted 65 lines · Jon Mason

Switch to using virtio graphics for the Arm QEMU machines. You will noticed the difference in the dmesg by seeing:

[    2.693337] [drm] pci: virtio-gpu-pci detected at 0000:00:10.0
---
 meta/conf/machine/qemuarm.conf   | 2 +-
 meta/conf/machine/qemuarm64.conf | 2 +-
 meta/conf/machine/qemuarmv5.conf | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
meta/conf/machine/qemuarm.conf +0 -0
index 93d855b6e1e2..d71a793edf05 100644
@@ -20,7 +20,7 @@ QB_SMP = "-smp 4"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
 # For graphics to work we need to define the VGA device as well as the

necessary USB devices

meta/conf/machine/qemuarm.conf +1 -1
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarm64.conf +0 -0
index ea7fae2722a0..3b08dedddc86 100644
@@ -19,7 +19,7 @@ QB_CPU = "-cpu cortex-a57"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the

necessary USB devices

meta/conf/machine/qemuarm64.conf +1 -1
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarmv5.conf +2 -1
index 6c99a5296589..252d6286d8ec 100644
@@ -13,7 +13,8 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1"
 QB_SYSTEM_NAME = "qemu-system-arm"
 QB_MACHINE = "-machine versatilepb"
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
-QB_OPT_APPEND = "-usb -device usb-tablet"
+QB_GRAPHICS = "-device virtio-gpu-pci"
+QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 PREFERRED_VERSION_linux-yocto ??= "5.13%"
 QB_DTB =
 "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7',

'', 'zImage-versatile-pb.dtb', d)}"

--
2.20.1

author
#2 lore raw
Quoted 4 lines · Alexander Kanavin

Have you investigated (optionally) enabling virgl as well on ARM hosts? On x86, currently -vga virtio is used and will be switched to -device virtio-vga-gl with qemu 6.1, according to
https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/

My local Arm system does not have a graphics adapter in it.

Let me know when you make the change and I'll get my setup working and see if it can't be enabled.

Thanks,
Jon

Quoted 64 lines

On ARM... I don't know, as I do not have an ARM host with a GPU.

Alex

Quoted 58 lines · Jon Mason

Switch to using virtio graphics for the Arm QEMU machines. You will noticed the difference in the dmesg by seeing:

[    2.693337] [drm] pci: virtio-gpu-pci detected at 0000:00:10.0
---
 meta/conf/machine/qemuarm.conf   | 2 +-
 meta/conf/machine/qemuarm64.conf | 2 +-
 meta/conf/machine/qemuarmv5.conf | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
meta/conf/machine/qemuarm.conf +1 -1
index 93d855b6e1e2..d71a793edf05 100644
@@ -20,7 +20,7 @@ QB_SMP = "-smp 4"
 # Standard Serial console
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarm64.conf +1 -1
index ea7fae2722a0..3b08dedddc86 100644
@@ -19,7 +19,7 @@ QB_CPU = "-cpu cortex-a57"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
-QB_GRAPHICS = "-device VGA,edid=on"
+QB_GRAPHICS = "-device virtio-gpu-pci"
 QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
meta/conf/machine/qemuarmv5.conf +2 -2
index 6c99a5296589..252d6286d8ec 100644
@@ -13,7 +13,8 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1"
 QB_SYSTEM_NAME = "qemu-system-arm"
 QB_MACHINE = "-machine versatilepb"
 QB_KERNEL_CMDLINE_APPEND = "vmalloc=256"
-QB_OPT_APPEND = "-usb -device usb-tablet"
+QB_GRAPHICS = "-device virtio-gpu-pci"
+QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
 PREFERRED_VERSION_linux-yocto ??= "5.13%"
 QB_DTB = "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}"
 
--

2.20.1