From b4678f08823e75b454719500f6e997765298c53d Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 5 Mar 2020 23:59:40 +0100 Subject: [PATCH] pmb.qemu: make video resolution configurable + consistent (!1886) For some reason, the SDL display backend changes the video resolution to 1024x768, while the GTK display keeps it at 640x480. This is annoying, because at the moment we can only set one display resolution for a device in postmarketOS (e.g. for the splash screen). At the moment, the resolution for the splash screen is set to 640x480, which therefore shows up too small with the default SDL display. It seems like the display resolution can be only changed in the guest directly. Linux has a video= kernel parameter that can be used to implement this. (See: https://www.kernel.org/doc/html/latest/fb/modedb.html) Let's set 1024x768 by default, but make it configurable through --video. --- pmb/parse/arguments.py | 3 +++ pmb/qemu/run.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 139ea2d4..57757c0c 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -136,6 +136,9 @@ def arguments_qemu(subparser): 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("--video", dest="qemu_video", default="1024x768@60", + help="Video resolution for QEMU (WidthxHeight@RefreshRate). " + "Default is 1024x768@60.") 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 6cbb32d5..f1e48541 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -73,6 +73,10 @@ def command_qemu(args, arch, img_path): cmdline = args.deviceinfo["kernel_cmdline"] if args.cmdline: cmdline = args.cmdline + + if "video=" not in cmdline: + cmdline += " video=" + args.qemu_video + logging.debug("Kernel cmdline: " + cmdline) port_ssh = str(args.port)