Skip to contentSkip to conversation

runqemu: decouple gtk and gl options

PATCH In review Alexander Kanavin 2 participants 5 messages Sep 12, 2019 – Sep 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 runqemu: decouple gtk and gl options

This will allow not having to multiply these options for the sdl frontend, instead combining them as needed.

---
 meta/lib/oeqa/selftest/cases/runtime_test.py |  2 +-
 scripts/runqemu                              | 21 +++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)
meta/lib/oeqa/selftest/cases/runtime_test.py +1 -1
index 20969d2c48a..3f212bd0eac 100644
@@ -191,7 +191,7 @@ class TestImage(OESelftestTestCase):
         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'
+        features += 'TEST_RUNQEMUPARAMS = "gtk gl"\n'
         self.write_config(features)
         bitbake('core-image-minimal')
         bitbake('-c testimage core-image-minimal')
scripts/runqemu +14 -7
index 4415e9b69f8..68ba7dcfb94 100755
@@ -65,9 +65,10 @@ 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
-    sdl - choose the SDL frontend instead of the Gtk+ default
-    gtk-gl - enable virgl-based GL acceleration using Gtk+ frontend
-    gtk-gl-es - enable virgl-based GL acceleration, using OpenGL ES and Gtk+ frontend
+    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
     serial - enable a serial console on /dev/ttyS0
     serialstdio - enable a serial console on the console (regardless of graphics mode)
@@ -436,10 +437,16 @@ class BaseConfig(object):
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
                 self.qemu_opt_script += ' -display sdl'
-            elif arg == 'gtk-gl':
-                self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
-            elif arg == 'gtk-gl-es':
-                self.qemu_opt_script += ' -vga virtio -display gtk,gl=es'
+            elif arg == 'gtk':
+                if 'gl' in sys.argv[1:]:
+                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
+                elif 'gl-es' in sys.argv[1:]:
+                    self.qemu_opt_script += ' -vga virtio -display gtk,gl=es'
+                else:
+                    self.qemu_opt_script += ' -display gtk'
+            elif arg == 'gl' or arg == 'gl-es':
+                # These args are handled inside sdl or gtk blocks above
+                pass
             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),
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 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
#2 lore raw

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

In reply to Alexander Kanavin
---
 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
#3 lore raw

Re: [PATCH 3/3] oe-selftest: extend virgl gtk test to also check the SDL option

meta/lib/oeqa/selftest/cases/runtime_test.py class TestImage(OESelftestTestCase): · line 169

Quoted 2 lines · Alexander Kanavin
meta/lib/oeqa/selftest/cases/runtime_test.py +1 -1
-    def test_testimage_virgl_gtk(self):
+    def test_testimage_virgl_gtk_sdl(self):

Failing on the autobuilder: https://autobuilder.yoctoproject.org/typhoon/#/builders/56/builds/707/steps/8/logs/step2d

Ross

#4 lore raw

Re: [PATCH 3/3] oe-selftest: extend virgl gtk test to also check the SDL option

Quoted 8 lines · Ross Burton

meta/lib/oeqa/selftest/cases/runtime_test.py class TestImage(OESelftestTestCase): · line 169

Quoted 2 lines · Alexander Kanavin
meta/lib/oeqa/selftest/cases/runtime_test.py +1 -1
-    def test_testimage_virgl_gtk(self):
+    def test_testimage_virgl_gtk_sdl(self):

Failing on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/56/builds/707/steps/8/logs/step2d

Can I see the following two please?

WARNING: core-image-minimal-1.0-r0 do_testimage: Check full boot log:
/home/pokybuild/yocto-worker/oe-selftest/build/build-st-31169/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/testimage/qemu_boot_log.20190913155532
ERROR: Logfile of failure stored in:
/home/pokybuild/yocto-worker/oe-selftest/build/build-st-31169/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/log.do_testimage.45597

Alex