Skip to contentSkip to conversation

fbcon: Console Rotation - Prepare fbcon for console rotation

PATCH In review Antonino A. Daplas 1 participant 1 message Nov 7, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 fbcon: Console Rotation - Prepare fbcon for console rotation

This patch prepares fbcon for console rotation and contains the following changes:

- add rotate field in struct fbcon_ops to keep fbcon's current rotation angle

- add con_rotate field in struct display to store per-display rotation angle

- create a private copy of the current var to fbcon. This will prevent fbcon from directly manipulating info->var, especially the fields xoffset, yoffset and vmode.

- add ability to swap pertinent axes (xres, yres; xpanstep, ypanstep; etc) depending on the rotation angle

- change global update_var() (function that sets the screen start address) as an fbcon method update_start. This is required because the axes, start offset, and/or direction can be reversed depending on the rotation angle.

- add fbcon method rotate_font() which will rotate each character bitmap to the correct angle of rotation.

- add fbcon boot option 'rotate' to select the angle of rotation at bootime. Currently does nothing until all patches are applied.

---
 drivers/video/console/Kconfig    |   10 +
 drivers/video/console/bitblit.c  |   46 ++----
 drivers/video/console/fbcon.c    |  283 ++++++++++++++++++++++++---------------
 drivers/video/console/fbcon.h    |   58 +++++++
 drivers/video/console/tileblit.c |   13 +
 include/linux/fb.h               |   12 +
 6 files changed, 285 insertions(+), 137 deletions(-)
drivers/video/console/Kconfig +10 -0
index fadf7c5..94c5f13 100644
@@ -101,6 +101,16 @@ config FRAMEBUFFER_CONSOLE
 	help
 	  Low-level framebuffer-based console driver.
 
+config FRAMEBUFFER_CONSOLE_ROTATION
+       bool "Framebuffer Console Rotation"
+       depends on FRAMEBUFFER_CONSOLE
+       help
+         Enable display rotation for the framebuffer console.  This is done
+         in software and may be significantly slower than a normally oriented
+         display.  Note that the rotation is done at the console level only
+         such that other users of the framebuffer will remain normally
+         oriented.
+
 config STI_CONSOLE
         tristate "STI text console" 
         depends on PARISC
drivers/video/console/bitblit.c +17 -29

64 lines not on this page · raw message

drivers/video/console/fbcon.c +181 -102

613 lines not on this page · raw message

drivers/video/console/fbcon.h +54 -4

94 lines not on this page · raw message

drivers/video/console/tileblit.c +13 -0
index 7f76e2c..cb25324 100644
@@ -118,6 +118,18 @@ static void tile_cursor(struct vc_data *
 	info->tileops->fb_tilecursor(info, &cursor);
 }
 
+static int tile_update_start(struct fb_info *info)
+{
+	struct fbcon_ops *ops = info->fbcon_par;
+	int err;
+
+	err = fb_pan_display(info, &ops->var);
+	ops->var.xoffset = info->var.xoffset;
+	ops->var.yoffset = info->var.yoffset;
+	ops->var.vmode = info->var.vmode;
+	return err;
+}
+
 void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info,
 		       struct display *p, struct fbcon_ops *ops)
 {
@@ -128,6 +140,7 @@ void fbcon_set_tileops(struct vc_data *v
 	ops->putcs = tile_putcs;
 	ops->clear_margins = tile_clear_margins;
 	ops->cursor = tile_cursor;
+	ops->update_start = tile_update_start;
 
 	if (p) {
 		map.width = vc->vc_font.width;
include/linux/fb.h +10 -2
index e7ff98e..51791dc 100644
@@ -201,6 +201,14 @@ struct fb_bitfield {
 #define FB_VMODE_SMOOTH_XPAN	512	/* smooth xpan possible (internally used) */
 #define FB_VMODE_CONUPDATE	512	/* don't update x/yoffset	*/
 
+/*
+ * Display rotation support
+ */
+#define FB_ROTATE_UR      0
+#define FB_ROTATE_CW      1
+#define FB_ROTATE_UD      2
+#define FB_ROTATE_CCW     3
+
 #define PICOS2KHZ(a) (1000000000UL/(a))
 #define KHZ2PICOS(a) (1000000000UL/(a))
 
@@ -489,9 +497,9 @@ struct fb_cursor_user {
 #define FB_EVENT_MODE_DELETE            0x04
 /*      A driver registered itself */
 #define FB_EVENT_FB_REGISTERED          0x05
-/*      get console to framebuffer mapping */
+/*      CONSOLE-SPECIFIC: get console to framebuffer mapping */
 #define FB_EVENT_GET_CONSOLE_MAP        0x06
-/*      set console to framebuffer mapping */
+/*      CONSOLE-SPECIFIC: set console to framebuffer mapping */
 #define FB_EVENT_SET_CONSOLE_MAP        0x07
 /*      A display blank is requested       */
 #define FB_EVENT_BLANK                  0x08

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php