legionus / kbd

Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git
https://kbd-project.org
Other
85 stars 40 forks source link

setfont fails to get font (setfont -o font_out.psf) if current font size is between 17x17 and 24x24 #70

Closed msokalski closed 2 years ago

msokalski commented 2 years ago

I have bunch of .psf files in sizes 6x6 - 32x32, each has 256 characters with unicode map appended. I'm able to set each of them with setfont font.psf command, and it works just fine. But for some reason I'm not able to retrieve them from TTY if previously set font size was between 17x17 and 24x24 (incl). setfont -o font_out.psf get_font: GIO_FONT: Invalid argument Probably if font's width spans over exactly 3 bytes is somehow problematic. I've also tried to use KDFONTOP ioctl with KD_FONT_OP_GET op. It works fine only if font size is not in the problematic range too, but ioctl call returns -EPERM to me (which is probably something different from what setfont reports with "Invalid argument").

After all, it is probably a bug in the kernel but the only case when KDFONTOP can return -EPERM is when op is different than KD_FONT_OP_GET so I'm really lost.

edit: actually errno in my case is also -EINVAL

Please find fonts attached cp437_psf.zip

msokalski commented 2 years ago

Ok, I've confirmed it is linux/drivers/video/fbdev/core/fbcon.c fault. Now, I'm closing this issue :)

legionus commented 2 years ago

@msokalski I didn't make it in time, but I'm glad it worked out :)