diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2026-03-09 15:14:51 +0100 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2026-03-09 15:47:21 +0100 |
| commit | 1de371b1f1b02dc82da598f9707089229699a604 (patch) | |
| tree | b64512a5f8d2601a23104e4f1251ed878ada78e5 /tools/perf/scripts/python | |
| parent | e2e000a0b22036a72474088d3399097ff47ace02 (diff) | |
lib/fonts: Manage font-data lifetime with font_data_get/_put()
Add font_data_get() and font_data_put(). Update consoles to use them
over REFCOUNT() and plain kfree().
Newly allocated font data starts with a reference count of 1. Loading
the font puts the previously loaded font. If the reference count reaches
zero, font_data_put() frees the font data.
The kernel stores a refcount of zero for internal font data. Invoking
font_data_get() and font_data_put() tests this internally and returns
success without further operation. From the caller's perspective,
getting and putting works the same for all font data.
Fbcon used the userfont flag distinguish between internal fonts and
fonts loaded by user space. Only the latter where refcounted. With the
new helper's automatic handling of internal font data, remove the
userfont flag from fbcon.
Newport_con uses a default font, FONT_DATA, until user space loads
custom font data. Remove all special cases for FONT_DATA, as the get
and put calls' read-only handling also covers this case.
v3:
- fix module linker error wrt font symbols (Nathan, Arnd)
- fix typos
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
