summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-02-22 15:33:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 11:44:52 +0000
commitcd4cdecd01c305b83a7483e44edb6ba856821148 (patch)
tree7a65fa17ea7fcf8b8bef5eec9c6e9298cda2bd7b /scripts
parent18f565f3ca18c281b4a99721fcfcbcc5405d6346 (diff)
downloadopenembedded-core-contrib-cd4cdecd01c305b83a7483e44edb6ba856821148.tar.gz
runqemu: add options for enabling virgl GL acceleration
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index d171c4f894..054037312b 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -74,6 +74,9 @@ of the following environment variables (in any order):
MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
Simplified QEMU command-line options can be passed with:
nographic - disable video console
+ gl - enable virgl-based GL acceleration
+ gl-es - enable virgl-based GL acceleration, using OpenGL ES
+ egl-headless - enable headless EGL output; use vnc or spice to see it
serial - enable a serial console on /dev/ttyS0
serialstdio - enable a serial console on the console (regardless of graphics mode)
slirp - enable user networking, no root privileges is required
@@ -434,6 +437,26 @@ class BaseConfig(object):
elif arg == 'nographic':
self.qemu_opt_script += ' -nographic'
self.kernel_cmdline_script += ' console=ttyS0'
+ elif arg == 'gl':
+ self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
+ elif arg == 'gl-es':
+ self.qemu_opt_script += ' -vga virtio -display gtk,gl=es'
+ elif arg == 'egl-headless':
+ self.qemu_opt_script += ' -vga virtio -display egl-headless'
+ # As runqemu can be run within bitbake (when using testimage, for example),
+ # we need to ensure that we run host pkg-config, and that it does not
+ # get mis-directed to native build paths set by bitbake.
+ try:
+ del os.environ['PKG_CONFIG_PATH']
+ del os.environ['PKG_CONFIG_DIR']
+ del os.environ['PKG_CONFIG_LIBDIR']
+ except KeyError:
+ pass
+ try:
+ dripath = subprocess.check_output("PATH=/bin:/usr/bin:$PATH pkg-config --variable=dridriverdir dri", shell=True)
+ except subprocess.CalledProcessError as e:
+ raise RunQemuError("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.")
+ os.environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip()
elif arg == 'serial':
self.kernel_cmdline_script += ' console=ttyS0'
self.serialconsole = True