mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: simona@ffwll.ch, deller@gmx.de, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 3/6] fbcon: Set rotate_font callback with related callbacks
Date: Mon, 18 Aug 2025 12:36:38 +0200	[thread overview]
Message-ID: <20250818104655.235001-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20250818104655.235001-1-tzimmermann@suse.de>

The field struct fbcon.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>
---
 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 | 2 ++
 drivers/video/fbdev/core/fbcon_ud.c     | 1 +
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c
index 0f47eb4a792d..4c1a40864e84 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 *confb)
 	confb->clear_margins = ccw_clear_margins;
 	confb->cursor = ccw_cursor;
 	confb->update_start = ccw_update_start;
+	confb->rotate_font = fbcon_rotate_font;
 }
diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core/fbcon_cw.c
index 9d9cd316b74f..ac3af039fe4a 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 *confb)
 	confb->clear_margins = cw_clear_margins;
 	confb->cursor = cw_cursor;
 	confb->update_start = cw_update_start;
+	confb->rotate_font = fbcon_rotate_font;
 }
diff --git a/drivers/video/fbdev/core/fbcon_rotate.c b/drivers/video/fbdev/core/fbcon_rotate.c
index acf8e72ae00b..8100d6f28e70 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 *confb = 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 *confb)
 {
-	confb->rotate_font = fbcon_rotate_font;
-
 	switch (confb->rotate) {
 	case FB_ROTATE_CW:
 		fbcon_rotate_cw(confb);
diff --git a/drivers/video/fbdev/core/fbcon_rotate.h b/drivers/video/fbdev/core/fbcon_rotate.h
index 5909513bd7b4..c378687dd09d 100644
--- a/drivers/video/fbdev/core/fbcon_rotate.h
+++ b/drivers/video/fbdev/core/fbcon_rotate.h
@@ -90,6 +90,8 @@ 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 *confb);
 extern void fbcon_rotate_ud(struct fbcon *confb);
 extern void fbcon_rotate_ccw(struct fbcon *confb);
diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core/fbcon_ud.c
index b0ab9babf639..74e1331fae33 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 *confb)
 	confb->clear_margins = ud_clear_margins;
 	confb->cursor = ud_cursor;
 	confb->update_start = ud_update_start;
+	confb->rotate_font = fbcon_rotate_font;
 }
-- 
2.50.1


  parent reply	other threads:[~2025-08-18 10:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 10:36 [PATCH 0/6] fbcon: Move bitops callbacks into separate struct Thomas Zimmermann
2025-08-18 10:36 ` [PATCH 1/6] fbcon: Fix empty lines in fbcon.h Thomas Zimmermann
2025-09-05 19:00   ` Sam Ravnborg
2025-08-18 10:36 ` [PATCH 2/6] fbcon: Rename struct fbcon_ops to struct fbcon Thomas Zimmermann
2025-08-19  0:18   ` kernel test robot
2025-09-05 18:31   ` Sam Ravnborg
2025-08-18 10:36 ` Thomas Zimmermann [this message]
2025-09-05 18:37   ` [PATCH 3/6] fbcon: Set rotate_font callback with related callbacks Sam Ravnborg
2025-08-18 10:36 ` [PATCH 4/6] fbcon: Move fbcon callbacks into struct fbcon_bitops Thomas Zimmermann
2025-09-05 18:53   ` Sam Ravnborg
2025-09-08 13:06     ` Thomas Zimmermann
2025-09-08 18:51       ` Sam Ravnborg
2025-09-09  7:04         ` Thomas Zimmermann
2025-08-18 10:36 ` [PATCH 5/6] fbcon: Streamline setting rotated/unrotated bitops Thomas Zimmermann
2025-08-18 10:36 ` [PATCH 6/6] fbcon: Pass struct fbcon to callbacks in struct fbcon_bitops Thomas Zimmermann
2025-09-05 19:00   ` Sam Ravnborg
2025-09-08 13:08     ` Thomas Zimmermann
2025-09-05  6:56 ` [PATCH 0/6] fbcon: Move bitops callbacks into separate struct 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=20250818104655.235001-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=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

all inboxes | Powered by JetHome®