summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/core/bitblit.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-09-09 14:44:44 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2025-09-19 10:04:05 +0200
commit217cb07be424d127293dc0b32dbd077ad37c24f6 (patch)
tree9b66fb9170026e114475790c8c2a4ac079045992 /drivers/video/fbdev/core/bitblit.c
parent9cfd09402eb45f1b14b60668fd7c628445efdd8d (diff)
fbcon: Move fbcon callbacks into struct fbcon_bitops
Depending on rotation settings, fbcon sets different callback functions in struct fbcon_par from within fbcon_set_bitops(). Declare the callback functions in the new type struct fbcon_bitops. Then only replace the single bitops pointer in struct fbcon_par. Keeping callbacks in constant instances of struct fbcon_bitops makes it harder to exploit the callbacks. Also makes the code slightly easier to maintain. For tile-based consoles, there's a separate instance of the bitops structure. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://lore.kernel.org/r/20250909124616.143365-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/video/fbdev/core/bitblit.c')
-rw-r--r--drivers/video/fbdev/core/bitblit.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c
index ebadc9619699..7a68372f0444 100644
--- a/drivers/video/fbdev/core/bitblit.c
+++ b/drivers/video/fbdev/core/bitblit.c
@@ -384,15 +384,18 @@ static int bit_update_start(struct fb_info *info)
return err;
}
+static const struct fbcon_bitops bit_fbcon_bitops = {
+ .bmove = bit_bmove,
+ .clear = bit_clear,
+ .putcs = bit_putcs,
+ .clear_margins = bit_clear_margins,
+ .cursor = bit_cursor,
+ .update_start = bit_update_start,
+};
+
void fbcon_set_bitops(struct fbcon_par *par)
{
- par->bmove = bit_bmove;
- par->clear = bit_clear;
- par->putcs = bit_putcs;
- par->clear_margins = bit_clear_margins;
- par->cursor = bit_cursor;
- par->update_start = bit_update_start;
- par->rotate_font = NULL;
+ par->bitops = &bit_fbcon_bitops;
if (par->rotate)
fbcon_set_rotate(par);