From: Thomas Zimmermann <tzimmermann@suse.de>
To: sam@ravnborg.org, simona@ffwll.ch, deller@gmx.de
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v2 3/5] fbcon: Set rotate_font callback with related callbacks
Date: Tue, 9 Sep 2025 14:44:43 +0200 [thread overview]
Message-ID: <20250909124616.143365-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20250909124616.143365-1-tzimmermann@suse.de>
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
next prev parent reply other threads:[~2025-09-09 12:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 12:44 [PATCH v2 0/5] fbcon: Move bitops callbacks into separate struct Thomas Zimmermann
2025-09-09 12:44 ` [PATCH v2 1/5] fbcon: Fix empty lines in fbcon.h Thomas Zimmermann
2025-09-09 12:44 ` [PATCH v2 2/5] fbcon: Rename struct fbcon_ops to struct fbcon_par Thomas Zimmermann
2025-09-09 12:44 ` Thomas Zimmermann [this message]
2025-09-09 12:44 ` [PATCH v2 4/5] fbcon: Move fbcon callbacks into struct fbcon_bitops Thomas Zimmermann
2025-09-09 12:44 ` [PATCH v2 5/5] fbcon: Streamline setting rotated/unrotated bitops Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250909124616.143365-4-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).