lkml.org 
[lkml]   [2022]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch 1/3] VT: Add height parameter to con_font_get/set consw operations
From
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@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

\
 
 \ /
  Last update: 2022-12-06 07:41    [W:0.075 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site