diff -uNr linux-2.6.7-orig/drivers/video/console/fbcon.c linux-2.6.7/drivers/video/console/fbcon.c
--- linux-2.6.7-orig/drivers/video/console/fbcon.c	2004-06-16 06:19:42.000000000 +0100
+++ linux-2.6.7/drivers/video/console/fbcon.c	2004-06-19 00:26:57.000000000 +0100
@@ -56,6 +56,8 @@
  *  more details.
  */
 
+
+
 #undef FBCONDEBUG
 
 #include <linux/config.h>
@@ -94,8 +96,10 @@
 
 #include "fbcon.h"
 
+#define FBCONDEBUG 1
+
 #ifdef FBCONDEBUG
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#  define DPRINTK(fmt, args...) printk(KERN_INFO "%s: " fmt, __FUNCTION__ , ## args)
 #else
 #  define DPRINTK(fmt, args...)
 #endif
@@ -150,16 +154,28 @@
 static const char *fbcon_startup(void);
 static void fbcon_init(struct vc_data *vc, int init);
 static void fbcon_deinit(struct vc_data *vc);
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_clear(struct vc_data *conp, int sx, int sy, int height,
+		       int width);
+static void fbcon_putc(struct vc_data *conp, int c, int xpos, int ypos);
+static void fbcon_putcs(struct vc_data *conp, const unsigned short *s, int count, int xpos, int ypos);
+#else
 static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,
 			int width);
 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos);
 static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
 			int count, int ypos, int xpos);
+#endif
 static void fbcon_cursor(struct vc_data *vc, int mode);
 static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 			int count);
-static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	static void fbcon_bmove(struct vc_data *conp, int sx, int sy, int dx, int dy,
+			int height, int width);
+#else			
+	static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
 			int height, int width);
+#endif			
 static int fbcon_switch(struct vc_data *vc);
 static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch);
 static int fbcon_font_op(struct vc_data *vc, struct console_font_op *op);
@@ -170,13 +186,26 @@
 /*
  *  Internal routines
  */
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ int real_x(struct display *p, int ypos);
+#else
 static __inline__ int real_y(struct display *p, int ypos);
+#endif
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ void xwrap_up(struct vc_data *vc, int count);
+static __inline__ void xwrap_down(struct vc_data *vc, int count);
+static __inline__ void xpan_up(struct vc_data *vc, int count);
+static __inline__ void xpan_down(struct vc_data *vc, int count);
+static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sx, int sy,
+			    int dx, int dy, int height, int width, u_int x_break);			    
+#else
 static __inline__ void ywrap_up(struct vc_data *vc, int count);
 static __inline__ void ywrap_down(struct vc_data *vc, int count);
 static __inline__ void ypan_up(struct vc_data *vc, int count);
 static __inline__ void ypan_down(struct vc_data *vc, int count);
 static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx,
 			    int dy, int dx, int height, int width, u_int y_break);
+#endif
 
 #ifdef CONFIG_MAC
 /*
@@ -606,7 +635,11 @@
 	    (info->fix.type == FB_TYPE_TEXT))
 		logo = 0;
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	info->var.yoffset = info->var.xoffset = p->xscroll = 0;  /* reset wrap/pan */
+#else
 	info->var.xoffset = info->var.yoffset = p->yscroll = 0;	/* reset wrap/pan */
+#endif
 
 	/* If we are not the first console on this
 	   fb, copy the font from that console */
@@ -631,6 +664,16 @@
 			vc->vc_complement_mask <<= 1;
 	}
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	cols = info->var.yres / vc->vc_font.width;
+	rows = info->var.xres / vc->vc_font.height;
+	vc_resize(vc->vc_num, cols, rows);
+
+	if (info->var.accel_flags)
+		p->scrollmode = SCROLL_XNOMOVE;
+	else
+		p->scrollmode = SCROLL_XREDRAW;
+#else
 	cols = info->var.xres / vc->vc_font.width;
 	rows = info->var.yres / vc->vc_font.height;
 	vc_resize(vc->vc_num, cols, rows);
@@ -639,7 +682,7 @@
 		p->scrollmode = SCROLL_YNOMOVE;
 	else
 		p->scrollmode = SCROLL_YREDRAW;
-
+#endif
 	/*
 	 *  ++guenther: console.c:vc_allocate() relies on initializing
 	 *  vc_{cols,rows}, but we must not set those if we are only
@@ -649,7 +692,7 @@
 		vc->vc_cols = cols;
 		vc->vc_rows = rows;
 	}
-
+	
 	if (logo) {
 		/* Need to make room for the logo */
 		int cnt;
@@ -700,7 +743,11 @@
 						vc->vc_size_row *
 						rows);
 			scr_memcpyw(q, save, logo_lines * cols * 2);
-			vc->vc_y += logo_lines;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+			vc->vc_x += logo_lines;
+#else
+ 	    		vc->vc_y += logo_lines;
+#endif			
 			vc->vc_pos += logo_lines * vc->vc_size_row;
 			kfree(save);
 		}
@@ -757,7 +804,16 @@
  *  Implies should only really hardware scroll in rows. Only reason for
  *  restriction is simplicity & efficiency at the moment.
  */
+ 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ int real_x(struct display *p, int xpos)
+{
+    	int rows = p->vrows;
 
+    	xpos += p->xscroll;
+    	return xpos < rows ? xpos : xpos-rows;
+}
+#else 
 static __inline__ int real_y(struct display *p, int ypos)
 {
 	int rows = p->vrows;
@@ -765,15 +821,25 @@
 	ypos += p->yscroll;
 	return ypos < rows ? ypos : ypos - rows;
 }
+#endif
 
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_clear(struct vc_data *vc, int sx, int sy, int height,
+			int width)
+#else
 static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,
 			int width)
+#endif			
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	
 	struct display *p = &fb_display[vc->vc_num];
-	u_int y_break;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	u_int x_break;
+#else
+     	u_int y_break;
+#endif	
 
 	if (!info->fbops->fb_blank && console_blanked)
 		return;
@@ -785,6 +851,16 @@
 
 	/* Split blits that cross physical y_wrap boundary */
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	x_break = p->vrows - p->xscroll;
+	if (sx < x_break && sx + height - 1 >= x_break) {
+		u_int b = x_break - sx;
+		accel_clear(vc, info, real_x(p, sx), sy, b, width);
+		accel_clear(vc, info, real_x(p, sx + b), sy, height-b, width);
+    	} else
+		accel_clear(vc, info, real_x(p, sx), sy, height, width);
+#else
+
 	y_break = p->vrows - p->yscroll;
 	if (sy < y_break && sy + height - 1 >= y_break) {
 		u_int b = y_break - sy;
@@ -793,9 +869,14 @@
 				 width);
 	} else
 		accel_clear(vc, info, real_y(p, sy), sx, height, width);
+#endif
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_putc(struct vc_data *vc, int c, int xpos, int ypos)
+#else
 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
@@ -816,9 +897,14 @@
 
 	if (vt_cons[vc->vc_num]->vc_mode != KD_TEXT)
 		return;
-
+// RP Guess
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	image.dx = ypos * vc->vc_font.width;
+	image.dy = real_x(p, xpos) * vc->vc_font.height;
+#else
 	image.dx = xpos * vc->vc_font.width;
 	image.dy = real_y(p, ypos) * vc->vc_font.height;
+#endif	
 	image.width = vc->vc_font.width;
 	image.height = vc->vc_font.height;
 	image.fg_color = attr_fgcol(fgshift, c);
@@ -841,8 +927,13 @@
 	info->fbops->fb_imageblit(info, &image);
 }
 
-static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
-			int count, int ypos, int xpos)
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, 
+			int count, int xpos, int ypos)
+#else
+static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, 
+ 			int count, int ypos, int xpos)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
@@ -855,7 +946,11 @@
 	if (vt_cons[vc->vc_num]->vc_mode != KD_TEXT)
 		return;
 
-	accel_putcs(vc, info, s, count, real_y(p, ypos), xpos);
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	accel_putcs(vc, info, s, count, real_x(p, xpos), ypos);
+#else
+     	accel_putcs(vc, info, s, count, real_y(p, ypos), xpos);
+#endif
 }
 
 static void fbcon_cursor(struct vc_data *vc, int mode)
@@ -866,16 +961,28 @@
 	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
 	struct display *p = &fb_display[vc->vc_num];
 	int w = (vc->vc_font.width + 7) >> 3, c;
-	int y = real_y(p, vc->vc_y);
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	int x = real_x(p, vc->vc_x);
+#else
+     	int y = real_y(p, vc->vc_y);
+#endif	
+
 	struct fb_cursor cursor;
 	
 	if (mode & CM_SOFTBACK) {
 		mode &= ~CM_SOFTBACK;
 		if (softback_lines) {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	    		if (x + softback_lines >= vc->vc_rows)
+		    		mode = CM_ERASE;
+		 	else
+				x += softback_lines;
+#else
 			if (y + softback_lines >= vc->vc_rows)
 				mode = CM_ERASE;
 			else
 				y += softback_lines;
+#endif			
 		}
 	} else if (softback_lines)
 		fbcon_set_origin(vc);
@@ -904,11 +1011,18 @@
 			cursor.image.bg_color = attr_bgcol(bgshift, c);
 			cursor.set |= FB_CUR_SETCMAP;
 		}
-		
+//RPFIX
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)		
 		if ((info->cursor.image.dx != (vc->vc_font.width * vc->vc_x)) ||
-		    (info->cursor.image.dy != (vc->vc_font.height * y))) {
-			cursor.image.dx = vc->vc_font.width * vc->vc_x;
+		    (info->cursor.image.dy != (vc->vc_font.height * x))) {
+		    	cursor.image.dx = vc->vc_font.height * vc->vc_y;
+			cursor.image.dy = vc->vc_font.width * x;
+#else
+		if ((info->cursor.image.dx != (vc->vc_font.height * vc->vc_y)) ||
+		    (info->cursor.image.dy != (vc->vc_font.width * x))) {
+		    	cursor.image.dx = vc->vc_font.width * vc->vc_x;
 			cursor.image.dy = vc->vc_font.height * y;
+#endif
 			cursor.set |= FB_CUR_SETPOS;
 		}
 
@@ -983,17 +1097,30 @@
 	return 0;
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ void xwrap_up(struct vc_data *vc, int count)
+#else
 static __inline__ void ywrap_up(struct vc_data *vc, int count)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	
+
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+   	p->xscroll += count;
+    	if (p->xscroll >= p->vrows)	/* Deal with wrap */
+		p->xscroll -= p->vrows;
+    	info->var.yoffset = 0;
+    	info->var.xoffset = p->xscroll * vc->vc_font.height;
+    	info->var.vmode |= FB_VMODE_XWRAP;
+#else	
 	p->yscroll += count;
 	if (p->yscroll >= p->vrows)	/* Deal with wrap */
 		p->yscroll -= p->vrows;
 	info->var.xoffset = 0;
 	info->var.yoffset = p->yscroll * vc->vc_font.height;
 	info->var.vmode |= FB_VMODE_YWRAP;
+#endif
 	update_var(vc->vc_num, info);
 	scrollback_max += count;
 	if (scrollback_max > scrollback_phys_max)
@@ -1001,17 +1128,30 @@
 	scrollback_current = 0;
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ void xwrap_down(struct vc_data *vc, int count)
+#else
 static __inline__ void ywrap_down(struct vc_data *vc, int count)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	
+
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	p->xscroll -= count;
+    	if (p->xscroll < 0)		/* Deal with wrap */
+		p->xscroll += p->vrows;
+    	info->var.yoffset = 0;
+    	info->var.xoffset = p->xscroll * vc->vc_font.height;
+    	info->var.vmode |= FB_VMODE_XWRAP;
+#else	
 	p->yscroll -= count;
 	if (p->yscroll < 0)	/* Deal with wrap */
 		p->yscroll += p->vrows;
 	info->var.xoffset = 0;
 	info->var.yoffset = p->yscroll * vc->vc_font.height;
 	info->var.vmode |= FB_VMODE_YWRAP;
+#endif
 	update_var(vc->vc_num, info);
 	scrollback_max -= count;
 	if (scrollback_max < 0)
@@ -1019,11 +1159,26 @@
 	scrollback_current = 0;
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ void xpan_up(struct vc_data *vc, int count)
+#else
 static __inline__ void ypan_up(struct vc_data *vc, int count)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	
+
+#if defined(CONFIG_FBCON_ROTATE_L) || defined(CONFIG_FBCON_ROTATE_R)
+    	p->xscroll += count;
+	if (p->xscroll > p->vrows - vc->vc_rows) {
+		accel_bmove(vc, info, p->vrows - vc->vc_rows, 
+				0, 0, 0, vc->vc_rows, vc->vc_cols);
+		p->xscroll -= p->vrows - vc->vc_rows;
+    	}
+    	info->var.yoffset = 0;
+    	info->var.xoffset = p->xscroll * vc->vc_font.height;
+    	info->var.vmode &= ~FB_VMODE_XWRAP;
+#else	
 	p->yscroll += count;
 	if (p->yscroll > p->vrows - vc->vc_rows) {
 		accel_bmove(vc, info, p->vrows - vc->vc_rows, 
@@ -1033,6 +1188,7 @@
 	info->var.xoffset = 0;
 	info->var.yoffset = p->yscroll * vc->vc_font.height;
 	info->var.vmode &= ~FB_VMODE_YWRAP;
+#endif	
 	update_var(vc->vc_num, info);
 	accel_clear_margins(vc, info, 1);
 	scrollback_max += count;
@@ -1041,11 +1197,26 @@
 	scrollback_current = 0;
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static __inline__ void xpan_down(struct vc_data *vc, int count)
+#else
 static __inline__ void ypan_down(struct vc_data *vc, int count)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	
+
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    	p->xscroll -= count;
+    	if (p->xscroll < 0) {
+		accel_bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, 
+				0, vc->vc_rows, vc->vc_cols);
+		p->xscroll += p->vrows - vc->vc_rows;
+    	}
+    	info->var.yoffset = 0;
+    	info->var.xoffset = p->xscroll*vc->vc_font.height;
+    	info->var.vmode &= ~FB_VMODE_XWRAP;
+#else	
 	p->yscroll -= count;
 	if (p->yscroll < 0) {
 		accel_bmove(vc, info, 0, 0, p->vrows - vc->vc_rows,
@@ -1055,6 +1226,7 @@
 	info->var.xoffset = 0;
 	info->var.yoffset = p->yscroll * vc->vc_font.height;
 	info->var.vmode &= ~FB_VMODE_YWRAP;
+#endif
 	update_var(vc->vc_num, info);
 	accel_clear_margins(vc, info, 1);
 	scrollback_max -= count;
@@ -1113,7 +1285,11 @@
 		unsigned short *start;
 		unsigned short *le;
 		unsigned short c;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+		int y = 0;
+#else		
 		int x = 0;
+#endif		
 		unsigned short attr = 1;
 
 		start = s;
@@ -1123,20 +1299,38 @@
 			if (attr != (c & 0xff00)) {
 				attr = c & 0xff00;
 				if (s > start) {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)					
+					accel_putcs(vc, info, start, s - start,
+						    real_x(p, line), y);
+					y += s - start;
+#else					
 					accel_putcs(vc, info, start, s - start,
 						    real_y(p, line), x);
 					x += s - start;
+
+#endif
+					
 					start = s;
 				}
 			}
 			if (c == scr_readw(d)) {
 				if (s > start) {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)					
+					accel_putcs(vc, info, start, s - start,
+						    real_x(p, line), y);
+					y += s - start + 1;
+#else					
 					accel_putcs(vc, info, start, s - start,
 						    real_y(p, line), x);
 					x += s - start + 1;
+#endif
 					start = s + 1;
 				} else {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+					y++;
+#else					
 					x++;
+#endif					
 					start++;
 				}
 			}
@@ -1144,8 +1338,13 @@
 			d++;
 		} while (s < le);
 		if (s > start)
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)		
+			accel_putcs(vc, info, start, s - start,
+				    real_x(p, line), y);
+#else
 			accel_putcs(vc, info, start, s - start,
 				    real_y(p, line), x);
+#endif				    
 		line++;
 		if (d == (u16 *) softback_end)
 			d = (u16 *) softback_buf;
@@ -1170,7 +1369,11 @@
 		unsigned short *start = s;
 		unsigned short *le = advance_row(s, 1);
 		unsigned short c;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+		int y = 0;
+#else
 		int x = 0;
+#endif				
 		unsigned short attr = 1;
 
 		do {
@@ -1178,20 +1381,37 @@
 			if (attr != (c & 0xff00)) {
 				attr = c & 0xff00;
 				if (s > start) {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+			    		accel_putcs(vc, info, start, s - start,
+						    real_x(p, line), y);
+				    	y += s - start;
+#else					
 					accel_putcs(vc, info, start, s - start,
 						    real_y(p, line), x);
 					x += s - start;
+#endif					
 					start = s;
 				}
 			}
 			if (c == scr_readw(d)) {
 				if (s > start) {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)					
+					accel_putcs(vc, info, start, s - start,
+						    real_x(p, line), y);
+					y += s - start + 1;
+#else
 					accel_putcs(vc, info, start, s - start,
 						    real_y(p, line), x);
 					x += s - start + 1;
+#endif
 					start = s + 1;
 				} else {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+					y++;
+#else
 					x++;
+#endif					
+
 					start++;
 				}
 			}
@@ -1201,8 +1421,13 @@
 			d++;
 		} while (s < le);
 		if (s > start)
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+			accel_putcs(vc, info, start, s - start,
+				    real_x(p, line), y);
+#else
 			accel_putcs(vc, info, start, s - start,
 				    real_y(p, line), x);
+#endif				    
 		console_conditional_schedule();
 		if (offset > 0)
 			line++;
@@ -1245,7 +1470,11 @@
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	int scroll_partial = !(p->scrollmode & __SCROLL_XNOPARTIAL);
+#else
 	int scroll_partial = !(p->scrollmode & __SCROLL_YNOPARTIAL);
+#endif
 
 	if (!info->fbops->fb_blank && console_blanked)
 		return 0;
@@ -1269,6 +1498,67 @@
 			fbcon_softback_note(vc, t, count);
 		if (logo_shown >= 0)
 			goto redraw_up;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	    	switch (p->scrollmode & __SCROLL_XMASK) {
+		case __SCROLL_XMOVE:
+			accel_bmove(vc, info, t + count, 0, t, 0,
+					 b - t - count, vc->vc_cols);
+			accel_clear(vc, info, b - count, 0, count,
+					 vc->vc_cols);
+			break;
+		case __SCROLL_XWRAP:
+			if (b - t - count > 3 * vc->vc_rows >> 2) {
+				if (t > 0)
+					fbcon_bmove(vc, 0, 0, count, 0, t,
+						    vc->vc_cols);
+				xwrap_up(vc, count);
+				if (vc->vc_rows - b > 0)
+					fbcon_bmove(vc, b - count, 0, b, 0,
+						    vc->vc_rows - b,
+						    vc->vc_cols);
+			} else if (p->scrollmode & __SCROLL_XPANREDRAW)
+				goto redraw_up;
+			else
+				fbcon_bmove(vc, t + count, 0, t, 0,
+					    b - t - count, vc->vc_cols);
+			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+			break;
+		case __SCROLL_XPAN:
+			if ((p->xscroll + count <=
+			     2 * (p->vrows - vc->vc_rows))
+			    && ((!scroll_partial && (b - t == vc->vc_rows))
+				|| (scroll_partial
+				    && (b - t - count >
+					3 * vc->vc_rows >> 2)))) {
+				if (t > 0)
+					fbcon_bmove(vc, 0, 0, count, 0, t,
+						    vc->vc_cols);
+				xpan_up(vc, count);
+				if (vc->vc_rows - b > 0)
+					fbcon_bmove(vc, b - count, 0, b, 0,
+						    vc->vc_rows - b,
+						    vc->vc_cols);
+			} else if (p->scrollmode & __SCROLL_XPANREDRAW)
+				goto redraw_up;
+			else
+				fbcon_bmove(vc, t + count, 0, t, 0,
+					    b - t - count, vc->vc_cols);
+			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+			break;
+		case __SCROLL_XREDRAW:
+		      redraw_up:
+			fbcon_redraw(vc, p, t, b - t - count,
+				     count * vc->vc_cols);
+			accel_clear(vc, info, real_x(p, b - count), 0,
+					 count, vc->vc_cols);
+			scr_memsetw((unsigned short *) (vc->vc_origin +
+							vc->vc_size_row *
+							(b - count)),
+				    vc->vc_video_erase_char,
+				    vc->vc_size_row * count);
+			return 1;
+		}			
+#else			
 		switch (p->scrollmode & __SCROLL_YMASK) {
 		case __SCROLL_YMOVE:
 			accel_bmove(vc, info, t + count, 0, t, 0,
@@ -1331,11 +1621,74 @@
 				    vc->vc_size_row * count);
 			return 1;
 		}
+#endif		
 		break;
 
 	case SM_DOWN:
 		if (count > vc->vc_rows)	/* Maximum realistic size */
 			count = vc->vc_rows;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+		switch (p->scrollmode & __SCROLL_XMASK) {
+		case __SCROLL_XMOVE:
+			accel_bmove(vc, info, t, 0, t + count, 0,
+					 b - t - count, vc->vc_cols);
+			accel_clear(vc, info, t, 0, count, vc->vc_cols);
+			break;
+
+		case __SCROLL_XWRAP:
+			if (b - t - count > 3 * vc->vc_rows >> 2) {
+				if (vc->vc_rows - b > 0)
+					fbcon_bmove(vc, b, 0, b - count, 0,
+						    vc->vc_rows - b,
+						    vc->vc_cols);
+				xwrap_down(vc, count);
+				if (t > 0)
+					fbcon_bmove(vc, count, 0, 0, 0, t,
+						    vc->vc_cols);
+			} else if (p->scrollmode & __SCROLL_XPANREDRAW)
+				goto redraw_down;
+			else
+				fbcon_bmove(vc, t, 0, t + count, 0,
+					    b - t - count, vc->vc_cols);
+			fbcon_clear(vc, t, 0, count, vc->vc_cols);
+			break;
+
+		case __SCROLL_XPAN:
+			if ((count - p->xscroll <= p->vrows - vc->vc_rows)
+			    && ((!scroll_partial && (b - t == vc->vc_rows))
+				|| (scroll_partial
+				    && (b - t - count >
+					3 * vc->vc_rows >> 2)))) {
+				if (vc->vc_rows - b > 0)
+					fbcon_bmove(vc, b, 0, b - count, 0,
+						    vc->vc_rows - b,
+						    vc->vc_cols);
+				xpan_down(vc, count);
+				if (t > 0)
+					fbcon_bmove(vc, count, 0, 0, 0, t,
+						    vc->vc_cols);
+			} else if (p->scrollmode & __SCROLL_XPANREDRAW)
+				goto redraw_down;
+			else
+				fbcon_bmove(vc, t, 0, t + count, 0,
+					    b - t - count, vc->vc_cols);
+			fbcon_clear(vc, t, 0, count, vc->vc_cols);
+			break;
+
+		case __SCROLL_XREDRAW:
+		      redraw_down:
+			fbcon_redraw(vc, p, b - 1, b - t - count,
+				     -count * vc->vc_cols);
+			accel_clear(vc, info, real_x(p, t), 0, count,
+					 vc->vc_cols);
+			scr_memsetw((unsigned short *) (vc->vc_origin +
+							vc->vc_size_row *
+							t),
+				    vc->vc_video_erase_char,
+				    vc->vc_size_row * count);
+			return 1;
+		}
+#else		
 		switch (p->scrollmode & __SCROLL_YMASK) {
 		case __SCROLL_YMOVE:
 			accel_bmove(vc, info, t, 0, t + count, 0,
@@ -1396,13 +1749,18 @@
 				    vc->vc_size_row * count);
 			return 1;
 		}
+#endif		
 	}
 	return 0;
 }
 
-
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_bmove(struct vc_data *vc, int sx, int sy, int dx, int dy,
+			int height, int width)
+#else
 static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
 			int height, int width)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
@@ -1420,16 +1778,62 @@
 	 *  Recursive invocations don't need to erase the cursor over and
 	 *  over again, so we use fbcon_bmove_rec()
 	 */
-	fbcon_bmove_rec(vc, p, sy, sx, dy, dx, height, width,
+
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+     	fbcon_bmove_rec(vc, p, sx, sy, dx, dy, height, width,
+			p->vrows - p->xscroll);
+#else
+     	fbcon_bmove_rec(vc, p, sy, sx, dy, dx, height, width,
 			p->vrows - p->yscroll);
+#endif			
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, 
+			    int dy, int dx, int height, int width, u_int x_break)
+#else
 static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, 
 			    int dy, int dx, int height, int width, u_int y_break)
+#endif
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	u_int b;
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	if (sx < x_break && sx + height > x_break) {
+		b = x_break - sy;
+		if (dx < sx) {	/* Avoid trashing self */
+			fbcon_bmove_rec(vc, p, sx, sy, dx, dy, b, width,
+					x_break);
+			fbcon_bmove_rec(vc, p, sx + b, sy, dx + b, dy,
+					height - b, width, x_break);
+		} else {
+			fbcon_bmove_rec(vc, p, sx + b, sy, dx + b, dy,
+					height - b, width, x_break);
+			fbcon_bmove_rec(vc, p, sx, sy, dx, dy, b, width,
+					x_break);
+		}
+		return;
+	}
+
+	if (dx < x_break && dx + height > x_break) {
+		b = x_break - dx;
+		if (dy < sy) {	/* Avoid trashing self */
+			fbcon_bmove_rec(vc, p, sx, sy, dx, dy, b, width,
+					x_break);
+			fbcon_bmove_rec(vc, p, sx + b, sy, dx + b, dy,
+					height - b, width, x_break);
+		} else {
+			fbcon_bmove_rec(vc, p, sx + b, sy, dx + b, dy,
+					height - b, width, x_break);
+			fbcon_bmove_rec(vc, p, sx, sy, dx, dy, b, width,
+					x_break);
+		}
+		return;
+	}
+	accel_bmove(vc, info, real_x(p, sy), sy, real_x(p, dy), dy,
+			height, width);
+#else
 	if (sy < y_break && sy + height > y_break) {
 		b = y_break - sy;
 		if (dy < sy) {	/* Avoid trashing self */
@@ -1463,12 +1867,27 @@
 	}
 	accel_bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
 			height, width);
+#endif			
 }
 
 static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc)
 {
 	int m;
-
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	if (p->scrollmode & __SCROLL_XFIXED)
+		return;
+	if (divides(info->fix.xwrapstep, vc->vc_font.height) &&
+	    divides(vc->vc_font.height, info->var.xres_virtual))
+		m = __SCROLL_XWRAP;
+	else if (divides(info->fix.xpanstep, vc->vc_font.height) &&
+		 info->var.xres_virtual >= info->var.xres + vc->vc_font.height)
+		m = __SCROLL_XPAN;
+	else if (p->scrollmode & __SCROLL_XNOMOVE)
+		m = __SCROLL_XREDRAW;
+	else
+		m = __SCROLL_XMOVE;
+	p->scrollmode = (p->scrollmode & ~__SCROLL_XMASK) | m;
+#else
 	if (p->scrollmode & __SCROLL_YFIXED)
 		return;
 	if (divides(info->fix.ywrapstep, vc->vc_font.height) &&
@@ -1482,6 +1901,7 @@
 	else
 		m = __SCROLL_YMOVE;
 	p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
+#endif	
 }
 
 static int fbcon_resize(struct vc_data *vc, unsigned int width, 
@@ -1553,6 +1973,20 @@
 			conp2->vc_top = 0;
 		logo_shown = -1;
 	}
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)	
+	if (info)
+		info->var.xoffset = p->xscroll = 0;
+        fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
+	switch (p->scrollmode & __SCROLL_XMASK) {
+	case __SCROLL_XWRAP:
+		scrollback_phys_max = p->vrows - vc->vc_rows;
+		break;
+	case __SCROLL_XPAN:
+		scrollback_phys_max = p->vrows - 2 * vc->vc_rows;
+		if (scrollback_phys_max < 0)
+			scrollback_phys_max = 0;
+		break;
+#else		
 	if (info)
 		info->var.yoffset = p->yscroll = 0;
         fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
@@ -1565,6 +1999,7 @@
 		if (scrollback_phys_max < 0)
 			scrollback_phys_max = 0;
 		break;
+#endif		
 	default:
 		scrollback_phys_max = 0;
 		break;
@@ -1616,21 +2051,37 @@
 		if (blank) {
 			unsigned short oldc;
 			u_int height;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+			u_int x_break;
+#else			
 			u_int y_break;
-
+#endif
 			oldc = vc->vc_video_erase_char;
 			vc->vc_video_erase_char &= charmask;
 			height = vc->vc_rows;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)			
+			x_break = p->vrows - p->xscroll;
+			if (height > x_break) {
+				accel_clear(vc, info, real_x(p, 0),
+					    0, x_break, vc->vc_cols);
+				accel_clear(vc, info, real_x(p, x_break),
+					    0, height - x_break, 
+					    vc->vc_cols);
+			} else
+				accel_clear(vc, info, real_x(p, 0),
+					    0, height, vc->vc_cols);
+#else
 			y_break = p->vrows - p->yscroll;
 			if (height > y_break) {
-				accel_clear(vc, info, real_y(p, 0),
+				accel_clear(vc, info, real_x(p, 0),
 					    0, y_break, vc->vc_cols);
-				accel_clear(vc, info, real_y(p, y_break),
-					    0, height - y_break, 
+				accel_clear(vc, info, real_y(p, x_break),
+					    0, height - x_break, 
 					    vc->vc_cols);
 			} else
 				accel_clear(vc, info, real_y(p, 0),
 					    0, height, vc->vc_cols);
+#endif					    
 			vc->vc_video_erase_char = oldc;
 		} else
 			update_screen(vc->vc_num);
@@ -1790,8 +2241,13 @@
 
 	if (resize) {
 		/* reset wrap/pan */
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+		info->var.yoffset = info->var.xoffset = p->xscroll = 0;
+		vc_resize(vc->vc_num, info->var.yres / w, info->var.xres / h);
+#else
 		info->var.xoffset = info->var.yoffset = p->yscroll = 0;
 		vc_resize(vc->vc_num, info->var.xres / w, info->var.yres / h);
+#endif		
 		if (CON_IS_VISIBLE(vc) && softback_buf) {
 			int l = fbcon_softback_size / vc->vc_size_row;
 			if (l > 5)
@@ -1926,7 +2382,11 @@
 	struct font_desc *f;
 
 	if (!op->data)
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)	
+		f = get_default_font(info->var.yres, info->var.xres);
+#else
 		f = get_default_font(info->var.xres, info->var.yres);
+#endif		
 	else if (strncpy_from_user(name, op->data, MAX_FONT_NAME - 1) < 0)
 		return -EFAULT;
 	else {
@@ -2006,8 +2466,13 @@
 	return (u16 *) p;
 }
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)	
 static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos,
 				 int *px, int *py)
+#else
+static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos,
+				 int *py, int *px)
+#endif				 
 {
 	unsigned long ret;
 	int x, y;
@@ -2015,20 +2480,35 @@
 	if (pos >= vc->vc_origin && pos < vc->vc_scr_end) {
 		unsigned long offset = (pos - vc->vc_origin) / 2;
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)	
+		y = offset % vc->vc_cols;
+		x = offset / vc->vc_cols;
+		if (vc->vc_num == fg_console)
+			x += softback_lines;
+		ret = pos + (vc->vc_cols - y) * 2;
+#else
 		x = offset % vc->vc_cols;
 		y = offset / vc->vc_cols;
 		if (vc->vc_num == fg_console)
 			y += softback_lines;
 		ret = pos + (vc->vc_cols - x) * 2;
+
+#endif		
 	} else if (vc->vc_num == fg_console && softback_lines) {
 		unsigned long offset = pos - softback_curr;
 
 		if (pos < softback_curr)
 			offset += softback_end - softback_buf;
 		offset /= 2;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)		
+		y = offset % vc->vc_cols;
+		x = offset / vc->vc_cols;
+		ret = pos + (vc->vc_cols - y) * 2;
+#else
 		x = offset % vc->vc_cols;
 		y = offset / vc->vc_cols;
 		ret = pos + (vc->vc_cols - x) * 2;
+#endif		
 		if (ret == softback_end)
 			ret = softback_buf;
 		if (ret == softback_in)
@@ -2130,9 +2610,23 @@
 	     || !lines))
 		return 0;
 	fbcon_cursor(vc, CM_ERASE);
-
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+	offset = p->xscroll - scrollback_current;
+#else
 	offset = p->yscroll - scrollback_current;
+#endif
 	limit = p->vrows;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)	
+	switch (p->scrollmode && __SCROLL_XMASK) {
+	case __SCROLL_XWRAP:
+		info->var.vmode |= FB_VMODE_XWRAP;
+		break;
+	case __SCROLL_XPAN:
+		limit -= vc->vc_rows;
+		info->var.vmode &= ~FB_VMODE_XWRAP;
+		break;
+	}
+#else
 	switch (p->scrollmode && __SCROLL_YMASK) {
 	case __SCROLL_YWRAP:
 		info->var.vmode |= FB_VMODE_YWRAP;
@@ -2142,12 +2636,18 @@
 		info->var.vmode &= ~FB_VMODE_YWRAP;
 		break;
 	}
+#endif		
 	if (offset < 0)
 		offset += limit;
 	else if (offset >= limit)
 		offset -= limit;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)		
+	info->var.yoffset = 0;
+	info->var.xoffset = offset * vc->vc_font.height;
+#else
 	info->var.xoffset = 0;
 	info->var.yoffset = offset * vc->vc_font.height;
+#endif	
 	update_var(vc->vc_num, info);
 	if (!scrollback_current)
 		fbcon_cursor(vc, CM_DRAW);
diff -uNr linux-2.6.7-orig/drivers/video/console/fbcon.h linux-2.6.7/drivers/video/console/fbcon.h
--- linux-2.6.7-orig/drivers/video/console/fbcon.h	2004-06-16 06:19:43.000000000 +0100
+++ linux-2.6.7/drivers/video/console/fbcon.h	2004-06-18 20:18:19.000000000 +0100
@@ -23,6 +23,8 @@
     *    low-level frame buffer device
     */
 
+
+
 struct display {
     /* Filled in by the frame buffer device */
     u_short inverse;                /* != 0 text black on white as default */
@@ -30,7 +32,11 @@
     u_char *fontdata;
     int userfont;                   /* != 0 if fontdata kmalloc()ed */
     u_short scrollmode;             /* Scroll Method */
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)    
+    short xscroll;                  /* Hardware scrolling */
+#else    
     short yscroll;                  /* Hardware scrolling */
+#endif    
     int vrows;                      /* number of virtual rows */
     int cursor_shape;
 };
@@ -68,6 +74,17 @@
      */
      
 /* Internal flags */
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+#define __SCROLL_XPAN		0x001
+#define __SCROLL_XWRAP		0x002
+#define __SCROLL_XMOVE		0x003
+#define __SCROLL_XREDRAW	0x004
+#define __SCROLL_XMASK		0x00f
+#define __SCROLL_XFIXED		0x010
+#define __SCROLL_XNOMOVE	0x020
+#define __SCROLL_XPANREDRAW	0x040
+#define __SCROLL_XNOPARTIAL	0x080
+#else
 #define __SCROLL_YPAN		0x001
 #define __SCROLL_YWRAP		0x002
 #define __SCROLL_YMOVE		0x003
@@ -77,6 +94,7 @@
 #define __SCROLL_YNOMOVE	0x020
 #define __SCROLL_YPANREDRAW	0x040
 #define __SCROLL_YNOPARTIAL	0x080
+#endif
 
 /* Only these should be used by the drivers */
 /* Which one should you use? If you have a fast card and slow bus,
@@ -91,8 +109,13 @@
    with every line covering all screen columns, it would not be the right
    benchmark).
  */
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+#define SCROLL_XREDRAW		(__SCROLL_XFIXED|__SCROLL_XREDRAW)
+#define SCROLL_XNOMOVE		(__SCROLL_XNOMOVE|__SCROLL_XPANREDRAW)
+#else
 #define SCROLL_YREDRAW		(__SCROLL_YFIXED|__SCROLL_YREDRAW)
 #define SCROLL_YNOMOVE		(__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
+#endif
 
 /* SCROLL_YNOPARTIAL, used in combination with the above, is for video
    cards which can not handle using panning to scroll a portion of the
@@ -100,8 +123,12 @@
    whole screens.
  */
 /* Namespace consistency */
-#define SCROLL_YNOPARTIAL	__SCROLL_YNOPARTIAL
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+#define SCROLL_XNOPARTIAL	(__SCROLL_XNOPARTIAL)
+#else
+#define SCROLL_YNOPARTIAL	__SCROLL_YNOPARTIAL
+#endif
 extern int fb_console_init(void);
 
 #endif /* _VIDEO_FBCON_H */
diff -uNr linux-2.6.7-orig/drivers/video/fbmem.c linux-2.6.7/drivers/video/fbmem.c
--- linux-2.6.7-orig/drivers/video/fbmem.c	2004-06-16 06:18:37.000000000 +0100
+++ linux-2.6.7/drivers/video/fbmem.c	2004-06-19 10:52:58.000000000 +0100
@@ -958,10 +964,17 @@
 		return err;
         info->var.xoffset = var->xoffset;
         info->var.yoffset = var->yoffset;
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+        if (var->vmode & FB_VMODE_XWRAP)
+                info->var.vmode |= FB_VMODE_XWRAP;
+        else
+                info->var.vmode &= ~FB_VMODE_XWRAP;
+#else
         if (var->vmode & FB_VMODE_YWRAP)
                 info->var.vmode |= FB_VMODE_YWRAP;
         else
                 info->var.vmode &= ~FB_VMODE_YWRAP;
+#endif                
         return 0;
 }
 
diff -uNr linux-2.6.7-orig/include/linux/fb.h linux-2.6.7/include/linux/fb.h
--- linux-2.6.7-orig/include/linux/fb.h	2004-06-16 06:19:09.000000000 +0100
+++ linux-2.6.7/include/linux/fb.h	2004-06-18 20:11:28.000000000 +0100
@@ -118,9 +118,14 @@
 	__u32 type;			/* see FB_TYPE_*		*/
 	__u32 type_aux;			/* Interleave for interleaved Planes */
 	__u32 visual;			/* see FB_VISUAL_*		*/ 
+#define CONFIG_FBCON_ROTATE_R	1
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
 	__u16 xpanstep;			/* zero if no hardware panning  */
+	__u16 xwrapstep;		/* zero if no hardware xwrap    */
+#else	
 	__u16 ypanstep;			/* zero if no hardware panning  */
 	__u16 ywrapstep;		/* zero if no hardware ywrap    */
+#endif		
 	__u32 line_length;		/* length of a line in bytes    */
 	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
 					/* (physical address) */
@@ -170,7 +175,13 @@
 #define FB_VMODE_DOUBLE		2	/* double scan */
 #define FB_VMODE_MASK		255
 
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+#define FB_VMODE_XWRAP		256	/* xwrap instead of panning     */
+#else	
 #define FB_VMODE_YWRAP		256	/* ywrap instead of panning     */
+#endif		
+
+
 #define FB_VMODE_SMOOTH_XPAN	512	/* smooth xpan possible (internally used) */
 #define FB_VMODE_CONUPDATE	512	/* don't update x/yoffset	*/
 
diff -ur linux-2.6.7-base/drivers/video/cfbimgblt.c linux-2.6.7/drivers/video/cfbimgblt.c
--- linux-2.6.7-base/drivers/video/cfbimgblt.c	2004-06-16 06:19:35.000000000 +0100
+++ linux-2.6.7/drivers/video/cfbimgblt.c	2004-06-20 11:31:53.000000000 +0100
@@ -60,6 +60,9 @@
 };
 
 static u32 cfb_tab16[] = {
+#if defined(CONFIG_FBCON_ROTATE_R) || defined(CONFIG_FBCON_ROTATE_L)
+    0x00000000, 0x0000ffff
+#else
 #if defined(__BIG_ENDIAN)
     0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
 #elif defined(__LITTLE_ENDIAN)
@@ -67,6 +70,7 @@
 #else
 #error FIXME: No endianness??
 #endif
+#endif
 };
 
 static u32 cfb_tab32[] = {
diff -ur linux-2.6.7-base/drivers/video/console/Kconfig linux-2.6.7/drivers/video/console/Kconfig
--- linux-2.6.7-base/drivers/video/console/Kconfig	2004-06-16 06:19:02.000000000 +0100
+++ linux-2.6.7/drivers/video/console/Kconfig	2004-06-20 11:25:04.000000000 +0100
@@ -106,6 +106,11 @@
 	tristate "Framebuffer Console support"
 	depends on FB
 
+config FBCON_ROTATE_R
+	bool "Rotate the console 90 degrees to the right"
+	depends on FRAMEBUFFER_CONSOLE
+	default n
+
 config PCI_CONSOLE
 	bool
 	depends on FRAMEBUFFER_CONSOLE

 
