can't set virtual console resolution

when EFI booting my x250 Thinkpad into 14.3-RELEASE.

I have the resolution during boot via /boot/loader.conf
Code:
exec="gop set 2" # during boot, 800x600x32
kern.vt.color.0.rgb="#303000"
kern.vt.color.15.rgb="#00f000"
kern.vt.fb.default_mode="640x480x16" # has no effect

But not on the virtual terminals afterwards.

I know https://forums.freebsd.org/threads/drm-user-defined-mode-not-supported.96680/#post-710068, read
vt() and
Code:
$ cat /usr/local/etc/pkg/repos/kmods.conf
# https://forums.freebsd.org/threads/new-install-of-14-2.96276/#post-684792
FreeBSD-kmods: {
        enabled: yes,
        priority: 0,
        url: pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR},
        signature_type: "fingerprints",
        fingerprints: "/usr/share/keys/pkg",
        mirror_type: "srv",
}
$ dmesg | fgrep drm
[drm] Got Intel graphics stolen memory base 0xce000000, size 0x2000000
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
lkpi_iic0: <LinuxKPI I2C> on drmn0
lkpi_iic1: <LinuxKPI I2C> on drmn0
lkpi_iic2: <LinuxKPI I2C> on drmn0
lkpi_iic3: <LinuxKPI I2C> on drmn0
lkpi_iic4: <LinuxKPI I2C> on drm1
lkpi_iic5: <LinuxKPI I2C> on drm2
lkpi_iic6: <LinuxKPI I2C> on drm4
[drm] Initialized i915 1.6.0 20201103 for drmn0 on minor 0
VT: Replacing driver "efifb" with new "drmfb".
name=drmn0 id=i915drmfb flags=0x0 stride=5504

Mind there is no connector.

How can I get consistent 800x600 on all virtual consoles?
 
Try setting efi_max_resolution="800x600" in /boot/loader.conf, see if that works better for you.

Code:
           efi_max_resolution

           vbe_max_resolution
                     Specify the maximum desired resolution for the EFI or VBE
                     framebuffer console.  The following values are accepted:

                     Value           Resolution
                     480p            640x480
                     720p            1280x720
                     1080p           1920x1080
                     1440p           2560x1440
                     2160p           3840x2160
                     4k              3840x2160
                     5k              5120x2880
                     WidthxHeight    WidthxHeight
loader.conf(5)
 
added
Code:
$ fgrep efi_ /boot/loader.conf
efi_max_resolution="800x600"
rebooted, no effect.
 
kern.vt.fb.default_mode="640x480x16" # has no effect
That one is wrong by the way, you only give it the resolution, not the number of color bits. So kern.vt.fb.default_mode="640x480"
 
thanks SirDice, changed to
Code:
$ fgrep 800x600 /boot/loader.conf
exec="gop set 2" # during boot, 800x600x32
# kern.vt.fb.default_mode="800x600x32"
kern.vt.fb.default_mode="800x600"
efi_max_resolution="800x600"
reboot, still no effect.
 
Let’s bring this one back. Looks like there is an ongoing VT bug.

Manually loading my specific Intel graphics driver i915kms:

sh:
sudo kldload i915kms

this will break stuff with sudo use sudo sparingly

I get back to command line (tail -20 or something) with gpu graphics driver loaded:

sh:
VT: Replacing driver “efifb” with new “drmfb”.
start FB_INFO:
height=2160 width=3840 depth=32
pbase=<memory address> vbase=<memory address>
name=drmn1 id=i915drmfb flags=0x0 stride=15360
end FB_INFO
rc@at:~$

Running more tests
 
Hei,
just stumbled over this one, while I was (re-)setting up an existing machine that is supposed to become a server (text mode without kmod driver) and was a bhyve host with gui before.

What SirDice suggested works, when the kmod IS NOT loaded, which solved my problem :)
With the driver loaded though, the resolution will always switch to the highest possible and stay there. No way to change that. What you can do, is to build a bigger font and apply that. For a 27" 2K screen like mine, a 6x12 pixel font looks kinda similar to the default font on my 14" laptop in fullHD.

Without the kmod driver one can change resolution, but not load fonts.
With the kmod driver loaded it's the opposite and one can't change resolution but can load fonts.

About a year ago to build my big font I downloaded the set of terminus fonts at https://sourceforge.net/projects/te...-font-4.47/terminus-font-4.47.tar.gz/download and then build some different sizes until I found a suitable:

Build exampel:
vtfontcvt -w 6 -h 12 ter-u12n.bdf /usr/share/vt/fonts/terminus-u12n.fnt
Test it:
vidcontrol -f /usr/share/vt/fonts/terminus-u12n.fnt

Fonts prefixes:
u is unicode
b is bold
n is normal

To apply that at boot, put the following into your /etc/rc.conf
Code:
allscreens_flags="-f /usr/share/vt/fonts/terminus-u12n.fnt"

Note that only a few of vidcontrol's options work for vt, but font loading does. You may drop the path to the font and the .fnt, if you place it in /usr/share/vt/fonts. I hope that works for you, since I just took that from my notes. There is a FreeBSD wiki page about that topic somewhere, too.
 
How can I get consistent 800x600 on all virtual consoles?
First you must realize that UEFI GOP driver in BIOS is providing resolution along with DRM driver.

Do you know for sure that 800x600 is even a valid resolution for your GOP driver?

At loader prompt (Beastie Logo) explore your GOP resolutions.

gop list

These are the only resolutions that will be available to set via /boot/loader.conf

Updating the BIOS/GOP and different monitors supported resolution also can play a part. GOP driver will only support what a monitor can provide.
 
build my big font I downloaded the set of terminus fonts ... build some different sizes
To apply that at boot, put the following into your /etc/rc.conf
allscreens_flags="-f /usr/share/vt/fonts/terminus-u12n.fnt"
By default, the system provides a set of Terminus fonts in /boot/fonts [1], applicable from /boot/loader.conf with the screen.font="6x12" variable. Have you tried those?

Once the font set in /boot/loader.conf, it shouldn't effect the size when a drm-kmod driver is loaded.

Also, unlike /etc/rc.conf allscreens_flags, which has effect later in the boot process when rc.conf is read, the /boot/loader.conf set font has an immediate effect, after the boot loader sets all the environment variables, before the system is bootstraped, starting with the boot menu.

If you don't like Terminus fonts, it's possible to take a compatible .fn font you like from local or external sources, gzip(1) in a XxY.fnt.gz format and place it under /boot/fonts (e.g. from local: /usr/share/vt/fonts/spleen-6x12.fnt).

[1]
Code:
10x18.fnt.gz
10x20.fnt.gz
11x22.fnt.gz
12x24.fnt.gz
14x28.fnt.gz
16x32.fnt.gz
32x64.fnt.gz
6x12.fnt.gz
8x14.fnt.gz
8x14v.fnt.gz
8x16.fnt.gz
8x16b.fnt.gz
8x16v.fnt.gz
INDEX.fonts
 
Thanks for the additional information. I can't really recall, why I downloaded the font at that time. I actually created the first font for vt many years ago. I can't see any option in loader.conf(5) or
vt(4) to put in /boot/loader.conf that will be loading a font. Only options to define a font size through screen.font. Or is it, that the font corresponding to the size in screen.font will be loader from /boot/fonts ?
 
Back
Top