[kbd] [patch 1/3] VT: Add height parameter to con_font_get/set consw operations
Jiri Slaby
jirislaby at kernel.org
Tue Dec 6 09:40:30 MSK 2022
On 05. 12. 22, 1:07, Samuel Thibault wrote:
> The current con_font_get/set API currently hardcodes a 32-pixel-tall
> limitation, which only dates from the old VGA hardware which could not
> handle taller fonts than that.
>
> This change just adds a vpitch parameter to release this
> constraint. Drivers which do not support vpitch != 32 can just return
> EINVAL when it is not 32, font loading tools will revert to trying 32
> and succeed.
>
> This change makes the fbcon driver consider vpitch appropriately, thus
> making it able to load large fonts.
>
> Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
>
...
> --- linux-6.0.orig/drivers/usb/misc/sisusbvga/sisusb_con.c
> +++ linux-6.0/drivers/usb/misc/sisusbvga/sisusb_con.c
...
> @@ -1243,13 +1244,15 @@ sisusbcon_font_set(struct vc_data *c, st
>
> /* Interface routine */
> static int
> -sisusbcon_font_get(struct vc_data *c, struct console_font *font)
> +sisusbcon_font_get(struct vc_data *c, struct console_font *font, unsigned int vpitch)
> {
> struct sisusb_usb_data *sisusb;
>
> sisusb = sisusb_get_sisusb_lock_and_check(c->vc_num);
> if (!sisusb)
> return -ENODEV;
> + if (vpitch != 32)
> + return -EINVAL;
>
> /* sisusb->lock is down */
>
> @@ -1268,7 +1271,7 @@ sisusbcon_font_get(struct vc_data *c, st
> }
>
> /* Copy 256 chars only, like vgacon */
> - memcpy(font->data, sisusb->font_backup, 256 * 32);
> + memcpy(font->data, sisusb->font_backup, 256 * height);
Have you tested this? What does this 'height' refer to?
thanks,
--
js
suse labs
More information about the kbd
mailing list