pmb.qemu: simplify --display by introducing --no-gl (!1886)

At the moment, the --display argument is a bit complicated to use.
A common use would be to switch between the UIs (sdl, gtk, none)
or to enable the software rasterizer. Split the two use cases
to separate arguments to make it more intuitive.
This commit is contained in:
Minecrell 2020-03-05 22:36:06 +01:00 committed by Oliver Smith
parent d1f5753c89
commit 32dca18eb6
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 10 additions and 3 deletions

View File

@ -126,9 +126,12 @@ def arguments_qemu(subparser):
ret.add_argument("--flavor", help="name of the kernel flavor (run 'pmbootstrap flasher list_flavors'"
" to get a list of all installed flavors")
ret.add_argument("--display", dest="qemu_display", const="sdl,gl=on",
ret.add_argument("--display", dest="qemu_display", choices=["sdl", "gtk", "none"],
help="QEMU's display parameter (default: sdl,gl=on)",
default="sdl,gl=on", nargs="?")
default="sdl", nargs="?")
ret.add_argument("--no-gl", dest="qemu_gl", default=True, action='store_false',
help="Avoid using GL for accelerating graphics in QEMU "
"(use software rasterizer, slow!)")
ret.add_argument("--audio", dest="qemu_audio", choices=["alsa", "pa", "sdl"],
help="QEMU's audio backend (default: none)",

View File

@ -177,7 +177,11 @@ def command_qemu(args, arch, device, img_path):
else:
logging.info("WARNING: QEMU is not using KVM and will run slower!")
command += ["-display", args.qemu_display]
display = args.qemu_display
if display != "none":
display += ",gl=" + ("on" if args.qemu_gl else "off")
command += ["-display", display]
# Audio support
if args.qemu_audio: