mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE
Note that to actually use accelerated GL passthrough, there are two options 1) a suitable frontend need to be also enabled - gtk+ and SDL both seem to work well. Previously I struggled to make SDL work, but now it seems fine. 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 (From OE-Core rev: 662c688e635f4490aac0d6d34ce7a7b31d73f5c5) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
08a3d674e0
commit
7561eb32a0
@@ -188,18 +188,14 @@ class TestImage(OESelftestTestCase):
|
||||
self.skipTest('virgl isn\'t working with Opensuse 15.0')
|
||||
|
||||
qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native')
|
||||
sdl_packageconfig = get_bb_var('PACKAGECONFIG', 'libsdl2-native')
|
||||
qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
|
||||
features = 'INHERIT += "testimage"\n'
|
||||
if 'gtk+' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " gtk+"\n'
|
||||
if 'sdl' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " sdl"\n'
|
||||
if 'virglrenderer' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " virglrenderer"\n'
|
||||
if 'glx' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " glx"\n'
|
||||
if 'opengl' not in sdl_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-libsdl2-native = " opengl"\n'
|
||||
if 'opengl' not in qemu_distrofeatures:
|
||||
features += 'DISTRO_FEATURES_append = " opengl"\n'
|
||||
features += 'TEST_SUITES = "ping ssh virgl"\n'
|
||||
features += 'IMAGE_FEATURES_append = " ssh-server-dropbear"\n'
|
||||
features += 'IMAGE_INSTALL_append = " kmscube"\n'
|
||||
@@ -231,12 +227,10 @@ class TestImage(OESelftestTestCase):
|
||||
dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
self.skipTest("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.")
|
||||
qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native')
|
||||
qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
|
||||
features = 'INHERIT += "testimage"\n'
|
||||
if 'virglrenderer' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " virglrenderer"\n'
|
||||
if 'glx' not in qemu_packageconfig:
|
||||
features += 'PACKAGECONFIG_append_pn-qemu-system-native = " glx"\n'
|
||||
if 'opengl' not in qemu_distrofeatures:
|
||||
features += 'DISTRO_FEATURES_append = " opengl"\n'
|
||||
features += 'TEST_SUITES = "ping ssh virgl"\n'
|
||||
features += 'IMAGE_FEATURES_append = " ssh-server-dropbear"\n'
|
||||
features += 'IMAGE_INSTALL_append = " kmscube"\n'
|
||||
|
||||
@@ -9,7 +9,9 @@ DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native"
|
||||
|
||||
EXTRA_OECONF_append = " --target-list=${@get_qemu_system_target_list(d)}"
|
||||
|
||||
PACKAGECONFIG ??= "fdt alsa kvm"
|
||||
PACKAGECONFIG ??= "fdt alsa kvm \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer glx', '' ,d)} \
|
||||
"
|
||||
|
||||
# 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 ''}"
|
||||
|
||||
@@ -21,5 +21,8 @@ do_install_append_class-nativesdk() {
|
||||
PACKAGECONFIG ??= " \
|
||||
fdt sdl kvm \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer glx', '' ,d)} \
|
||||
"
|
||||
PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer glx', '' ,d)} \
|
||||
"
|
||||
PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
|
||||
|
||||
Reference in New Issue
Block a user