Commit 9cfd0940 authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

fbcon: Set rotate_font callback with related callbacks



The field struct fbcon_par.rotate_font points to fbcon_rotate_font() if
the console is rotated. Set the callback in the same place as the other
callbacks. Prepares for declaring all fbcon callbacks in a dedicated
struct type.

If not rotated, fbcon_set_bitops() still clears the callback to NULL.

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20250909124616.143365-4-tzimmermann@suse.de
parent a6adbbc4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -398,4 +398,5 @@ void fbcon_rotate_ccw(struct fbcon_par *par)
	par->clear_margins = ccw_clear_margins;
	par->cursor = ccw_cursor;
	par->update_start = ccw_update_start;
	par->rotate_font = fbcon_rotate_font;
}
+1 −0
Original line number Diff line number Diff line
@@ -381,4 +381,5 @@ void fbcon_rotate_cw(struct fbcon_par *par)
	par->clear_margins = cw_clear_margins;
	par->cursor = cw_cursor;
	par->update_start = cw_update_start;
	par->rotate_font = fbcon_rotate_font;
}
+1 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include "fbcon.h"
#include "fbcon_rotate.h"

static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc)
int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc)
{
	struct fbcon_par *par = info->fbcon_par;
	int len, err = 0;
@@ -95,8 +95,6 @@ static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc)

void fbcon_set_rotate(struct fbcon_par *par)
{
	par->rotate_font = fbcon_rotate_font;

	switch (par->rotate) {
	case FB_ROTATE_CW:
		fbcon_rotate_cw(par);
+3 −0
Original line number Diff line number Diff line
@@ -90,7 +90,10 @@ static inline void rotate_ccw(const char *in, char *out, u32 width, u32 height)
	}
}

int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc);

extern void fbcon_rotate_cw(struct fbcon_par *par);
extern void fbcon_rotate_ud(struct fbcon_par *par);
extern void fbcon_rotate_ccw(struct fbcon_par *par);

#endif
+1 −0
Original line number Diff line number Diff line
@@ -425,4 +425,5 @@ void fbcon_rotate_ud(struct fbcon_par *par)
	par->clear_margins = ud_clear_margins;
	par->cursor = ud_cursor;
	par->update_start = ud_update_start;
	par->rotate_font = fbcon_rotate_font;
}