diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-19 18:19:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-19 18:28:56 +0300 |
commit | ffc1e089725e3f8a15ddfdce283db42f7d0fa147 (patch) | |
tree | a12ea38b9de91ce77840411df3cb247537e6101a /drivers/video/console/vgacon.c | |
parent | e34a79d0b320ea8248e1ee3482eb5c388a27d303 (diff) | |
download | linux-ffc1e089725e3f8a15ddfdce283db42f7d0fa147.tar.xz |
VT: Add height parameter to con_font_get/set consw operations
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>
Link: https://lore.kernel.org/r/20230119151934.932642243@ens-lyon.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video/console/vgacon.c')
-rw-r--r-- | drivers/video/console/vgacon.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index fcdf017e2665..03c2cce71c0c 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -1029,7 +1029,7 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight) } static int vgacon_font_set(struct vc_data *c, struct console_font *font, - unsigned int flags) + unsigned int vpitch, unsigned int flags) { unsigned charcount = font->charcount; int rc; @@ -1037,7 +1037,7 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, if (vga_video_type < VIDEO_TYPE_EGAM) return -EINVAL; - if (font->width != VGA_FONTWIDTH || + if (font->width != VGA_FONTWIDTH || vpitch != 32 || (charcount != 256 && charcount != 512)) return -EINVAL; @@ -1050,9 +1050,9 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, return rc; } -static int vgacon_font_get(struct vc_data *c, struct console_font *font) +static int vgacon_font_get(struct vc_data *c, struct console_font *font, unsigned int vpitch) { - if (vga_video_type < VIDEO_TYPE_EGAM) + if (vga_video_type < VIDEO_TYPE_EGAM || vpitch != 32) return -EINVAL; font->width = VGA_FONTWIDTH; |