bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target
PATCH 1/3 bitbake.conf: propagate 'opengl' DISTRO_FEATURE to native/nativesdk from target
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.
--- 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.4.bb | 2 -- meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 -- 5 files changed, 6 insertions(+), 6 deletions(-)
meta/conf/bitbake.conf +2 -2
@@ -833,8 +833,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"
meta/recipes-gnome/gtk+/gtk+3.inc +2 -0
@@ -46,6 +46,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
meta/recipes-graphics/cairo/cairo_1.16.0.bb +2 -0
@@ -42,6 +42,8 @@ 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)} \ trace" +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"
meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb +0 -2
@@ -19,8 +19,6 @@ UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases" inherit meson pkgconfig 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 -Dx11=false, virtual/libx11 virtual/libgl"
meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +0 -2
@@ -22,5 +22,3 @@ inherit meson pkgconfig features_check BBCLASSEXTEND = "native nativesdk" REQUIRED_DISTRO_FEATURES = "opengl" -REQUIRED_DISTRO_FEATURES_class-native = "" -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
Signature · 1 line
2.26.1
PATCH 2/3 libsdl2: enable opengl option for native/nativesdk, subject to 'opengl' in DISTRO_FEATURES
This allows virgl support in qemu with the SDL frontend
--- meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-graphics/libsdl2/libsdl2_2.0.12.bb +2 -2
@@ -45,8 +45,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)} \
Signature · 1 line
2.26.1
PATCH 3/3 qemu: enable virglrenderer and glx options subject to 'opengl' DISTRO_FEATURE
In reply to Alexander KanavinNote 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
--- meta/lib/oeqa/selftest/cases/runtime_test.py | 18 ++++++------------ .../qemu/qemu-system-native_4.2.0.bb | 4 +++- meta/recipes-devtools/qemu/qemu_4.2.0.bb | 5 ++++- 3 files changed, 13 insertions(+), 14 deletions(-)
meta/lib/oeqa/selftest/cases/runtime_test.py +6 -12
@@ -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'
meta/recipes-devtools/qemu/qemu-system-native_4.2.0.bb +3 -1
@@ -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 ''}"
meta/recipes-devtools/qemu/qemu_4.2.0.bb +4 -1
@@ -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"
Signature · 1 line
2.26.1
Quoted 9 lines · Alexander Kanavin
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.
DISTRO_FEATURES are meant for target most of the time so this seems not the right way to go about it. perhaps HOST_DISTRO_FEATURES or some such would be the way to go, since it should not be enforced on folks who do
not want it and dont use qemu as machine but just as a veneer to cross build stuff.
Quoted 77 lines
Signed-off-by Alexander Kanavin <[email protected]>--- 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.4.bb | 2 -- meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 -- 5 files changed, 6 insertions(+), 6 deletions(-)meta/conf/bitbake.conf +2
-2@@ -833,8 +833,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"meta/recipes-gnome/gtk+/gtk+3.inc +2
-0@@ -46,6 +46,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 buildmeta/recipes-graphics/cairo/cairo_1.16.0.bb +2
-0@@ -42,6 +42,8 @@ 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)} \ trace" +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"meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb +0
-2@@ -19,8 +19,6 @@ UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases" inherit meson pkgconfig 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 -Dx11=false, virtual/libx11 virtual/libgl"meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +0
-2@@ -22,5 +22,3 @@ inherit meson pkgconfig features_check BBCLASSEXTEND = "native nativesdk" REQUIRED_DISTRO_FEATURES = "opengl" -REQUIRED_DISTRO_FEATURES_class-native = "" -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
Quoted 6 lines · Khem Raj
DISTRO_FEATURESare meant for target most of the time so this seems not the right way to go about it. perhapsHOST_DISTRO_FEATURESor some such would be the way to go, since it should not be enforced on folks who do not want it and dont use qemu as machine but just as a veneer to cross build stuff.
If someone isn't using qemu-system-native recipe (the full system emulators), then qemu-system-native isn't built at all, and so they're entirely unaffected, no? All the native opengl stuff is pulled in by only that recipe.
Otherwise, it's easy to disable: set DISTRO_FEATURES_FILTER_NATIVE to "".
Alex
Quoted 100 lines
Quoted 15 lines
Signed-off-by Alexander Kanavin <[email protected]>--- 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.4.bb | 2 -- meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 -- 5 files changed, 6 insertions(+), 6 deletions(-)meta/conf/bitbake.conf +0
-0meta/conf/bitbake.conf DISTRO_FEATURES_NATIVESDK ?= "x11" · line 839
Quoted 9 lines
meta/conf/bitbake.conf +2
-2@@ -833,8 +833,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 sysvinitgobject-introspection-data ldconfig"
Review
Quoted 2 lines
meta/conf/bitbake.conf +0
-0MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"(quoted diff) +0
-0b/meta/recipes-gnome/gtk+/gtk+3.inc
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 47
Quoted 6 lines
index 5d1f59ea1a..6154154004 100644
meta/recipes-gnome/gtk+/gtk+3.inc +0
-0@@ -46,6 +46,8 @@ do_compile_prepend() { PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'openglwayland x11', d)} \
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 48
Quoted 1 line
meta/recipes-gnome/gtk+/gtk+3.inc +0
-0${@bb.utils.contains('DISTRO_FEATURES', 'openglx11', 'glx', '', d)}"
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 49
Quoted 1 line
meta/recipes-gnome/gtk+/gtk+3.inc +1
-0+PACKAGECONFIG_class-native = "${@bb.utils.filter('DISTRO_FEATURES','x11', d)}"
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 50
Quoted 1 line
meta/recipes-gnome/gtk+/gtk+3.inc +1
-0+PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES','x11', d)}"
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 51
Quoted 2 lines
meta/recipes-gnome/gtk+/gtk+3.inc +0
-0PACKAGECONFIG[x11] ="--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
meta/recipes-gnome/gtk+/gtk+3.inc do_compile_prepend() { · line 52
Quoted 1 line
meta/recipes-gnome/gtk+/gtk+3.inc +0
-0# this is provided by oe-core patch that removes epoxy/gl dependencyfrom a X11 build
Review
Quoted 1 line
(quoted diff) +0
-0b/meta/recipes-graphics/cairo/cairo_1.16.0.bb
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??=
Quoted 4 lines
index
b772c2ece2..092c77b826100644meta/recipes-graphics/cairo/cairo_1.16.0.bb +0
-0@@ -42,6 +42,8 @@ PACKAGECONFIG ??="${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??= · line 42
Quoted 1 line
meta/recipes-graphics/cairo/cairo_1.16.0.bb +0
-0${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11xcb', '', d)} \
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??= · line 43
Quoted 1 line
meta/recipes-graphics/cairo/cairo_1.16.0.bb +0
-0${@bb.utils.contains('DISTRO_FEATURES', 'x11opengl', 'opengl', '', d)} \
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??= · line 45
Quoted 2 lines
meta/recipes-graphics/cairo/cairo_1.16.0.bb +1
-0trace" +PACKAGECONFIG_class-native = "${@bb.utils.contains('DISTRO_FEATURES','x11', 'x11 xcb', '', d)}"
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??= · line 46
Quoted 1 line
meta/recipes-graphics/cairo/cairo_1.16.0.bb +1
-0+PACKAGECONFIG_class-nativesdk ="${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)}"
meta/recipes-graphics/cairo/cairo_1.16.0.bb PACKAGECONFIG ??= · line 47
Quoted 2 lines
meta/recipes-graphics/cairo/cairo_1.16.0.bb +0
-0PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no--disable-xlib,${X11DEPENDS}"
Review
Quoted 2 lines
meta/recipes-graphics/cairo/cairo_1.16.0.bb +0
-0PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"(quoted diff) +0
-0b/meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb
meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb UPSTREAM_CHECK_URI = "
Quoted 4 lines
index
0782c6ce35..6646ef79fe100644meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb +0
-0@@ -19,8 +19,6 @@ UPSTREAM_CHECK_URI = "meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases"
Quoted 8 lines
meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb +0
-2inherit meson pkgconfig 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 -Dx11=false, virtual/libx11virtual/libgl"
Review
Quoted 1 line
(quoted diff) +0
-0b/meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb
Quoted 13 lines
index
1046b8504f..29b12628d0100644meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +0
-2@@ -22,5 +22,3 @@ inherit meson pkgconfig features_check BBCLASSEXTEND = "native nativesdk" REQUIRED_DISTRO_FEATURES = "opengl" -REQUIRED_DISTRO_FEATURES_class-native = "" -REQUIRED_DISTRO_FEATURES_class-nativesdk = ""