Skip to contentSkip to conversation

runqemu: add options that enable virgl with the SDL frontend

PATCH New Alexander Kanavin 1 participant 4 messages Sep 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 runqemu: add options that enable virgl with the SDL frontend

---
 scripts/runqemu | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
scripts/runqemu +9 -4
index 68ba7dcfb94..18091a29c3b 100755
@@ -67,9 +67,9 @@ of the following environment variables (in any order):
     nographic - disable video console
     sdl - choose the SDL UI frontend
     gtk - choose the Gtk UI frontend
-    gl - enable virgl-based GL acceleration (also needs gtk option)
-    gl-es - enable virgl-based GL acceleration, using OpenGL ES (also needs gtk option)
-    egl-headless - enable headless EGL output; use vnc or spice to see it
+    gl - enable virgl-based GL acceleration (also needs gtk or sdl options)
+    gl-es - enable virgl-based GL acceleration, using OpenGL ES (also needs gtk or sdl options)
+    egl-headless - enable headless EGL output; use vnc (via publicvnc option) 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
@@ -436,7 +436,12 @@ class BaseConfig(object):
                 self.qemu_opt_script += ' -nographic'
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
-                self.qemu_opt_script += ' -display sdl'
+                if 'gl' in sys.argv[1:]:
+                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=on'
+                elif 'gl-es' in sys.argv[1:]:
+                    self.qemu_opt_script += ' -vga virtio -display sdl,gl=es'
+                else:
+                    self.qemu_opt_script += ' -display sdl'
             elif arg == 'gtk':
                 if 'gl' in sys.argv[1:]:
                     self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/4 oe-selftest: extend virgl gtk test to also check the SDL option

---
 meta/lib/oeqa/selftest/cases/runtime_test.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
meta/lib/oeqa/selftest/cases/runtime_test.py +13 -4
index 3f212bd0eac..8f98a9ead46 100644
@@ -166,9 +166,9 @@ class TestImage(OESelftestTestCase):
         bitbake('core-image-full-cmdline socat')
         bitbake('-c testimage core-image-full-cmdline')
 
-    def test_testimage_virgl_gtk(self):
+    def test_testimage_virgl_gtk_sdl(self):
         """
-        Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk frontend
+        Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk and SDL frontends
         Expected: 1. Check that virgl kernel driver is loaded and 3d acceleration is enabled
                   2. Check that kmscube demo runs without crashing.
         Product: oe-core
@@ -181,18 +181,27 @@ class TestImage(OESelftestTestCase):
             self.skipTest('virgl isn\'t working with Debian 8')
 
         qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native')
+        sdl_packageconfig = get_bb_var('PACKAGECONFIG', 'libsdl2-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'
         features += 'TEST_SUITES = "ping ssh virgl"\n'
         features += 'IMAGE_FEATURES_append = " ssh-server-dropbear"\n'
         features += 'IMAGE_INSTALL_append = " kmscube"\n'
-        features += 'TEST_RUNQEMUPARAMS = "gtk gl"\n'
-        self.write_config(features)
+        features_gtk = features + 'TEST_RUNQEMUPARAMS = "gtk gl"\n'
+        self.write_config(features_gtk)
+        bitbake('core-image-minimal')
+        bitbake('-c testimage core-image-minimal')
+        features_sdl = features + 'TEST_RUNQEMUPARAMS = "sdl gl"\n'
+        self.write_config(features_sdl)
         bitbake('core-image-minimal')
         bitbake('-c testimage core-image-minimal')
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/4 runqemu: unset another environment variable for 'egl-headless'

In reply to Alexander Kanavin

Some host distributions (opensuse for example) are using 'pkgconf', which, unlike the original pkg-config, appends PKG_CONFIG_SYSROOT_DIR to every directory from the .pc file.

---
 scripts/runqemu | 1 +
 1 file changed, 1 insertion(+)
scripts/runqemu +1 -0
index 18091a29c3b..3ebe9d66ff8 100755
@@ -461,6 +461,7 @@ class BaseConfig(object):
                     del os.environ['PKG_CONFIG_PATH']
                     del os.environ['PKG_CONFIG_DIR']
                     del os.environ['PKG_CONFIG_LIBDIR']
+                    del os.environ['PKG_CONFIG_SYSROOT_DIR']
                 except KeyError:
                     pass
                 try:
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/4 strace: add a timeout for running ptests

In reply to Alexander Kanavin

5.2 kernel has introduced a significant performance regression where some of the tests take many minutes to complete (where previously it was seconds). While we're getting to the bottom of the issue and working with upstream to resove it, this change allows tests to proceed instead of getting stuck and eventually timing out.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=13506

---
 meta/recipes-devtools/strace/strace/run-ptest | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/strace/strace/run-ptest +1 -0
index 8070d831799..2fed984e901 100755
@@ -1,2 +1,3 @@
 #!/bin/sh
+export TIMEOUT_DURATION=30
 make -B -C tests -k test-suite.log
Signature · 1 line
2.17.1