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: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
---
drivers/video/fbdev/core/fbcon_ccw.c | 1 +
drivers/video/fbdev/core/fbcon_cw.c | 1 +
drivers/video/fbdev/core/fbcon_rotate.c | 4 +---
drivers/video/fbdev/core/fbcon_rotate.h | 3 +++
drivers/video/fbdev/core/fbcon_ud.c | 1 +
5 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c
index 2ba8ec4c3e2b..ba744b67a4fd 100644
--- a/drivers/video/fbdev/core/fbcon_ccw.c
+++ b/drivers/video/fbdev/core/fbcon_ccw.c
@@ -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;
}
diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core/fbcon_cw.c
index 4bd22d5ee5f4..974bd9d9b770 100644
--- a/drivers/video/fbdev/core/fbcon_cw.c
+++ b/drivers/video/fbdev/core/fbcon_cw.c
@@ -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;
}
diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/core/fbcon_rotate.c
index 380b2746451a..0c7cac71a9c2 100644
--- a/drivers/video/fbdev/core/fbcon_rotate.c
+++ b/drivers/video/fbdev/core/fbcon_rotate.c
@@ -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);
diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/core/fbcon_rotate.h
index 48305e1a0763..784f3231a958 100644
--- a/drivers/video/fbdev/core/fbcon_rotate.h
+++ b/drivers/video/fbdev/core/fbcon_rotate.h
@@ -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
diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core/fbcon_ud.c
index 14b40e2bf323..1a214a4d538f 100644
--- a/drivers/video/fbdev/core/fbcon_ud.c
+++ b/drivers/video/fbdev/core/fbcon_ud.c
@@ -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;
}
--
2.51.0