swaywm / wlroots

A modular Wayland compositor library
https://gitlab.freedesktop.org/wlroots/wlroots/
MIT License
2.15k stars 342 forks source link

wlroots doesn't keep mode set via video= kernel cmdline #2040

Closed flokli closed 4 years ago

flokli commented 4 years ago

I want to run a wayland compositor on a device with a fixed screen resolution, and to ease debugging, want to provide a similar environment in a qemu VM.

I used the kernels cmdline option to configure a resolution:

video=Virtual-1:2280x800@60me

During boot, I see this custom resolution being configured. However, as soon as my compositor (cage in that case) starts, it seems to fall back to 1024x768.

I'm running qemu with -vga std, -m 2048 and -smp 2, if that helps.

I experienced this bug in sway as well, so assume it's a wlroots problem, and not cage-specific.

emersion commented 4 years ago

video is a kernel option for framebuffer devices. fbdev isn't used on wlroots, DRM/KMS is used instead, so this option won't work. You should configure your compositor to set a custom mode instead (e.g. output XXX mode --custom YYY in Sway).

Also see https://wiki.archlinux.org/index.php/Kernel_mode_setting#Forcing_modes_and_EDID for a solution with kernel params.

agx commented 4 years ago

we're using a modeline in the config file for that https://source.puri.sm/Librem5/phosh/blob/master/data/rootston.ini#L12

flokli commented 4 years ago

I went generating a custom edid with my custom mode, added it to the initrd, and passed it as kernel cmdline:

drm_kms_helper.edid_firmware=Virtual-1:edid/1280x800.bin

That way, I don't need to rely on the compositor providing a way to add/set custom modes.