From 32dca18eb6ba1bf72c9b315d9b1288590ce7be84 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 5 Mar 2020 22:36:06 +0100 Subject: [PATCH] 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. --- pmb/parse/arguments.py | 7 +++++-- pmb/qemu/run.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index dcfbe35b..46bce397 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -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)", diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 4f01d43a..8e1369f6 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -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: