From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA2AB38C400 for ; Wed, 4 Mar 2026 09:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772615482; cv=none; b=GOjz2FRVcsSflKS+qy8EQ/MA3ai3b1l+BGg1/C90tuQ8GK3oaMTpN+yYpeH9lN//gTYCFEb6bDiwjbRuGyYqXG8dIEVNbxf6gzj4g30A38A8GGVopCXnjoRfSXDLb3c7JMiFTTQ8C+XXiUKcKEizvV/tBYjt0X/ufRaPClu+8mk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772615482; c=relaxed/simple; bh=ripy+Gx6HFSXM3VEfmx+KTJp9gzrvR7EN7zgO4oGYqE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FTDfnXx9+LghL5Da5avn5BDwmG4d2hUeVaIDrD5UVpL+zmQZlNlKKVw5k4gHRxW55b+0ihTFSiw3YvHyRvme9fTE/PT+PaKg2XwUPHq2kl8IsNbX7SXsQOoy+1qfA3Fm+qWE+jBIDCZHP9jqxcrST2eBwiqIjXY+8kRHHR/XqSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=0YJtaA4P; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=twf61IoF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=0YJtaA4P; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=twf61IoF; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="0YJtaA4P"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="twf61IoF"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="0YJtaA4P"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="twf61IoF" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 838725BD8C; Wed, 4 Mar 2026 09:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1772615478; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=fDIPlEVlN5WpTj9ewGlGzSitCmY6MgIV+DCsJkgpd4U=; b=0YJtaA4PUSd2hYJvoggrvRMQg9GexGfdCivIaNF08wLjkmHDJlSXamjMc3gAqEz5iSjy2G Y0Af9SEf2ntKkDIxbiOYsp4UYQ3k3D49XzCO/ZsHBBmZDcLuCNw1n0JKspu7G9M23sjkrx 2Ie6fQsdjzI4R34XGLU3JMMPTdCUc9E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1772615478; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=fDIPlEVlN5WpTj9ewGlGzSitCmY6MgIV+DCsJkgpd4U=; b=twf61IoFmdUHXSAP6fWTARuRfX3XMXuuvW8ejTOO6E4XoQ8xQkorN8XNfLuTxh3Da0vlTB oTzwSrT/EXQk+WDg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=0YJtaA4P; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=twf61IoF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1772615478; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=fDIPlEVlN5WpTj9ewGlGzSitCmY6MgIV+DCsJkgpd4U=; b=0YJtaA4PUSd2hYJvoggrvRMQg9GexGfdCivIaNF08wLjkmHDJlSXamjMc3gAqEz5iSjy2G Y0Af9SEf2ntKkDIxbiOYsp4UYQ3k3D49XzCO/ZsHBBmZDcLuCNw1n0JKspu7G9M23sjkrx 2Ie6fQsdjzI4R34XGLU3JMMPTdCUc9E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1772615478; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=fDIPlEVlN5WpTj9ewGlGzSitCmY6MgIV+DCsJkgpd4U=; b=twf61IoFmdUHXSAP6fWTARuRfX3XMXuuvW8ejTOO6E4XoQ8xQkorN8XNfLuTxh3Da0vlTB oTzwSrT/EXQk+WDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5629A3EA69; Wed, 4 Mar 2026 09:11:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id KC/PEzb3p2lnOQAAD6G6ig (envelope-from ); Wed, 04 Mar 2026 09:11:18 +0000 Message-ID: <4f9b6f94-ed54-4324-a47a-4b379b4e9866@suse.de> Date: Wed, 4 Mar 2026 10:11:17 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 00/13] vc,fbcon,fonts: Proper handling of font data To: Helge Deller , gregkh@linuxfoundation.org, sam@ravnborg.org Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260302141255.518657-1-tzimmermann@suse.de> <11c9e67c-36f9-4d27-8064-41b804cc0c02@gmx.de> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAg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Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: <11c9e67c-36f9-4d27-8064-41b804cc0c02@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_TO(0.00)[gmx.de,linuxfoundation.org,ravnborg.org]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmx.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,suse.de:dkim,suse.de:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.51 X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 838725BD8C 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)