qemu: enable virglrenderer and glx options for qemu-system-native and nativesdk-qemu
PATCH 1/6 qemu: enable virglrenderer and glx options for qemu-system-native and nativesdk-qemu
Note that to actually use accelerated GL passthrough, there are two options
1) a suitable frontend need to be also enabled - gtk+ seems to work well, sdl was found to be buggy.
2) it is also possible to render off-screen with -display egl-headless option, and see the output with a VNC viewer (for which, qemu needs to be started with a VNC server):
$ runqemu kvm egl-headless publicvnc
--- meta/recipes-devtools/qemu/qemu-system-native_3.1.0.bb | 2 +- meta/recipes-devtools/qemu/qemu_3.1.0.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/qemu/qemu-system-native_3.1.0.bb +1 -1
@@ -9,7 +9,7 @@ DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native" EXTRA_OECONF_append = " --target-list=${@get_qemu_system_target_list(d)}" -PACKAGECONFIG ??= "fdt alsa kvm" +PACKAGECONFIG ??= "fdt alsa kvm virglrenderer glx" # Handle distros such as CentOS 5 32-bit that do not have kvm support PACKAGECONFIG_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
meta/recipes-devtools/qemu/qemu_3.1.0.bb +1 -1
@@ -17,6 +17,6 @@ PACKAGECONFIG ??= " \ fdt sdl kvm \ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ " -PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm" +PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm virglrenderer glx"
Signature · 1 line
2.17.1
PATCH 2/6 qemu: add a gtk+ frontend to target builds
sdl frontend remains enabled and available.
--- meta/recipes-devtools/qemu/qemu_3.1.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/qemu/qemu_3.1.0.bb +1 -1
@@ -14,7 +14,7 @@ do_install_append_class-nativesdk() { } PACKAGECONFIG ??= " \ - fdt sdl kvm \ + fdt sdl gtk+ kvm \ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ " PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm virglrenderer glx"
Signature · 1 line
2.17.1
PATCH 3/6 qemu: remove sdl option from PACKAGECONFIG default
In reply to Alexander KanavinThis removes confusion over where qemu frontends are enabled for native/nativesdk builds: currently they are also set in local.conf.sample from poky distro, and with this change that becomes the only place.
--- meta/recipes-devtools/qemu/qemu_3.1.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/qemu/qemu_3.1.0.bb +1 -1
@@ -17,6 +17,6 @@ PACKAGECONFIG ??= " \ fdt sdl gtk+ kvm \ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ " -PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm virglrenderer glx" +PACKAGECONFIG_class-nativesdk ??= "fdt kvm virglrenderer glx"
Signature · 1 line
2.17.1
PATCH 4/6 qemu: remove support for building against host sdl
In reply to Alexander KanavinThis hasn't been the default for a long time (as some distros don't support it), and with gtk+ being the new default shouldn't be needed at all.
--- meta/recipes-devtools/qemu/qemu.inc | 8 -------- 1 file changed, 8 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +0 -8
@@ -80,14 +80,6 @@ export LIBTOOL="${HOST_SYS}-libtool" B = "${WORKDIR}/build" -do_configure_prepend_class-native() { - # Append build host pkg-config paths for native target since the host may provide sdl - BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") - if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH - fi -} - do_configure() { ${S}/configure ${EXTRA_OECONF} }
Signature · 1 line
2.17.1
PATCH 5/6 local.conf.sample: enable gtk+ frontend in addition to sdl
In reply to Alexander KanavinAs SDL was found to be buggy for virgl-based GL passthrough, gtk+ is enabled to allow that use case.
--- meta-poky/conf/local.conf.sample | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
meta-poky/conf/local.conf.sample +6 -5
@@ -238,11 +238,12 @@ BB_DISKMON_DIRS ??= "\ # Qemu configuration # # By default qemu will build with a builtin VNC server where graphical output can be -# seen. The two lines below enable the SDL backend too. By default libsdl2-native will -# be built, if you want to use your host's libSDL instead of the minimal libsdl built -# by libsdl2-native then uncomment the ASSUME_PROVIDED line below. -PACKAGECONFIG_append_pn-qemu-system-native = " sdl" -PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" +# seen. The two lines below enable the SDL and Gtk UI frontends as well. +# +# By default libsdl2-native will be built, if you want to use your host's libSDL instead +# of the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. +PACKAGECONFIG_append_pn-qemu-system-native = " sdl gtk+" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl gtk+" #ASSUME_PROVIDED += "libsdl2-native" # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
Signature · 1 line
2.17.1
PATCH 6/6 local.conf.sample: remove support for building against host libsdl
In reply to Alexander Kanavin--- meta-poky/conf/local.conf.sample | 4 ---- 1 file changed, 4 deletions(-)
meta-poky/conf/local.conf.sample +0 -4
@@ -239,12 +239,8 @@ BB_DISKMON_DIRS ??= "\ # # By default qemu will build with a builtin VNC server where graphical output can be # seen. The two lines below enable the SDL and Gtk UI frontends as well. -# -# By default libsdl2-native will be built, if you want to use your host's libSDL instead -# of the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. PACKAGECONFIG_append_pn-qemu-system-native = " sdl gtk+" PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl gtk+" -#ASSUME_PROVIDED += "libsdl2-native" # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to # track the version of this file when it was generated. This can safely be ignored if
Signature · 1 line
2.17.1