From: Thomas Zimmermann <tzimmermann@suse.de>
To: Helge Deller <deller@gmx.de>,
gregkh@linuxfoundation.org, sam@ravnborg.org
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 00/13] vc,fbcon,fonts: Proper handling of font data
Date: Wed, 4 Mar 2026 10:11:17 +0100 [thread overview]
Message-ID: <4f9b6f94-ed54-4324-a47a-4b379b4e9866@suse.de> (raw)
In-Reply-To: <11c9e67c-36f9-4d27-8064-41b804cc0c02@gmx.de>
Hi
Am 03.03.26 um 16:29 schrieb Helge Deller:
> On 3/2/26 15:08, Thomas Zimmermann wrote:
>> Provide helpers for handling console font data. Update consoles and VT.
>>
>> VT's vc_state stores font data as a plain byte array of glphys. Fbcon,
>> newport_con and the kernel's internal fonts store the glyph data as an
>> array of plain bytes plus a hidden header for reference counting, check
>> sums and buffer sizes. The reference counting only works for user-space
>> fonts but not for internal fonts. Font-data handling is duplicated in
>> several places. Most of the font handling is open-coded and mixed up
>> with
>> VT's plain glyph arrays.
>>
>> To address these issues, add proper handling of font data to all
>> involved
>> components: struct vc_font for font state in VC; a font data type for
>> the
>> consoles. Then implement interfaces for handling font data one by one.
>>
>> Patch 1 prepares the fbdev interface.
>>
>> Patches 2 to 4 prepare VT's font handling.
>>
>> Patches 5 to 13 refactor fbcon and newport_con to use clean
>> interfaces for
>> their fonts.
>>
>> Fbcon has long been a source of problems and bug reports. [1] With its
>> confusing implementation, it is hard to find the cause of these bugs.
>> Cleaning up the fbcon code will hopefully help with resolving bug
>> reports
>> in the future.
>>
>> The series has been tested with fbcon under DRM's bochs driver by
>> changing
>> fonts at runtime using the setfont utility. [2] The changes to
>> newport_con
>> have only been tested to compile.
>>
>> v2:
>> - keep declaring the internal fonts in the public header file (Helge)
>> - rebase and clean up
>>
>> [1]
>> https://lore.kernel.org/all/6992c84c.a70a0220.2c38d7.00e8.GAE@google.com/
>> [2] https://www.man7.org/linux/man-pages/man8/setfont.8.html
>>
>> Thomas Zimmermann (13):
>> fbdev: Declare src parameter of fb_pad_ helpers as constant
>> vt: Remove trailing whitespaces
>> vt: Store font in struct vc_font
>> vt: Calculate font-buffer size with vc_font_size()
>> lib/fonts: Remove trailing whitespaces
>> lib/fonts: Remove FNTCHARCNT()
>> lib/fonts: Store font data as font_data_t; update consoles
>> lib/fonts: Read font size with font_data_size()
>> lib/fonts: Compare font data for equality with font_data_is_equal()
>> lib/fonts: Manage font-data lifetime with font_data_get/_put()
>> lib/fonts: Create font_data_t from struct console_font with
>> font_data_import()
>> lib/fonts: Store font data for user space with font_data_export()
>> lib/fonts: Remove internal symbols and macros from public header file
>>
>> drivers/video/console/newport_con.c | 61 +++----
>> drivers/video/fbdev/core/bitblit.c | 11 +-
>> drivers/video/fbdev/core/fbcon.c | 194 +++++++----------------
>> drivers/video/fbdev/core/fbcon.h | 8 +-
>> drivers/video/fbdev/core/fbmem.c | 6 +-
>> include/linux/console_struct.h | 59 ++++++-
>> include/linux/fb.h | 10 +-
>> include/linux/font.h | 115 +++++++++-----
>> lib/fonts/font.h | 38 +++++
>> lib/fonts/font_10x18.c | 2 +-
>> lib/fonts/font_6x10.c | 3 +-
>> lib/fonts/font_6x11.c | 2 +-
>> lib/fonts/font_6x8.c | 3 +-
>> lib/fonts/font_7x14.c | 2 +-
>> lib/fonts/font_8x16.c | 3 +-
>> lib/fonts/font_8x8.c | 2 +-
>> lib/fonts/font_acorn_8x8.c | 4 +-
>> lib/fonts/font_mini_4x6.c | 10 +-
>> lib/fonts/font_pearl_8x8.c | 2 +-
>> lib/fonts/font_sun12x22.c | 3 +-
>> lib/fonts/font_sun8x16.c | 3 +-
>> lib/fonts/font_ter10x18.c | 4 +-
>> lib/fonts/font_ter16x32.c | 4 +-
>> lib/fonts/fonts.c | 236 +++++++++++++++++++++++++++-
>> 24 files changed, 518 insertions(+), 267 deletions(-)
>> create mode 100644 lib/fonts/font.h
> Thomas, thanks for the nice cleanup!
> Beside a few minor comments which I posted to the various patches, the
> series looks good.
>
> I've applied it for further testing to the fbdev git tree.
Great, thanks!
> In case you send later v3 series, I'll update it.
I'd preferably not modify the data structures for now. Shall I send an
update for the typos?
Best regards
Thomas
>
> Thanks a lot!
> Helge
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-03-04 9:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 14:08 Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 01/13] fbdev: Declare src parameter of fb_pad_ helpers as constant Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 02/13] vt: Remove trailing whitespaces Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 03/13] vt: Store font in struct vc_font Thomas Zimmermann
2026-03-03 14:31 ` Helge Deller
2026-03-04 7:49 ` Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 04/13] vt: Calculate font-buffer size with vc_font_size() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 05/13] lib/fonts: Remove trailing whitespaces Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 06/13] lib/fonts: Remove FNTCHARCNT() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 07/13] lib/fonts: Store font data as font_data_t; update consoles Thomas Zimmermann
2026-03-03 14:57 ` Helge Deller
2026-03-04 7:51 ` Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 08/13] lib/fonts: Read font size with font_data_size() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 09/13] lib/fonts: Compare font data for equality with font_data_is_equal() Thomas Zimmermann
2026-03-05 0:23 ` Nathan Chancellor
2026-03-05 9:31 ` Thomas Zimmermann
2026-03-05 20:12 ` Nathan Chancellor
2026-03-02 14:08 ` [PATCH v2 10/13] lib/fonts: Manage font-data lifetime with font_data_get/_put() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 11/13] lib/fonts: Create font_data_t from struct console_font with font_data_import() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 12/13] lib/fonts: Store font data for user space with font_data_export() Thomas Zimmermann
2026-03-02 14:08 ` [PATCH v2 13/13] lib/fonts: Remove internal symbols and macros from public header file Thomas Zimmermann
2026-03-03 15:29 ` [PATCH v2 00/13] vc,fbcon,fonts: Proper handling of font data Helge Deller
2026-03-04 9:11 ` Thomas Zimmermann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f9b6f94-ed54-4324-a47a-4b379b4e9866@suse.de \
--to=tzimmermann@suse.de \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®