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.
This commit is contained in:
Minecrell 2020-03-05 23:59:40 +01:00 committed by Oliver Smith
parent f602df0140
commit b4678f0882
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 7 additions and 0 deletions

View File

@ -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)",

View File

@ -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)