Skip to contentSkip to conversation

runqemu: force software x11 renderer for SDL when GL is not in use

PATCH New Alexander Kanavin 1 participant 1 message May 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu: force software x11 renderer for SDL when GL is not in use

If libsdl is configured with opengl enabled, it will try to use GL renderers to open a window even if qemu doesn't use virgl. Setting the environment variable forces a software X11 renderer, which is the same one used when libsdl has opengl switched off. This avoids needlessly loading the GL libraries and drivers from the host.

---
 scripts/runqemu | 3 +++
 1 file changed, 3 insertions(+)
scripts/runqemu +3 -0
index 7eb7a9c7b4..21680b49d2 100755
@@ -448,6 +448,9 @@ class BaseConfig(object):
                 logger.setLevel(logging.ERROR)
                 sys.argv.remove(quiet)
 
+        if 'gl' not in sys.argv[1:] and 'gl-es' not in sys.argv[1:]:
+            os.environ['SDL_RENDER_DRIVER'] = 'software'
+
         unknown_arg = ""
         for arg in sys.argv[1:]:
             if arg in self.fstypes + self.vmtypes + self.wictypes:
Signature · 1 line
2.26.1