* [PATCH 1/2] runqemu: set host DRI driver path for all instances of virgl usage
@ 2020-05-06 19:01 Alexander Kanavin
2020-05-06 19:01 ` [PATCH 2/2] libepoxy: do not strip RUNPATH from native/nativesdk Alexander Kanavin
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2020-05-06 19:01 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
Falling through to host GL stack via epoxy chrpath hack was
found to be problematic in case of SDL particularly (because it does
not actually use epoxy, and does its own dlopen()).
So let's just use the mesa-native libraries everywhere, but instruct
them to load DRI drivers from the host.
NVidia's proprietary blob users have to take care of themselves, I'm afraid.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
scripts/runqemu | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index 310d79fdc5..7eb7a9c7b4 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -420,6 +420,23 @@ class BaseConfig(object):
logger.error("%s not a directory valid DEPLOY_DIR_IMAGE" % deploy_dir_image)
self.set("MACHINE", arg)
+ def set_dri_path(self):
+ # 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']
+ del os.environ['PKG_CONFIG_SYSROOT_DIR']
+ 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()
+
def check_args(self):
for debug in ("-d", "--debug"):
if debug in sys.argv:
@@ -440,15 +457,19 @@ class BaseConfig(object):
self.kernel_cmdline_script += ' console=ttyS0'
elif arg == 'sdl':
if 'gl' in sys.argv[1:]:
+ self.set_dri_path()
self.qemu_opt_script += ' -vga virtio -display sdl,gl=on'
elif 'gl-es' in sys.argv[1:]:
+ self.set_dri_path()
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.set_dri_path()
self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
elif 'gl-es' in sys.argv[1:]:
+ self.set_dri_path()
self.qemu_opt_script += ' -vga virtio -display gtk,gl=es'
else:
self.qemu_opt_script += ' -display gtk'
@@ -456,22 +477,8 @@ class BaseConfig(object):
# These args are handled inside sdl or gtk blocks above
pass
elif arg == 'egl-headless':
+ self.set_dri_path()
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']
- del os.environ['PKG_CONFIG_SYSROOT_DIR']
- 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
--
2.26.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] libepoxy: do not strip RUNPATH from native/nativesdk
2020-05-06 19:01 [PATCH 1/2] runqemu: set host DRI driver path for all instances of virgl usage Alexander Kanavin
@ 2020-05-06 19:01 ` Alexander Kanavin
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2020-05-06 19:01 UTC (permalink / raw)
To: openembedded-core; +Cc: Alexander Kanavin
This was done to fall through to host GL stack; now that
mesa-native with host dri drivers is used instead, this is
no longer necessary or desirable.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb | 8 --------
1 file changed, 8 deletions(-)
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb b/meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb
index af9867407e..0782c6ce35 100644
--- a/meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb
+++ b/meta/recipes-graphics/libepoxy/libepoxy_1.5.4.bb
@@ -33,11 +33,3 @@ PACKAGECONFIG_class-nativesdk = "egl x11"
BBCLASSEXTEND = "native nativesdk"
-# This will ensure that dlopen will attempt only GL libraries provided by host
-do_install_append_class-native() {
- chrpath --delete ${D}${libdir}/*.so
-}
-
-do_install_append_class-nativesdk() {
- chrpath --delete ${D}${libdir}/*.so
-}
--
2.26.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-06 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-06 19:01 [PATCH 1/2] runqemu: set host DRI driver path for all instances of virgl usage Alexander Kanavin
2020-05-06 19:01 ` [PATCH 2/2] libepoxy: do not strip RUNPATH from native/nativesdk Alexander Kanavin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox