diff options
author | Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> | 2025-04-10 05:54:40 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-04-11 11:44:22 +0100 |
commit | 3434e65b4e64f6e577533e661edfac9ba96a2e0b (patch) | |
tree | 81620e0ccc746d247a0b0c68b21ed3b276bdd35e /scripts | |
parent | 3febeb358778f686530942bb7dcd4bb2bca66040 (diff) | |
download | poky-3434e65b4e64f6e577533e661edfac9ba96a2e0b.tar.gz |
runqemu: also set GBM_BACKENDS_PATH
Newer Mesa dynamically loads GBM backends from the libdir. This is going
to cause issues with running native QEMU as the libdir
(mesa-native/recipes-sysroot-native) will not exist when it's executed.
Follow the LIBGL_DRIVERS_PATH approach and specify a path to GBM
backends via GBM_BACKENDS_PATH environment variable.
(From OE-Core rev: 91797b077f5fe9f13319d1633f491bad2c6f7560)
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 86124a4a6a..3d77046972 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -468,9 +468,11 @@ class BaseConfig(object): | |||
468 | self.set("IMAGE_LINK_NAME", image_link_name) | 468 | self.set("IMAGE_LINK_NAME", image_link_name) |
469 | logger.debug('Using IMAGE_LINK_NAME = "%s"' % image_link_name) | 469 | logger.debug('Using IMAGE_LINK_NAME = "%s"' % image_link_name) |
470 | 470 | ||
471 | def set_dri_path(self): | 471 | def set_mesa_paths(self): |
472 | drivers_path = os.path.join(self.bindir_native, '../lib/dri') | 472 | drivers_path = os.path.join(self.bindir_native, '../lib/dri') |
473 | if not os.path.exists(drivers_path) or not os.listdir(drivers_path): | 473 | gbm_path = os.path.join(self.bindir_native, '../lib/gbm') |
474 | if not os.path.exists(drivers_path) or not os.listdir(drivers_path) \ | ||
475 | or not os.path.exists(gbm_path) or not os.listdir(gbm_path): | ||
474 | raise RunQemuError(""" | 476 | raise RunQemuError(""" |
475 | qemu has been built without opengl support and accelerated graphics support is not available. | 477 | qemu has been built without opengl support and accelerated graphics support is not available. |
476 | To enable it, add: | 478 | To enable it, add: |
@@ -479,6 +481,7 @@ DISTRO_FEATURES_NATIVESDK:append = " opengl" | |||
479 | to your build configuration. | 481 | to your build configuration. |
480 | """) | 482 | """) |
481 | self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path | 483 | self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path |
484 | self.qemu_environ['GBM_BACKENDS_PATH'] = gbm_path | ||
482 | 485 | ||
483 | def check_args(self): | 486 | def check_args(self): |
484 | for debug in ("-d", "--debug"): | 487 | for debug in ("-d", "--debug"): |
@@ -1461,7 +1464,7 @@ to your build configuration. | |||
1461 | self.qemu_opt += ' -display ' | 1464 | self.qemu_opt += ' -display ' |
1462 | if self.egl_headless == True: | 1465 | if self.egl_headless == True: |
1463 | self.check_render_nodes() | 1466 | self.check_render_nodes() |
1464 | self.set_dri_path() | 1467 | self.set_mesa_paths() |
1465 | self.qemu_opt += 'egl-headless,' | 1468 | self.qemu_opt += 'egl-headless,' |
1466 | else: | 1469 | else: |
1467 | if self.sdl == True: | 1470 | if self.sdl == True: |
@@ -1471,10 +1474,10 @@ to your build configuration. | |||
1471 | self.qemu_opt += 'gtk,' | 1474 | self.qemu_opt += 'gtk,' |
1472 | 1475 | ||
1473 | if self.gl == True: | 1476 | if self.gl == True: |
1474 | self.set_dri_path() | 1477 | self.set_mesa_paths() |
1475 | self.qemu_opt += 'gl=on,' | 1478 | self.qemu_opt += 'gl=on,' |
1476 | elif self.gl_es == True: | 1479 | elif self.gl_es == True: |
1477 | self.set_dri_path() | 1480 | self.set_mesa_paths() |
1478 | self.qemu_opt += 'gl=es,' | 1481 | self.qemu_opt += 'gl=es,' |
1479 | self.qemu_opt += 'show-cursor=on' | 1482 | self.qemu_opt += 'show-cursor=on' |
1480 | 1483 | ||