]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/fonts: Create font_data_t from struct console_font with font_data_import()
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 9 Mar 2026 14:14:53 +0000 (15:14 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 9 Mar 2026 14:47:21 +0000 (15:47 +0100)
commit514d0de7cf403144d3e6c5b9fabb1ce4c15974ca
tree3b1acf7be87281f58a94782a969a6b4113f110c1
parent1e3c49aa03fbfeea595ca0c9a4ebaf1e9cc078af
lib/fonts: Create font_data_t from struct console_font with font_data_import()

Add font_data_import() and update consoles to use it.

The implementation of font_data_import() is based on code from fbcon,
which supports overflow checks and crc32 checksums. Fbcon uses the crc32
checksum.

Newport_con now implements the same overflow checks as fbcon. As before,
this console does not support checksums, which are optional. Newport_con
can now also handle input font data with a vertical pitch other than 32
bytes. (The vertical pitch is the offset between two glyphs in the font
data.)

As an internal change, remove the const qualifier from the data field
if struct font_data. This allows font_data_import() to write the data
without type casting. For all users of the font data via font_data_t,
the stored data is still read only.

v3:
- fix typos

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/console/newport_con.c
drivers/video/fbdev/core/fbcon.c
include/linux/font.h
lib/fonts/fonts.c