Support for console rotation is somewhat bolted onto the helper
fbcon_set_bitops() for unrotated displays.
Update fbcon_set_bitops() with a switch statement that picks the
correct settings helper for the current rotation. For unrotated
consoles, set the bitops for in the new helper fbcon_set_bitops_ur().
Rename the other, existing helpers to match the common naming
scheme.
The old helper fbcon_set_rotate() is no longer used.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20250909124616.143365-6-tzimmermann@suse.de
.update_start = bit_update_start,
};
-void fbcon_set_bitops(struct fbcon_par *par)
+void fbcon_set_bitops_ur(struct fbcon_par *par)
{
par->bitops = &bit_fbcon_bitops;
-
- if (par->rotate)
- fbcon_set_rotate(par);
}
#include <asm/irq.h>
#include "fbcon.h"
+#include "fbcon_rotate.h"
#include "fb_internal.h"
/*
}
#endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */
+static void fbcon_set_bitops(struct fbcon_par *par)
+{
+ switch (par->rotate) {
+ default:
+ fallthrough;
+ case FB_ROTATE_UR:
+ fbcon_set_bitops_ur(par);
+ break;
+ case FB_ROTATE_CW:
+ fbcon_set_bitops_cw(par);
+ break;
+ case FB_ROTATE_UD:
+ fbcon_set_bitops_ud(par);
+ break;
+ case FB_ROTATE_CCW:
+ fbcon_set_bitops_ccw(par);
+ break;
+ }
+}
+
static int fbcon_get_rotate(struct fb_info *info)
{
struct fbcon_par *par = info->fbcon_par;
#ifdef CONFIG_FB_TILEBLITTING
extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
#endif
-extern void fbcon_set_bitops(struct fbcon_par *par);
+extern void fbcon_set_bitops_ur(struct fbcon_par *par);
extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
#define FBCON_ATTRIBUTE_UNDERLINE 1
(void) (&_r == &_v); \
(i == FB_ROTATE_UR || i == FB_ROTATE_UD) ? _r : _v; })
-#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
-extern void fbcon_set_rotate(struct fbcon_par *par);
-#else
-#define fbcon_set_rotate(x) do {} while(0)
-#endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */
-
#endif /* _VIDEO_FBCON_H */
.rotate_font = fbcon_rotate_font,
};
-void fbcon_rotate_ccw(struct fbcon_par *par)
+void fbcon_set_bitops_ccw(struct fbcon_par *par)
{
par->bitops = &ccw_fbcon_bitops;
}
.rotate_font = fbcon_rotate_font,
};
-void fbcon_rotate_cw(struct fbcon_par *par)
+void fbcon_set_bitops_cw(struct fbcon_par *par)
{
par->bitops = &cw_fbcon_bitops;
}
finished:
return err;
}
-
-void fbcon_set_rotate(struct fbcon_par *par)
-{
- switch (par->rotate) {
- case FB_ROTATE_CW:
- fbcon_rotate_cw(par);
- break;
- case FB_ROTATE_UD:
- fbcon_rotate_ud(par);
- break;
- case FB_ROTATE_CCW:
- fbcon_rotate_ccw(par);
- break;
- }
-}
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);
+#if defined(CONFIG_FRAMEBUFFER_CONSOLE_ROTATION)
+void fbcon_set_bitops_cw(struct fbcon_par *par);
+void fbcon_set_bitops_ud(struct fbcon_par *par);
+void fbcon_set_bitops_ccw(struct fbcon_par *par);
+#else
+static inline void fbcon_set_bitops_cw(struct fbcon_par *par)
+{ }
+static inline void fbcon_set_bitops_ud(struct fbcon_par *par)
+{ }
+static inline void fbcon_set_bitops_ccw(struct fbcon_par *par)
+{ }
+#endif
#endif
.rotate_font = fbcon_rotate_font,
};
-void fbcon_rotate_ud(struct fbcon_par *par)
+void fbcon_set_bitops_ud(struct fbcon_par *par)
{
par->bitops = &ud_fbcon_bitops;
}