Re: vt: efifb / fb+kms resolutions and fonts — how to?

Toomas Soome tsoome at me.com
Thu May 13 14:36:09 UTC 2021



> On 13. May 2021, at 17:04, Lev Serebryakov <lev at FreeBSD.org> wrote:
> 
> 
> Is it possible to get native 1920x1080 resoultiuon and small fond (many lines) early on boot?
> 
> Lenovo T540p has native resolution 1920x1080 and boots with UEFI. I've tried two configs:
> 
> (1) No special configuration in /boot/loader.conf
> 
> (1.1) Loader menu is ugly, font is large and jagged, looks like "text resolution" is 80x25.
> 
> (1.2) Early on boot kernel reports: "VT(efifb): resolution 640x480".
>       "text resolution" is 80x25 and font is large and ugly still.
>       Font ugliness is expected for non-native resolution and explains loader ugliness.
> 
> (1.3) After i915kms.ko load (by rc(8)) resolution is native (1920x1080), font is very small, there are
>       A LOT of "text resolution".
> 
> (2) "efi_max_resolution=1080p" in /boot/loader.conf
> 
> (2.1) Loader menu is nice, font is large and smooth, but looks like "text resolution" is 80x25 still.
> 
> (2.2) Early on boot kernel reports: "VT(efifb): resolution 1920x1080".
>       "text resolution" is 80x25 and font is large and smooth still.
> 
> (2.3) After i915kms.ko load (by rc(8)) resolution is native (1920x1080), font is THE SAME (large and smooth),
>       "text resolution" is 80x25 still!
> 
> 
> Adding "screen.font="16x32"" into "/boot/loader.conf" doesn't change anything.
> 
> Is it possible to have EFIFB resolution 1920x1080, but small font and lot of "text resolution" from early boot on?
> 

First thing, please check if you have boot1.efi or loader.efi in ESP (EFI System Partition), and when it is loader.efi, please check it is latest.

Then next step would be to test out gfx modes, on loader OK prompt, try to switch modes with gop list + gop set command, use gop get to verify (on my system, only 800x600 is used, despite there are different modes in list). With mode change, there also may be font change.

Then next thing is to check different fonts; the default list is shown when you enter: set screen.font=    — without value, it will list the available ones. Once you set the font, show COLUMNS and show LINES will tell you terminal size. This font is also passed to kernel and used as default font.

If you want to use custom font, it must be prepared with vtfontcvt; and can be loaded with loadfont command (or it can be added to index, note that index is assuming unique glyph size and last entry wins). In any case, you can test this with loadfont /boot/fonts/gallant.fnt, gallant is not listed in the index (because it has much smaller number of glyphs compared to terminus).

If KMS will set different resolution and the default font is not good, then vidcontrol command can be used to load better one. 

hope this helps,
toomas




More information about the freebsd-current mailing list