All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] virgl: add SDL support and enable by default
@ 2019-09-06 11:18 Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target Alexander Kanavin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

This patchset adds two enhancements to qemu virgl support (which is
a virtualized accelerated 3D graphics support for the qemu guests):

1. SDL qemu frontend now comes with virgl fully enabled and working
(over ssh X11 forwarding as well!), so using the gtk frontend
is no longer necessary. 'oe-selftest' is adjusted to test both
frontends.

2. virgl itself is enabled by default in qemu, when 'opengl' is in
DISTRO_FEATURES. This adds a few native dependencies to qemu-system-native
(particularly, libdrm, virglrenderer and a special minimal configuration
of mesa-native). I tested the impact on build times: it is about 25-30
seconds on a 16 core machine. 'bitbake core-image-minimal' goes from
26m45 to 27m13.

Gtk qemu frontend remains disabled by default, as it adds more to the build times.

The following changes since commit f399b2d73b828f70536857e3e9189b1deb4a4143:

  poky: Use 5.2 kernel by default (2019-09-06 08:25:29 +0100)

are available in the Git repository at:

  git://git.yoctoproject.org/poky-contrib akanavin/qemu-split-virgl-gtk
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=akanavin/qemu-split-virgl-gtk

Alexander Kanavin (5):
  bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk
    from target
  libsdl2: enable opengl option for native/nativesdk, subject to
    'opengl' in DISTRO_FEATURES
  qemu: enable virglrenderer and glx options subject to 'opengl'
    DISTRO_FEATURE
  runqemu: add options that enable virgl with the SDL frontend
  oe-selftest: extend virgl gtk test to also check the SDL option

 meta/conf/bitbake.conf                        |  4 +--
 meta/lib/oeqa/selftest/cases/runtime_test.py  | 29 ++++++++++---------
 .../qemu/qemu-system-native_4.1.0.bb          |  4 ++-
 meta/recipes-devtools/qemu/qemu_4.1.0.bb      |  5 +++-
 meta/recipes-gnome/gtk+/gtk+3.inc             |  2 ++
 meta/recipes-graphics/cairo/cairo_1.16.0.bb   |  2 ++
 .../libepoxy/libepoxy_1.5.3.bb                |  2 --
 .../libsdl2/libsdl2_2.0.10.bb                 |  4 +--
 .../virglrenderer/virglrenderer_0.8.0.bb      |  2 --
 scripts/runqemu                               | 15 ++++++++--
 10 files changed, 43 insertions(+), 26 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target
  2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
@ 2019-09-06 11:18 ` Alexander Kanavin
  2019-09-06 14:26   ` Khem Raj
  2019-09-06 11:18 ` [PATCH 2/5] libsdl2: enable opengl option for native/nativesdk, subject to 'opengl' in DISTRO_FEATURES Alexander Kanavin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

This will allow better control over native virgl/qemu configurations.

Adjust gtk+3/cairo native configurations to actually ignore opengl
when building for -native: we do not need it, and it would cause build
failures as only a limited subset of mesa-native is currently built.

Drop native/nativesdk overrides from virglrenderer/libepoxy recipes
as opengl feature is now correctly set for those variants.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/conf/bitbake.conf                                     | 4 ++--
 meta/recipes-gnome/gtk+/gtk+3.inc                          | 2 ++
 meta/recipes-graphics/cairo/cairo_1.16.0.bb                | 2 ++
 meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb           | 2 --
 meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb | 2 --
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a0a7f4911e0..d36f4c6ccef 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -824,8 +824,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
 
 # Normally target distro features will not be applied to native builds:
 # Native distro features on this list will use the target feature value
-DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
-DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
+DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation opengl"
+DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation opengl"
 
 DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
 MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc
index 77b6c31536b..2f9e05b1cd4 100644
--- a/meta/recipes-gnome/gtk+/gtk+3.inc
+++ b/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -47,6 +47,8 @@ do_compile_prepend() {
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
+PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 
 PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
 # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
diff --git a/meta/recipes-graphics/cairo/cairo_1.16.0.bb b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
index f32e9ba1bcd..84c7b0adde9 100644
--- a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
+++ b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
@@ -41,6 +41,8 @@ X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
+PACKAGECONFIG_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)}"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)}"
 
 PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no --disable-xlib,${X11DEPENDS}"
 PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
index c8d1650c637..5d7639a929e 100644
--- a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
+++ b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
@@ -14,8 +14,6 @@ UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases"
 inherit meson pkgconfig distro_features_check
 
 REQUIRED_DISTRO_FEATURES = "opengl"
-REQUIRED_DISTRO_FEATURES_class-native = ""
-REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
 
 PACKAGECONFIG[egl] = "-Degl=yes, -Degl=no, virtual/egl"
 PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11 virtual/libgl"
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
index d2b11c103a3..65365eb900a 100644
--- a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
+++ b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
@@ -17,5 +17,3 @@ inherit autotools pkgconfig distro_features_check
 BBCLASSEXTEND = "native nativesdk"
 
 REQUIRED_DISTRO_FEATURES = "opengl"
-REQUIRED_DISTRO_FEATURES_class-native = ""
-REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] libsdl2: enable opengl option for native/nativesdk, subject to 'opengl' in DISTRO_FEATURES
  2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target Alexander Kanavin
@ 2019-09-06 11:18 ` Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 3/5] qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE Alexander Kanavin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

This allows virgl support in qemu with the SDL frontend

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/recipes-graphics/libsdl2/libsdl2_2.0.10.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.10.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.10.bb
index 3a0654b866b..0d8d724374e 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.10.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.10.bb
@@ -40,8 +40,8 @@ EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
 # and BSP layers to pick either (desktop) opengl, gles2, or no GL
 PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
 
-PACKAGECONFIG_class-native = "x11"
-PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG_class-native = "x11 ${PACKAGECONFIG_GL}"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${PACKAGECONFIG_GL}"
 PACKAGECONFIG ??= " \
     ${PACKAGECONFIG_GL} \
     ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE
  2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 2/5] libsdl2: enable opengl option for native/nativesdk, subject to 'opengl' in DISTRO_FEATURES Alexander Kanavin
@ 2019-09-06 11:18 ` Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 5/5] oe-selftest: extend virgl gtk test to also check the SDL option Alexander Kanavin
  4 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/selftest/cases/runtime_test.py      | 15 ++++++---------
 .../qemu/qemu-system-native_4.1.0.bb              |  4 +++-
 meta/recipes-devtools/qemu/qemu_4.1.0.bb          |  5 ++++-
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 20969d2c48a..7b48fe562ef 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -181,13 +181,12 @@ class TestImage(OESelftestTestCase):
             self.skipTest('virgl isn\'t working with Debian 8')
 
         qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-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 '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'
@@ -215,12 +214,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'
diff --git a/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb b/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb
index d83ee59375c..7394385d30b 100644
--- a/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb
+++ b/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb
@@ -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 ''}"
diff --git a/meta/recipes-devtools/qemu/qemu_4.1.0.bb b/meta/recipes-devtools/qemu/qemu_4.1.0.bb
index f0c1daabe15..a4018cc4485 100644
--- a/meta/recipes-devtools/qemu/qemu_4.1.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_4.1.0.bb
@@ -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"
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend
  2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
                   ` (2 preceding siblings ...)
  2019-09-06 11:18 ` [PATCH 3/5] qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE Alexander Kanavin
@ 2019-09-06 11:18 ` Alexander Kanavin
  2019-09-06 11:18 ` [PATCH 5/5] oe-selftest: extend virgl gtk test to also check the SDL option Alexander Kanavin
  4 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

Also, add an option to use Gtk without virgl acceleration.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 scripts/runqemu | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index b5200106244..80d59424d78 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -65,9 +65,12 @@ 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 frontend without GL acceleration
+    sdl-gl - enable virgl-based GL acceleration using SDL frontend
+    sdl-gl-es - enable virgl-based GL acceleration, using OpenGL ES and SDL frontend
+    gtk - choose the Gtk frontend without GL acceleration
+    gtk-gl - enable virgl-based GL acceleration using Gtk frontend
+    gtk-gl-es - enable virgl-based GL acceleration, using OpenGL ES and Gtk frontend
     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,6 +439,12 @@ class BaseConfig(object):
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
                 self.qemu_opt_script += ' -display sdl'
+            elif arg == 'sdl-gl':
+                self.qemu_opt_script += ' -vga virtio -display sdl,gl=on'
+            elif arg == 'sdl-gl-es':
+                self.qemu_opt_script += ' -vga virtio -display sdl,gl=es'
+            elif arg == 'gtk':
+                self.qemu_opt_script += ' -display gtk'
             elif arg == 'gtk-gl':
                 self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
             elif arg == 'gtk-gl-es':
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] oe-selftest: extend virgl gtk test to also check the SDL option
  2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
                   ` (3 preceding siblings ...)
  2019-09-06 11:18 ` [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend Alexander Kanavin
@ 2019-09-06 11:18 ` Alexander Kanavin
  4 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 11:18 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/selftest/cases/runtime_test.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 7b48fe562ef..d8698f37375 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -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
@@ -185,13 +185,19 @@ class TestImage(OESelftestTestCase):
         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 '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'
-        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')
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target
  2019-09-06 11:18 ` [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target Alexander Kanavin
@ 2019-09-06 14:26   ` Khem Raj
  2019-09-06 14:57     ` Alexander Kanavin
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2019-09-06 14:26 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 5433 bytes --]

On Fri, Sep 6, 2019 at 4:18 AM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> This will allow better control over native virgl/qemu configurations.
>
> Adjust gtk+3/cairo native configurations to actually ignore opengl
> when building for -native: we do not need it, and it would cause build
> failures as only a limited subset of mesa-native is currently built.
>
> Drop native/nativesdk overrides from virglrenderer/libepoxy recipes
> as opengl feature is now correctly set for those variants.
>
> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ---
>  meta/conf/bitbake.conf                                     | 4 ++--
>  meta/recipes-gnome/gtk+/gtk+3.inc                          | 2 ++
>  meta/recipes-graphics/cairo/cairo_1.16.0.bb                | 2 ++
>  meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb           | 2 --
>  meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb | 2 --
>  5 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index a0a7f4911e0..d36f4c6ccef 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -824,8 +824,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
>
>  # Normally target distro features will not be applied to native builds:
>  # Native distro features on this list will use the target feature value
> -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
> -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
> +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation opengl"
> +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation opengl"
>
>  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit
> gobject-introspection-data ldconfig"
>  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc
> b/meta/recipes-gnome/gtk+/gtk+3.inc
> index 77b6c31536b..2f9e05b1cd4 100644
> --- a/meta/recipes-gnome/gtk+/gtk+3.inc
> +++ b/meta/recipes-gnome/gtk+/gtk+3.inc
> @@ -47,6 +47,8 @@ do_compile_prepend() {
>
>  PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland
> x11', d)} \
>                     ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11',
> 'glx', '', d)}"
> +PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES',
> 'x11', d)}"
> +PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES',
> 'x11', d)}"
>

Should we extend distro features to non target recipes as well I wonder
since I might have a development system which has full x11 and capable of
running GTK with X11 but target maybe not will
So is distro feature in someway related in these
Different classes of recipes ?

>
>  PACKAGECONFIG[x11] =
> "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11
> libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite
> libxfixes"
>  # this is provided by oe-core patch that removes epoxy/gl dependency from
> a X11 build
> diff --git a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
> b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
> index f32e9ba1bcd..84c7b0adde9 100644
> --- a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
> +++ b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
> @@ -41,6 +41,8 @@ X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
>  PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \
>                     ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11
> xcb', '', d)} \
>                     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl',
> 'opengl', '', d)}"
> +PACKAGECONFIG_class-native = "${@bb.utils.contains('DISTRO_FEATURES',
> 'x11', 'x11 xcb', '', d)}"
> +PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES',
> 'x11', 'x11 xcb', '', d)}"
>
>  PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no
> --disable-xlib,${X11DEPENDS}"
>  PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
> diff --git a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
> b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
> index c8d1650c637..5d7639a929e 100644
> --- a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
> +++ b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
> @@ -14,8 +14,6 @@ UPSTREAM_CHECK_URI = "
> https://github.com/anholt/libepoxy/releases"
>  inherit meson pkgconfig distro_features_check
>
>  REQUIRED_DISTRO_FEATURES = "opengl"
> -REQUIRED_DISTRO_FEATURES_class-native = ""
> -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
>
>  PACKAGECONFIG[egl] = "-Degl=yes, -Degl=no, virtual/egl"
>  PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11 virtual/libgl"
> diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
> b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
> index d2b11c103a3..65365eb900a 100644
> --- a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
> +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
> @@ -17,5 +17,3 @@ inherit autotools pkgconfig distro_features_check
>  BBCLASSEXTEND = "native nativesdk"
>
>  REQUIRED_DISTRO_FEATURES = "opengl"
> -REQUIRED_DISTRO_FEATURES_class-native = ""
> -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
> --
> 2.17.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 8082 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target
  2019-09-06 14:26   ` Khem Raj
@ 2019-09-06 14:57     ` Alexander Kanavin
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-06 14:57 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 6152 bytes --]

I think the native dsitro features should still be in lockstep with target
distro features, for simplicity's sake. For example here, we enable native
opengl support only if the target also will have it. If the host system
can't handle opengl, then there'll be a runtime error from qemu.

Trying to manage native distro features according to what the host system
can do sounds like a lot of complexity, I'd rather just install missing
packages on the host, or print runtime/test time errors.

Alex

On Fri, 6 Sep 2019 at 16:26, Khem Raj <raj.khem@gmail.com> wrote:

>
>
> On Fri, Sep 6, 2019 at 4:18 AM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> This will allow better control over native virgl/qemu configurations.
>>
>> Adjust gtk+3/cairo native configurations to actually ignore opengl
>> when building for -native: we do not need it, and it would cause build
>> failures as only a limited subset of mesa-native is currently built.
>>
>> Drop native/nativesdk overrides from virglrenderer/libepoxy recipes
>> as opengl feature is now correctly set for those variants.
>>
>> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
>> ---
>>  meta/conf/bitbake.conf                                     | 4 ++--
>>  meta/recipes-gnome/gtk+/gtk+3.inc                          | 2 ++
>>  meta/recipes-graphics/cairo/cairo_1.16.0.bb                | 2 ++
>>  meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb           | 2 --
>>  meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb | 2 --
>>  5 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index a0a7f4911e0..d36f4c6ccef 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -824,8 +824,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
>>
>>  # Normally target distro features will not be applied to native builds:
>>  # Native distro features on this list will use the target feature value
>> -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
>> -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
>> +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation opengl"
>> +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation opengl"
>>
>>  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit
>> gobject-introspection-data ldconfig"
>>  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
>> diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc
>> b/meta/recipes-gnome/gtk+/gtk+3.inc
>> index 77b6c31536b..2f9e05b1cd4 100644
>> --- a/meta/recipes-gnome/gtk+/gtk+3.inc
>> +++ b/meta/recipes-gnome/gtk+/gtk+3.inc
>> @@ -47,6 +47,8 @@ do_compile_prepend() {
>>
>>  PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland
>> x11', d)} \
>>                     ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11',
>> 'glx', '', d)}"
>> +PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES',
>> 'x11', d)}"
>> +PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES',
>> 'x11', d)}"
>>
>
> Should we extend distro features to non target recipes as well I wonder
> since I might have a development system which has full x11 and capable of
> running GTK with X11 but target maybe not will
> So is distro feature in someway related in these
> Different classes of recipes ?
>
>>
>>  PACKAGECONFIG[x11] =
>> "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11
>> libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite
>> libxfixes"
>>  # this is provided by oe-core patch that removes epoxy/gl dependency
>> from a X11 build
>> diff --git a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
>> b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
>> index f32e9ba1bcd..84c7b0adde9 100644
>> --- a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
>> +++ b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
>> @@ -41,6 +41,8 @@ X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
>>  PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)}
>> \
>>                     ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11
>> xcb', '', d)} \
>>                     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl',
>> 'opengl', '', d)}"
>> +PACKAGECONFIG_class-native = "${@bb.utils.contains('DISTRO_FEATURES',
>> 'x11', 'x11 xcb', '', d)}"
>> +PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES',
>> 'x11', 'x11 xcb', '', d)}"
>>
>>  PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no
>> --disable-xlib,${X11DEPENDS}"
>>  PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
>> diff --git a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
>> b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
>> index c8d1650c637..5d7639a929e 100644
>> --- a/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
>> +++ b/meta/recipes-graphics/libepoxy/libepoxy_1.5.3.bb
>> @@ -14,8 +14,6 @@ UPSTREAM_CHECK_URI = "
>> https://github.com/anholt/libepoxy/releases"
>>  inherit meson pkgconfig distro_features_check
>>
>>  REQUIRED_DISTRO_FEATURES = "opengl"
>> -REQUIRED_DISTRO_FEATURES_class-native = ""
>> -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
>>
>>  PACKAGECONFIG[egl] = "-Degl=yes, -Degl=no, virtual/egl"
>>  PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11 virtual/libgl"
>> diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
>> b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
>> index d2b11c103a3..65365eb900a 100644
>> --- a/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
>> +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.0.bb
>> @@ -17,5 +17,3 @@ inherit autotools pkgconfig distro_features_check
>>  BBCLASSEXTEND = "native nativesdk"
>>
>>  REQUIRED_DISTRO_FEATURES = "opengl"
>> -REQUIRED_DISTRO_FEATURES_class-native = ""
>> -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
>> --
>> 2.17.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>

[-- Attachment #2: Type: text/html, Size: 9066 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend
  2019-09-01 20:36 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
@ 2019-09-01 20:36 ` Alexander Kanavin
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-09-01 20:36 UTC (permalink / raw)
  To: openembedded-core

Also, add an option to use Gtk without virgl acceleration.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 scripts/runqemu | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index b5200106244..80d59424d78 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -65,9 +65,12 @@ 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 frontend without GL acceleration
+    sdl-gl - enable virgl-based GL acceleration using SDL frontend
+    sdl-gl-es - enable virgl-based GL acceleration, using OpenGL ES and SDL frontend
+    gtk - choose the Gtk frontend without GL acceleration
+    gtk-gl - enable virgl-based GL acceleration using Gtk frontend
+    gtk-gl-es - enable virgl-based GL acceleration, using OpenGL ES and Gtk frontend
     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,6 +439,12 @@ class BaseConfig(object):
                 self.kernel_cmdline_script += ' console=ttyS0'
             elif arg == 'sdl':
                 self.qemu_opt_script += ' -display sdl'
+            elif arg == 'sdl-gl':
+                self.qemu_opt_script += ' -vga virtio -display sdl,gl=on'
+            elif arg == 'sdl-gl-es':
+                self.qemu_opt_script += ' -vga virtio -display sdl,gl=es'
+            elif arg == 'gtk':
+                self.qemu_opt_script += ' -display gtk'
             elif arg == 'gtk-gl':
                 self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
             elif arg == 'gtk-gl-es':
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-06 14:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 11:18 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
2019-09-06 11:18 ` [PATCH 1/5] bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target Alexander Kanavin
2019-09-06 14:26   ` Khem Raj
2019-09-06 14:57     ` Alexander Kanavin
2019-09-06 11:18 ` [PATCH 2/5] libsdl2: enable opengl option for native/nativesdk, subject to 'opengl' in DISTRO_FEATURES Alexander Kanavin
2019-09-06 11:18 ` [PATCH 3/5] qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE Alexander Kanavin
2019-09-06 11:18 ` [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend Alexander Kanavin
2019-09-06 11:18 ` [PATCH 5/5] oe-selftest: extend virgl gtk test to also check the SDL option Alexander Kanavin
  -- strict thread matches above, loose matches on Subject: below --
2019-09-01 20:36 [PATCH 0/5] virgl: add SDL support and enable by default Alexander Kanavin
2019-09-01 20:36 ` [PATCH 4/5] runqemu: add options that enable virgl with the SDL frontend Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.