Date: Mon, 31 Aug 1998 23:54:49 +0200 (CEST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Jes Sorensen <Jes.Sorensen@cern.ch>
cc: linux-m68k@lists.linux-m68k.org
Subject: Re: L68K: 2.1.119 is out
In-Reply-To: <Pine.LNX.4.02A.9808312330260.4415-100000@mercator.cs.kuleuven.ac.be>
Sender: owner-linux-m68k@phil.uni-sb.de

On Mon, 31 Aug 1998, Geert Uytterhoeven wrote:
> Video patches (upgrade to vger) will follow soon.

Here they are. Notes:

  - Update console/video subsystem to vger-current
  - Move fbmem.c from drivers/char to drivers/video
  - Move many includes from drivers/video to include/video
  - Remove everything that smells like gspcon, vgafb or mdafb
  - The 16 color Penguin works again!
  - The palette code for Atari is still broken for everything but TT. Who's
    willing to fix it? (special thanks to Andreas for the fixes for TT)
  - Franky: no, g364fb is not the Rainbow III driver :-) I'm waiting for the
    results of my betatester so I can merge both...

diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/char/Makefile m68k/drivers/char/Makefile
--- jes-2.1.119/drivers/char/Makefile	Sun Aug 30 20:40:39 1998
+++ m68k/drivers/char/Makefile	Mon Aug 31 00:44:17 1998
@@ -27,9 +27,6 @@
 L_OBJS += vt.o vc_screen.o consolemap.o consolemap_deftbl.o
 LX_OBJS += console.o selection.o
 endif
-ifdef CONFIG_FB
-  LX_OBJS += fbmem.o
-endif
 
 ifeq ($(CONFIG_ATARI_MFPSER),y)
 L_OBJS += atari_MFPser.o
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/char/console.c m68k/drivers/char/console.c
--- jes-2.1.119/drivers/char/console.c	Sun Aug 30 20:40:40 1998
+++ m68k/drivers/char/console.c	Mon Aug 31 20:30:56 1998
@@ -47,7 +47,6 @@
  *     - video_num_columns
  *     - video_num_lines
  *     - video_size_row
- *     - video_screen_size
  *     - can_do_color
  *
  *   The abstract console driver provides a generic interface for a text
@@ -108,8 +107,6 @@
 
 struct consw *conswitchp = NULL;
 
-static int vesa_blank_mode = 0; /* 0:none 1:suspendV 2:suspendH 3:powerdown */
-
 /* A bitmap for codes <32. A bit of 1 indicates that the code
  * corresponding to that bit number invokes some special action
  * (such as cursor movement) and should not be displayed as a
@@ -137,17 +134,18 @@
 static void vc_init(unsigned int console, unsigned int rows,
 		    unsigned int cols, int do_clear);
 static void blank_screen(void);
-static void unblank_screen(void);
 static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
 static void reset_terminal(int currcons, int do_clear);
 static void con_flush_chars(struct tty_struct *tty);
+static void set_vesa_blanking(unsigned long arg);
 
 static int printable = 0;		/* Is console ready for printing? */
 
 int do_poke_blanked_console = 0;
 int console_blanked = 0;
 
+static int vesa_blank_mode = 0; /* 0:none 1:suspendV 2:suspendH 3:powerdown */
 static int blankinterval = 10*60*HZ;
 static int vesa_off_interval = 0;
 
@@ -183,7 +181,7 @@
  */
 
 #define IS_FG (currcons == fg_console)
-#define IS_VISIBLE (*display_fg == vc_cons[currcons].d)
+#define IS_VISIBLE CON_IS_VISIBLE(vc_cons[currcons].d)
 
 #ifdef VT_BUF_VRAM_ONLY
 #define DO_UPDATE 0
@@ -503,9 +501,8 @@
 	pos = origin + video_size_row*y + 2*x;
 }
 
-static inline void save_screen(void)
+static inline void save_screen(int currcons)
 {
-	int currcons = fg_console;
 	if (sw->con_save_screen)
 		sw->con_save_screen(vc_cons[currcons].d);
 }
@@ -514,13 +511,11 @@
  *	Redrawing of screen
  */
 
-void update_screen(int new_console)
+void redraw_screen(int new_console, int is_switch)
 {
-	int currcons = fg_console;
 	int redraw = 1;
-	int old_console;
+	int currcons, old_console;
 	static int lock = 0;
-	struct vc_data **display;
 
 	if (lock)
 		return;
@@ -531,28 +526,40 @@
 	}
 	lock = 1;
 
-	hide_cursor(currcons);
-	if (fg_console != new_console) {
-		display = vc_cons[new_console].d->vc_display_fg;
-		old_console = (*display) ? (*display)->vc_num : fg_console;
-		*display = vc_cons[new_console].d;
-		fg_console = new_console;
-		currcons = old_console;
-		if (!IS_VISIBLE)
-			set_origin(currcons);
+	if (is_switch) {
+		currcons = fg_console;
+		hide_cursor(currcons);
+		if (fg_console != new_console) {
+			struct vc_data **display = vc_cons[new_console].d->vc_display_fg;
+			old_console = (*display) ? (*display)->vc_num : fg_console;
+			*display = vc_cons[new_console].d;
+			fg_console = new_console;
+			currcons = old_console;
+			if (!IS_VISIBLE) {
+				save_screen(currcons);
+				set_origin(currcons);
+			}
+			currcons = new_console;
+			if (old_console == new_console)
+				redraw = 0;
+		}
+	} else {
 		currcons = new_console;
-		if (old_console == new_console)
-			redraw = 0;
+		hide_cursor(currcons);
 	}
+
 	if (redraw) {
 		set_origin(currcons);
-		if (sw->con_switch(vc_cons[currcons].d))
+		set_palette(currcons);
+		if (sw->con_switch(vc_cons[currcons].d) && vcmode != KD_GRAPHICS)
 			/* Update the screen contents */
 			do_update_region(currcons, origin, screenbuf_size/2);
 	}
 	set_cursor(currcons);
-	set_leds();
-	compute_shiftstate();
+	if (is_switch) {
+		set_leds();
+		compute_shiftstate();
+	}
 	lock = 0;
 }
 
@@ -579,7 +586,7 @@
     if (!complement_mask)
         complement_mask = can_do_color ? 0x7700 : 0x0800;
     video_size_row = video_num_columns<<1;
-    video_screen_size = video_num_lines*video_size_row;
+    screenbuf_size = video_num_lines*video_size_row;
 }
 
 int vc_allocate(unsigned int currcons, int init)	/* return 0 on success */
@@ -595,7 +602,7 @@
 
 	    /* due to the granularity of kmalloc, we waste some memory here */
 	    /* the alloc is done in two steps, to optimize the common situation
-	       of a 25x80 console (structsize=216, video_screen_size=4000) */
+	       of a 25x80 console (structsize=216, screenbuf_size=4000) */
 	    /* although the numbers above are not valid since long ago, the
 	       point is still up-to-date and the comment still has its value
 	       even if only as a historical artifact.  --mj, July 1998 */
@@ -605,7 +612,7 @@
 	    vc_cons[currcons].d = (struct vc_data *)p;
 	    vt_cons[currcons] = (struct vt_struct *)(p+sizeof(struct vc_data));
 	    visual_init(currcons);
-	    q = (long)kmalloc(video_screen_size, GFP_KERNEL);
+	    q = (long)kmalloc(screenbuf_size, GFP_KERNEL);
 	    if (!q) {
 		kfree_s((char *) p, structsize);
 		vc_cons[currcons].d = NULL;
@@ -616,7 +623,6 @@
 		con_set_default_unimap(currcons);
 	    screenbuf = (unsigned short *) q;
 	    kmalloced = 1;
-	    screenbuf_size = video_screen_size;
 	    if (!sw->con_save_screen)
 	    	init = 0; /* If console does not have save_screen routine,
 	    		     we should clear the screen */
@@ -670,12 +676,12 @@
 		oll = video_num_lines;
 		occ = video_num_columns;
 		osr = video_size_row;
-		oss = video_screen_size;
+		oss = screenbuf_size;
 
 		video_num_lines = ll;
 		video_num_columns = cc;
 		video_size_row = sr;
-		video_screen_size = ss;
+		screenbuf_size = ss;
 
 		rlth = MIN(osr, sr);
 		rrem = sr - rlth;
@@ -720,11 +726,10 @@
 			*cws = ws;
 		}
 
-		if (IS_FG && vt_cons[fg_console]->vc_mode == KD_TEXT)
+		if (IS_VISIBLE)
 			update_screen(fg_console);
 	}
 
-	set_cursor(fg_console);
 	return 0;
 }
 
@@ -1139,7 +1144,7 @@
 			case 5:			/* Inverted screen on/off */
 				if (decscnm != on_off) {
 					decscnm = on_off;
-					invert_screen(currcons, 0, video_screen_size, 0);
+					invert_screen(currcons, 0, screenbuf_size, 0);
 					update_attr(currcons);
 				}
 				break;
@@ -1488,7 +1493,7 @@
 			vc_state = ESpalette;
 			return;
 		} else if (c=='R') {   /* reset palette */
-			reset_palette (currcons);
+			reset_palette(currcons);
 			vc_state = ESnormal;
 		} else
 			vc_state = ESnormal;
@@ -1504,7 +1509,7 @@
 				palette[i++] += par[j++];
 				palette[i] = 16*par[j++];
 				palette[i] += par[j];
-				set_palette() ;
+				set_palette(currcons);
 				vc_state = ESnormal;
 			}
 		} else
@@ -1902,7 +1907,6 @@
 	if (want_console >= 0) {
 		if (want_console != fg_console && vc_cons_allocated(want_console)) {
 			hide_cursor(fg_console);
-			save_screen();
 			change_console(want_console);
 			/* we only changed when the console had already
 			   been allocated - a new console is not created
@@ -2016,7 +2020,7 @@
 	NULL,
 	vt_console_device,
 	keyboard_wait_for_keypress,
-	do_unblank_screen,
+	unblank_screen,
 	NULL,
 	CON_PRINTBUFFER,
 	-1,
@@ -2046,7 +2050,7 @@
 		case 3:
 			return paste_selection(tty);
 		case 4:
-			do_unblank_screen();
+			unblank_screen();
 			return 0;
 		case 5:
 			return sel_loadlut(arg);
@@ -2195,7 +2199,7 @@
 	video_num_columns = cols;
 	video_num_lines = rows;
 	video_size_row = cols<<1;
-	video_screen_size = video_num_lines * video_size_row;
+	screenbuf_size = video_num_lines * video_size_row;
 
 	set_origin(currcons);
 	pos = origin;
@@ -2282,9 +2286,8 @@
 		kmem_start += sizeof(struct vt_struct);
 		visual_init(currcons);
 		screenbuf = (unsigned short *) kmem_start;
-		kmem_start += video_screen_size;
+		kmem_start += screenbuf_size;
 		kmalloced = 0;
-		screenbuf_size = video_screen_size;
 		vc_init(currcons, video_num_lines, video_num_columns, 
 			currcons || !sw->con_save_screen);
 		for (j=k=0; j<16; j++) {
@@ -2293,15 +2296,13 @@
 			vc_cons[currcons].d->vc_palette[k++] = default_blu[j] ;
 		}
 	}
-
 	currcons = fg_console = 0;
 	master_display_fg = vc_cons[currcons].d;
 	set_origin(currcons);
-	save_screen();
+	save_screen(currcons);
 	gotoxy(currcons,x,y);
 	csi_J(currcons, 0);
 	update_screen(fg_console);
-	set_cursor(currcons);
 	printk("Console: %s %s %dx%d",
 		can_do_color ? "colour" : "mono",
 		display_desc, video_num_columns, video_num_lines);
@@ -2327,28 +2328,31 @@
 
 void take_over_console(struct consw *csw, int first, int last, int deflt)
 {
-	int i;
+	int i, j = -1;
 	const char *desc;
 
-	if (deflt)
-		conswitchp = csw;
 	desc = csw->con_startup();
 	if (!desc) return;
+	if (deflt)
+		conswitchp = csw;
 
 	for (i = first; i <= last; i++) {
+		int currcons = i;
 		if (!vc_cons[i].d || !vc_cons[i].d->vc_sw)
 			continue;
-		if (i == fg_console &&
-		    vc_cons[i].d->vc_sw->con_save_screen)
-			vc_cons[i].d->vc_sw->con_save_screen(vc_cons[i].d);
+		j = i;
+		if (IS_VISIBLE)
+			save_screen(i);
 		vc_cons[i].d->vc_sw->con_deinit(vc_cons[i].d);
 		vc_cons[i].d->vc_sw = csw;
 		vc_cons[i].d->vc_sw->con_init(vc_cons[i].d, 0);
-		}
-	printk("Console: switching to %s %s %dx%d\n",
-	       vc_cons[fg_console].d->vc_can_do_color ? "colour" : "mono",
-	       desc, vc_cons[fg_console].d->vc_cols, vc_cons[fg_console].d->vc_rows);
-	set_palette();
+		if (IS_VISIBLE)
+			update_screen(i);
+	}
+	if (j >= 0)
+		printk("Console: switching to %s %s %dx%d\n",
+		       vc_cons[j].d->vc_can_do_color ? "colour" : "mono",
+		       desc, vc_cons[j].d->vc_cols, vc_cons[j].d->vc_rows);
 }
 
 #endif
@@ -2357,7 +2361,7 @@
  *	Screen blanking
  */
 
-void set_vesa_blanking(unsigned long arg)
+static void set_vesa_blanking(unsigned long arg)
 {
     char *argp = (char *)arg + 1;
     unsigned int mode;
@@ -2365,13 +2369,7 @@
     vesa_blank_mode = (mode < 4) ? mode : 0;
 }
 
-void vesa_blank(void)
-{
-    struct vc_data *c = vc_cons[fg_console].d;
-    c->vc_sw->con_blank(c, vesa_blank_mode + 1);
-}
-
-void vesa_powerdown(void)
+static void vesa_powerdown(void)
 {
     struct vc_data *c = vc_cons[fg_console].d;
     /*
@@ -2391,7 +2389,7 @@
     }
 }
 
-void vesa_powerdown_screen(void)
+static void vesa_powerdown_screen(void)
 {
 	timer_active &= ~(1<<BLANK_TIMER);
 	timer_table[BLANK_TIMER].fn = unblank_screen;
@@ -2399,7 +2397,7 @@
 	vesa_powerdown();
 }
 
-void do_blank_screen(int nopowersave)
+void do_blank_screen(int entering_gfx)
 {
 	int currcons = fg_console;
 	int i;
@@ -2408,9 +2406,9 @@
 		return;
 
 	/* entering graphics mode? */
-	if (nopowersave) {
+	if (entering_gfx) {
 		hide_cursor(currcons);
-		save_screen();
+		save_screen(currcons);
 		sw->con_blank(vc_cons[currcons].d, -1);
 		console_blanked = fg_console + 1;
 		set_origin(currcons);
@@ -2418,13 +2416,13 @@
 	}
 
 	/* don't blank graphics */
-	if (vt_cons[fg_console]->vc_mode != KD_TEXT) {
+	if (vcmode != KD_TEXT) {
 		console_blanked = fg_console + 1;
 		return;
 	}
 
-	hide_cursor(fg_console);
-	if(vesa_off_interval && !nopowersave) {
+	hide_cursor(currcons);
+	if (vesa_off_interval) {
 		timer_table[BLANK_TIMER].fn = vesa_powerdown_screen;
 		timer_table[BLANK_TIMER].expires = jiffies + vesa_off_interval;
 		timer_active |= (1<<BLANK_TIMER);
@@ -2433,26 +2431,25 @@
 		timer_table[BLANK_TIMER].fn = unblank_screen;
 	}
 
-	save_screen();
+	save_screen(currcons);
 	/* In case we need to reset origin, blanking hook returns 1 */
 	i = sw->con_blank(vc_cons[currcons].d, 1);
 	console_blanked = fg_console + 1;
 	if (i)
 		set_origin(currcons);
 
-	if(!nopowersave)
-	{
 #ifdef CONFIG_APM
-		if (apm_display_blank())
-			return;
+	if (apm_display_blank())
+		return;
 #endif
-		vesa_blank();
-	}
+    	if (vesa_blank_mode)
+		sw->con_blank(vc_cons[currcons].d, vesa_blank_mode + 1);
 }
 
-void do_unblank_screen(void)
+void unblank_screen(void)
 {
 	int currcons;
+
 	if (!console_blanked)
 		return;
 	if (!vc_cons_allocated(fg_console)) {
@@ -2482,11 +2479,6 @@
 	do_blank_screen(0);
 }
 
-static void unblank_screen(void)
-{
-	do_unblank_screen();
-}
-
 void poke_blanked_console(void)
 {
 	timer_active &= ~(1<<BLANK_TIMER);
@@ -2506,13 +2498,13 @@
  *	Palettes
  */
 
-void set_palette(void)
+void set_palette(int currcons)
 {
-    if (vt_cons[fg_console]->vc_mode != KD_GRAPHICS)
-	vc_cons[fg_console].d->vc_sw->con_set_palette(vc_cons[fg_console].d, color_table);
+	if (vcmode != KD_GRAPHICS)
+		sw->con_set_palette(vc_cons[currcons].d, color_table);
 }
 
-int set_get_cmap(unsigned char *arg, int set)
+static int set_get_cmap(unsigned char *arg, int set)
 {
     int i, j, k;
 
@@ -2528,13 +2520,14 @@
 	}
     if (set) {
 	for (i = 0; i < MAX_NR_CONSOLES; i++)
-	    if (vc_cons_allocated(i))
+	    if (vc_cons_allocated(i)) {
 		for (j = k = 0; j < 16; j++) {
 		    vc_cons[i].d->vc_palette[k++] = default_red[j];
 		    vc_cons[i].d->vc_palette[k++] = default_grn[j];
 		    vc_cons[i].d->vc_palette[k++] = default_blu[j];
 		}
-	set_palette();
+		set_palette(i);
+	    }
     }
     return 0;
 }
@@ -2544,25 +2537,25 @@
  * map, 3 bytes per colour, 16 colours, range from 0 to 255.
  */
 
-int con_set_cmap (unsigned char *arg)
+int con_set_cmap(unsigned char *arg)
 {
 	return set_get_cmap (arg,1);
 }
 
-int con_get_cmap (unsigned char *arg)
+int con_get_cmap(unsigned char *arg)
 {
 	return set_get_cmap (arg,0);
 }
 
-void reset_palette (int currcons)
+void reset_palette(int currcons)
 {
-	int j, k ;
+	int j, k;
 	for (j=k=0; j<16; j++) {
 		palette[k++] = default_red[j];
 		palette[k++] = default_grn[j];
 		palette[k++] = default_blu[j];
 	}
-	set_palette() ;
+	set_palette(currcons);
 }
 
 /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/char/fbmem.c m68k/drivers/char/fbmem.c
--- jes-2.1.119/drivers/char/fbmem.c	Sun Aug 30 20:40:40 1998
+++ m68k/drivers/char/fbmem.c	Thu Jan  1 01:00:00 1970
@@ -1,666 +0,0 @@
-/*
- *  linux/drivers/char/fbmem.c
- *
- *  Copyright (C) 1994 Martin Schaller
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- */
-
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/major.h>
-#include <linux/malloc.h>
-#include <linux/mman.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/console_struct.h>
-#include <linux/init.h>
-#ifdef CONFIG_PROC_FS
-#include <linux/proc_fs.h>
-#endif
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
-#ifdef __mc68000__
-#include <asm/setup.h>
-#endif
-#ifdef __powerpc__
-#include <asm/io.h>
-#endif
-#include <asm/uaccess.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-
-#include <linux/fb.h>
-
-
-    /*
-     *  Frame buffer device initialization and setup routines
-     */
-
-extern unsigned long acornfb_init(void);
-extern void acornfb_setup(char *options, int *ints);
-extern void amifb_init(void);
-extern void amifb_setup(char *options, int *ints);
-extern void atafb_init(void);
-extern void atafb_setup(char *options, int *ints);
-extern void macfb_init(void);
-extern void macfb_setup(char *options, int *ints);
-extern void cyberfb_init(void);
-extern void cyberfb_setup(char *options, int *ints);
-extern void retz3fb_init(void);
-extern void retz3fb_setup(char *options, int *ints);
-extern void clgenfb_init(void);
-extern void clgenfb_setup(char *options, int *ints);
-extern void vfb_init(void);
-extern void vfb_setup(char *options, int *ints);
-extern void offb_init(void);
-extern void offb_setup(char *options, int *ints);
-extern void atyfb_init(void);
-extern void atyfb_setup(char *options, int *ints);
-extern void dnfb_init(void);
-extern void tgafb_init(void);
-extern void virgefb_init(void);
-extern void virgefb_setup(char *options, int *ints);
-extern void resolver_video_setup(char *options, int *ints);
-extern void s3triofb_init(void);
-extern void s3triofb_setup(char *options, int *ints);
-extern void vgafb_init(void);
-extern void vgafb_setup(char *options, int *ints);
-extern void vesafb_init(void);
-extern void vesafb_setup(char *options, int *ints);
-extern void mdafb_init(void);
-extern void mdafb_setup(char *options, int *ints);
-extern void hpfb_init(void);
-extern void hpfb_setup(char *options, int *ints);
-extern void sbusfb_init(void);
-extern void sbusfb_setup(char *options, int *ints);
-
-static struct {
-	const char *name;
-	void (*init)(void);
-	void (*setup)(char *options, int *ints);
-} fb_drivers[] __initdata = {
-#ifdef CONFIG_FB_RETINAZ3
-	{ "retz3", retz3fb_init, retz3fb_setup },
-#endif
-#ifdef CONFIG_FB_ACORN
-	{ "acorn", acornfb_init, acornfb_setup },
-#endif
-#ifdef CONFIG_FB_AMIGA
-	{ "amifb", amifb_init, amifb_setup },
-#endif
-#ifdef CONFIG_FB_ATARI
-	{ "atafb", atafb_init, atafb_setup },
-#endif
-#ifdef CONFIG_FB_MAC
-	{ "macfb", macfb_init, macfb_setup },
-#endif
-#ifdef CONFIG_FB_CYBER
-	{ "cyber", cyberfb_init, cyberfb_setup },
-#endif
-#ifdef CONFIG_FB_CLGEN
-	{ "clgen", clgenfb_init, clgenfb_setup },
-#endif
-#ifdef CONFIG_FB_OF
-	{ "offb", offb_init, offb_setup },
-#endif
-#ifdef CONFIG_FB_ATY
-	{ "atyfb", atyfb_init, atyfb_setup },
-#endif
-#ifdef CONFIG_APOLLO
-	{ "apollo", dnfb_init, NULL },
-#endif
-#ifdef CONFIG_FB_S3TRIO
-	{ "s3trio", s3triofb_init, s3triofb_setup },
-#endif 
-#ifdef CONFIG_FB_TGA
-	{ "tga", tgafb_init, NULL },
-#endif
-#ifdef CONFIG_FB_VIRGE
-	{ "virge", virgefb_init, virgefb_setup },
-#endif
-#ifdef CONFIG_FB_VGA
-	{ "vga", vgafb_init, vgafb_setup },
-#endif 
-#ifdef CONFIG_FB_VESA
-	{ "vesa", vesafb_init, vesafb_setup },
-#endif 
-#ifdef CONFIG_FB_MDA
-	{ "mda", mdafb_init, mdafb_setup },
-#endif 
-#ifdef CONFIG_FB_HP300
-	{ "hpfb", hpfb_init, hpfb_setup },
-#endif 
-#ifdef CONFIG_FB_SBUS
-	{ "sbus", sbusfb_init, sbusfb_setup },
-#endif
-#ifdef CONFIG_GSP_RESOLVER
-	/* Not a real frame buffer device... */
-	{ "resolver", NULL, resolver_video_setup },
-#endif
-#ifdef CONFIG_FB_VIRTUAL
-	/* Must be last to avoid that vfb becomes your primary display */
-	{ "vfb", vfb_init, vfb_setup },
-#endif
-};
-
-#define NUM_FB_DRIVERS	(sizeof(fb_drivers)/sizeof(*fb_drivers))
-
-static void (*pref_init_funcs[FB_MAX])(void);
-static int num_pref_init_funcs __initdata = 0;
-
-
-struct fb_info *registered_fb[FB_MAX];
-int num_registered_fb = 0;
-
-char con2fb_map[MAX_NR_CONSOLES];
-
-static inline int PROC_CONSOLE(void)
-{
-	if (!current->tty)
-		return fg_console;
-
-	if (current->tty->driver.type != TTY_DRIVER_TYPE_CONSOLE)
-		/* XXX Should report error here? */
-		return fg_console;
-
-	if (MINOR(current->tty->device) < 1)
-		return fg_console;
-
-	return MINOR(current->tty->device) - 1;
-}
-
-#ifdef CONFIG_PROC_FS
-static int fbmem_read_proc(char *buf, char **start, off_t offset,
-			   int len, int *eof, void *private)
-{
-	struct fb_info **fi;
-
-	len = 0;
-	for (fi = registered_fb; fi < &registered_fb[FB_MAX] && len < 4000; fi++)
-		if (*fi)
-			len += sprintf(buf + len, "%d %s\n",
-				       (*fi)->node,
-				       (*fi)->modename);
-	*start = buf + offset;
-	return len > offset ? len - offset : 0;
-}
-#endif
-
-static ssize_t
-fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
-{
-	unsigned long p = *ppos;
-	struct inode *inode = file->f_dentry->d_inode;
-	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_info *info = registered_fb[fbidx];
-	struct fb_ops *fb = info->fbops;
-	struct fb_fix_screeninfo fix;
-	char *base_addr;
-	ssize_t copy_size;
-
-	if (! fb || ! info->disp)
-		return -ENODEV;
-
-	fb->fb_get_fix(&fix,PROC_CONSOLE(), info);
-	base_addr=info->disp->screen_base;
-	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
-	if (copy_to_user(buf, base_addr+p, copy_size))
-	    return -EFAULT;
-	*ppos += copy_size;
-	return copy_size;
-}
-
-static ssize_t
-fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
-	unsigned long p = *ppos;
-	struct inode *inode = file->f_dentry->d_inode;
-	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_info *info = registered_fb[fbidx];
-	struct fb_ops *fb = info->fbops;
-	struct fb_fix_screeninfo fix;
-	char *base_addr;
-	ssize_t copy_size;
-
-	if (! fb || ! info->disp)
-		return -ENODEV;
-
-	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
-	base_addr=info->disp->screen_base;
-	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
-	if (copy_from_user(base_addr+p, buf, copy_size))
-	    return -EFAULT;
-	file->f_pos += copy_size;
-	return copy_size;
-}
-
-
-static void set_con2fb_map(int unit, int newidx)
-{
-    int oldidx = con2fb_map[unit];
-    struct fb_info *oldfb, *newfb;
-    struct vc_data *conp;
-    char *fontdata;
-    unsigned short fontwidth, fontheight, fontwidthlog, fontheightlog;
-    int userfont;
-
-    if (newidx != con2fb_map[unit]) {
-       oldfb = registered_fb[oldidx];
-       newfb = registered_fb[newidx];
-       if (newfb->fbops->fb_open(newfb,0))
-	   return;
-       oldfb->fbops->fb_release(oldfb,0);
-       conp = fb_display[unit].conp;
-       fontdata = fb_display[unit].fontdata;
-       fontwidth = fb_display[unit]._fontwidth;
-       fontheight = fb_display[unit]._fontheight;
-       fontwidthlog = fb_display[unit]._fontwidthlog;
-       fontheightlog = fb_display[unit]._fontheightlog;
-       userfont = fb_display[unit].userfont;
-       con2fb_map[unit] = newidx;
-       fb_display[unit] = *(newfb->disp);
-       fb_display[unit].conp = conp;
-       fb_display[unit].fontdata = fontdata;
-       fb_display[unit]._fontwidth = fontwidth;
-       fb_display[unit]._fontheight = fontheight;
-       fb_display[unit]._fontwidthlog = fontwidthlog;
-       fb_display[unit]._fontheightlog = fontheightlog;
-       fb_display[unit].userfont = userfont;
-       fb_display[unit].fb_info = newfb;
-       if (!newfb->changevar)
-	   newfb->changevar = oldfb->changevar;
-       /* tell console var has changed */
-       if (newfb->changevar)
-	   newfb->changevar(unit);
-    }
-}
-
-#ifdef CONFIG_KMOD
-static void try_to_load(int fb)
-{
-	char modname[16];
-
-	sprintf(modname, "fb%d", fb);
-	request_module(modname);
-}
-#endif /* CONFIG_KMOD */
-
-static int 
-fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-	 unsigned long arg)
-{
-	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_info *info = registered_fb[fbidx];
-	struct fb_ops *fb = info->fbops;
-	struct fb_cmap cmap;
-	struct fb_var_screeninfo var;
-	struct fb_fix_screeninfo fix;
-	struct fb_con2fbmap con2fb;
-	int i;
-	
-	if (! fb)
-		return -ENODEV;
-	switch (cmd) {
-	case FBIOGET_VSCREENINFO:
-		if ((i = fb->fb_get_var(&var, PROC_CONSOLE(), info)))
-			return i;
-		return copy_to_user((void *) arg, &var,
-				    sizeof(var)) ? -EFAULT : 0;
-	case FBIOPUT_VSCREENINFO:
-		if (copy_from_user(&var, (void *) arg, sizeof(var)))
-			return -EFAULT;
-		if ((i = fb->fb_set_var(&var, PROC_CONSOLE(), info)))
-			return i;
-		if (copy_to_user((void *) arg, &var, sizeof(var)))
-			return -EFAULT;
-		return 0;
-	case FBIOGET_FSCREENINFO:
-		if ((i = fb->fb_get_fix(&fix, PROC_CONSOLE(), info)))
-			return i;
-		return copy_to_user((void *) arg, &fix, sizeof(fix)) ?
-			-EFAULT : 0;
-	case FBIOPUTCMAP:
-		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
-			return -EFAULT;
-		return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(), info));
-	case FBIOGETCMAP:
-		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
-			return -EFAULT;
-		return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(), info));
-	case FBIOPAN_DISPLAY:
-		if (copy_from_user(&var, (void *) arg, sizeof(var)))
-			return -EFAULT;
-		if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(), info)))
-			return i;
-		if (copy_to_user((void *) arg, &var, sizeof(var)))
-			return -EFAULT;
-		return i;
-	case FBIOGET_CON2FBMAP:
-		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
-			return -EFAULT;
-		if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
-		    return -EINVAL;
-		con2fb.framebuffer = con2fb_map[con2fb.console-1];
-		return copy_to_user((void *)arg, &con2fb,
-				    sizeof(con2fb)) ? -EFAULT : 0;
-	case FBIOPUT_CON2FBMAP:
-		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
-			return - EFAULT;
-		if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES)
-		    return -EINVAL;
-		if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
-		    return -EINVAL;
-#ifdef CONFIG_KMOD
-		if (!registered_fb[con2fb.framebuffer])
-		    try_to_load(con2fb.framebuffer);
-#endif /* CONFIG_KMOD */
-		if (!registered_fb[con2fb.framebuffer])
-		    return -EINVAL;
-		if (con2fb.console != 0)
-		    set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
-		else
-		    /* set them all */
-		    for (i = 0; i < MAX_NR_CONSOLES; i++)
-			set_con2fb_map(i, con2fb.framebuffer);
-		return 0;
-	default:
-		return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(),
-				    info);
-	}
-}
-
-static int 
-fb_mmap(struct file *file, struct vm_area_struct * vma)
-{
-	int fbidx = GET_FB_IDX(file->f_dentry->d_inode->i_rdev);
-	struct fb_info *info = registered_fb[fbidx];
-	struct fb_ops *fb = info->fbops;
-	struct fb_fix_screeninfo fix;
-	struct fb_var_screeninfo var;
-	unsigned long start;
-	u32 len;
-
-	if (!fb)
-		return -ENODEV;
-	if (fb->fb_mmap)
-		return fb->fb_mmap(info, file, vma);
-	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
-
-	/* frame buffer memory */
-	start = (unsigned long)fix.smem_start;
-	len = (start & ~PAGE_MASK)+fix.smem_len;
-	start &= PAGE_MASK;
-	len = (len+~PAGE_MASK) & PAGE_MASK;
-	if (vma->vm_offset >= len) {
-		/* memory mapped io */
-		vma->vm_offset -= len;
-		fb->fb_get_var(&var, PROC_CONSOLE(), info);
-		if (var.accel_flags)
-			return -EINVAL;
-		start = (unsigned long)fix.mmio_start;
-		len = (start & ~PAGE_MASK)+fix.mmio_len;
-		start &= PAGE_MASK;
-		len = (len+~PAGE_MASK) & PAGE_MASK;
-	}
-	if ((vma->vm_end - vma->vm_start + vma->vm_offset) > len)
-		return -EINVAL;
-	vma->vm_offset += start;
-	if (vma->vm_offset & ~PAGE_MASK)
-		return -ENXIO;
-#if defined(__mc68000__)
-	if (CPU_IS_020_OR_030)
-		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
-	if (CPU_IS_040_OR_060) {
-		pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
-		/* Use no-cache mode, serialized */
-		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
-	}
-#elif defined(__powerpc__)
-	pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
-#elif defined(__alpha__)
-	/* Caching is off in the I/O space quadrant by design.  */
-#elif defined(__sparc__)
-	/* Should never get here, all fb drivers should have their own
-	   mmap routines */
-#elif defined(__i386__)
-	if (boot_cpu_data.x86 > 3)
-		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
-#else
-#warning What do we have to do here??
-#endif
-	if (remap_page_range(vma->vm_start, vma->vm_offset,
-			     vma->vm_end - vma->vm_start, vma->vm_page_prot))
-		return -EAGAIN;
-	vma->vm_file = file;
-	file->f_count++;
-	return 0;
-}
-
-static int
-fb_open(struct inode *inode, struct file *file)
-{
-	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_info *info;
-
-#ifdef CONFIG_KMOD
-	if (!(info = registered_fb[fbidx]))
-		try_to_load(fbidx);
-#endif /* CONFIG_KMOD */
-	if (!(info = registered_fb[fbidx]))
-		return -ENODEV;
-	return info->fbops->fb_open(info,1);
-}
-
-static int 
-fb_release(struct inode *inode, struct file *file)
-{
-	int fbidx = GET_FB_IDX(inode->i_rdev);
-	struct fb_info *info = registered_fb[fbidx];
-
-	info->fbops->fb_release(info,1);
-	return 0;
-}
-
-static struct file_operations fb_fops = {
-	NULL,		/* lseek	*/
-	fb_read,	/* read		*/
-	fb_write,	/* write	*/
-	NULL,		/* readdir 	*/
-	NULL,		/* poll 	*/
-	fb_ioctl,	/* ioctl 	*/
-	fb_mmap,	/* mmap		*/
-	fb_open,	/* open 	*/
-	NULL,		/* flush	*/
-	fb_release,	/* release 	*/
-	NULL		/* fsync 	*/
-};
-
-int
-register_framebuffer(struct fb_info *fb_info)
-{
-	int i, j;
-	static int fb_ever_opened[FB_MAX];
-	static int first = 1;
-
-	if (num_registered_fb == FB_MAX)
-		return -ENXIO;
-	num_registered_fb++;
-	for (i = 0 ; i < FB_MAX; i++)
-		if (!registered_fb[i])
-			break;
-	fb_info->node = i;
-	registered_fb[i] = fb_info;
-	if (!fb_ever_opened[i]) {
-		/*
-		 *  We assume initial frame buffer devices can be opened this
-		 *  many times
-		 */
-		for (j = 0; j < MAX_NR_CONSOLES; j++)
-			if (con2fb_map[j] == i)
-				fb_info->fbops->fb_open(fb_info,0);
-		fb_ever_opened[i] = 1;
-	}
-
-	if (first) {
-		first = 0;
-		take_over_console(&fb_con, 0, MAX_NR_CONSOLES-1, 1);
-	}
-
-	return 0;
-}
-
-int
-unregister_framebuffer(const struct fb_info *fb_info)
-{
-	int i, j;
-
-	i = fb_info->node;
-	for (j = 0; j < MAX_NR_CONSOLES; j++)
-		if (con2fb_map[j] == i)
-			return -EBUSY;
-	if (!registered_fb[i])
-		return -EINVAL; 
-	registered_fb[i]=NULL;
-	num_registered_fb--;
-	return 0;
-}
-
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_fbmem;
-#endif
-
-__initfunc(void
-fbmem_init(void))
-{
-	int i;
-
-#ifdef CONFIG_PROC_FS
-	proc_fbmem = create_proc_entry("fb", 0, 0);
-	if (proc_fbmem)
-		proc_fbmem->read_proc = fbmem_read_proc;
-#endif
-
-	if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
-		printk("unable to get major %d for fb devs\n", FB_MAJOR);
-
-	/*
-	 *  Probe for all builtin frame buffer devices
-	 */
-	for (i = 0; i < num_pref_init_funcs; i++)
-		pref_init_funcs[i]();
-
-	for (i = 0; i < NUM_FB_DRIVERS; i++)
-		if (fb_drivers[i].init)
-			fb_drivers[i].init();
-}
-
-
-int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
-			const struct fb_info *fb_info)
-{
-#if 0
-	/*
-	 * long long divisions .... $#%%#$ 
-	 */
-    unsigned long long hpicos, vpicos;
-    const unsigned long long _1e12 = 1000000000000ULL;
-    const struct fb_monspecs *monspecs = &fb_info->monspecs;
-
-    hpicos = (unsigned long long)htotal*(unsigned long long)pixclock;
-    vpicos = (unsigned long long)vtotal*(unsigned long long)hpicos;
-    if (!vpicos)
-	return 0;
-
-    if (monspecs->hfmin == 0)
-	return 1;
-
-    if (hpicos*monspecs->hfmin > _1e12 || hpicos*monspecs->hfmax < _1e12 ||
-	vpicos*monspecs->vfmin > _1e12 || vpicos*monspecs->vfmax < _1e12)
-	return 0;
-#endif
-    return 1;
-}
-
-int fbmon_dpms(const struct fb_info *fb_info)
-{
-    return fb_info->monspecs.dpms;
-}
-
-
-    /*
-     *  Command line options
-     */
-
-__initfunc(void video_setup(char *options, int *ints))
-{
-    int i, j;
-
-    if (!options || !*options)
-	    return;
-	    
-    if (!strncmp(options, "map:", 4)) {
-	    options += 4;
-	    if (*options)
-		    for (i = 0, j = 0; i < MAX_NR_CONSOLES; i++) {
-			    if (!options[j])
-				    j = 0;
-			    con2fb_map[i] = (options[j++]-'0') % FB_MAX;
-		    }
-	    return;
-    }
-
-    if (num_pref_init_funcs == FB_MAX)
-	    return;
-
-    for (i = 0; i < NUM_FB_DRIVERS; i++) {
-	    j = strlen(fb_drivers[i].name);
-	    if (!strncmp(options, fb_drivers[i].name, j) &&
-		options[j] == ':') {
-		    if (!strcmp(options+j+1, "off"))
-			    fb_drivers[i].init = NULL;
-		    else {
-			    if (fb_drivers[i].init) {
-				    pref_init_funcs[num_pref_init_funcs++] =
-					    fb_drivers[i].init;
-				    fb_drivers[i].init = NULL;
-			    }
-			    if (fb_drivers[i].setup)
-				    fb_drivers[i].setup(options+j+1, ints);
-		    }
-		    return;
-	    }
-    }
-    /*
-     * If we get here no fb was specified and we default to pass the
-     * options to the first frame buffer that has an init and a setup
-     * function.
-     */
-    for (i = 0; i < NUM_FB_DRIVERS; i++) {
-	    if (fb_drivers[i].init && fb_drivers[i].setup) {
-		    pref_init_funcs[num_pref_init_funcs++] =
-			    fb_drivers[i].init;
-		    fb_drivers[i].init = NULL;
-
-		    fb_drivers[i].setup(options, ints);
-		    return;
-	    }
-    }
-}
-
-
-    /*
-     *  Visible symbols for modules
-     */
-
-EXPORT_SYMBOL(register_framebuffer);
-EXPORT_SYMBOL(unregister_framebuffer);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/char/selection.c m68k/drivers/char/selection.c
--- jes-2.1.119/drivers/char/selection.c	Mon Aug 10 09:24:55 1998
+++ m68k/drivers/char/selection.c	Mon Aug 31 21:08:30 1998
@@ -123,7 +123,7 @@
 	int i, ps, pe;
 	unsigned int currcons = fg_console;
 
-	do_unblank_screen();
+	unblank_screen();
 	poke_blanked_console();
 
 	{ unsigned short *args, xs, ys, xe, ye;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/char/vt.c m68k/drivers/char/vt.c
--- jes-2.1.119/drivers/char/vt.c	Sun Aug 30 20:40:42 1998
+++ m68k/drivers/char/vt.c	Mon Aug 31 21:29:35 1998
@@ -22,6 +22,7 @@
 #include <linux/malloc.h>
 #include <linux/major.h>
 #include <linux/fs.h>
+#include <linux/config.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -82,45 +83,6 @@
 #define GPNUM (GPLAST - GPFIRST + 1)
 
 /*
- * This function is called when the size of the physical screen has been
- * changed.  If either the row or col argument is nonzero, set the appropriate
- * entry in each winsize structure for all the virtual consoles, then
- * send SIGWINCH to all processes with a virtual console as controlling
- * tty.
- */
-
-static int
-kd_size_changed(int row, int col)
-{
-  struct task_struct *p;
-  int i;
-
-  if ( !row && !col ) return 0;
-
-  for ( i = 0 ; i < MAX_NR_CONSOLES ; i++ )
-    {
-      if ( console_driver.table[i] )
-	{
-	  if ( row ) console_driver.table[i]->winsize.ws_row = row;
-	  if ( col ) console_driver.table[i]->winsize.ws_col = col;
-	}
-    }
-
-  read_lock(&tasklist_lock);
-  for_each_task(p)
-    {
-      if ( p->tty && MAJOR(p->tty->device) == TTY_MAJOR &&
-	   MINOR(p->tty->device) <= MAX_NR_CONSOLES && MINOR(p->tty->device) )
-	{
-	  send_sig(SIGWINCH, p, 1);
-	}
-    }
-  read_unlock(&tasklist_lock);
-
-  return 0;
-}
-
-/*
  * Generates sound of some frequency for some number of clock ticks
  *
  * If freq is 0, will turn off sound, else will turn it on for that time.
@@ -621,7 +583,7 @@
 		 * explicitly blank/unblank the screen if switching modes
 		 */
 		if (arg == KD_TEXT)
-			do_unblank_screen();
+			unblank_screen();
 		else
 			do_blank_screen(1);
 		return 0;
@@ -961,8 +923,7 @@
 			return i;
 		__get_user(ll, &vtsizes->v_rows);
 		__get_user(cc, &vtsizes->v_cols);
-		i = vc_resize_all(ll, cc);
-		return i ? i : 	kd_size_changed(ll, cc);
+		return vc_resize_all(ll, cc);
 	}
 
 	case VT_RESIZEX:
@@ -1010,12 +971,7 @@
 		if ( clin )
 		  video_font_height = clin;
 		
-		i = vc_resize_all(ll, cc);
-		if (i)
-			return i;
-
-		kd_size_changed(ll, cc);
-		return 0;
+		return vc_resize_all(ll, cc);
   	}
 
 	case PIO_FONT: {
@@ -1269,7 +1225,7 @@
 	 * unblank the screen later.
 	 */
 	old_vc_mode = vt_cons[fg_console]->vc_mode;
-	update_screen(new_console);
+	switch_screen(new_console);
 
 	/*
 	 * If this new console is under process control, send it a signal
@@ -1307,14 +1263,10 @@
 	if (old_vc_mode != vt_cons[new_console]->vc_mode)
 	{
 		if (vt_cons[new_console]->vc_mode == KD_TEXT)
-			do_unblank_screen();
+			unblank_screen();
 		else
 			do_blank_screen(1);
 	}
-
-	/* Set the colour palette for this VT */
-	if (vt_cons[new_console]->vc_mode == KD_TEXT)
-		set_palette() ;
 
 	/*
 	 * Wake anyone waiting for their VT to activate
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/Config.in m68k/drivers/video/Config.in
--- jes-2.1.119/drivers/video/Config.in	Sun Aug 30 20:40:50 1998
+++ m68k/drivers/video/Config.in	Mon Aug 31 00:46:02 1998
@@ -35,7 +35,7 @@
     if [ "$CONFIG_FB_OF" = "y" ]; then
       bool 'Apple "control" display support' CONFIG_FB_CONTROL
       bool 'Apple "platinum" display support' CONFIG_FB_PLATINUM
-#     bool 'Apple "valkyrie" display support' CONFIG_FB_VALKYRIE
+      bool 'Apple "valkyrie" display support' CONFIG_FB_VALKYRIE
       bool 'ATI Mach64 display support' CONFIG_FB_ATY
       bool 'IMS Twin Turbo display support' CONFIG_FB_IMSTT
       bool 'Chips 65550 display support' CONFIG_FB_CT65550
@@ -48,21 +48,12 @@
   if [ "$CONFIG_HP300" = "y" ]; then
     define_bool CONFIG_FB_HP300 y
   fi
-  # I used CONFIG_ARM here because the ARCH construct doesn't seem to work
-  # with xconfig.  --pb
-  if [ "$ARCH" = "i386" -o "$ARCH" = "alpha" -o "$ARCH" = "ppc" -o \
-       "$CONFIG_ARM" = "y" ]; then
-    if [ "$CONFIG_ARM" != "y" -o "$CONFIG_ARCH_ACORN" != "y" ] ; then
-      tristate 'Deprecated almost-VGA support (text only - use normal VGA console instead)' CONFIG_FB_VGA
-    fi
-  fi
   if [ "$ARCH" = "alpha" ]; then
     tristate 'TGA framebuffer support' CONFIG_FB_TGA
   fi
   if [ "$ARCH" = "i386" ]; then
     bool 'VESA VGA graphics console' CONFIG_FB_VESA
     define_bool CONFIG_VIDEO_SELECT y
-    tristate 'MDA dual-headed support' CONFIG_FB_MDA
   fi
   if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
     bool 'SBUS and UPA framebuffers' CONFIG_FB_SBUS
@@ -141,28 +132,33 @@
 	 "$CONFIG_FB_VESA" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" -o \
 	 "$CONFIG_FB_TCX" = "y" -o "$CONFIG_FB_CGTHREE" = "y" -o \
 	 "$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
-	 "$CONFIG_FB_HP300" = "y" ]; then
+	 "$CONFIG_FB_CGFOURTEEN" = "y" -o \
+	 "$CONFIG_FB_VALKYRIE" = "y" ]; then
       define_bool CONFIG_FBCON_CFB8 y
     else
       if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \
-	   "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
+	   "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_MAC" = "m" -o \
 	   "$CONFIG_FB_OF" = "m" -o "$CONFIG_FB_TGA" = "m" -o \
 	   "$CONFIG_FB_VESA" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \
 	   "$CONFIG_FB_TCX" = "m" -o "$CONFIG_FB_CGTHREE" = "m" -o \
-	   "$CONFIG_FB_CONTROL" = "m" ]; then
+	   "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
+	   "$CONFIG_FB_CGFOURTEEN" = "m" -o \
+	   "$CONFIG_FB_VALKYRIE" = "m" ]; then
 	define_bool CONFIG_FBCON_CFB8 m
       fi
     fi
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATY" = "y" -o \
 	 "$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
 	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_TBOX" = "y" -o \
-	 "$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" ]; then
+	 "$CONFIG_FB_CONTROL" = "y" -o "$CONFIG_FB_CLGEN" = "y" -o \
+	 "$CONFIG_FB_VALKYRIE" = "y" ]; then
       define_bool CONFIG_FBCON_CFB16 y
     else
       if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
 	   "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_VESA" = "m" -o \
 	   "$CONFIG_FB_VIRTUAL" = "m" -o "$CONFIG_FB_TBOX" = "m" -o \
-	   "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" ]; then
+	   "$CONFIG_FB_CONTROL" = "m" -o "$CONFIG_FB_CLGEN" = "m" -o \
+ 	   "$CONFIG_FB_VALKYRIE" = "m" ]; then
 	define_bool CONFIG_FBCON_CFB16 m
       fi
     fi
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/Makefile m68k/drivers/video/Makefile
--- jes-2.1.119/drivers/video/Makefile	Sun Aug 30 20:40:50 1998
+++ m68k/drivers/video/Makefile	Mon Aug 31 00:46:02 1998
@@ -9,9 +9,6 @@
 # parent makes..
 #
 
-GSPA = gspa
-GSPH2C = gspahextoc
-
 L_TARGET := video.a
 L_OBJS   :=
 M_OBJS   :=
@@ -19,6 +16,9 @@
 MX_OBJS  :=
 MOD_LIST_NAME := VIDEO_MODULES
 
+CONFIG_FBGEN_BUILTIN :=
+CONFIG_FBGEN_MODULE :=
+
 # Frame Buffer Console
 
 ifeq ($(CONFIG_FB),y)
@@ -37,8 +37,7 @@
 
 ifeq ($(CONFIG_FB),y)
   L_OBJS += fonts.o
-  OX_OBJS += fbcon.o fbcmap.o
-# fbgen is not compiled by default since nobody uses it yet, except clgenfb
+  OX_OBJS += fbcon.o fbcmap.o fbmem.o
   ifeq ($(CONFIG_FONT_8x8),y)
     L_OBJS += font_8x8.o
   endif
@@ -104,6 +103,10 @@
 L_OBJS += platinumfb.o
 endif
 
+ifeq ($(CONFIG_FB_VALKYRIE),y)
+L_OBJS += valkyriefb.o
+endif
+
 ifeq ($(CONFIG_FB_CT65550),y)
 L_OBJS += chipsfb.o
 endif
@@ -142,11 +145,11 @@
 
 ifeq ($(CONFIG_FB_CLGEN),y)
 L_OBJS += clgenfb.o
-OX_OBJS += fbgen.o
+CONFIG_FBGEN_BUILTIN = y
 else
   ifeq ($(CONFIG_FB_CLGEN),m)
   M_OBJS += clgenfb.o
-  OX_OBJS += fbgen.o
+  CONFIG_FBGEN_MODULE = y
   endif
 endif
 
@@ -166,26 +169,10 @@
   endif
 endif
 
-ifeq ($(CONFIG_FB_VGA),y)
-L_OBJS += vgafb.o
-else
-  ifeq ($(CONFIG_FB_VGA),m)
-  M_OBJS += vgafb.o
-  endif
-endif
-
 ifeq ($(CONFIG_FB_VESA),y)
 L_OBJS += vesafb.o
 endif
 
-ifeq ($(CONFIG_FB_MDA),y)
-L_OBJS += mdafb.o
-else
-  ifeq ($(CONFIG_FB_MDA),m)
-  M_OBJS += mdafb.o
-  endif
-endif
-
 ifeq ($(CONFIG_FB_VIRGE),y)
 L_OBJS += virgefb.o
 else
@@ -308,6 +295,14 @@
   endif
 endif
 
+ifdef CONFIG_FBGEN_BUILTIN
+OX_OBJS += fbgen.o
+else
+  ifdef CONFIG_FBGEN_MODULE
+  MX_OBJS += fbgen.o
+  endif
+endif
+
 # Generic Low Level Drivers
 
 ifeq ($(CONFIG_FBCON_AFB),y)
@@ -430,12 +425,6 @@
   endif
 endif
 
-# GSP Console
-
-ifdef CONFIG_AMIGA_GSP
-L_OBJS += gspcon.o gspcore.o
-endif
-
 # VGA Text Console
 
 ifdef CONFIG_VGA_CONSOLE
@@ -443,10 +432,6 @@
 endif
 
 include $(TOPDIR)/Rules.make
-
-gspcore.c: gspcore.gsp
-	$(GSPA) $< > $*.hex
-	$(GSPH2C) $*.hex > gspcore.c
 
 promcon_tbl.c: prom.uni
 	../char/conmakehash prom.uni | \
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/S3triofb.c m68k/drivers/video/S3triofb.c
--- jes-2.1.119/drivers/video/S3triofb.c	Sun Aug 30 20:40:50 1998
+++ m68k/drivers/video/S3triofb.c	Mon Aug 31 00:46:02 1998
@@ -45,9 +45,9 @@
 #include <asm/vc_ioctl.h>
 #endif
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "s3blit.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/s3blit.h>
 
 
 #define mem_in8(addr)           in_8((void *)(addr))
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/acornfb.c m68k/drivers/video/acornfb.c
--- jes-2.1.119/drivers/video/acornfb.c	Sun Aug 30 20:40:50 1998
+++ m68k/drivers/video/acornfb.c	Mon Aug 31 00:46:02 1998
@@ -21,10 +21,10 @@
 #include <asm/irq.h>
 #include <asm/uaccess.h>
 
-#include "fbcon-mfb.h"
-#include "fbcon-cfb2.h"
-#include "fbcon-cfb4.h"
-#include "fbcon-cfb8.h"
+#include <video/fbcon-mfb.h>
+#include <video/fbcon-cfb2.h>
+#include <video/fbcon-cfb4.h>
+#include <video/fbcon-cfb8.h>
 
 #define MAX_VIDC20_PALETTE	256
 #define MAX_VIDC_PALETTE	16
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/amifb.c m68k/drivers/video/amifb.c
--- jes-2.1.119/drivers/video/amifb.c	Sun Aug 30 20:40:50 1998
+++ m68k/drivers/video/amifb.c	Mon Aug 31 00:46:02 1998
@@ -61,9 +61,9 @@
 #include <asm/amigaints.h>
 #include <asm/setup.h>
 
-#include "fbcon-afb.h"
-#include "fbcon-ilbm.h"
-#include "fbcon-mfb.h"
+#include <video/fbcon-afb.h>
+#include <video/fbcon-ilbm.h>
+#include <video/fbcon-mfb.h>
 
 
 #define DEBUG
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/atafb.c m68k/drivers/video/atafb.c
--- jes-2.1.119/drivers/video/atafb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/atafb.c	Mon Aug 31 00:46:02 1998
@@ -70,12 +70,12 @@
 #include <linux/fb.h>
 #include <asm/atarikb.h>
 
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-iplan2p2.h"
-#include "fbcon-iplan2p4.h"
-#include "fbcon-iplan2p8.h"
-#include "fbcon-mfb.h"
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-iplan2p2.h>
+#include <video/fbcon-iplan2p4.h>
+#include <video/fbcon-iplan2p8.h>
+#include <video/fbcon-mfb.h>
 
 
 #define SWITCH_ACIA 0x01		/* modes for switch on OverScan */
@@ -682,44 +682,32 @@
 }
 
 
-static int tt_getcolreg(unsigned regno, unsigned *red,
-			unsigned *green, unsigned *blue,
-			unsigned *transp, struct fb_info *info)
+static int tt_getcolreg( unsigned regno, unsigned *red,
+						 unsigned *green, unsigned *blue,
+						 unsigned *transp, struct fb_info *info )
 {
-	int t, col;
-
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
 	if (regno > 255)
 		return 1;
-	t = tt_palette[regno];
-	col = t & 15;
-	col |= col << 4;
-	col |= col << 8;
-	*blue = col;
-	col = (t >> 4) & 15;
-	col |= col << 4;
-	col |= col << 8;
-	*green = col;
-	col = (t >> 8) & 15;
-	col |= col << 4;
-	col |= col << 8;
-	*red = col;
+	*blue = tt_palette[regno];
+	*green = (*blue >> 4) & 0xf;
+	*red = (*blue >> 8) & 0xf;
+	*blue &= 0xf;
 	*transp = 0;
 	return 0;
 }
 
 
-static int tt_setcolreg(unsigned regno, unsigned red,
-			unsigned green, unsigned blue,
-			unsigned transp, struct fb_info *info)
+static int tt_setcolreg( unsigned regno, unsigned red,
+						 unsigned green, unsigned blue,
+						 unsigned transp, struct fb_info *info )
 {
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) == TT_SHIFTER_STHIGH)
 		regno += 254;
 	if (regno > 255)
 		return 1;
-	tt_palette[regno] = (((red >> 12) << 8) | ((green >> 12) << 4) |
-			     (blue >> 12));
+	tt_palette[regno] = (red << 8) | (green << 4) | blue;
 	if ((shifter_tt.tt_shiftmode & TT_SHIFTER_MODEMASK) ==
 		TT_SHIFTER_STHIGH && regno == 254)
 		tt_palette[0] = 0;
@@ -782,6 +770,9 @@
 /* Default hsync timing [mon_type] in picoseconds */
 static long h_syncs[4] = {3000000, 4875000, 4000000, 4875000};
 
+#ifdef FBCON_HAS_CFB16
+static u16 fbcon_cfb16_cmap[16];
+#endif
 
 static inline int hxx_prescale(struct falcon_hw *hw)
 {
@@ -2529,6 +2520,7 @@
 #ifdef FBCON_HAS_CFB16
 		    case 16:
 			display->dispsw = &fbcon_cfb16;
+			display->dispsw_data = fbcon_cfb16_cmap;
 			break;
 #endif
 		}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/atyfb.c m68k/drivers/video/atyfb.c
--- jes-2.1.119/drivers/video/atyfb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/atyfb.c	Mon Aug 31 00:46:02 1998
@@ -1,4 +1,4 @@
-/*
+/*  $Id: atyfb.c,v 1.74 1998/08/23 14:20:38 mj Exp $
  *  linux/drivers/video/atyfb.c -- Frame buffer device for ATI Mach64
  *
  *	Copyright (C) 1997-1998  Geert Uytterhoeven
@@ -63,7 +63,7 @@
 #if defined(CONFIG_PMAC) || defined(CONFIG_CHRP)
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
-#include "macmodes.h"
+#include <video/macmodes.h>
 #endif
 #ifdef __sparc__
 #include <asm/pbm.h>
@@ -71,12 +71,13 @@
 #include <asm/uaccess.h>
 #endif
 
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb24.h>
+#include <video/fbcon-cfb32.h>
+
 #include "aty.h"
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb24.h"
-#include "fbcon-cfb32.h"
 
 
 /*
@@ -87,11 +88,6 @@
 
 #define GUI_RESERVE	0x00001000
 
-#define CLASS_GX	1
-#define CLASS_CT	2
-#define CLASS_VT	3
-#define CLASS_GT	4
-
 
 #ifndef __powerpc__
 #define eieio()		/* Enforce In-order Execution of I/O */
@@ -169,6 +165,7 @@
 };
 
 #define DEFAULT_CURSOR_BLINK_RATE	(20)
+#define CURSOR_DRAW_DELAY		(2)
 
 struct aty_cursor {
     int	enable;
@@ -211,22 +208,18 @@
     u8 clk_type;
     u8 mem_refresh_rate;
     struct display disp;
-#ifdef FBCON_HAS_CFB8
-    struct display_switch disp8;
-    struct display_switch adisp8;
-#endif
+    struct display_switch dispsw;
+    union {
 #ifdef FBCON_HAS_CFB16
-    struct display_switch disp16;
-    struct display_switch adisp16;
+	u16 cfb16[16];
 #endif
 #ifdef FBCON_HAS_CFB24
-    struct display_switch disp24;
-    struct display_switch adisp24;
+	u32 cfb24[16];
 #endif
 #ifdef FBCON_HAS_CFB32
-    struct display_switch disp32;
-    struct display_switch adisp32;
+	u32 cfb32[16];
 #endif
+    } fbcon_cmap;
 #ifdef __sparc__
     u8 open;
     u8 mmaped;
@@ -401,6 +394,8 @@
 
 static char atyfb_name[16] = "ATY Mach64";
 static char fontname[40] __initdata = { 0 };
+static char curblink __initdata = 1;
+static char noaccel __initdata = 0;
 
 static const u32 ref_clk_per = 1000000000000ULL/14318180;
 
@@ -533,6 +528,7 @@
 		aty_ld_le32(GEN_TEST_CNTL, info) | GUI_ENGINE_ENABLE, info);
     /* ensure engine is not locked up by clearing any FIFO or */
     /* HOST errors */
+    aty_st_le32(0xf4,0xa955,info);
     aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, info) | BUS_HOST_ERR_ACK |
 			  BUS_FIFO_ERR_ACK, info);
 }
@@ -638,6 +634,12 @@
     aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, info);
     aty_st_le32(DP_CHAIN_MASK, par->crtc.dp_chain_mask, info);
 
+    wait_for_fifo(5, info);
+    aty_st_le32(SCALE_3D_CNTL, 0, info);
+    aty_st_le32(Z_CNTL, 0, info);
+    aty_st_le32(CRTC_INT_CNTL, aty_ld_le32(CRTC_INT_CNTL, info) & ~0x20, info);
+    aty_st_le32(GUI_TRAJ_CNTL, 0x100023, info);
+
     /* insure engine is idle before leaving */
     wait_for_idle(info);
 }
@@ -805,8 +807,9 @@
 }
 
 static void
-aty_set_cursor(struct fb_info_aty *fb)
+aty_set_cursor(struct fb_info_aty *fb, int on)
 {
+	struct atyfb_par *par = &fb->current_par;
 	struct aty_cursor *c = fb->cursor;
 	u16 xoff, yoff;
 	int x, y;
@@ -819,8 +822,8 @@
 		return;
 #endif
 
-	if (c->on) {
-		x = c->pos.x - c->hot.x;
+	if (on) {
+		x = c->pos.x - c->hot.x - par->crtc.xoffset;
 		if (x < 0) {
 			xoff = -x;
 			x = 0;
@@ -828,7 +831,7 @@
 			xoff = 0;
 		}
 
-		y = c->pos.y - c->hot.y;
+		y = c->pos.y - c->hot.y - par->crtc.yoffset;
 		if (y < 0) {
 			yoff = -y;
 			y = 0;
@@ -844,11 +847,12 @@
 		aty_st_le32(GEN_TEST_CNTL, aty_ld_le32(GEN_TEST_CNTL, fb)
 						       | HWCURSOR_ENABLE, fb);
 	} else {
-		wait_for_fifo(4, fb);
+		wait_for_fifo(1, fb);
 		aty_st_le32(GEN_TEST_CNTL,
 			    aty_ld_le32(GEN_TEST_CNTL, fb) & ~HWCURSOR_ENABLE,
 			    fb);
 	}
+	wait_for_idle(fb);
 }
 
 static void
@@ -864,7 +868,7 @@
 
 	if (fb->cursor->vbl_cnt && --fb->cursor->vbl_cnt == 0) {
 		fb->cursor->on ^= 1;
-		aty_set_cursor(fb);
+		aty_set_cursor(fb, fb->cursor->on);
 		fb->cursor->vbl_cnt = fb->cursor->blink_rate;
 	}
 
@@ -889,32 +893,33 @@
 
 	x *= fontwidth(p);
 	y *= fontheight(p);
-	if (c->pos.x == x && c->pos.y == y && (mode == CM_ERASE) == !c->on)
+	if (c->pos.x == x && c->pos.y == y && (mode == CM_ERASE) == !c->enable)
 		return;
 
 	c->enable = 0;
+	if (c->on)
+		aty_set_cursor(fb, 0);
 	c->pos.x = x;
 	c->pos.y = y;
 
 	switch (mode) {
 	case CM_ERASE:
 		c->on = 0;
-		aty_set_cursor(fb);
 		break;
 
 	case CM_DRAW:
 	case CM_MOVE:
-		c->on = 1;
-		aty_set_cursor(fb);
-
-		c->vbl_cnt = c->blink_rate;
+		if (c->on)
+			aty_set_cursor(fb, 1);
+		else
+			c->vbl_cnt = CURSOR_DRAW_DELAY;
 		c->enable = 1;
 		break;
 	}
 }
 
-static struct aty_cursor *
-aty_init_cursor(struct fb_info_aty *fb)
+__initfunc(static struct aty_cursor *
+aty_init_cursor(struct fb_info_aty *fb))
 {
 	struct aty_cursor *cursor;
 	unsigned long addr;
@@ -932,7 +937,8 @@
 	memset(cursor->timer, 0, sizeof(*cursor->timer));
 
 	cursor->blink_rate = DEFAULT_CURSOR_BLINK_RATE;
-	cursor->offset = fb->total_vram - 0x1000;
+	fb->total_vram -= PAGE_SIZE;
+	cursor->offset = fb->total_vram;
 
 #ifdef __sparc__
 	addr = fb->frame_buffer - 0x800000 + cursor->offset;
@@ -947,11 +953,13 @@
 #endif
 #endif
 
-	init_timer(cursor->timer);
-	cursor->timer->expires = jiffies + (HZ / 50);
-	cursor->timer->data = (unsigned long)fb;
-	cursor->timer->function = aty_cursor_timer_handler;
-	add_timer(cursor->timer);
+	if (curblink) {
+		init_timer(cursor->timer);
+		cursor->timer->expires = jiffies + (HZ / 50);
+		cursor->timer->data = (unsigned long)fb;
+		cursor->timer->function = aty_cursor_timer_handler;
+		add_timer(cursor->timer);
+	}
 
 	return cursor;
 }
@@ -1282,10 +1290,6 @@
 	default:
 	    FAIL("Invalid pixel width");
     }
-    var->red.msb_right = 0;
-    var->green.msb_right = 0;
-    var->blue.msb_right = 0;
-    var->transp.msb_right = 0;
 
     /* output */
     var->xres = xres;
@@ -1752,7 +1756,7 @@
 
     if ((err = aty_var_to_crtc(info, var, &par->crtc)))
 	return err;
-    if ((Gx == GX_PCI_ID) || (Gx == CX_PCI_ID))
+    if ((Gx == GX_CHIP_ID) || (Gx == CX_CHIP_ID))
 	switch (info->clk_type) {
 	    case CLK_ATI18818_1:
 		err = aty_var_to_pll_18818(var->pixclock, &par->pll.gx);
@@ -1790,7 +1794,7 @@
 
     if ((err = aty_crtc_to_var(&par->crtc, var)))
 	return err;
-    if ((Gx == GX_PCI_ID) || (Gx == CX_PCI_ID))
+    if ((Gx == GX_CHIP_ID) || (Gx == CX_CHIP_ID))
 	err = aty_pll_gx_to_var(&par->pll.gx, &var->pixclock);
     else
 	err = aty_pll_ct_to_var(&par->pll.ct, &var->pixclock);
@@ -2008,32 +2012,44 @@
 	    display->can_soft_blank = 1;
 	    display->inverse = 0;
 	    accel = var->accel_flags & FB_ACCELF_TEXT;
+	    display->dispsw = &info->dispsw;
 	    switch (par.crtc.bpp) {
 #ifdef FBCON_HAS_CFB8
 		case 8:
-		    display->dispsw = accel ? &info->adisp8 : &info->disp8;
+		    info->dispsw = accel ? fbcon_aty8 : fbcon_cfb8;
 		    break;
 #endif
 #ifdef FBCON_HAS_CFB16
 		case 16:
-		    display->dispsw = accel ? &info->adisp16 : &info->disp16;
+		    info->dispsw = accel ? fbcon_aty16 : fbcon_cfb16;
+		    display->dispsw_data = info->fbcon_cmap.cfb16;
 		    break;
 #endif
 #ifdef FBCON_HAS_CFB24
 		case 24:
-		    display->dispsw = accel ? &info->adisp24 : &info->disp24;
+		    info->dispsw = accel ? fbcon_aty24 : fbcon_cfb24;
+		    display->dispsw_data = info->fbcon_cmap.cfb24;
 		    break;
 #endif
 #ifdef FBCON_HAS_CFB32
 		case 32:
-		    display->dispsw = accel ? &info->adisp32 : &info->disp32;
+		    info->dispsw = accel ? fbcon_aty32 : fbcon_cfb32;
+		    display->dispsw_data = info->fbcon_cmap.cfb32;
 		    break;
 #endif
 		default:
 		    display->dispsw = NULL;
 		    break;
 	    }
-	    display->scrollmode = accel ? 0 : SCROLL_YREDRAW;
+	    if (info->cursor) {
+		info->dispsw.cursor = atyfb_cursor;
+		info->dispsw.set_font = atyfb_set_font;
+	    }
+
+	    if (accel)
+	    	display->scrollmode = (info->bus_type == PCI) ? SCROLL_YNOMOVE : 0;
+	    else
+	    	display->scrollmode = SCROLL_YREDRAW;
 	    if (info->fb_info.changevar)
 		(*info->fb_info.changevar)(con);
 	}
@@ -2295,7 +2311,7 @@
 	printk("atyfb: Unknown mach64 0x%04x\n", Gx);
 	return 0;
     } else
-	printk("atyfb: %s [0x%04x rev 0x%2x] ", chipname, Gx, Rev);
+	printk("atyfb: %s [0x%04x rev 0x%02x] ", chipname, Gx, Rev);
     if ((Gx == GX_CHIP_ID) || (Gx == CX_CHIP_ID)) {
 	info->bus_type = (aty_ld_le32(CONFIG_STAT0, info) >> 0) & 0x07;
 	info->ram_type = (aty_ld_le32(CONFIG_STAT0, info) >> 3) & 0x07;
@@ -2369,7 +2385,6 @@
 	info->mem_refresh_rate = 6;	/* 110 = 80 Mhz - 100 Mhz */
     else
 	info->mem_refresh_rate = 7;	/* 111 = 100 Mhz and above */
-    printk("%d MHz PLL, %d Mhz MCLK\n", pll, mclk);
     info->pll_per = 1000000/pll;
     info->mclk_per = 1000000/mclk;
 
@@ -2424,6 +2439,15 @@
 		info->total_vram = 0x80000;
 	}
 
+    if (Gx == GI_CHIP_ID) {
+	if (aty_ld_le32(CONFIG_STAT1, info) & 0x40000000)
+	  info->total_vram += 0x400000;
+    }
+
+    printk("%d%c %d MHz PLL, %d Mhz MCLK\n", 
+    	   info->total_vram == 0x80000 ? 512 : (info->total_vram >> 20), 
+    	   info->total_vram == 0x80000 ? 'K' : 'M', pll, mclk);
+    
     if (info->bus_type == ISA)
 	if ((info->total_vram == 0x400000) || (info->total_vram == 0x800000)) {
 	    /* protect GUI-regs if complete Aperture is VRAM */
@@ -2456,7 +2480,18 @@
 #else /* !CONFIG_PMAC && !CONFIG_CHRP */
     var = default_var;
 #endif /* !CONFIG_PMAC && !CONFIG_CHRP */
-    var.accel_flags |= FB_ACCELF_TEXT;
+    if (noaccel)
+        var.accel_flags &= ~FB_ACCELF_TEXT;
+    else
+        var.accel_flags |= FB_ACCELF_TEXT;
+
+    if (var.yres == var.yres_virtual) {
+	u32 vram = (info->total_vram - (PAGE_SIZE << 2));
+	var.yres_virtual = ((vram * 8) / var.bits_per_pixel) / var.xres_virtual;
+	if (var.yres_virtual < var.yres)
+		var.yres_virtual = var.yres;
+    }
+
     if (atyfb_decode_var(&var, &info->default_par, info)) {
 	printk("atyfb: can't set default video mode\n");
 	return 0;
@@ -2481,56 +2516,14 @@
 	info->palette[j].blue = default_blu[k];
     }
 
-#ifdef FBCON_HAS_CFB8
-    info->disp8 = fbcon_cfb8;
-    info->adisp8 = fbcon_aty8;
-#endif
-#ifdef FBCON_HAS_CFB16
-    info->disp16 = fbcon_cfb16;
-    info->adisp16 = fbcon_aty16;
-#endif
-#ifdef FBCON_HAS_CFB24
-    info->disp24 = fbcon_cfb24;
-    info->adisp24 = fbcon_aty24;
-#endif
-#ifdef FBCON_HAS_CFB32
-    info->disp32 = fbcon_cfb32;
-    info->adisp32 = fbcon_aty32;
-#endif
-
-    if ((Gx == VT_CHIP_ID) || (Gx == GT_CHIP_ID) || (Gx == GU_CHIP_ID) ||
-	(Gx == LG_CHIP_ID) || (Gx == GB_CHIP_ID) || (Gx == GD_CHIP_ID) ||
-	(Gx == GI_CHIP_ID) || (Gx == GP_CHIP_ID) || (Gx == GQ_CHIP_ID) ||
-	(Gx == VU_CHIP_ID)) {
+    if (Gx != GX_CHIP_ID && Gx != CX_CHIP_ID) {
 	info->cursor = aty_init_cursor(info);
 	if (info->cursor) {
-#ifdef FBCON_HAS_CFB8
-	    info->disp8.cursor = atyfb_cursor;
-	    info->disp8.set_font = atyfb_set_font;
-	    info->adisp8.cursor = atyfb_cursor;
-	    info->adisp8.set_font = atyfb_set_font;
-#endif
-#ifdef FBCON_HAS_CFB16
-	    info->disp16.cursor = atyfb_cursor;
-	    info->disp16.set_font = atyfb_set_font;
-	    info->adisp16.cursor = atyfb_cursor;
-	    info->adisp16.set_font = atyfb_set_font;
-#endif
-#ifdef FBCON_HAS_CFB24
-	    info->disp24.cursor = atyfb_cursor;
-	    info->disp24.set_font = atyfb_set_font;
-	    info->adisp24.cursor = atyfb_cursor;
-	    info->adisp24.set_font = atyfb_set_font;
-#endif
-#ifdef FBCON_HAS_CFB32
-	    info->disp32.cursor = atyfb_cursor;
-	    info->disp32.set_font = atyfb_set_font;
-	    info->adisp32.cursor = atyfb_cursor;
-	    info->adisp32.set_font = atyfb_set_font;
-#endif
+	    info->dispsw.cursor = atyfb_cursor;
+	    info->dispsw.set_font = atyfb_set_font;
 	}
     }
-
+    
     atyfb_set_var(&var, -1, &info->fb_info);
 
     if (register_framebuffer(&info->fb_info) < 0)
@@ -2607,6 +2600,7 @@
 	    if (!info->mmap_map) {
 		printk("atyfb_init: can't alloc mmap_map\n");
 		kfree(info);
+		return;
 	    }
 	    memset(info->mmap_map, 0, j * sizeof(*info->mmap_map));
 
@@ -2910,16 +2904,32 @@
 				break;
 		memcpy(fontname, this_opt + 5, i);
 		fontname[i] = 0;
+	} else if (!strncmp(this_opt, "noblink", 7)) {
+		curblink = 0;
+	} else if (!strncmp(this_opt, "noaccel", 7)) {
+		noaccel = 1;
 	}
 #if defined(CONFIG_PMAC) || defined(CONFIG_CHRP)
-	if (!strncmp(this_opt, "vmode:", 6)) {
+	else if (!strncmp(this_opt, "vmode:", 6)) {
 	    unsigned int vmode = simple_strtoul(this_opt+6, NULL, 0);
 	    if (vmode > 0 && vmode <= VMODE_MAX)
 		default_vmode = vmode;
 	} else if (!strncmp(this_opt, "cmode:", 6)) {
 	    unsigned int cmode = simple_strtoul(this_opt+6, NULL, 0);
-	    if (cmode <= CMODE_32)
-		default_cmode = cmode;
+	    switch (cmode) {
+		case 0:
+		case 8:
+		    default_cmode = CMODE_8;
+		    break;
+		case 15:
+		case 16:
+		    default_cmode = CMODE_16;
+		    break;
+		case 24:
+		case 32:
+		    default_cmode = CMODE_32;
+		    break;
+	    }
 	}
 #endif
 #ifdef CONFIG_ATARI
@@ -2927,7 +2937,7 @@
 	 * Why do we need this silly Mach64 argument?
 	 * We are already here because of mach64= so its redundant.
 	 */
-	if (MACH_IS_ATARI && (!strncmp(this_opt, "Mach64:", 7))) {
+	else if (MACH_IS_ATARI && (!strncmp(this_opt, "Mach64:", 7))) {
 	    static unsigned char m64_num;
 	    static char mach64_str[80];
 	    strncpy(mach64_str, this_opt+7, 80);
@@ -3022,19 +3032,6 @@
 }
 
     /*
-     *  Update the `var' structure (called by fbcon.c)
-     */
-
-static int atyfbcon_updatevar(int con, struct fb_info *fb)
-{
-    struct fb_info_aty *info = (struct fb_info_aty *)fb;
-
-    info->current_par.crtc.yoffset = fb_display[con].var.yoffset;
-    set_off_pitch(&info->current_par, info);
-    return 0;
-}
-
-    /*
      *  Blank the display.
      */
 
@@ -3127,18 +3124,20 @@
 	switch (info->current_par.crtc.bpp) {
 #ifdef FBCON_HAS_CFB16
 	    case 16:
-		fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | regno;
+		info->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) |
+						regno;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB24
 	    case 24:
-		fbcon_cfb24_cmap[regno] = (regno << 16) | (regno << 8) | regno;
+		info->fbcon_cmap.cfb24[regno] = (regno << 16) | (regno << 8) |
+						regno;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB32
 	    case 32:
 		i = (regno << 8) | regno;
-		fbcon_cfb32_cmap[regno] = (i << 16) | i;
+		info->fbcon_cmap.cfb32[regno] = (i << 16) | i;
 		break;
 #endif
 	    }
@@ -3240,6 +3239,50 @@
     draw_rect(dstx, dsty, width, height, info);
 }
 
+    /*
+     *  Update the `var' structure (called by fbcon.c)
+     */
+
+static int atyfbcon_updatevar(int con, struct fb_info *fb)
+{
+    struct fb_info_aty *info = (struct fb_info_aty *)fb;
+    struct atyfb_par *par = &info->current_par;
+    struct display *p = &fb_display[con];
+    struct vc_data *conp = p->conp;
+    u32 yres, yoffset, sy, height;
+
+    yres = ((par->crtc.v_tot_disp >> 16) & 0x7ff) + 1;
+    yoffset = fb_display[con].var.yoffset;
+
+    sy = (conp->vc_rows + p->yscroll) * fontheight(p);
+    height = yres - conp->vc_rows * fontheight(p);
+
+    if (height && (yoffset + yres > sy)) {
+	u32 xres, xoffset;
+	u32 bgx;
+
+	xres = (((par->crtc.h_tot_disp >> 16) & 0xff) + 1) * 8;
+	xoffset = fb_display[con].var.xoffset;
+
+
+	bgx = attr_bgcol_ec(p, conp);
+	bgx |= (bgx << 8);
+	bgx |= (bgx << 16);
+
+	if (sy + height > par->crtc.vyres) {
+	    wait_for_fifo(1, info);
+	    aty_st_le32(SC_BOTTOM, sy + height - 1, info);
+	}
+	aty_rectfill(xoffset, sy, xres, height, bgx, info);
+    }
+
+    if (info->cursor && (yoffset + yres <= sy))
+	atyfb_cursor(p, CM_ERASE, info->cursor->pos.x, info->cursor->pos.y);
+
+    info->current_par.crtc.yoffset = yoffset;
+    set_off_pitch(&info->current_par, info);
+    return 0;
+}
 
     /*
      *  Text console acceleration
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/bwtwofb.c m68k/drivers/video/bwtwofb.c
--- jes-2.1.119/drivers/video/bwtwofb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/bwtwofb.c	Mon Aug 31 00:46:02 1998
@@ -1,4 +1,4 @@
-/* $Id: bwtwofb.c,v 1.4 1998/08/10 09:08:30 jj Exp $
+/* $Id: bwtwofb.c,v 1.5 1998/08/23 14:20:40 mj Exp $
  * bwtwofb.c: BWtwo frame buffer driver
  *
  * Copyright (C) 1998 Jakub Jelinek   (jj@ultra.linux.cz)
@@ -23,13 +23,13 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 #ifndef __sparc_v9__
 #include <asm/sun4paddr.h>
 #endif
 
-#include "fbcon-mfb.h"
+#include <video/fbcon-mfb.h>
 
 /* OBio addresses for the bwtwo registers */
 #define BWTWO_REGISTER_OFFSET 0x400000
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/cgfourteenfb.c m68k/drivers/video/cgfourteenfb.c
--- jes-2.1.119/drivers/video/cgfourteenfb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/cgfourteenfb.c	Mon Aug 31 00:46:02 1998
@@ -1,4 +1,4 @@
-/* $Id: cgfourteenfb.c,v 1.1 1998/07/28 13:08:32 jj Exp $
+/* $Id: cgfourteenfb.c,v 1.2 1998/08/23 14:20:42 mj Exp $
  * cgfourteenfb.c: CGfourteen frame buffer driver
  *
  * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -20,12 +20,12 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 
-#include "fbcon-cfb8.h"
+#include <video/fbcon-cfb8.h>
 
 #define CG14_MCR_INTENABLE_SHIFT	7
 #define CG14_MCR_INTENABLE_MASK		0x80
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/cgsixfb.c m68k/drivers/video/cgsixfb.c
--- jes-2.1.119/drivers/video/cgsixfb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/cgsixfb.c	Mon Aug 31 00:46:02 1998
@@ -1,4 +1,4 @@
-/* $Id: cgsixfb.c,v 1.9 1998/07/29 10:05:49 jj Exp $
+/* $Id: cgsixfb.c,v 1.10 1998/08/23 14:20:44 mj Exp $
  * cgsixfb.c: CGsix (GX,GXplus) frame buffer driver
  *
  * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -6,7 +6,6 @@
  * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -22,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 
 /* Offset of interesting structures in the OBIO space */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/cgthreefb.c m68k/drivers/video/cgthreefb.c
--- jes-2.1.119/drivers/video/cgthreefb.c	Mon Aug 10 09:30:15 1998
+++ m68k/drivers/video/cgthreefb.c	Mon Aug 31 00:46:02 1998
@@ -1,4 +1,4 @@
-/* $Id: cgthreefb.c,v 1.1 1998/07/21 14:50:47 jj Exp $
+/* $Id: cgthreefb.c,v 1.2 1998/08/23 14:20:46 mj Exp $
  * cgthreefb.c: CGthree frame buffer driver
  *
  * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -21,10 +21,10 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 
-#include "fbcon-cfb8.h"
+#include <video/fbcon-cfb8.h>
 
 /* Control Register Constants */
 #define CG3_CR_ENABLE_INTS      0x80
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/chipsfb.c m68k/drivers/video/chipsfb.c
--- jes-2.1.119/drivers/video/chipsfb.c	Sun Aug 30 20:40:51 1998
+++ m68k/drivers/video/chipsfb.c	Mon Aug 31 00:46:02 1998
@@ -38,10 +38,10 @@
 #include <asm/adb.h>
 #include <asm/pmu.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "macmodes.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/macmodes.h>
 
 static int currcon = 0;
 
@@ -62,6 +62,9 @@
 #ifdef CONFIG_PMAC_PBOOK
 	unsigned char *save_framebuffer;
 #endif
+#ifdef FBCON_HAS_CFB16
+	u16 fbcon_cfb16_cmap[16];
+#endif
 };
 
 #define write_xr(num,val)	{ out_8(p->io_base + 0x3D6, num); out_8(p->io_base + 0x3D7, val); }
@@ -303,7 +306,7 @@
 
 #ifdef FBCON_HAS_CFB16
 	if (regno < 16)
-		fbcon_cfb16_cmap[regno] = (red << 10) | (green << 5) | blue;
+		p->fbcon_cfb16_cmap[regno] = (red << 10) | (green << 5) | blue;
 #endif
 
     return 0;
@@ -345,6 +348,7 @@
 		
 #ifdef FBCON_HAS_CFB16
 		disp->dispsw = &fbcon_cfb16;
+		disp->dispsw_data = p->fbcon_cfb16_cmap;
 #else
 		disp->dispsw = NULL;
 #endif
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/clgenfb.c m68k/drivers/video/clgenfb.c
--- jes-2.1.119/drivers/video/clgenfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/clgenfb.c	Mon Aug 31 00:46:03 1998
@@ -16,14 +16,13 @@
 #include <asm/amigahw.h>
 #include <asm/pgtable.h>
 #include <asm/delay.h>
-#include "fbcon.h"
 
-#include "fbcon.h"
-#include "fbcon-mfb.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb24.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-mfb.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb24.h>
+#include <video/fbcon-cfb32.h>
 
 #include "clgenfb.h"
 
@@ -92,6 +91,17 @@
     unsigned char SFR; /* Shadow of special function register */
     
     struct clgenfb_par currentmode;
+    union {
+#ifdef FBCON_HAS_CFB16
+	u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB24
+	u32 cfb24[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+	u32 cfb32[16];
+#endif
+    } fbcon_cmap;
 };
 
 static struct display disp;
@@ -190,8 +200,8 @@
 			      struct fb_info_gen *info);
 static int  clgen_blank(int blank_mode, struct fb_info_gen *info);
 
-static struct display_switch *clgen_get_dispsw(const void *par,
-					       struct fb_info_gen *info);
+static void clgen_set_dispsw(const void *par, struct display *disp,
+			     struct fb_info_gen *info);
 
 /* function table of the above functions */
 static struct fbgen_hwswitch clgen_hwswitch = 
@@ -206,7 +216,7 @@
     clgen_setcolreg,
     clgen_pan_display,
     clgen_blank,
-    clgen_get_dispsw
+    clgen_set_dispsw
 };
 
 /* Text console acceleration */
@@ -1358,10 +1368,11 @@
 	}
 }
 
-static struct display_switch *clgen_get_dispsw(const void *par,
-					     struct fb_info_gen *info)
+static void clgen_set_dispsw(const void *par, struct display *disp,
+			     struct fb_info_gen *info)
 {
     struct clgenfb_par *_par = (struct clgenfb_par*) par;
+    struct clgenfb_info *info2 = (struct clgenfb_info *)info;
 
     printk("clgen_get_dispsw(): ");
     switch (_par->var.bits_per_pixel)
@@ -1369,32 +1380,41 @@
 #ifdef FBCON_HAS_MFB
     case 1:
 	printk("monochrome\n");
-	return &fbcon_mfb;
+	disp->dispsw = &fbcon_mfb;
+	break;
 #endif
 #ifdef FBCON_HAS_CFB8
     case 8:
 	printk("8 bit color depth\n");
-	return &fbcon_clgen_8;
+	disp->dispsw = &fbcon_clgen_8;
+	break;
 #endif
 #ifdef FBCON_HAS_CFB16
     case 16:
 	printk("16 bit color depth\n");
-	return &fbcon_cfb16;
+	disp->dispsw = &fbcon_cfb16;
+	disp->dispsw_data = info2->fbcon_cmap.cfb16;
+	break;
 #endif
 #ifdef FBCON_HAS_CFB24
     case 24:
 	printk("24 bit color depth\n");
-	return &fbcon_cfb24;
+	disp->dispsw = &fbcon_cfb24;
+	disp->dispsw_data = info2->fbcon_cmap.cfb24;
+	break;
 #endif
 #ifdef FBCON_HAS_CFB32
     case 32:
 	printk("32 bit color depth\n");
-	return &fbcon_cfb32;
+	disp->dispsw = &fbcon_cfb32;
+	disp->dispsw_data = info2->fbcon_cmap.cfb32;
+	break;
 #endif
 
     default:
 	printk("unsupported color depth\n");
-	return NULL;
+	disp->dispsw = NULL;
+	break;
     }
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/controlfb.c m68k/drivers/video/controlfb.c
--- jes-2.1.119/drivers/video/controlfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/controlfb.c	Mon Aug 31 00:46:03 1998
@@ -49,12 +49,12 @@
 #include <asm/adb.h>
 #include <asm/cuda.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb32.h>
+#include <video/macmodes.h>
 
-#include "macmodes.h"
 #include "controlfb.h"
 
 static int currcon = 0;
@@ -88,6 +88,14 @@
 	
 	int			sense, control_use_bank2;
 	unsigned long		total_vram;
+	union {
+#ifdef FBCON_HAS_CFB16
+		u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+		u32 cfb32[16];
+#endif
+	} fbcon_cmap;
 };
 
 /*
@@ -198,7 +206,7 @@
 	}
 	
 	if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) {
-		printk("Not activating, in control_set_var.\n");
+		/* printk("Not activating, in control_set_var.\n"); */
 		control_par_to_var(&par, var);
 		return 0;
 	}
@@ -211,7 +219,7 @@
 		p->var = disp->var = *var;
 		return 0;
 	}
-printk("Original bpp is %d, new bpp %d.\n", p->var.bits_per_pixel, var->bits_per_pixel);
+	/* printk("Original bpp is %d, new bpp %d.\n", p->var.bits_per_pixel, var->bits_per_pixel); */
 	/* OK, we're getting here at the right times... */
 	p->par = par;
 	control_par_to_var(&par, var);
@@ -375,19 +383,19 @@
 #ifdef FBCON_HAS_CFB16
 			case 16:
 #if 0
-				fbcon_cfb16_cmap[regno] = (red << 10) | (green << 5) | blue;
+				p->fbcon_cmap.cfb16[regno] = (red << 10) | (green << 5) | blue;
 #else
-				fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | regno;
+				p->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) | regno;
 #endif
 				break;
 #endif
 #ifdef FBCON_HAS_CFB32
 			case 32:
 #if 0
-				fbcon_cfb32_cmap[regno] = (red << 16) | (green << 8) | blue;
+				p->fbcon_cmap.cfb32[regno] = (red << 16) | (green << 8) | blue;
 #else
 				i = (regno << 8) | regno;
-				fbcon_cfb32_cmap[regno] = (i << 16) | i;
+				p->fbcon_cmap.cfb32[regno] = (i << 16) | i;
 				/* I think */
 #endif
 				break;
@@ -446,7 +454,7 @@
 	struct fb_par_control *par = &p->par;
 
 	p->sense = read_control_sense(p);
-	printk("Monitor sense value = 0x%x, ", p->sense);
+	printk(KERN_INFO "Monitor sense value = 0x%x, ", p->sense);
 	/* Try to pick a video mode out of NVRAM if we have one. */
 	par->vmode = nvram_read_byte(NV_VMODE);
 	if(par->vmode <= 0 || par->vmode > VMODE_MAX || !control_reg_init[par->vmode - 1])
@@ -479,7 +487,7 @@
 	}
 	control_set_hardware(p);
 	
-	printk("fb%d: control display adapter\n", GET_FB_IDX(p->info.node));	
+	printk(KERN_INFO "fb%d: control display adapter\n", GET_FB_IDX(p->info.node));	
 }
 
 /* Now how about actually saying, Make it so! */
@@ -529,8 +537,9 @@
 	out_le32(&p->control_regs->reg19.r, 0);
 
 	for (i = 0; i < 16; ++i) {
-		controlfb_setcolreg(color_table[i], default_red[i], default_grn[i],
-			default_blu[i], 0, (struct fb_info *)p);
+		controlfb_setcolreg(color_table[i], default_red[i]<<8,
+				    default_grn[i]<<8, default_blu[i]<<8,
+				    0, (struct fb_info *)p);
 	}
 /* Does the above need to be here each time? -- danj */
 
@@ -574,13 +583,20 @@
 	struct fb_info_control	*p;
 	unsigned long		addr, size;
 	int			i, bank1, bank2;
-	
+
+#if 0
 	if(dp->next != 0)
 		printk("Warning: only using first control display device.\n");
 		/* danj: I have a feeling this no longer applies - if we somehow *
-		 * had two of them, they'd be two framebuffers, right?           */
-	if(dp->n_addrs != 2)
-		panic("expecting 2 address for control (got %d)", dp->n_addrs);
+		 * had two of them, they'd be two framebuffers, right?
+		 * Yep. - paulus
+		 */
+#endif
+
+	if(dp->n_addrs != 2) {
+		printk(KERN_ERR "expecting 2 address for control (got %d)", dp->n_addrs);
+		return;
+	}
 	p = kmalloc(sizeof(*p), GFP_ATOMIC);
 	if (p == 0)
 		return;
@@ -664,7 +680,7 @@
 
 #if 1
 /* This routine takes a user-supplied var, and picks the best vmode/cmode from it. */
-static int control_var_to_par(struct fb_var_screeninfo *var, 
+static int control_var_to_par(struct fb_var_screeninfo *var,
 	struct fb_par_control *par, const struct fb_info *fb_info)
 {
 	int xres = var->xres;
@@ -765,7 +781,7 @@
 }
 #else
 /* This routine takes a user-supplied var, and picks the best vmode/cmode from it. */
-static int control_var_to_par(struct fb_var_screeninfo *var, 
+static int control_var_to_par(struct fb_var_screeninfo *var,
 	struct fb_par_control *par, const struct fb_info *fb_info)
 {
 	struct fb_info_control *p = (struct fb_info_control *) fb_info;
@@ -942,8 +958,28 @@
 	printk(KERN_ERR "Scroll mode not YREDRAW in control_par_to_display!!\n");
 	disp->scrollmode = SCROLL_YREDRAW;
 }
-	disp->dispsw = (par->cmode == CMODE_32) ? &fbcon_cfb32 :
-		((par->cmode == CMODE_16) ? &fbcon_cfb16 : &fbcon_cfb8);
+	switch (par->cmode) {
+#ifdef FBCON_HAS_CFB8
+		case CMODE_8:
+			disp->dispsw = &fbcon_cfb8;
+			break;
+#endif
+#ifdef FBCON_HAS_CFB16
+		case CMODE_16:
+			disp->dispsw = &fbcon_cfb16;
+			disp->dispsw_data = p->fbcon_cmap.cfb16;
+			break;
+#endif
+#ifdef FBCON_HAS_CFB32
+		case CMODE_32:
+			disp->dispsw = &fbcon_cfb32;
+			disp->dispsw_data = p->fbcon_cmap.cfb32;
+			break;
+#endif
+		default:
+			disp->dispsw = NULL;
+			break;
+	}
 }
 
 static void control_init_info(struct fb_info *info, struct fb_info_control *p)
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/creatorfb.c m68k/drivers/video/creatorfb.c
--- jes-2.1.119/drivers/video/creatorfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/creatorfb.c	Mon Aug 31 00:46:03 1998
@@ -1,10 +1,9 @@
-/* $Id: creatorfb.c,v 1.13 1998/08/07 19:10:48 jj Exp $
+/* $Id: creatorfb.c,v 1.14 1998/08/23 14:20:51 mj Exp $
  * creatorfb.c: Creator/Creator3D frame buffer driver
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -20,7 +19,7 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 
 #define	FFB_SFB8R_VOFF		0x00000000
 #define	FFB_SFB8G_VOFF		0x00400000
@@ -358,48 +357,35 @@
 	int i, xy;
 	u8 *fd;
 
-	if (p->fontheightlog) {
-		xy = (yy << (16 + p->fontheightlog));
-		i = ((c & p->charmask) << p->fontheightlog);
+	if (fontheightlog(p)) {
+		xy = (yy << (16 + fontheightlog(p)));
+		i = ((c & p->charmask) << fontheightlog(p));
 	} else {
-		xy = ((yy * p->fontheight) << 16);
-		i = (c & p->charmask) * p->fontheight;
+		xy = ((yy * fontheight(p)) << 16);
+		i = (c & p->charmask) * fontheight(p);
 	}
-#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
-	fd = p->fontdata + i;
-	xy += (xx * 8) + fb->s.ffb.xy_margin;
-#else
-	if (p->fontwidth <= 8)
+	if (fontwidth(p) <= 8)
 		fd = p->fontdata + i;
 	else
 		fd = p->fontdata + (i << 1);
-	if (p->fontwidthlog)
-		xy += (xx << p->fontwidthlog) + fb->s.ffb.xy_margin;
+	if (fontwidthlog(p))
+		xy += (xx << fontwidthlog(p)) + fb->s.ffb.xy_margin;
 	else
-		xy += (xx * p->fontwidth) + fb->s.ffb.xy_margin;
-#endif
-	fbc->ppc = 0x203;
+		xy += (xx * fontwidth(p)) + fb->s.ffb.xy_margin;
 	fbc->fg = ffb_cmap[attr_fgcol(p,c)];
-	fbc->fbc = 0x2000707f;
-	fbc->rop = 0x83;
-	fbc->pmask = 0xffffffff;
 	fbc->bg = ffb_cmap[attr_bgcol(p,c)];
-	fbc->fontw = p->fontwidth;
+	fbc->fontw = fontwidth(p);
 	fbc->fontinc = 0x10000;
 	fbc->fontxy = xy;
-#ifndef CONFIG_FBCON_FONTWIDTH8_ONLY
-	if (p->fontwidth <= 8) {
-#endif
-		for (i = 0; i < p->fontheight; i++)
+	if (fontwidth(p) <= 8) {
+		for (i = 0; i < fontheight(p); i++)
 			fbc->font = *fd++ << 24;
-#ifndef CONFIG_FBCON_FONTWIDTH8_ONLY
 	} else {
-		for (i = 0; i < p->fontheight; i++) {
+		for (i = 0; i < fontheight(p); i++) {
 			fbc->font = *(u16 *)fd << 16;
 			fd += 2;
 		}
 	}
-#endif
 }
 
 static void ffb_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/cyberfb.c m68k/drivers/video/cyberfb.c
--- jes-2.1.119/drivers/video/cyberfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/cyberfb.c	Mon Aug 31 00:46:03 1998
@@ -37,10 +37,10 @@
 #include <asm/pgtable.h>
 #include <asm/amigahw.h>
 
-#include "s3blit.h"
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
+#include <video/s3blit.h>
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
 
 
 #ifdef CYBERFBDEBUG
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/dnfb.c m68k/drivers/video/dnfb.c
--- jes-2.1.119/drivers/video/dnfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/dnfb.c	Mon Aug 31 00:46:03 1998
@@ -14,7 +14,7 @@
 #include <linux/fb.h>
 #include <linux/module.h>
 
-#include "fbcon-mfb.h"
+#include <video/fbcon-mfb.h>
 
 
 /* apollo video HW definitions */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-afb.c m68k/drivers/video/fbcon-afb.c
--- jes-2.1.119/drivers/video/fbcon-afb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-afb.c	Mon Aug 31 00:46:03 1998
@@ -15,8 +15,8 @@
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-afb.h"
+#include <video/fbcon.h>
+#include <video/fbcon-afb.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-afb.h m68k/drivers/video/fbcon-afb.h
--- jes-2.1.119/drivers/video/fbcon-afb.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-afb.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Amiga bitplanes (afb)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_AFB) || defined(CONFIG_FBCON_AFB_MODULE)
-#define FBCON_HAS_AFB
-#endif
-#else
-#if defined(CONFIG_FBCON_AFB)
-#define FBCON_HAS_AFB
-#endif
-#endif
-
-extern struct display_switch fbcon_afb;
-extern void fbcon_afb_setup(struct display *p);
-extern void fbcon_afb_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			    int height, int width);
-extern void fbcon_afb_clear(struct vc_data *conp, struct display *p, int sy,
-			    int sx, int height, int width);
-extern void fbcon_afb_putc(struct vc_data *conp, struct display *p, int c,
-			   int yy, int xx);
-extern void fbcon_afb_putcs(struct vc_data *conp, struct display *p,
-			    const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_afb_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb16.c m68k/drivers/video/fbcon-cfb16.c
--- jes-2.1.119/drivers/video/fbcon-cfb16.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb16.c	Mon Aug 31 00:46:03 1998
@@ -9,23 +9,20 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb16.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb16.h>
 
 
     /*
      *  16 bpp packed pixels
      */
 
-u16 fbcon_cfb16_cmap[16];
-
 static u32 tab_cfb16[] = {
 #if defined(__BIG_ENDIAN)
     0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
@@ -91,7 +88,7 @@
 
     dest = p->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 2;
 
-    bgx = fbcon_cfb16_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
     bgx |= (bgx << 16);
 
     width *= fontwidth(p)/4;
@@ -123,8 +120,8 @@
 
     dest = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
 
-    fgx = fbcon_cfb16_cmap[attr_fgcol(p, c)];
-    bgx = fbcon_cfb16_cmap[attr_bgcol(p, c)];
+    fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
+    bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
@@ -173,8 +170,8 @@
     u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
-    fgx = fbcon_cfb16_cmap[attr_fgcol(p, *s)];
-    bgx = fbcon_cfb16_cmap[attr_bgcol(p, *s)];
+    fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, *s)];
+    bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, *s)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
@@ -258,7 +255,7 @@
     unsigned int bottom_start = conp->vc_rows*fontheight(p);
     unsigned int bottom_width = p->var.yres_virtual-bottom_start;
 
-    bgx = fbcon_cfb16_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
     bgx |= (bgx << 16);
 
     if (right_width) {
@@ -313,4 +310,4 @@
 EXPORT_SYMBOL(fbcon_cfb16_putc);
 EXPORT_SYMBOL(fbcon_cfb16_putcs);
 EXPORT_SYMBOL(fbcon_cfb16_revc);
-EXPORT_SYMBOL(fbcon_cfb16_cmap);
+EXPORT_SYMBOL(fbcon_cfb16_clear_margins);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb16.h m68k/drivers/video/fbcon-cfb16.h
--- jes-2.1.119/drivers/video/fbcon-cfb16.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb16.h	Thu Jan  1 01:00:00 1970
@@ -1,29 +0,0 @@
-    /*
-     *  16 bpp packed pixel (cfb16)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB16_MODULE)
-#define FBCON_HAS_CFB16
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB16)
-#define FBCON_HAS_CFB16
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb16;
-extern u16 fbcon_cfb16_cmap[16];
-extern void fbcon_cfb16_setup(struct display *p);
-extern void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy,
-			      int dx, int height, int width);
-extern void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy,
-			      int sx, int height, int width);
-extern void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c,
-			     int yy, int xx);
-extern void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p,
-			      const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb16_revc(struct display *p, int xx, int yy);
-extern void fbcon_cfb16_clear_margins(struct vc_data *conp, struct display *p);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb2.c m68k/drivers/video/fbcon-cfb2.c
--- jes-2.1.119/drivers/video/fbcon-cfb2.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb2.c	Mon Aug 31 00:46:03 1998
@@ -16,8 +16,8 @@
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb2.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb2.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb2.h m68k/drivers/video/fbcon-cfb2.h
--- jes-2.1.119/drivers/video/fbcon-cfb2.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb2.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  2 bpp packed pixel (cfb2)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB2) || defined(CONFIG_FBCON_CFB2_MODULE)
-#define FBCON_HAS_CFB2
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB2)
-#define FBCON_HAS_CFB2
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb2;
-extern void fbcon_cfb2_setup(struct display *p);
-extern void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			     int height, int width);
-extern void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy,
-			     int sx, int height, int width);
-extern void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c,
-			    int yy, int xx);
-extern void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p,
-			     const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb2_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb24.c m68k/drivers/video/fbcon-cfb24.c
--- jes-2.1.119/drivers/video/fbcon-cfb24.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb24.c	Mon Aug 31 00:46:03 1998
@@ -9,23 +9,20 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb24.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb24.h>
 
 
     /*
      *  24 bpp packed pixels
      */
 
-u32 fbcon_cfb24_cmap[16];
-
 void fbcon_cfb24_setup(struct display *p)
 {
     p->next_line = p->line_length ? p->line_length : p->var.xres_virtual*3;
@@ -80,9 +77,9 @@
     *dest++ = (d2<<16) | (d3>>8);
     *dest++ = (d3<<24) | d4;
 #elif defined(__LITTLE_ENDIAN)
-    *dest++ = (d1<<8) | (d2>>16);
-    *dest++ = (d2<<16) | (d3>>8);
-    *dest++ = (d3<<24) | d4;
+    *dest++ = d1       | (d2<<24);
+    *dest++ = (d2>> 8) | (d3<<16);
+    *dest++ = (d3>>16) | (d4<< 8);
 #else
 #error FIXME: No endianness??
 #endif
@@ -97,7 +94,7 @@
 
     dest = p->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 3;
 
-    bgx = fbcon_cfb24_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
 
     width *= fontwidth(p)/4;
     if (sx == 0 && width * 12 == bytes)
@@ -130,8 +127,8 @@
     else
 	cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
 
-    fgx = fbcon_cfb24_cmap[attr_fgcol(p, c)];
-    bgx = fbcon_cfb24_cmap[attr_bgcol(p, c)];
+    fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
     eorx = fgx ^ bgx;
 
     for (rows = fontheight(p); rows--; dest += bytes) {
@@ -175,8 +172,8 @@
     u32 eorx, fgx, bgx, d1, d2, d3, d4;
 
     dest0 = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
-    fgx = fbcon_cfb24_cmap[attr_fgcol(p, *s)];
-    bgx = fbcon_cfb24_cmap[attr_bgcol(p, *s)];
+    fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, *s)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, *s)];
     eorx = fgx ^ bgx;
     while (count--) {
 	c = *s++ & p->charmask;
@@ -255,7 +252,7 @@
     unsigned int bottom_start = conp->vc_rows*fontheight(p);
     unsigned int bottom_width = p->var.yres_virtual-bottom_start;
 
-    bgx = fbcon_cfb24_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
 
     if (right_width) {
 	dest0 = p->screen_base+right_start*3;
@@ -308,4 +305,4 @@
 EXPORT_SYMBOL(fbcon_cfb24_putc);
 EXPORT_SYMBOL(fbcon_cfb24_putcs);
 EXPORT_SYMBOL(fbcon_cfb24_revc);
-EXPORT_SYMBOL(fbcon_cfb24_cmap);
+EXPORT_SYMBOL(fbcon_cfb24_clear_margins);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb24.h m68k/drivers/video/fbcon-cfb24.h
--- jes-2.1.119/drivers/video/fbcon-cfb24.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb24.h	Thu Jan  1 01:00:00 1970
@@ -1,29 +0,0 @@
-    /*
-     *  24 bpp packed pixel (cfb24)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB24_MODULE)
-#define FBCON_HAS_CFB24
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB24)
-#define FBCON_HAS_CFB24
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb24;
-extern u32 fbcon_cfb24_cmap[16];
-extern void fbcon_cfb24_setup(struct display *p);
-extern void fbcon_cfb24_bmove(struct display *p, int sy, int sx, int dy,
-			      int dx, int height, int width);
-extern void fbcon_cfb24_clear(struct vc_data *conp, struct display *p, int sy,
-			      int sx, int height, int width);
-extern void fbcon_cfb24_putc(struct vc_data *conp, struct display *p, int c,
-			     int yy, int xx);
-extern void fbcon_cfb24_putcs(struct vc_data *conp, struct display *p,
-			      const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb24_revc(struct display *p, int xx, int yy);
-extern void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb32.c m68k/drivers/video/fbcon-cfb32.c
--- jes-2.1.119/drivers/video/fbcon-cfb32.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb32.c	Mon Aug 31 00:46:03 1998
@@ -9,23 +9,20 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb32.h>
 
 
     /*
      *  32 bpp packed pixels
      */
 
-u32 fbcon_cfb32_cmap[16];
-
 void fbcon_cfb32_setup(struct display *p)
 {
     p->next_line = p->line_length ? p->line_length : p->var.xres_virtual<<2;
@@ -81,7 +78,7 @@
 
     dest = p->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 4;
 
-    bgx = fbcon_cfb32_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
 
     width *= fontwidth(p)/4;
     if (sx == 0 && width * 16 == bytes)
@@ -119,8 +116,8 @@
 	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
     else
 	cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
-    fgx = fbcon_cfb32_cmap[attr_fgcol(p, c)];
-    bgx = fbcon_cfb32_cmap[attr_bgcol(p, c)];
+    fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
     eorx = fgx ^ bgx;
 
     for (rows = fontheight(p); rows--; dest += bytes) {
@@ -160,8 +157,8 @@
     u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
-    fgx = fbcon_cfb32_cmap[attr_fgcol(p, *s)];
-    bgx = fbcon_cfb32_cmap[attr_bgcol(p, *s)];
+    fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, *s)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, *s)];
     eorx = fgx ^ bgx;
     while (count--) {
 	c = *s++ & p->charmask;
@@ -240,7 +237,7 @@
     unsigned int bottom_start = conp->vc_rows*fontheight(p);
     unsigned int bottom_width = p->var.yres_virtual-bottom_start;
 
-    bgx = fbcon_cfb32_cmap[attr_bgcol_ec(p, conp)];
+    bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
 
     if (right_width) {
 	dest0 = p->screen_base+right_start*4;
@@ -289,4 +286,4 @@
 EXPORT_SYMBOL(fbcon_cfb32_putc);
 EXPORT_SYMBOL(fbcon_cfb32_putcs);
 EXPORT_SYMBOL(fbcon_cfb32_revc);
-EXPORT_SYMBOL(fbcon_cfb32_cmap);
+EXPORT_SYMBOL(fbcon_cfb32_clear_margins);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb32.h m68k/drivers/video/fbcon-cfb32.h
--- jes-2.1.119/drivers/video/fbcon-cfb32.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb32.h	Thu Jan  1 01:00:00 1970
@@ -1,29 +0,0 @@
-    /*
-     *  32 bpp packed pixel (cfb32)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FBCON_CFB32_MODULE)
-#define FBCON_HAS_CFB32
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB32)
-#define FBCON_HAS_CFB32
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb32;
-extern u32 fbcon_cfb32_cmap[16];
-extern void fbcon_cfb32_setup(struct display *p);
-extern void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy,
-			      int dx, int height, int width);
-extern void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy,
-			      int sx, int height, int width);
-extern void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c,
-			     int yy, int xx);
-extern void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p,
-			      const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb32_revc(struct display *p, int xx, int yy);
-extern void fbcon_cfb32_clear_margins(struct vc_data *conp, struct display *p);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb4.c m68k/drivers/video/fbcon-cfb4.c
--- jes-2.1.119/drivers/video/fbcon-cfb4.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb4.c	Mon Aug 31 00:46:03 1998
@@ -16,8 +16,8 @@
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb4.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb4.h>
 
 
     /*
@@ -133,7 +133,7 @@
 	dest = p->screen_base + yy * fontheight(p) * bytes + xx * 4;
 	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
 
-	fgx=15;/*attr_fgcol(p,c);*/
+	fgx=attr_fgcol(p,c);
 	bgx=attr_bgcol(p,c);
 	fgx |= (fgx << 4);
 	fgx |= (fgx << 8);
@@ -158,7 +158,7 @@
 	u32 eorx, fgx, bgx;
 
 	dest0 = p->screen_base + yy * fontheight(p) * bytes + xx * 4;
-	fgx=15/*attr_fgcol(p,*s)*/;
+	fgx=attr_fgcol(p,*s);
 	bgx=attr_bgcol(p,*s);
 	fgx |= (fgx << 4);
 	fgx |= (fgx << 8);
@@ -188,7 +188,7 @@
 
 	dest = p->screen_base + yy * fontheight(p) * bytes + xx * 4;
 	for (rows = fontheight(p) ; rows-- ; dest += bytes) {
-		((u32 *)dest)[0] ^= 0x0f0f0f0f;
+		((u32 *)dest)[0] ^= 0xffffffff;
 	}
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb4.h m68k/drivers/video/fbcon-cfb4.h
--- jes-2.1.119/drivers/video/fbcon-cfb4.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb4.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  4 bpp packed pixel (cfb4)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB4) || defined(CONFIG_FBCON_CFB4_MODULE)
-#define FBCON_HAS_CFB4
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB4)
-#define FBCON_HAS_CFB4
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb4;
-extern void fbcon_cfb4_setup(struct display *p);
-extern void fbcon_cfb4_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			     int height, int width);
-extern void fbcon_cfb4_clear(struct vc_data *conp, struct display *p, int sy,
-			     int sx, int height, int width);
-extern void fbcon_cfb4_putc(struct vc_data *conp, struct display *p, int c,
-			    int yy, int xx);
-extern void fbcon_cfb4_putcs(struct vc_data *conp, struct display *p,
-			     const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb4_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb8.c m68k/drivers/video/fbcon-cfb8.c
--- jes-2.1.119/drivers/video/fbcon-cfb8.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb8.c	Mon Aug 31 00:46:03 1998
@@ -9,15 +9,14 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
 
 
     /*
@@ -281,3 +280,4 @@
 EXPORT_SYMBOL(fbcon_cfb8_putc);
 EXPORT_SYMBOL(fbcon_cfb8_putcs);
 EXPORT_SYMBOL(fbcon_cfb8_revc);
+EXPORT_SYMBOL(fbcon_cfb8_clear_margins);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-cfb8.h m68k/drivers/video/fbcon-cfb8.h
--- jes-2.1.119/drivers/video/fbcon-cfb8.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-cfb8.h	Thu Jan  1 01:00:00 1970
@@ -1,28 +0,0 @@
-    /*
-     *  8 bpp packed pixel (cfb8)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB8_MODULE)
-#define FBCON_HAS_CFB8
-#endif
-#else
-#if defined(CONFIG_FBCON_CFB8)
-#define FBCON_HAS_CFB8
-#endif
-#endif
-
-extern struct display_switch fbcon_cfb8;
-extern void fbcon_cfb8_setup(struct display *p);
-extern void fbcon_cfb8_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			     int height, int width);
-extern void fbcon_cfb8_clear(struct vc_data *conp, struct display *p, int sy,
-			     int sx, int height, int width);
-extern void fbcon_cfb8_putc(struct vc_data *conp, struct display *p, int c,
-			    int yy, int xx);
-extern void fbcon_cfb8_putcs(struct vc_data *conp, struct display *p,
-			     const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_cfb8_revc(struct display *p, int xx, int yy);
-extern void fbcon_cfb8_clear_margins(struct vc_data *conp, struct display *p);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-ilbm.c m68k/drivers/video/fbcon-ilbm.c
--- jes-2.1.119/drivers/video/fbcon-ilbm.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-ilbm.c	Mon Aug 31 00:46:03 1998
@@ -15,8 +15,8 @@
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-ilbm.h"
+#include <video/fbcon.h>
+#include <video/fbcon-ilbm.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-ilbm.h m68k/drivers/video/fbcon-ilbm.h
--- jes-2.1.119/drivers/video/fbcon-ilbm.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-ilbm.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Amiga interleaved bitplanes (ilbm)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_ILBM) || defined(CONFIG_FBCON_ILBM_MODULE)  
-#define FBCON_HAS_ILBM 
-#endif
-#else
-#if defined(CONFIG_FBCON_ILBM) 
-#define FBCON_HAS_ILBM 
-#endif
-#endif
-
-extern struct display_switch fbcon_ilbm;
-extern void fbcon_ilbm_setup(struct display *p);
-extern void fbcon_ilbm_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			     int height, int width);
-extern void fbcon_ilbm_clear(struct vc_data *conp, struct display *p, int sy,
-			     int sx, int height, int width);
-extern void fbcon_ilbm_putc(struct vc_data *conp, struct display *p, int c,
-			    int yy, int xx);
-extern void fbcon_ilbm_putcs(struct vc_data *conp, struct display *p,
-			     const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_ilbm_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p2.c m68k/drivers/video/fbcon-iplan2p2.c
--- jes-2.1.119/drivers/video/fbcon-iplan2p2.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p2.c	Mon Aug 31 00:46:03 1998
@@ -19,8 +19,8 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-#include "fbcon-iplan2p2.h"
+#include <video/fbcon.h>
+#include <video/fbcon-iplan2p2.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p2.h m68k/drivers/video/fbcon-iplan2p2.h
--- jes-2.1.119/drivers/video/fbcon-iplan2p2.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p2.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Atari interleaved bitplanes (2 planes) (iplan2p2)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P2_MODULE)
-#define FBCON_HAS_IPLAN2P2
-#endif
-#else
-#if defined(CONFIG_FBCON_IPLAN2P2)
-#define FBCON_HAS_IPLAN2P2
-#endif
-#endif
-
-extern struct display_switch fbcon_iplan2p2;
-extern void fbcon_iplan2p2_setup(struct display *p);
-extern void fbcon_iplan2p2_bmove(struct display *p, int sy, int sx, int dy,
-				 int dx, int height, int width);
-extern void fbcon_iplan2p2_clear(struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width);
-extern void fbcon_iplan2p2_putc(struct vc_data *conp, struct display *p, int c,
-				int yy, int xx);
-extern void fbcon_iplan2p2_putcs(struct vc_data *conp, struct display *p,
-				 const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_iplan2p2_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p4.c m68k/drivers/video/fbcon-iplan2p4.c
--- jes-2.1.119/drivers/video/fbcon-iplan2p4.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p4.c	Mon Aug 31 00:46:03 1998
@@ -19,8 +19,8 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-#include "fbcon-iplan2p4.h"
+#include <video/fbcon.h>
+#include <video/fbcon-iplan2p4.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p4.h m68k/drivers/video/fbcon-iplan2p4.h
--- jes-2.1.119/drivers/video/fbcon-iplan2p4.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p4.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Atari interleaved bitplanes (4 planes) (iplan2p4)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_IPLAN2P4) || defined(CONFIG_FBCON_IPLAN2P4_MODULE)
-#define FBCON_HAS_IPLAN2P4
-#endif
-#else
-#if defined(CONFIG_FBCON_IPLAN2P4)
-#define FBCON_HAS_IPLAN2P4
-#endif
-#endif
-
-extern struct display_switch fbcon_iplan2p4;
-extern void fbcon_iplan2p4_setup(struct display *p);
-extern void fbcon_iplan2p4_bmove(struct display *p, int sy, int sx, int dy,
-				 int dx, int height, int width);
-extern void fbcon_iplan2p4_clear(struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width);
-extern void fbcon_iplan2p4_putc(struct vc_data *conp, struct display *p, int c,
-				int yy, int xx);
-extern void fbcon_iplan2p4_putcs(struct vc_data *conp, struct display *p,
-				 const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_iplan2p4_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p8.c m68k/drivers/video/fbcon-iplan2p8.c
--- jes-2.1.119/drivers/video/fbcon-iplan2p8.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p8.c	Mon Aug 31 00:46:03 1998
@@ -19,8 +19,8 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-#include "fbcon-iplan2p8.h"
+#include <video/fbcon.h>
+#include <video/fbcon-iplan2p8.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-iplan2p8.h m68k/drivers/video/fbcon-iplan2p8.h
--- jes-2.1.119/drivers/video/fbcon-iplan2p8.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-iplan2p8.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Atari interleaved bitplanes (8 planes) (iplan2p8)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_IPLAN2P8) || defined(CONFIG_FBCON_IPLAN2P8_MODULE)
-#define FBCON_HAS_IPLAN2P8
-#endif
-#else
-#if defined(CONFIG_FBCON_IPLAN2P8)
-#define FBCON_HAS_IPLAN2P8
-#endif
-#endif
-
-extern struct display_switch fbcon_iplan2p8;
-extern void fbcon_iplan2p8_setup(struct display *p);
-extern void fbcon_iplan2p8_bmove(struct display *p, int sy, int sx, int dy,
-				 int dx, int height, int width);
-extern void fbcon_iplan2p8_clear(struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width);
-extern void fbcon_iplan2p8_putc(struct vc_data *conp, struct display *p, int c,
-				int yy, int xx);
-extern void fbcon_iplan2p8_putcs(struct vc_data *conp, struct display *p,
-				 const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_iplan2p8_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-mac.c m68k/drivers/video/fbcon-mac.c
--- jes-2.1.119/drivers/video/fbcon-mac.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-mac.c	Mon Aug 31 00:46:03 1998
@@ -19,8 +19,8 @@
 #include <linux/fb.h>
 #include <linux/delay.h>
 
-#include "fbcon.h"
-#include "fbcon-mac.h"
+#include <video/fbcon.h>
+#include <video/fbcon-mac.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-mac.h m68k/drivers/video/fbcon-mac.h
--- jes-2.1.119/drivers/video/fbcon-mac.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-mac.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Mac variable bpp packed pixels (mac)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FBCON_MAC_MODULE)
-#define FBCON_HAS_MAC
-#endif
-#else
-#if defined(CONFIG_FBCON_MAC)
-#define FBCON_HAS_MAC
-#endif
-#endif
-
-extern struct display_switch fbcon_mac;
-extern void fbcon_mac_setup(struct display *p);
-extern void fbcon_mac_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			    int height, int width);
-extern void fbcon_mac_clear(struct vc_data *conp, struct display *p, int sy,
-			    int sx, int height, int width);
-extern void fbcon_mac_putc(struct vc_data *conp, struct display *p, int c,
-			   int yy, int xx);
-extern void fbcon_mac_putcs(struct vc_data *conp, struct display *p,
-			    const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_mac_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-mfb.c m68k/drivers/video/fbcon-mfb.c
--- jes-2.1.119/drivers/video/fbcon-mfb.c	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-mfb.c	Mon Aug 31 00:46:03 1998
@@ -15,8 +15,8 @@
 #include <linux/string.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-#include "fbcon-mfb.h"
+#include <video/fbcon.h>
+#include <video/fbcon-mfb.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-mfb.h m68k/drivers/video/fbcon-mfb.h
--- jes-2.1.119/drivers/video/fbcon-mfb.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-mfb.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  Monochrome (mfb)
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_MFB) || defined(CONFIG_FBCON_MFB_MODULE)
-#define FBCON_HAS_MFB
-#endif
-#else
-#if defined(CONFIG_FBCON_MFB)
-#define FBCON_HAS_MFB
-#endif
-#endif
-
-extern struct display_switch fbcon_mfb;
-extern void fbcon_mfb_setup(struct display *p);
-extern void fbcon_mfb_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			    int height, int width);
-extern void fbcon_mfb_clear(struct vc_data *conp, struct display *p, int sy,
-			    int sx, int height, int width);
-extern void fbcon_mfb_putc(struct vc_data *conp, struct display *p, int c,
-			   int yy, int xx);
-extern void fbcon_mfb_putcs(struct vc_data *conp, struct display *p,
-			    const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_mfb_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-vga.c m68k/drivers/video/fbcon-vga.c
--- jes-2.1.119/drivers/video/fbcon-vga.c	Mon Aug 10 09:30:41 1998
+++ m68k/drivers/video/fbcon-vga.c	Mon Aug 31 00:46:03 1998
@@ -18,8 +18,8 @@
 
 #include <asm/io.h>
 
-#include "fbcon.h"
-#include "fbcon-vga.h"
+#include <video/fbcon.h>
+#include <video/fbcon-vga.h>
 
 
     /*
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon-vga.h m68k/drivers/video/fbcon-vga.h
--- jes-2.1.119/drivers/video/fbcon-vga.h	Sun Aug 30 20:40:52 1998
+++ m68k/drivers/video/fbcon-vga.h	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-    /*
-     *  VGA characters/attributes
-     */
-
-#include <linux/config.h>
-
-#ifdef MODULE
-#if defined(CONFIG_FBCON_VGA) || defined(CONFIG_FBCON_VGA_MODULE)
-#define FBCON_HAS_VGA
-#endif
-#else
-#if defined(CONFIG_FBCON_VGA)
-#define FBCON_HAS_VGA
-#endif
-#endif
-
-extern struct display_switch fbcon_vga;
-extern void fbcon_vga_setup(struct display *p);
-extern void fbcon_vga_bmove(struct display *p, int sy, int sx, int dy, int dx,
-			    int height, int width);
-extern void fbcon_vga_clear(struct vc_data *conp, struct display *p, int sy,
-			    int sx, int height, int width);
-extern void fbcon_vga_putc(struct vc_data *conp, struct display *p, int c,
-			   int yy, int xx);
-extern void fbcon_vga_putcs(struct vc_data *conp, struct display *p,
-			    const unsigned short *s, int count, int yy, int xx);
-extern void fbcon_vga_revc(struct display *p, int xx, int yy);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon.c m68k/drivers/video/fbcon.c
--- jes-2.1.119/drivers/video/fbcon.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/fbcon.c	Mon Aug 31 00:46:03 1998
@@ -29,6 +29,8 @@
  *  added by 
  *                         Jakub Jelinek (jj@ultra.linux.cz)
  *
+ *  Random hacking by Martin Mares <mj@ucw.cz>
+ *
  *
  *  The low level operations for the various display memory organizations are
  *  now in separate source files.
@@ -54,8 +56,6 @@
 
 #undef FBCONDEBUG
 
-#define FLASHING_CURSOR		1
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -94,9 +94,9 @@
 #define INCLUDE_LINUX_LOGO_DATA
 #include <asm/linux_logo.h>
 
-#include "fbcon.h"
-#include "fbcon-mac.h"	/* for 6x11 font on mac */
-#include "font.h"
+#include <video/fbcon.h>
+#include <video/fbcon-mac.h>	/* for 6x11 font on mac */
+#include <video/font.h>
 
 #ifdef FBCONDEBUG
 #  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
@@ -128,10 +128,9 @@
  * if dispsw->cursor is NULL, use Atari alike software cursor
  */
 
-#if FLASHING_CURSOR
 static int cursor_drawn = 0;
 
-#define CURSOR_DRAW_DELAY		(2)
+#define CURSOR_DRAW_DELAY		(1)
 
 /* # VBL ints between cursor state changes */
 #define AMIGA_CURSOR_BLINK_RATE		(20)
@@ -143,16 +142,12 @@
 static int cursor_on = 0;
 static int cursor_blink_rate;
 
-static __inline__ void CURSOR_UNDRAWN(void)
+static inline void cursor_undrawn(void)
 {
     vbl_cursor_cnt = 0;
     cursor_drawn = 0;
 }
-#endif
 
-/*
- *  Scroll Method
- */
 
 #define divides(a, b)	((!(a) || (b)%(a)) ? 0 : 1)
 
@@ -188,9 +183,7 @@
 
 static void fbcon_setup(int con, int init, int logo);
 static __inline__ int real_y(struct display *p, int ypos);
-#if FLASHING_CURSOR
 static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp);
-#endif
 static __inline__ void updatescrollmode(struct display *p);
 static __inline__ void ywrap_up(int unit, struct vc_data *conp,
 				struct display *p, int count);
@@ -205,8 +198,6 @@
 
 static int fbcon_show_logo(void);
 
-#if FLASHING_CURSOR
-
 #ifdef CONFIG_MAC
 /*
  * On the Macintoy, there may or may not be a working VBL int. We need to prob
@@ -233,7 +224,6 @@
       cursor_timer.next = cursor_timer.next = NULL;
       add_timer(&cursor_timer);
 }
-#endif
 
 /*
  *  Low Level Operations
@@ -373,16 +363,20 @@
 
 static __inline__ void updatescrollmode(struct display *p)
 {
-    if (p->scrollmode == SCROLL_YREDRAW)
+    int m;
+    if (p->scrollmode & __SCROLL_YFIXED)
     	return;
     if (divides(p->ywrapstep, fontheight(p)) &&
 	divides(fontheight(p), p->var.yres_virtual))
-	p->scrollmode = SCROLL_YWRAP;
+	m = __SCROLL_YWRAP;
     else if (divides(p->ypanstep, fontheight(p)) &&
 	     p->var.yres_virtual >= p->var.yres+fontheight(p))
-	p->scrollmode = SCROLL_YPAN;
+	m = __SCROLL_YPAN;
+    else if (p->scrollmode & __SCROLL_YNOMOVE)
+    	m = __SCROLL_YREDRAW;
     else
-	p->scrollmode = SCROLL_YMOVE;
+	m = __SCROLL_YMOVE;
+    p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
 }
 
 static void fbcon_font_widths(struct display *p)
@@ -405,7 +399,6 @@
 {
     struct display *p = &fb_display[con];
     struct vc_data *conp = p->conp;
-    int unit = conp->vc_num;
     int nr_rows, nr_cols;
     int old_rows, old_cols;
     unsigned short *save = NULL, *r, *q;
@@ -496,7 +489,7 @@
     	    	scr_memsetw(save, conp->vc_video_erase_char, logo_lines * nr_cols * 2);
     	    	r = q - step;
     	    	for (cnt = 0; cnt < logo_lines; cnt++, r += i)
-    	    		scr_memcpyw(save + cnt * nr_cols, r, 2 * i);
+    	    		scr_memcpyw_to(save + cnt * nr_cols, r, 2 * i);
     	    	r = q;
     	    }
     	}
@@ -552,24 +545,18 @@
     p->bgcol = 0;
 
     if (!init) {
-        if (con == fg_console)
-            set_palette(); /* Unlike vgacon, we have to set palette before resize on directcolor, 
-                              so that it is drawn with correct colors */
 	vc_resize_con(nr_rows, nr_cols, con);
 	if (save) {
     	    q = (unsigned short *)(conp->vc_origin + conp->vc_size_row * old_rows);
-	    scr_memcpyw(q, save, logo_lines * nr_cols * 2);
+	    scr_memcpyw_from(q, save, logo_lines * nr_cols * 2);
 	    conp->vc_y += logo_lines;
     	    conp->vc_pos += logo_lines * conp->vc_size_row;
     	    kfree(save);
 	}
-	if (con == fg_console && vt_cons[unit]->vc_mode == KD_TEXT)
-	    update_screen(con); /* So that we set origin correctly */
     }
 	
     if (logo) {
-    	logo_shown = fg_console;
-    	fbcon_show_logo(); /* This is protected above by initmem_freed */
+	logo_shown = -2;
     	conp->vc_top = logo_lines;
     }
 }
@@ -625,7 +612,7 @@
 
     if ((sy <= p->cursor_y) && (p->cursor_y < sy+height) &&
 	(sx <= p->cursor_x) && (p->cursor_x < sx+width)) {
-	CURSOR_UNDRAWN();
+	cursor_undrawn();
 	redraw_cursor = 1;
     }
 
@@ -652,9 +639,12 @@
 
     if (!p->can_soft_blank && console_blanked)
 	    return;
+	    
+    if (vt_cons[unit]->vc_mode != KD_TEXT)
+    	    return;
 
     if ((p->cursor_x == xpos) && (p->cursor_y == ypos)) {
-	    CURSOR_UNDRAWN();
+	    cursor_undrawn();
 	    redraw_cursor = 1;
     }
 
@@ -675,9 +665,12 @@
     if (!p->can_soft_blank && console_blanked)
 	    return;
 
+    if (vt_cons[unit]->vc_mode != KD_TEXT)
+    	    return;
+
     if ((p->cursor_y == ypos) && (xpos <= p->cursor_x) &&
 	(p->cursor_x < (xpos + count))) {
-	    CURSOR_UNDRAWN();
+	    cursor_undrawn();
 	    redraw_cursor = 1;
     }
     p->dispsw->putcs(conp, p, s, count, real_y(p, ypos), xpos);
@@ -704,29 +697,28 @@
 	(mode == CM_ERASE) == !cursor_on)
 	return;
 
-	cursor_on = 0;
-	if (cursor_drawn)
-	    p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
-
-	p->cursor_x = conp->vc_x;
-	p->cursor_y = conp->vc_y;
-
-	switch (mode) {
-	    case CM_ERASE:
-	        cursor_drawn = 0;
-	        break;
-	    case CM_MOVE:
-	    case CM_DRAW:
-		if (cursor_drawn)
-		    p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
-		vbl_cursor_cnt = CURSOR_DRAW_DELAY;
-		cursor_on = 1;
-		break;
-	}
+    cursor_on = 0;
+    if (cursor_drawn)
+        p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
+
+    p->cursor_x = conp->vc_x;
+    p->cursor_y = conp->vc_y;
+
+    switch (mode) {
+        case CM_ERASE:
+            cursor_drawn = 0;
+            break;
+        case CM_MOVE:
+        case CM_DRAW:
+            if (cursor_drawn)
+	        p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
+            vbl_cursor_cnt = CURSOR_DRAW_DELAY;
+            cursor_on = 1;
+            break;
+        }
 }
 
 
-#if FLASHING_CURSOR
 static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp)
 {
     struct display *p;
@@ -742,7 +734,6 @@
 	vbl_cursor_cnt = cursor_blink_rate;
     }
 }
-#endif
 
 static int scrollback_phys_max = 0;
 static int scrollback_max = 0;
@@ -828,6 +819,7 @@
     unsigned short *d = (unsigned short *)
 	(conp->vc_origin + conp->vc_size_row * line);
     unsigned short *s = d + offset;
+
     while (count--) {
 	unsigned short *start = s;
 	unsigned short *le = (unsigned short *)
@@ -841,14 +833,16 @@
 	    if (attr != (c & 0xff00)) {
 		attr = c & 0xff00;
 		if (s > start) {
-		    p->dispsw->putcs(conp, p, start, s - start, line, x);
+		    p->dispsw->putcs(conp, p, start, s - start,
+				     real_y(p, line), x);
 		    x += s - start;
 		    start = s;
 		}
 	    }
 	    if (c == scr_readw(d)) {
 	    	if (s > start) {
-	    	    p->dispsw->putcs(conp, p, start, s - start, line, x);
+	    	    p->dispsw->putcs(conp, p, start, s - start,
+				     real_y(p, line), x);
 		    x += s - start + 1;
 		    start = s + 1;
 	    	} else {
@@ -861,7 +855,7 @@
 	    d++;
 	} while (s < le);
 	if (s > start)
-	    p->dispsw->putcs(conp, p, start, s - start, line, x);
+	    p->dispsw->putcs(conp, p, start, s - start, real_y(p, line), x);
 	if (offset > 0)
 		line++;
 	else {
@@ -879,6 +873,7 @@
     if (sy != dy)
     	panic("fbcon_redraw_bmove width sy != dy");
     /* h will be always 1, but it does not matter if we are more generic */
+
     while (h-- > 0) {
 	struct vc_data *conp = p->conp;
 	unsigned short *d = (unsigned short *)
@@ -931,7 +926,7 @@
     if (!p->can_soft_blank && console_blanked)
 	return 0;
 
-    if (!count)
+    if (!count || vt_cons[unit]->vc_mode != KD_TEXT)
 	return 0;
 
     fbcon_cursor(conp, CM_ERASE);
@@ -946,125 +941,119 @@
 	case SM_UP:
 	    if (count > conp->vc_rows)	/* Maximum realistic size */
 		count = conp->vc_rows;
-	    if (vt_cons[unit]->vc_mode == KD_TEXT)
-		switch (p->scrollmode) {
-		    case SCROLL_YWRAP:
-			if (b-t-count > 3*conp->vc_rows>>2) {
-			    if (t > 0)
-				fbcon_bmove(conp, 0, 0, count, 0, t,
-					    conp->vc_cols);
-			    ywrap_up(unit, conp, p, count);
-			    if (conp->vc_rows-b > 0)
-				fbcon_bmove(conp, b-count, 0, b, 0,
-					    conp->vc_rows-b, conp->vc_cols);
-			} else
-			    fbcon_bmove(conp, t+count, 0, t, 0, b-t-count,
-					conp->vc_cols);
-			fbcon_clear(conp, b-count, 0, count, conp->vc_cols);
-			break;
-
-		    case SCROLL_YPAN:
-			if (( is_txt && (b-t == conp->vc_rows)) ||
-			    (!is_txt && (b-t-count > 3*conp->vc_rows>>2))) {
-			    if (t > 0)
-				fbcon_bmove(conp, 0, 0, count, 0, t,
-					    conp->vc_cols);
-			    ypan_up(unit, conp, p, count);
-			    if (conp->vc_rows-b > 0)
-				fbcon_bmove(conp, b-count, 0, b, 0,
-					    conp->vc_rows-b, conp->vc_cols);
-			} else
-			    fbcon_bmove(conp, t+count, 0, t, 0, b-t-count,
-					conp->vc_cols);
-			fbcon_clear(conp, b-count, 0, count, conp->vc_cols);
-			break;
-
-		    case SCROLL_YMOVE:
-			p->dispsw->bmove(p, t+count, 0, t, 0, b-t-count,
-					 conp->vc_cols);
-			p->dispsw->clear(conp, p, b-count, 0, count,
-					 conp->vc_cols);
-			break;
-		    case SCROLL_YREDRAW:
-		    	fbcon_redraw(conp, p, t, b-t-count, count*conp->vc_cols);
-		    	p->dispsw->clear(conp, p, b-count, 0, count,
-		    			 conp->vc_cols);
-		    	scr_memsetw((unsigned short *)(conp->vc_origin + 
-		    		    conp->vc_size_row * (b-count)), 
-		    		    conp->vc_video_erase_char,
-		    		    conp->vc_size_row * count);
-		    	return 1;
-		}
-	    else {
-		if (p->scrollmode != SCROLL_YREDRAW)
-			fbcon_bmove(conp, t+count, 0, t, 0, b-t-count, conp->vc_cols);
+	    switch (p->scrollmode & __SCROLL_YMASK) {
+	    case __SCROLL_YMOVE:
+		p->dispsw->bmove(p, t+count, 0, t, 0, b-t-count,
+				 conp->vc_cols);
+		p->dispsw->clear(conp, p, b-count, 0, count,
+				 conp->vc_cols);
+		break;
+
+	    case __SCROLL_YWRAP:
+		if (b-t-count > 3*conp->vc_rows>>2) {
+		    if (t > 0)
+			fbcon_bmove(conp, 0, 0, count, 0, t,
+				    conp->vc_cols);
+			ywrap_up(unit, conp, p, count);
+		    if (conp->vc_rows-b > 0)
+			fbcon_bmove(conp, b-count, 0, b, 0,
+				    conp->vc_rows-b, conp->vc_cols);
+		} else if (p->scrollmode & __SCROLL_YPANREDRAW)
+		    goto redraw_up;
+		else
+		    fbcon_bmove(conp, t+count, 0, t, 0, b-t-count,
+				conp->vc_cols);
+		fbcon_clear(conp, b-count, 0, count, conp->vc_cols);
+		break;
+
+	    case __SCROLL_YPAN:
+		if (( is_txt && (b-t == conp->vc_rows)) ||
+		    (!is_txt && (b-t-count > 3*conp->vc_rows>>2))) {
+		    if (t > 0)
+			fbcon_bmove(conp, 0, 0, count, 0, t,
+				    conp->vc_cols);
+		    ypan_up(unit, conp, p, count);
+		    if (conp->vc_rows-b > 0)
+			fbcon_bmove(conp, b-count, 0, b, 0,
+				    conp->vc_rows-b, conp->vc_cols);
+		} else if (p->scrollmode & __SCROLL_YPANREDRAW)
+		    goto redraw_up;
+		else
+		    fbcon_bmove(conp, t+count, 0, t, 0, b-t-count,
+				conp->vc_cols);
 		fbcon_clear(conp, b-count, 0, count, conp->vc_cols);
+		break;
+
+	    case __SCROLL_YREDRAW:
+	    redraw_up:
+		fbcon_redraw(conp, p, t, b-t-count, count*conp->vc_cols);
+		p->dispsw->clear(conp, p, real_y(p, b-count), 0,
+				 count, conp->vc_cols);
+		scr_memsetw((unsigned short *)(conp->vc_origin + 
+		    	    conp->vc_size_row * (b-count)), 
+		    	    conp->vc_video_erase_char,
+		    	    conp->vc_size_row * count);
+		return 1;
 	    }
 	    break;
 
 	case SM_DOWN:
 	    if (count > conp->vc_rows)	/* Maximum realistic size */
 		count = conp->vc_rows;
-	    if (vt_cons[unit]->vc_mode == KD_TEXT)
-		switch (p->scrollmode) {
-		    case SCROLL_YWRAP:
-			if (b-t-count > 3*conp->vc_rows>>2) {
-			    if (conp->vc_rows-b > 0)
-				fbcon_bmove(conp, b, 0, b-count, 0,
-					    conp->vc_rows-b, conp->vc_cols);
-			    ywrap_down(unit, conp, p, count);
-			    if (t > 0)
-				fbcon_bmove(conp, count, 0, 0, 0, t,
-					    conp->vc_cols);
-			} else
-			    fbcon_bmove(conp, t, 0, t+count, 0, b-t-count,
-					conp->vc_cols);
-			fbcon_clear(conp, t, 0, count, conp->vc_cols);
-			break;
-
-		    case SCROLL_YPAN:
-			if (( is_txt && (b-t == conp->vc_rows)) ||
-			    (!is_txt && (b-t-count > 3*conp->vc_rows>>2))) {
-			    if (conp->vc_rows-b > 0)
-				fbcon_bmove(conp, b, 0, b-count, 0,
-					    conp->vc_rows-b, conp->vc_cols);
-			    ypan_down(unit, conp, p, count);
-			    if (t > 0)
-				fbcon_bmove(conp, count, 0, 0, 0, t,
-					    conp->vc_cols);
-			} else
-			    fbcon_bmove(conp, t, 0, t+count, 0, b-t-count,
-					conp->vc_cols);
-			fbcon_clear(conp, t, 0, count, conp->vc_cols);
-			break;
-
-		    case SCROLL_YMOVE:
-			p->dispsw->bmove(p, t, 0, t+count, 0, b-t-count,
-					 conp->vc_cols);
-			p->dispsw->clear(conp, p, t, 0, count, conp->vc_cols);
-			break;
-			
-		    case SCROLL_YREDRAW:
-			fbcon_redraw(conp, p, b - 1, b-t-count, -count*conp->vc_cols);
-			p->dispsw->clear(conp, p, t, 0, count, conp->vc_cols);
-		    	scr_memsetw((unsigned short *)(conp->vc_origin + 
-		    		    conp->vc_size_row * t), 
-		    		    conp->vc_video_erase_char,
-		    		    conp->vc_size_row * count);
-		    	return 1;
-		}
-	    else {
-		/*
-		 *  Fixed bmove() should end Arno's frustration with copying?
-		 *  Confucius says:
-		 *	Man who copies in wrong direction, end up with trashed
-		 *	data
-		 */
-		if (p->scrollmode != SCROLL_YREDRAW)
-			fbcon_bmove(conp, t, 0, t+count, 0, b-t-count, conp->vc_cols);
+	    switch (p->scrollmode & __SCROLL_YMASK) {
+	    case __SCROLL_YMOVE:
+		p->dispsw->bmove(p, t, 0, t+count, 0, b-t-count,
+				 conp->vc_cols);
+		p->dispsw->clear(conp, p, t, 0,
+				 count, conp->vc_cols);
+		break;
+
+	    case __SCROLL_YWRAP:
+		if (b-t-count > 3*conp->vc_rows>>2) {
+		    if (conp->vc_rows-b > 0)
+			fbcon_bmove(conp, b, 0, b-count, 0,
+				    conp->vc_rows-b, conp->vc_cols);
+		    ywrap_down(unit, conp, p, count);
+		    if (t > 0)
+			fbcon_bmove(conp, count, 0, 0, 0, t,
+				    conp->vc_cols);
+		} else if (p->scrollmode & __SCROLL_YPANREDRAW)
+		    goto redraw_down;
+		else
+		    fbcon_bmove(conp, t, 0, t+count, 0, b-t-count,
+				conp->vc_cols);
 		fbcon_clear(conp, t, 0, count, conp->vc_cols);
+		break;
+
+	    case __SCROLL_YPAN:
+		if (( is_txt && (b-t == conp->vc_rows)) ||
+		    (!is_txt && (b-t-count > 3*conp->vc_rows>>2))) {
+		    if (conp->vc_rows-b > 0)
+			fbcon_bmove(conp, b, 0, b-count, 0,
+				    conp->vc_rows-b, conp->vc_cols);
+		    ypan_down(unit, conp, p, count);
+		    if (t > 0)
+			fbcon_bmove(conp, count, 0, 0, 0, t,
+				    conp->vc_cols);
+		} else if (p->scrollmode & __SCROLL_YPANREDRAW)
+		    goto redraw_down;
+		else
+		    fbcon_bmove(conp, t, 0, t+count, 0, b-t-count,
+				conp->vc_cols);
+		fbcon_clear(conp, t, 0, count, conp->vc_cols);
+		break;
+
+	    case __SCROLL_YREDRAW:
+	    redraw_down:
+		fbcon_redraw(conp, p, b - 1, b-t-count, -count*conp->vc_cols);
+		p->dispsw->clear(conp, p, real_y(p, t), 0,
+				 count, conp->vc_cols);
+	    	scr_memsetw((unsigned short *)(conp->vc_origin + 
+	    		    conp->vc_size_row * t), 
+	    		    conp->vc_video_erase_char,
+	    		    conp->vc_size_row * count);
+	    	return 1;
 	    }
-	    break;
     }
     return 0;
 }
@@ -1144,11 +1133,11 @@
     	logo_shown = -1;
     }
     p->var.yoffset = p->yscroll*fontheight(p);
-    switch (p->scrollmode) {
-	case SCROLL_YWRAP:
+    switch (p->scrollmode & __SCROLL_YMASK) {
+	case __SCROLL_YWRAP:
 	    scrollback_phys_max = p->vrows-conp->vc_rows;
 	    break;
-	case SCROLL_YPAN:
+	case __SCROLL_YPAN:
 	    scrollback_phys_max = p->vrows-2*conp->vc_rows;
 	    if (scrollback_phys_max < 0)
 		scrollback_phys_max = 0;
@@ -1164,6 +1153,14 @@
 	(*info->switch_con)(conp->vc_num, info);
     if (p->dispsw && p->dispsw->clear_margins)
 	p->dispsw->clear_margins(conp, p);
+    if (logo_shown == -2) {
+	logo_shown = fg_console;
+	fbcon_show_logo(); /* This is protected above by initmem_freed */
+	update_region(fg_console,
+		      conp->vc_origin + conp->vc_size_row * conp->vc_top,
+		      conp->vc_size_row * (conp->vc_bottom - conp->vc_top) / 2);
+	return 0;
+    }
     return 1;
 }
 
@@ -1325,7 +1322,7 @@
 	p->vrows = p->var.yres_virtual/h;
 	updatescrollmode(p);
 	vc_resize_con( p->var.yres/h, p->var.xres/w, unit );
-    } else if (unit == fg_console)
+    } else if (p->fb_info->display_fg == p->conp)
 	update_screen( unit );
 
     if (old_data && (--REFCOUNT(old_data) == 0))
@@ -1547,11 +1544,11 @@
 
     offset = p->yscroll-scrollback_current;
     limit = p->vrows;
-    switch (p->scrollmode) {
-	case SCROLL_YWRAP:
+    switch (p->scrollmode && __SCROLL_YMASK) {
+	case __SCROLL_YWRAP:
 	    p->var.vmode |= FB_VMODE_YWRAP;
 	    break;
-	case SCROLL_YPAN:
+	case __SCROLL_YPAN:
 	    limit -= conp->vc_rows;
 	    p->var.vmode &= ~FB_VMODE_YWRAP;
 	    break;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbcon.h m68k/drivers/video/fbcon.h
--- jes-2.1.119/drivers/video/fbcon.h	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/fbcon.h	Thu Jan  1 01:00:00 1970
@@ -1,424 +0,0 @@
-/*
- *  linux/drivers/video/fbcon.h -- Low level frame buffer based console driver
- *
- *	Copyright (C) 1997 Geert Uytterhoeven
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License.  See the file COPYING in the main directory of this archive
- *  for more details.
- */
-
-#ifndef __VIDEO_FBCON_H
-#define __VIDEO_FBCON_H
-
-#include <linux/config.h>
-#include <linux/console_struct.h>
-
-
-    /*                                  
-     *  `switch' for the Low Level Operations
-     */
- 
-struct display_switch {                                                
-    void (*setup)(struct display *p);
-    void (*bmove)(struct display *p, int sy, int sx, int dy, int dx,
-		  int height, int width);
-    /* for clear, conp may be NULL, which means use a blanking (black) color */
-    void (*clear)(struct vc_data *conp, struct display *p, int sy, int sx,
-		  int height, int width);
-    void (*putc)(struct vc_data *conp, struct display *p, int c, int yy,
-    		 int xx);
-    void (*putcs)(struct vc_data *conp, struct display *p, const unsigned short *s,
-		  int count, int yy, int xx);     
-    void (*revc)(struct display *p, int xx, int yy);
-    void (*cursor)(struct display *p, int mode, int xx, int yy);
-    int  (*set_font)(struct display *p, int width, int height);
-    void (*clear_margins)(struct vc_data *conp, struct display *p);
-    unsigned int fontwidthmask;      /* 1 at (1 << (width - 1)) if width is supported */
-}; 
-
-#define fontheight(p) ((p)->_fontheight)
-#define fontheightlog(p) ((p)->_fontheightlog)
-
-#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
-
-/* fontwidth w is supported by dispsw */
-#define FONTWIDTH(w)	(1 << ((8) - 1))
-/* fontwidths w1-w2 inclusive are supported by dispsw */
-#define FONTWIDTHRANGE(w1,w2)	FONTWIDTH(8)
-
-#define fontwidth(p) (8)
-#define fontwidthlog(p) (0)
-
-#else
-
-/* fontwidth w is supported by dispsw */
-#define FONTWIDTH(w)	(1 << ((w) - 1))
-/* fontwidths w1-w2 inclusive are supported by dispsw */
-#define FONTWIDTHRANGE(w1,w2)	(FONTWIDTH(w2+1) - FONTWIDTH(w1))
-
-#define fontwidth(p) ((p)->_fontwidth)
-#define fontwidthlog(p) ((p)->_fontwidthlog)
-
-#endif
-
-    /*
-     *  Attribute Decoding
-     */
-
-/* Color */
-#define attr_fgcol(p,s)    \
-	(((s) >> ((p)->fgshift)) & 0x0f)
-#define attr_bgcol(p,s)    \
-	(((s) >> ((p)->bgshift)) & 0x0f)
-#define	attr_bgcol_ec(p,conp) \
-	((conp) ? (((conp)->vc_video_erase_char >> ((p)->bgshift)) & 0x0f) : 0)
-
-/* Monochrome */
-#define attr_bold(p,s) \
-	((s) & 0x200)
-#define attr_reverse(p,s) \
-	(((s) & 0x800) ^ ((p)->inverse ? 0x800 : 0))
-#define attr_underline(p,s) \
-	((s) & 0x400)
-#define attr_blink(p,s) \
-	((s) & 0x8000)
-	
-    /*
-     *  Scroll Method
-     */
-
-#define SCROLL_YWRAP	(0)
-#define SCROLL_YPAN	(1)
-#define SCROLL_YMOVE	(2)
-#define SCROLL_YREDRAW	(3)
-
-extern void fbcon_redraw_bmove(struct display *, int, int, int, int, int, int);
-
-
-/* ================================================================= */
-/*                      Utility Assembler Functions                  */
-/* ================================================================= */
-
-
-#ifdef __mc68000__
-
-/* ====================================================================== */
-
-/* Those of a delicate disposition might like to skip the next couple of
- * pages.
- *
- * These functions are drop in replacements for memmove and
- * memset(_, 0, _). However their five instances add at least a kilobyte
- * to the object file. You have been warned.
- *
- * Not a great fan of assembler for the sake of it, but I think
- * that these routines are at least 10 times faster than their C
- * equivalents for large blits, and that's important to the lowest level of
- * a graphics driver. Question is whether some scheme with the blitter
- * would be faster. I suspect not for simple text system - not much
- * asynchrony.
- *
- * Code is very simple, just gruesome expansion. Basic strategy is to
- * increase data moved/cleared at each step to 16 bytes to reduce
- * instruction per data move overhead. movem might be faster still
- * For more than 15 bytes, we try to align the write direction on a
- * longword boundary to get maximum speed. This is even more gruesome.
- * Unaligned read/write used requires 68020+ - think this is a problem?
- *
- * Sorry!
- */
-
-
-/* ++roman: I've optimized Robert's original versions in some minor
- * aspects, e.g. moveq instead of movel, let gcc choose the registers,
- * use movem in some places...
- * For other modes than 1 plane, lots of more such assembler functions
- * were needed (e.g. the ones using movep or expanding color values).
- */
-
-/* ++andreas: more optimizations:
-   subl #65536,d0 replaced by clrw d0; subql #1,d0 for dbcc
-   addal is faster than addaw
-   movep is rather expensive compared to ordinary move's
-   some functions rewritten in C for clarity, no speed loss */
-
-static __inline__ void *mymemclear_small(void *s, size_t count)
-{
-   if (!count)
-      return(0);
-
-   __asm__ __volatile__(
-         "lsrl   #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movew %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t"
-      "1: subql  #1,%1 ; jcs 3f\n\t"
-      "2: moveml %2/%3/%4/%5,%0@-\n\t"
-         "dbra %1,2b\n\t"
-      "3:"
-         : "=a" (s), "=d" (count)
-         :  "d" (0), "d" (0), "d" (0), "d" (0),
-            "0" ((char *)s+count), "1" (count)
-  );
-
-   return(0);
-}
-
-
-static __inline__ void *mymemclear(void *s, size_t count)
-{
-   if (!count)
-      return(0);
-
-   if (count < 16) {
-      __asm__ __volatile__(
-            "lsrl   #1,%1 ; jcc 1f ; clrb %0@+\n\t"
-         "1: lsrl   #1,%1 ; jcc 1f ; clrw %0@+\n\t"
-         "1: lsrl   #1,%1 ; jcc 1f ; clrl %0@+\n\t"
-         "1: lsrl   #1,%1 ; jcc 1f ; clrl %0@+ ; clrl %0@+\n\t"
-         "1:"
-            : "=a" (s), "=d" (count)
-            : "0" (s), "1" (count)
-     );
-   } else {
-      long tmp;
-      __asm__ __volatile__(
-            "movel %1,%2\n\t"
-            "lsrl   #1,%2 ; jcc 1f ; clrb %0@+ ; subqw #1,%1\n\t"
-            "lsrl   #1,%2 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
-            "clrw   %0@+  ; subqw  #2,%1 ; jra 2f\n\t"
-         "1: lsrl   #1,%2 ; jcc 2f\n\t"
-            "clrw   %0@+  ; subqw  #2,%1\n\t"
-         "2: movew %1,%2; lsrl #2,%1 ; jeq 6f\n\t"
-            "lsrl   #1,%1 ; jcc 3f ; clrl %0@+\n\t"
-         "3: lsrl   #1,%1 ; jcc 4f ; clrl %0@+ ; clrl %0@+\n\t"
-         "4: subql  #1,%1 ; jcs 6f\n\t"
-         "5: clrl %0@+; clrl %0@+ ; clrl %0@+ ; clrl %0@+\n\t"
-            "dbra %1,5b   ; clrw %1; subql #1,%1; jcc 5b\n\t"
-         "6: movew %2,%1; btst #1,%1 ; jeq 7f ; clrw %0@+\n\t"
-         "7:            ; btst #0,%1 ; jeq 8f ; clrb %0@+\n\t"
-         "8:"
-            : "=a" (s), "=d" (count), "=d" (tmp)
-            : "0" (s), "1" (count)
-     );
-   }
-
-   return(0);
-}
-
-
-static __inline__ void *mymemset(void *s, size_t count)
-{
-   if (!count)
-      return(0);
-
-   __asm__ __volatile__(
-         "lsrl   #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movew %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@-\n\t"
-      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t"
-      "1: subql  #1,%1 ; jcs 3f\n\t"
-      "2: moveml %2/%3/%4/%5,%0@-\n\t"
-         "dbra %1,2b\n\t"
-      "3:"
-         : "=a" (s), "=d" (count)
-         :  "d" (-1), "d" (-1), "d" (-1), "d" (-1),
-            "0" ((char *) s + count), "1" (count)
-  );
-
-   return(0);
-}
-
-
-static __inline__ void *mymemmove(void *d, const void *s, size_t count)
-{
-   if (d < s) {
-      if (count < 16) {
-         __asm__ __volatile__(
-               "lsrl   #1,%2 ; jcc 1f ; moveb %1@+,%0@+\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movew %1@+,%0@+\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@+,%0@+\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t"
-            "1:"
-               : "=a" (d), "=a" (s), "=d" (count)
-               : "0" (d), "1" (s), "2" (count)
-        );
-      } else {
-         long tmp;
-         __asm__ __volatile__(
-               "movel  %0,%3\n\t"
-               "lsrl   #1,%3 ; jcc 1f ; moveb %1@+,%0@+ ; subqw #1,%2\n\t"
-               "lsrl   #1,%3 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
-               "movew  %1@+,%0@+  ; subqw  #2,%2 ; jra 2f\n\t"
-            "1: lsrl   #1,%3 ; jcc 2f\n\t"
-               "movew  %1@+,%0@+  ; subqw  #2,%2\n\t"
-            "2: movew  %2,%-; lsrl #2,%2 ; jeq 6f\n\t"
-               "lsrl   #1,%2 ; jcc 3f ; movel %1@+,%0@+\n\t"
-            "3: lsrl   #1,%2 ; jcc 4f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t"
-            "4: subql  #1,%2 ; jcs 6f\n\t"
-            "5: movel  %1@+,%0@+;movel %1@+,%0@+\n\t"
-               "movel  %1@+,%0@+;movel %1@+,%0@+\n\t"
-               "dbra   %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t"
-            "6: movew  %+,%2; btst #1,%2 ; jeq 7f ; movew %1@+,%0@+\n\t"
-            "7:              ; btst #0,%2 ; jeq 8f ; moveb %1@+,%0@+\n\t"
-            "8:"
-               : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
-               : "0" (d), "1" (s), "2" (count)
-        );
-      }
-   } else {
-      if (count < 16) {
-         __asm__ __volatile__(
-               "lsrl   #1,%2 ; jcc 1f ; moveb %1@-,%0@-\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movew %1@-,%0@-\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@-,%0@-\n\t"
-            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t"
-            "1:"
-               : "=a" (d), "=a" (s), "=d" (count)
-               : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count)
-        );
-      } else {
-         long tmp;
-         __asm__ __volatile__(
-               "movel %0,%3\n\t"
-               "lsrl   #1,%3 ; jcc 1f ; moveb %1@-,%0@- ; subqw #1,%2\n\t"
-               "lsrl   #1,%3 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
-               "movew  %1@-,%0@-  ; subqw  #2,%2 ; jra 2f\n\t"
-            "1: lsrl   #1,%3 ; jcc 2f\n\t"
-               "movew  %1@-,%0@-  ; subqw  #2,%2\n\t"
-            "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t"
-               "lsrl   #1,%2 ; jcc 3f ; movel %1@-,%0@-\n\t"
-            "3: lsrl   #1,%2 ; jcc 4f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t"
-            "4: subql  #1,%2 ; jcs 6f\n\t"
-            "5: movel %1@-,%0@-;movel %1@-,%0@-\n\t"
-               "movel %1@-,%0@-;movel %1@-,%0@-\n\t"
-               "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t"
-            "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@-,%0@-\n\t"
-            "7:              ; btst #0,%2 ; jeq 8f ; moveb %1@-,%0@-\n\t"
-            "8:"
-               : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
-               : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count)
-        );
-      }
-   }
-
-   return(0);
-}
-
-
-/* ++andreas: Simple and fast version of memmove, assumes size is
-   divisible by 16, suitable for moving the whole screen bitplane */
-static __inline__ void fast_memmove(char *dst, const char *src, size_t size)
-{
-  if (!size)
-    return;
-  if (dst < src)
-    __asm__ __volatile__
-      ("1:"
-       "  moveml %0@+,%/d0/%/d1/%/a0/%/a1\n"
-       "  moveml %/d0/%/d1/%/a0/%/a1,%1@\n"
-       "  addql #8,%1; addql #8,%1\n"
-       "  dbra %2,1b\n"
-       "  clrw %2; subql #1,%2\n"
-       "  jcc 1b"
-       : "=a" (src), "=a" (dst), "=d" (size)
-       : "0" (src), "1" (dst), "2" (size / 16 - 1)
-       : "d0", "d1", "a0", "a1", "memory");
-  else
-    __asm__ __volatile__
-      ("1:"
-       "  subql #8,%0; subql #8,%0\n"
-       "  moveml %0@,%/d0/%/d1/%/a0/%/a1\n"
-       "  moveml %/d0/%/d1/%/a0/%/a1,%1@-\n"
-       "  dbra %2,1b\n"
-       "  clrw %2; subql #1,%2\n"
-       "  jcc 1b"
-       : "=a" (src), "=a" (dst), "=d" (size)
-       : "0" (src + size), "1" (dst + size), "2" (size / 16 - 1)
-       : "d0", "d1", "a0", "a1", "memory");
-}
-
-#else /* !m68k */
-
-    /*
-     *  Anyone who'd like to write asm functions for other CPUs?
-     */
-
-static __inline__ void *mymemclear_small(void *s, size_t count)
-{
-    return(memset(s, 0, count));
-}
-
-static __inline__ void *mymemclear(void *s, size_t count)
-{
-    return(memset(s, 0, count));
-}
-
-static __inline__ void *mymemset(void *s, size_t count)
-{
-    return(memset(s, 255, count));
-}
-
-#ifdef __i386__
-static __inline__ void fast_memmove(void *d, const void *s, size_t count)
-{
-    if (d < s) {
-__asm__ __volatile__ (
-	"cld\n\t"
-	"shrl $1,%%ecx\n\t"
-	"jnc 1f\n\t"
-	"movsb\n"
-	"1:\tshrl $1,%%ecx\n\t"
-	"jnc 2f\n\t"
-	"movsw\n"
-	"2:\trep\n\t"
-	"movsl"
-	: /* no output */
-	:"c"(count),"D"((long)d),"S"((long)s)
-	:"cx","di","si","memory");
-    } else {
-__asm__ __volatile__ (
-	"std\n\t"
-	"shrl $1,%%ecx\n\t"
-	"jnc 1f\n\t"
-	"movb 3(%%esi),%%al\n\t"
-	"movb %%al,3(%%edi)\n\t"
-	"decl %%esi\n\t"
-	"decl %%edi\n"
-	"1:\tshrl $1,%%ecx\n\t"
-	"jnc 2f\n\t"
-	"movw 2(%%esi),%%ax\n\t"
-	"movw %%ax,2(%%edi)\n\t"
-	"decl %%esi\n\t"
-	"decl %%edi\n\t"
-	"decl %%esi\n\t"
-	"decl %%edi\n"
-	"2:\trep\n\t"
-	"movsl"
-	: /* no output */
-	:"c"(count),"D"(count-4+(long)d),"S"(count-4+(long)s)
-	:"ax","cx","di","si","memory");
-    }
-}
-
-static __inline__ void *mymemmove(char *dst, const char *src, size_t size)
-{
-    fast_memmove(dst, src, size);
-    return dst;
-}
-#else
-static __inline__ void *mymemmove(void *d, const void *s, size_t count)
-{
-    return(memmove(d, s, count));
-}
-
-static __inline__ void fast_memmove(char *dst, const char *src, size_t size)
-{
-    memmove(dst, src, size);
-}
-#endif	/* !i386 */
-
-#endif /* !m68k */
-
-#endif /* __VIDEO_FBCON_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbgen.c m68k/drivers/video/fbgen.c
--- jes-2.1.119/drivers/video/fbgen.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/fbgen.c	Mon Aug 31 00:46:03 1998
@@ -255,7 +255,7 @@
 	display->can_soft_blank = 1;
     else
 	display->can_soft_blank = 0;
-    display->dispsw = fbhw->get_dispsw(&par, info);
+    fbhw->set_dispsw(&par, display, info);
 #if 0 /* FIXME: generic inverse is not supported yet */
     display->inverse = (fix.visual == FB_VISUAL_MONO01 ? !inverse : inverse);
 #else
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fbmem.c m68k/drivers/video/fbmem.c
--- jes-2.1.119/drivers/video/fbmem.c	Thu Jan  1 01:00:00 1970
+++ m68k/drivers/video/fbmem.c	Mon Aug 31 00:46:03 1998
@@ -0,0 +1,677 @@
+/*
+ *  linux/drivers/video/fbmem.c
+ *
+ *  Copyright (C) 1994 Martin Schaller
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/malloc.h>
+#include <linux/mman.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/console_struct.h>
+#include <linux/init.h>
+#ifdef CONFIG_PROC_FS
+#include <linux/proc_fs.h>
+#endif
+#ifdef CONFIG_KMOD
+#include <linux/kmod.h>
+#endif
+
+#ifdef __mc68000__
+#include <asm/setup.h>
+#endif
+#ifdef __powerpc__
+#include <asm/io.h>
+#endif
+#include <asm/uaccess.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+
+#include <linux/fb.h>
+
+
+    /*
+     *  Frame buffer device initialization and setup routines
+     */
+
+extern unsigned long acornfb_init(void);
+extern void acornfb_setup(char *options, int *ints);
+extern void amifb_init(void);
+extern void amifb_setup(char *options, int *ints);
+extern void atafb_init(void);
+extern void atafb_setup(char *options, int *ints);
+extern void macfb_init(void);
+extern void macfb_setup(char *options, int *ints);
+extern void cyberfb_init(void);
+extern void cyberfb_setup(char *options, int *ints);
+extern void retz3fb_init(void);
+extern void retz3fb_setup(char *options, int *ints);
+extern void clgenfb_init(void);
+extern void clgenfb_setup(char *options, int *ints);
+extern void vfb_init(void);
+extern void vfb_setup(char *options, int *ints);
+extern void offb_init(void);
+extern void offb_setup(char *options, int *ints);
+extern void atyfb_init(void);
+extern void atyfb_setup(char *options, int *ints);
+extern void dnfb_init(void);
+extern void tgafb_init(void);
+extern void virgefb_init(void);
+extern void virgefb_setup(char *options, int *ints);
+extern void resolver_video_setup(char *options, int *ints);
+extern void s3triofb_init(void);
+extern void s3triofb_setup(char *options, int *ints);
+extern void vesafb_init(void);
+extern void vesafb_setup(char *options, int *ints);
+extern void hpfb_init(void);
+extern void hpfb_setup(char *options, int *ints);
+extern void sbusfb_init(void);
+extern void sbusfb_setup(char *options, int *ints);
+extern void valkyriefb_init(void);
+extern void valkyriefb_setup(char *options, int *ints);
+
+static struct {
+	const char *name;
+	void (*init)(void);
+	void (*setup)(char *options, int *ints);
+} fb_drivers[] __initdata = {
+#ifdef CONFIG_FB_RETINAZ3
+	{ "retz3", retz3fb_init, retz3fb_setup },
+#endif
+#ifdef CONFIG_FB_ACORN
+	{ "acorn", acornfb_init, acornfb_setup },
+#endif
+#ifdef CONFIG_FB_AMIGA
+	{ "amifb", amifb_init, amifb_setup },
+#endif
+#ifdef CONFIG_FB_ATARI
+	{ "atafb", atafb_init, atafb_setup },
+#endif
+#ifdef CONFIG_FB_MAC
+	{ "macfb", macfb_init, macfb_setup },
+#endif
+#ifdef CONFIG_FB_CYBER
+	{ "cyber", cyberfb_init, cyberfb_setup },
+#endif
+#ifdef CONFIG_FB_CLGEN
+	{ "clgen", clgenfb_init, clgenfb_setup },
+#endif
+#ifdef CONFIG_FB_OF
+	{ "offb", offb_init, offb_setup },
+#endif
+#ifdef CONFIG_FB_ATY
+	{ "atyfb", atyfb_init, atyfb_setup },
+#endif
+#ifdef CONFIG_APOLLO
+	{ "apollo", dnfb_init, NULL },
+#endif
+#ifdef CONFIG_FB_S3TRIO
+	{ "s3trio", s3triofb_init, s3triofb_setup },
+#endif 
+#ifdef CONFIG_FB_TGA
+	{ "tga", tgafb_init, NULL },
+#endif
+#ifdef CONFIG_FB_VIRGE
+	{ "virge", virgefb_init, virgefb_setup },
+#endif
+#ifdef CONFIG_FB_VESA
+	{ "vesa", vesafb_init, vesafb_setup },
+#endif 
+#ifdef CONFIG_FB_HP300
+	{ "hpfb", hpfb_init, hpfb_setup },
+#endif 
+#ifdef CONFIG_FB_SBUS
+	{ "sbus", sbusfb_init, sbusfb_setup },
+#endif
+#ifdef CONFIG_FB_VALKYRIE
+	{ "valkyriefb", valkyriefb_init, valkyriefb_setup },
+#endif
+#ifdef CONFIG_GSP_RESOLVER
+	/* Not a real frame buffer device... */
+	{ "resolver", NULL, resolver_video_setup },
+#endif
+#ifdef CONFIG_FB_VIRTUAL
+	/* Must be last to avoid that vfb becomes your primary display */
+	{ "vfb", vfb_init, vfb_setup },
+#endif
+};
+
+#define NUM_FB_DRIVERS	(sizeof(fb_drivers)/sizeof(*fb_drivers))
+
+static void (*pref_init_funcs[FB_MAX])(void);
+static int num_pref_init_funcs __initdata = 0;
+
+
+#define GET_INODE(i) MKDEV(FB_MAJOR, (i) << FB_MODES_SHIFT)
+#define GET_FB_VAR_IDX(node) (MINOR(node) & ((1 << FB_MODES_SHIFT)-1)) 
+
+struct fb_info *registered_fb[FB_MAX];
+int num_registered_fb = 0;
+
+char con2fb_map[MAX_NR_CONSOLES];
+
+static int first_fb_vc = 0;
+static int last_fb_vc = MAX_NR_CONSOLES-1;
+static int fbcon_is_default = 1;
+
+static inline int PROC_CONSOLE(void)
+{
+	if (!current->tty)
+		return fg_console;
+
+	if (current->tty->driver.type != TTY_DRIVER_TYPE_CONSOLE)
+		/* XXX Should report error here? */
+		return fg_console;
+
+	if (MINOR(current->tty->device) < 1)
+		return fg_console;
+
+	return MINOR(current->tty->device) - 1;
+}
+
+#ifdef CONFIG_PROC_FS
+static int fbmem_read_proc(char *buf, char **start, off_t offset,
+			   int len, int *eof, void *private)
+{
+	struct fb_info **fi;
+
+	len = 0;
+	for (fi = registered_fb; fi < &registered_fb[FB_MAX] && len < 4000; fi++)
+		if (*fi)
+			len += sprintf(buf + len, "%d %s\n",
+				       GET_FB_IDX((*fi)->node),
+				       (*fi)->modename);
+	*start = buf + offset;
+	return len > offset ? len - offset : 0;
+}
+#endif
+
+static ssize_t
+fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+{
+	unsigned long p = *ppos;
+	struct inode *inode = file->f_dentry->d_inode;
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
+	struct fb_fix_screeninfo fix;
+	char *base_addr;
+	ssize_t copy_size;
+
+	if (! fb || ! info->disp)
+		return -ENODEV;
+
+	fb->fb_get_fix(&fix,PROC_CONSOLE(), info);
+	base_addr=info->disp->screen_base;
+	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
+	if (copy_to_user(buf, base_addr+p, copy_size))
+	    return -EFAULT;
+	*ppos += copy_size;
+	return copy_size;
+}
+
+static ssize_t
+fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+	unsigned long p = *ppos;
+	struct inode *inode = file->f_dentry->d_inode;
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
+	struct fb_fix_screeninfo fix;
+	char *base_addr;
+	ssize_t copy_size;
+
+	if (! fb || ! info->disp)
+		return -ENODEV;
+
+	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
+	base_addr=info->disp->screen_base;
+	copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
+	if (copy_from_user(base_addr+p, buf, copy_size))
+	    return -EFAULT;
+	file->f_pos += copy_size;
+	return copy_size;
+}
+
+
+static void set_con2fb_map(int unit, int newidx)
+{
+    int oldidx = con2fb_map[unit];
+    struct fb_info *oldfb, *newfb;
+    struct vc_data *conp;
+    char *fontdata;
+    unsigned short fontwidth, fontheight, fontwidthlog, fontheightlog;
+    int userfont;
+
+    if (newidx != con2fb_map[unit]) {
+       oldfb = registered_fb[oldidx];
+       newfb = registered_fb[newidx];
+       if (newfb->fbops->fb_open(newfb,0))
+	   return;
+       oldfb->fbops->fb_release(oldfb,0);
+       conp = fb_display[unit].conp;
+       fontdata = fb_display[unit].fontdata;
+       fontwidth = fb_display[unit]._fontwidth;
+       fontheight = fb_display[unit]._fontheight;
+       fontwidthlog = fb_display[unit]._fontwidthlog;
+       fontheightlog = fb_display[unit]._fontheightlog;
+       userfont = fb_display[unit].userfont;
+       con2fb_map[unit] = newidx;
+       fb_display[unit] = *(newfb->disp);
+       fb_display[unit].conp = conp;
+       fb_display[unit].fontdata = fontdata;
+       fb_display[unit]._fontwidth = fontwidth;
+       fb_display[unit]._fontheight = fontheight;
+       fb_display[unit]._fontwidthlog = fontwidthlog;
+       fb_display[unit]._fontheightlog = fontheightlog;
+       fb_display[unit].userfont = userfont;
+       fb_display[unit].fb_info = newfb;
+       if (!newfb->changevar)
+	   newfb->changevar = oldfb->changevar;
+       /* tell console var has changed */
+       if (newfb->changevar)
+	   newfb->changevar(unit);
+    }
+}
+
+#ifdef CONFIG_KMOD
+static void try_to_load(int fb)
+{
+	char modname[16];
+
+	sprintf(modname, "fb%d", fb);
+	request_module(modname);
+}
+#endif /* CONFIG_KMOD */
+
+static int 
+fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+	 unsigned long arg)
+{
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
+	struct fb_cmap cmap;
+	struct fb_var_screeninfo var;
+	struct fb_fix_screeninfo fix;
+	struct fb_con2fbmap con2fb;
+	int i;
+	
+	if (! fb)
+		return -ENODEV;
+	switch (cmd) {
+	case FBIOGET_VSCREENINFO:
+		if ((i = fb->fb_get_var(&var, PROC_CONSOLE(), info)))
+			return i;
+		return copy_to_user((void *) arg, &var,
+				    sizeof(var)) ? -EFAULT : 0;
+	case FBIOPUT_VSCREENINFO:
+		if (copy_from_user(&var, (void *) arg, sizeof(var)))
+			return -EFAULT;
+		if ((i = fb->fb_set_var(&var, PROC_CONSOLE(), info)))
+			return i;
+		if (copy_to_user((void *) arg, &var, sizeof(var)))
+			return -EFAULT;
+		return 0;
+	case FBIOGET_FSCREENINFO:
+		if ((i = fb->fb_get_fix(&fix, PROC_CONSOLE(), info)))
+			return i;
+		return copy_to_user((void *) arg, &fix, sizeof(fix)) ?
+			-EFAULT : 0;
+	case FBIOPUTCMAP:
+		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
+			return -EFAULT;
+		return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(), info));
+	case FBIOGETCMAP:
+		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
+			return -EFAULT;
+		return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(), info));
+	case FBIOPAN_DISPLAY:
+		if (copy_from_user(&var, (void *) arg, sizeof(var)))
+			return -EFAULT;
+		if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(), info)))
+			return i;
+		if (copy_to_user((void *) arg, &var, sizeof(var)))
+			return -EFAULT;
+		return i;
+	case FBIOGET_CON2FBMAP:
+		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
+			return -EFAULT;
+		if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
+		    return -EINVAL;
+		con2fb.framebuffer = con2fb_map[con2fb.console-1];
+		return copy_to_user((void *)arg, &con2fb,
+				    sizeof(con2fb)) ? -EFAULT : 0;
+	case FBIOPUT_CON2FBMAP:
+		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
+			return - EFAULT;
+		if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES)
+		    return -EINVAL;
+		if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
+		    return -EINVAL;
+#ifdef CONFIG_KMOD
+		if (!registered_fb[con2fb.framebuffer])
+		    try_to_load(con2fb.framebuffer);
+#endif /* CONFIG_KMOD */
+		if (!registered_fb[con2fb.framebuffer])
+		    return -EINVAL;
+		if (con2fb.console != 0)
+		    set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
+		else
+		    /* set them all */
+		    for (i = 0; i < MAX_NR_CONSOLES; i++)
+			set_con2fb_map(i, con2fb.framebuffer);
+		return 0;
+	default:
+		return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(),
+				    info);
+	}
+}
+
+static int 
+fb_mmap(struct file *file, struct vm_area_struct * vma)
+{
+	int fbidx = GET_FB_IDX(file->f_dentry->d_inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+	struct fb_ops *fb = info->fbops;
+	struct fb_fix_screeninfo fix;
+	struct fb_var_screeninfo var;
+	unsigned long start;
+	u32 len;
+
+	if (!fb)
+		return -ENODEV;
+	if (fb->fb_mmap)
+		return fb->fb_mmap(info, file, vma);
+	fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
+
+	/* frame buffer memory */
+	start = (unsigned long)fix.smem_start;
+	len = (start & ~PAGE_MASK)+fix.smem_len;
+	start &= PAGE_MASK;
+	len = (len+~PAGE_MASK) & PAGE_MASK;
+	if (vma->vm_offset >= len) {
+		/* memory mapped io */
+		vma->vm_offset -= len;
+		fb->fb_get_var(&var, PROC_CONSOLE(), info);
+		if (var.accel_flags)
+			return -EINVAL;
+		start = (unsigned long)fix.mmio_start;
+		len = (start & ~PAGE_MASK)+fix.mmio_len;
+		start &= PAGE_MASK;
+		len = (len+~PAGE_MASK) & PAGE_MASK;
+	}
+	if ((vma->vm_end - vma->vm_start + vma->vm_offset) > len)
+		return -EINVAL;
+	vma->vm_offset += start;
+	if (vma->vm_offset & ~PAGE_MASK)
+		return -ENXIO;
+#if defined(__mc68000__)
+	if (CPU_IS_020_OR_030)
+		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
+	if (CPU_IS_040_OR_060) {
+		pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
+		/* Use no-cache mode, serialized */
+		pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
+	}
+#elif defined(__powerpc__)
+	pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
+#elif defined(__alpha__)
+	/* Caching is off in the I/O space quadrant by design.  */
+#elif defined(__sparc__)
+	/* Should never get here, all fb drivers should have their own
+	   mmap routines */
+#elif defined(__i386__)
+	if (boot_cpu_data.x86 > 3)
+		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
+#else
+#warning What do we have to do here??
+#endif
+	if (remap_page_range(vma->vm_start, vma->vm_offset,
+			     vma->vm_end - vma->vm_start, vma->vm_page_prot))
+		return -EAGAIN;
+	vma->vm_file = file;
+	file->f_count++;
+	return 0;
+}
+
+static int
+fb_open(struct inode *inode, struct file *file)
+{
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info;
+
+#ifdef CONFIG_KMOD
+	if (!(info = registered_fb[fbidx]))
+		try_to_load(fbidx);
+#endif /* CONFIG_KMOD */
+	if (!(info = registered_fb[fbidx]))
+		return -ENODEV;
+	return info->fbops->fb_open(info,1);
+}
+
+static int 
+fb_release(struct inode *inode, struct file *file)
+{
+	int fbidx = GET_FB_IDX(inode->i_rdev);
+	struct fb_info *info = registered_fb[fbidx];
+
+	info->fbops->fb_release(info,1);
+	return 0;
+}
+
+static struct file_operations fb_fops = {
+	NULL,		/* lseek	*/
+	fb_read,	/* read		*/
+	fb_write,	/* write	*/
+	NULL,		/* readdir 	*/
+	NULL,		/* poll 	*/
+	fb_ioctl,	/* ioctl 	*/
+	fb_mmap,	/* mmap		*/
+	fb_open,	/* open 	*/
+	NULL,		/* flush	*/
+	fb_release,	/* release 	*/
+	NULL		/* fsync 	*/
+};
+
+int
+register_framebuffer(struct fb_info *fb_info)
+{
+	int i, j;
+	static int fb_ever_opened[FB_MAX];
+	static int first = 1;
+
+	if (num_registered_fb == FB_MAX)
+		return -ENXIO;
+	num_registered_fb++;
+	for (i = 0 ; i < FB_MAX; i++)
+		if (!registered_fb[i])
+			break;
+	fb_info->node=GET_INODE(i);
+	registered_fb[i] = fb_info;
+	if (!fb_ever_opened[i]) {
+		/*
+		 *  We assume initial frame buffer devices can be opened this
+		 *  many times
+		 */
+		for (j = 0; j < MAX_NR_CONSOLES; j++)
+			if (con2fb_map[j] == i)
+				fb_info->fbops->fb_open(fb_info,0);
+		fb_ever_opened[i] = 1;
+	}
+
+	if (first) {
+		first = 0;
+		take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default);
+	}
+
+	return 0;
+}
+
+int
+unregister_framebuffer(const struct fb_info *fb_info)
+{
+	int i, j;
+
+	i = GET_FB_IDX(fb_info->node);
+	for (j = 0; j < MAX_NR_CONSOLES; j++)
+		if (con2fb_map[j] == i)
+			return -EBUSY;
+	if (!registered_fb[i])
+		return -EINVAL; 
+	registered_fb[i]=NULL;
+	num_registered_fb--;
+	return 0;
+}
+
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry *proc_fbmem;
+#endif
+
+__initfunc(void
+fbmem_init(void))
+{
+	int i;
+
+#ifdef CONFIG_PROC_FS
+	proc_fbmem = create_proc_entry("fb", 0, 0);
+	if (proc_fbmem)
+		proc_fbmem->read_proc = fbmem_read_proc;
+#endif
+
+	if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
+		printk("unable to get major %d for fb devs\n", FB_MAJOR);
+
+	/*
+	 *  Probe for all builtin frame buffer devices
+	 */
+	for (i = 0; i < num_pref_init_funcs; i++)
+		pref_init_funcs[i]();
+
+	for (i = 0; i < NUM_FB_DRIVERS; i++)
+		if (fb_drivers[i].init)
+			fb_drivers[i].init();
+}
+
+
+int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
+			const struct fb_info *fb_info)
+{
+#if 0
+	/*
+	 * long long divisions .... $#%%#$ 
+	 */
+    unsigned long long hpicos, vpicos;
+    const unsigned long long _1e12 = 1000000000000ULL;
+    const struct fb_monspecs *monspecs = &fb_info->monspecs;
+
+    hpicos = (unsigned long long)htotal*(unsigned long long)pixclock;
+    vpicos = (unsigned long long)vtotal*(unsigned long long)hpicos;
+    if (!vpicos)
+	return 0;
+
+    if (monspecs->hfmin == 0)
+	return 1;
+
+    if (hpicos*monspecs->hfmin > _1e12 || hpicos*monspecs->hfmax < _1e12 ||
+	vpicos*monspecs->vfmin > _1e12 || vpicos*monspecs->vfmax < _1e12)
+	return 0;
+#endif
+    return 1;
+}
+
+int fbmon_dpms(const struct fb_info *fb_info)
+{
+    return fb_info->monspecs.dpms;
+}
+
+
+    /*
+     *  Command line options
+     */
+
+__initfunc(void video_setup(char *options, int *ints))
+{
+    int i, j;
+
+    if (!options || !*options)
+	    return;
+	    
+    if (!strncmp(options, "map:", 4)) {
+	    options += 4;
+	    if (*options)
+		    for (i = 0, j = 0; i < MAX_NR_CONSOLES; i++) {
+			    if (!options[j])
+				    j = 0;
+			    con2fb_map[i] = (options[j++]-'0') % FB_MAX;
+		    }
+	    return;
+    }
+
+    if (!strncmp(options, "vc:", 3)) {
+	    options += 3;
+	    if (*options)
+		first_fb_vc = simple_strtoul(options, &options, 10);
+	    if (*options++ == '-')
+		last_fb_vc = simple_strtoul(options, &options, 10);
+	    fbcon_is_default = 0;
+    }
+
+    if (num_pref_init_funcs == FB_MAX)
+	    return;
+
+    for (i = 0; i < NUM_FB_DRIVERS; i++) {
+	    j = strlen(fb_drivers[i].name);
+	    if (!strncmp(options, fb_drivers[i].name, j) &&
+		options[j] == ':') {
+		    if (!strcmp(options+j+1, "off"))
+			    fb_drivers[i].init = NULL;
+		    else {
+			    if (fb_drivers[i].init) {
+				    pref_init_funcs[num_pref_init_funcs++] =
+					    fb_drivers[i].init;
+				    fb_drivers[i].init = NULL;
+			    }
+			    if (fb_drivers[i].setup)
+				    fb_drivers[i].setup(options+j+1, ints);
+		    }
+		    return;
+	    }
+    }
+    /*
+     * If we get here no fb was specified and we default to pass the
+     * options to the first frame buffer that has an init and a setup
+     * function.
+     */
+    for (i = 0; i < NUM_FB_DRIVERS; i++) {
+	    if (fb_drivers[i].init && fb_drivers[i].setup) {
+		    pref_init_funcs[num_pref_init_funcs++] =
+			    fb_drivers[i].init;
+		    fb_drivers[i].init = NULL;
+
+		    fb_drivers[i].setup(options, ints);
+		    return;
+	    }
+    }
+}
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(register_framebuffer);
+EXPORT_SYMBOL(unregister_framebuffer);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font.h m68k/drivers/video/font.h
--- jes-2.1.119/drivers/video/font.h	Mon Aug 10 09:30:44 1998
+++ m68k/drivers/video/font.h	Thu Jan  1 01:00:00 1970
@@ -1,51 +0,0 @@
-/*
- *  font.h -- `Soft' font definitions
- *
- *  Created 1995 by Geert Uytterhoeven
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License.  See the file COPYING in the main directory of this archive
- *  for more details.
- */
-
-#ifndef _FONT_H_
-#define _FONT_H_
-
-#include <linux/types.h>
-
-struct fbcon_font_desc {
-    int idx;
-    char *name;
-    int width, height;
-    void *data;
-    int pref;
-};
-
-#define VGA8x8_IDX	0
-#define VGA8x16_IDX	1
-#define PEARL8x8_IDX	2
-#define VGA6x11_IDX	3
-#define SUN8x16_IDX	4
-#define SUN12x22_IDX	5
-#define ACORN8x8_IDX	6
-
-extern struct fbcon_font_desc	font_vga_8x8,
-				font_vga_8x16,
-				font_pearl_8x8,
-				font_vga_6x11,
-				font_sun_8x16,
-				font_sun_12x22,
-				font_acorn_8x8;
-
-/* Find a font with a specific name */
-
-extern struct fbcon_font_desc *fbcon_find_font(char *name);
-
-/* Get the default font for a specific screen size */
-
-extern struct fbcon_font_desc *fbcon_get_default_font(int xres, int yres);
-
-/* Max. length for the name of a predefined font */
-#define MAX_FONT_NAME	32
-
-#endif /* _FONT_H_ */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_6x11.c m68k/drivers/video/font_6x11.c
--- jes-2.1.119/drivers/video/font_6x11.c	Mon Aug 10 09:30:45 1998
+++ m68k/drivers/video/font_6x11.c	Mon Aug 31 00:46:03 1998
@@ -4,7 +4,7 @@
 /*                                            */
 /**********************************************/
 
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX (11*256)
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_8x16.c m68k/drivers/video/font_8x16.c
--- jes-2.1.119/drivers/video/font_8x16.c	Mon Aug 10 09:30:46 1998
+++ m68k/drivers/video/font_8x16.c	Mon Aug 31 00:46:03 1998
@@ -4,7 +4,7 @@
 /*                                            */
 /**********************************************/
 
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX 4096
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_8x8.c m68k/drivers/video/font_8x8.c
--- jes-2.1.119/drivers/video/font_8x8.c	Mon Aug 10 09:30:47 1998
+++ m68k/drivers/video/font_8x8.c	Mon Aug 31 00:46:03 1998
@@ -4,7 +4,7 @@
 /*                                            */
 /**********************************************/
 
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX 2048
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_acorn_8x8.c m68k/drivers/video/font_acorn_8x8.c
--- jes-2.1.119/drivers/video/font_acorn_8x8.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/font_acorn_8x8.c	Mon Aug 31 00:46:03 1998
@@ -2,7 +2,7 @@
 
 #include <linux/config.h>
 
-#include "font.h"
+#include <video/font.h>
 
 static unsigned char acorndata_8x8[] = {
 /* 00 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_pearl_8x8.c m68k/drivers/video/font_pearl_8x8.c
--- jes-2.1.119/drivers/video/font_pearl_8x8.c	Mon Aug 10 09:30:48 1998
+++ m68k/drivers/video/font_pearl_8x8.c	Mon Aug 31 00:46:03 1998
@@ -9,7 +9,7 @@
 /*                                            */
 /**********************************************/
 
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX 2048
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_sun12x22.c m68k/drivers/video/font_sun12x22.c
--- jes-2.1.119/drivers/video/font_sun12x22.c	Mon Aug 10 09:30:50 1998
+++ m68k/drivers/video/font_sun12x22.c	Mon Aug 31 00:46:03 1998
@@ -1,4 +1,4 @@
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX 5632
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/font_sun8x16.c m68k/drivers/video/font_sun8x16.c
--- jes-2.1.119/drivers/video/font_sun8x16.c	Mon Aug 10 09:30:51 1998
+++ m68k/drivers/video/font_sun8x16.c	Mon Aug 31 00:46:03 1998
@@ -1,4 +1,4 @@
-#include "font.h"
+#include <video/font.h>
 
 #define FONTDATAMAX 4096
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/fonts.c m68k/drivers/video/fonts.c
--- jes-2.1.119/drivers/video/fonts.c	Mon Aug 10 09:30:51 1998
+++ m68k/drivers/video/fonts.c	Mon Aug 31 00:46:03 1998
@@ -16,7 +16,7 @@
 #if defined(__mc68000__) || defined(CONFIG_APUS)
 #include <asm/setup.h>
 #endif
-#include "font.h"
+#include <video/font.h>
 
 #define NO_FONTS
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/g364fb.c m68k/drivers/video/g364fb.c
--- jes-2.1.119/drivers/video/g364fb.c	Thu Jan  1 01:00:00 1970
+++ m68k/drivers/video/g364fb.c	Mon Aug 31 00:46:03 1998
@@ -0,0 +1,515 @@
+/* $Id: g364fb.c,v 1.1 1998/08/19 21:56:39 ralf Exp $
+ *
+ * linux/drivers/video/g364fb.c -- Mips Magnum frame buffer device
+ *
+ * (C) 1998 Thomas Bogendoerfer
+ *
+ *  This driver is based on tgafb.c
+ *
+ *	Copyright (C) 1997 Geert Uytterhoeven 
+ *	Copyright (C) 1995  Jay Estabrook
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License. See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/malloc.h>
+#include <linux/vmalloc.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/selection.h>
+#include <linux/console.h>
+#include <asm/io.h>
+#include <asm/jazz.h>
+
+#include "fbcon.h"
+#include "fbcon-cfb8.h"
+
+/* 
+ * Various defines for the G364
+ */
+#define G364_MEM_BASE   0xe4400000
+#define G364_PORT_BASE  0xe4000000
+#define ID_REG 		0xe4000000  	/* Read only */
+#define BOOT_REG 	0xe4080000
+#define TIMING_REG 	0xe4080108 	/* to 0x080170 - DON'T TOUCH! */
+#define DISPLAY_REG 	0xe4080118
+#define VDISPLAY_REG 	0xe4080150
+#define MASK_REG 	0xe4080200
+#define CTLA_REG 	0xe4080300
+#define CURS_TOGGLE 	0x800000
+#define BIT_PER_PIX	0x700000	/* bits 22 to 20 of Control A */
+#define DELAY_SAMPLE    0x080000
+#define PORT_INTER	0x040000
+#define PIX_PIPE_DEL	0x030000	/* bits 17 and 16 of Control A */
+#define PIX_PIPE_DEL2	0x008000	/* same as above - don't ask me why */
+#define TR_CYCLE_TOG	0x004000
+#define VRAM_ADR_INC	0x003000	/* bits 13 and 12 of Control A */
+#define BLANK_OFF	0x000800
+#define FORCE_BLANK	0x000400
+#define BLK_FUN_SWTCH	0x000200
+#define BLANK_IO	0x000100
+#define BLANK_LEVEL	0x000080
+#define A_VID_FORM	0x000040
+#define D_SYNC_FORM	0x000020
+#define FRAME_FLY_PAT	0x000010
+#define OP_MODE		0x000008
+#define INTL_STAND	0x000004
+#define SCRN_FORM	0x000002
+#define ENABLE_VTG	0x000001	
+#define TOP_REG 	0xe4080400
+#define CURS_PAL_REG 	0xe4080508 	/* to 0x080518 */
+#define CHKSUM_REG 	0xe4080600 	/* to 0x080610 - unused */
+#define CURS_POS_REG 	0xe4080638
+#define CLR_PAL_REG 	0xe4080800	/* to 0x080ff8 */
+#define CURS_PAT_REG 	0xe4081000	/* to 0x081ff8 */
+#define MON_ID_REG 	0xe4100000 	/* unused */
+#define RESET_REG 	0xe4180000  	/* Write only */
+
+#define arraysize(x)	(sizeof(x)/sizeof(*(x)))
+
+static int currcon = 0;
+static struct display disp;
+static struct fb_info fb_info;
+static struct { u_char red, green, blue, pad; } palette[256];
+
+static struct fb_fix_screeninfo fb_fix = { { "G364 8plane", } };
+static struct fb_var_screeninfo fb_var = { 0, };
+
+
+/*
+ *  Interface used by the world
+ */
+static int g364fb_open(struct fb_info *info);
+static int g364fb_release(struct fb_info *info);
+static int g364fb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			  struct fb_info *info);
+static int g364fb_get_var(struct fb_var_screeninfo *var, int con,
+			  struct fb_info *info);
+static int g364fb_set_var(struct fb_var_screeninfo *var, int con,
+			  struct fb_info *info);
+static int g364fb_pan_display(struct fb_var_screeninfo *var, int con,
+			      struct fb_info *info);
+static int g364fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			   struct fb_info *info);
+static int g364fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			   struct fb_info *info);
+static int g364fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
+			u_long arg, int con, struct fb_info *info);
+
+
+/*
+ *  Interface to the low level console driver
+ */
+void g364fb_init(void);
+static int g364fbcon_switch(int con, struct fb_info *info);
+static int g364fbcon_updatevar(int con, struct fb_info *info);
+static void g364fbcon_blank(int blank, struct fb_info *info);
+
+
+/*
+ *  Internal routines
+ */
+static int g364fb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+			    u_int *transp, struct fb_info *info);
+static int g364fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			    u_int transp, struct fb_info *info);
+static void do_install_cmap(int con, struct fb_info *info);
+
+
+static struct fb_ops g364fb_ops = {
+    g364fb_open, g364fb_release, g364fb_get_fix, g364fb_get_var, g364fb_set_var,
+    g364fb_get_cmap, g364fb_set_cmap, g364fb_pan_display, g364fb_ioctl
+};
+
+
+void fbcon_g364fb_cursor(struct display *p, int mode, int x, int y)
+{
+    switch (mode) {
+     case CM_ERASE:
+	*(unsigned int *) CTLA_REG |= CURS_TOGGLE;
+	break;
+
+     case CM_MOVE:
+     case CM_DRAW:
+	*(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
+	*(unsigned int *) CURS_POS_REG = ((x * p->fontwidth) << 12) | ((y * p->fontheight)-p->var.yoffset);
+	break;
+    }
+}
+
+
+static struct display_switch fbcon_g364cfb8 = {
+    fbcon_cfb8_setup, fbcon_cfb8_bmove, fbcon_cfb8_clear, fbcon_cfb8_putc,
+    fbcon_cfb8_putcs, fbcon_cfb8_revc, fbcon_g364fb_cursor
+};
+
+
+/*
+ *  Open/Release the frame buffer device
+ */
+static int g364fb_open(struct fb_info *info)                                       
+{
+    /*                                                                     
+     *  Nothing, only a usage count for the moment                          
+     */                                                                    
+    MOD_INC_USE_COUNT;
+    return(0);                              
+}
+        
+static int g364fb_release(struct fb_info *info)
+{
+    MOD_DEC_USE_COUNT;
+    return(0);                                                    
+}
+
+
+/*
+ *  Get the Fixed Part of the Display
+ */
+static int g364fb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			  struct fb_info *info)
+{
+    memcpy(fix, &fb_fix, sizeof(fb_fix));
+    return 0;
+}
+
+
+/*
+ *  Get the User Defined Part of the Display
+ */
+static int g364fb_get_var(struct fb_var_screeninfo *var, int con,
+			  struct fb_info *info)
+{
+    memcpy(var, &fb_var, sizeof(fb_var));
+    return 0;
+}
+
+
+/*
+ *  Set the User Defined Part of the Display
+ */
+static int g364fb_set_var(struct fb_var_screeninfo *var, int con,
+			  struct fb_info *info)
+{
+    struct display *display;
+    int oldbpp = -1, err;
+
+    if (con >= 0)
+	display = &fb_display[con];
+    else
+	display = &disp;	/* used during initialization */
+
+    if (var->xres > fb_var.xres || var->yres > fb_var.yres ||
+	var->xres_virtual > fb_var.xres_virtual ||
+	var->yres_virtual > fb_var.yres_virtual ||
+	var->bits_per_pixel > fb_var.bits_per_pixel ||
+	var->nonstd ||
+	(var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
+	return -EINVAL;
+    memcpy(var, &fb_var, sizeof(fb_var));
+    
+    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+	oldbpp = display->var.bits_per_pixel;
+	display->var = *var;
+	*(unsigned int *)TOP_REG = var->yoffset * var->xres;	
+    }
+    if (oldbpp != var->bits_per_pixel) {
+	if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
+	    return err;
+	do_install_cmap(con, info);
+    }
+    return 0;
+}
+
+
+/*
+ *  Pan or Wrap the Display
+ *
+ *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
+ */
+static int g364fb_pan_display(struct fb_var_screeninfo *var, int con,
+			      struct fb_info *info)
+{
+    if (var->xoffset || var->yoffset+var->yres > var->yres_virtual)
+	return -EINVAL;
+    
+    *(unsigned int *)TOP_REG = var->yoffset * var->xres;
+    return 0;
+}
+
+/*
+ *  Get the Colormap
+ */
+static int g364fb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			   struct fb_info *info)
+{
+    if (con == currcon) /* current console? */
+	return fb_get_cmap(cmap, &fb_display[con].var, kspc, g364fb_getcolreg,
+			   info);
+    else if (fb_display[con].cmap.len) /* non default colormap? */
+	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
+    else
+	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+		     cmap, kspc ? 0 : 2);
+    return 0;
+}
+
+/*
+ *  Set the Colormap
+ */
+static int g364fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			   struct fb_info *info)
+{
+    int err;
+
+    if (!fb_display[con].cmap.len) {	/* no colormap allocated? */
+	if ((err = fb_alloc_cmap(&fb_display[con].cmap,
+				 1<<fb_display[con].var.bits_per_pixel, 0)))
+	    return err;
+    }
+    if (con == currcon) {		/* current console? */
+	err = fb_set_cmap(cmap, &fb_display[con].var, kspc, g364fb_setcolreg,
+			  info);
+	return err;
+    } else
+	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+    return 0;
+}
+
+
+static int g364fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
+			u_long arg, int con, struct fb_info *info)
+{
+    return -EINVAL;
+}
+
+
+/*
+ *  Initialisation
+ */
+__initfunc(void g364fb_init(void))
+{
+    int err;
+    int i,j;
+    volatile unsigned int *pal_ptr = (volatile unsigned int *) CLR_PAL_REG;
+    volatile unsigned int *curs_pal_ptr = (volatile unsigned int *) CURS_PAL_REG;
+    unsigned int xres, yres;
+    int mem;
+    
+    /* TBD: G364 detection */
+    
+    /* get the resolution set by ARC console */
+    *(volatile unsigned int *)CTLA_REG &= ~ENABLE_VTG;
+    xres = (*((volatile unsigned int*)DISPLAY_REG) & 0x00ffffff) * 4;
+    yres = (*((volatile unsigned int*)VDISPLAY_REG) & 0x00ffffff) / 2;
+    *(volatile unsigned int *)CTLA_REG |= ENABLE_VTG;    
+
+    /* initialise color palette */
+    for (i = 0; i < 16; i++) {
+	j = color_table[i];
+	palette[i].red=default_red[j];
+	palette[i].green=default_grn[j];
+	palette[i].blue=default_blu[j];
+	pal_ptr[i << 1] = (palette[i].red << 16) | (palette[i].green << 8) | palette[i].blue;
+    }
+    
+    /* setup cursor */
+    curs_pal_ptr[0] |= 0x00ffffff;
+    curs_pal_ptr[2] |= 0x00ffffff;
+    curs_pal_ptr[4] |= 0x00ffffff;
+
+    /*
+     * first set the whole cursor to transparent
+     */
+    for (i = 0; i < 512; i++)
+	*(unsigned short *)(CURS_PAT_REG+i*8) = 0;
+
+    /*
+     * switch the last two lines to cursor palette 3
+     * we assume here, that FONTSIZE_X is 8
+     */
+    *(unsigned short *)(CURS_PAT_REG + 14*64) = 0xffff;
+    *(unsigned short *)(CURS_PAT_REG + 15*64) = 0xffff;			    
+
+    fb_var.bits_per_pixel = 8;
+    fb_var.xres = fb_var.xres_virtual = xres;
+    fb_var.yres = yres;
+
+    fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
+    fb_fix.smem_start = (char *)0x40000000; /* physical address */
+    /* get size of video memory; this is special for the JAZZ hardware */
+    mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;
+    fb_fix.smem_len = (1 << (mem*2)) * 512 * 1024;
+    fb_fix.type = FB_TYPE_PACKED_PIXELS;
+    fb_fix.type_aux = 0;
+    fb_fix.visual = FB_VISUAL_PSEUDOCOLOR;    
+    fb_fix.xpanstep = 0;
+    fb_fix.ypanstep = 1;
+    fb_fix.ywrapstep = 0;
+    fb_fix.mmio_start = NULL;
+    fb_fix.mmio_len = 0;
+    fb_fix.accel = FB_ACCEL_NONE;
+    
+    fb_var.yres_virtual = fb_fix.smem_len / xres;
+    fb_var.xoffset = fb_var.yoffset = 0;
+    fb_var.grayscale = 0;
+
+    fb_var.red.offset = 0;
+    fb_var.green.offset = 0;
+    fb_var.blue.offset = 0;
+
+    fb_var.red.length = fb_var.green.length = fb_var.blue.length = 8;
+    fb_var.red.msb_right = fb_var.green.msb_right = fb_var.blue.msb_right = 0;
+    fb_var.transp.offset = fb_var.transp.length = fb_var.transp.msb_right = 0;
+    fb_var.nonstd = 0;
+    fb_var.activate = 0;
+    fb_var.height = fb_var.width = -1;
+    fb_var.accel_flags = 0;
+    fb_var.pixclock = 39722;
+    fb_var.left_margin = 40;
+    fb_var.right_margin = 24;
+    fb_var.upper_margin = 32;
+    fb_var.lower_margin = 11;
+    fb_var.hsync_len = 96;
+    fb_var.vsync_len = 2;
+    fb_var.sync = 0;
+    fb_var.vmode = FB_VMODE_NONINTERLACED;
+
+    disp.var = fb_var;
+    disp.cmap.start = 0;
+    disp.cmap.len = 0;
+    disp.cmap.red = disp.cmap.green = disp.cmap.blue = disp.cmap.transp = NULL;
+    disp.screen_base = G364_MEM_BASE; /* virtual kernel address */
+    disp.visual = fb_fix.visual;
+    disp.type = fb_fix.type;
+    disp.type_aux = fb_fix.type_aux;
+    disp.ypanstep = fb_fix.ypanstep;
+    disp.ywrapstep = fb_fix.ywrapstep;
+    disp.line_length = fb_fix.line_length;
+    disp.can_soft_blank = 1;
+    disp.inverse = 0;
+    disp.dispsw = &fbcon_g364cfb8;
+
+    strcpy(fb_info.modename, fb_fix.id);
+    fb_info.node = -1;
+    fb_info.fbops = &g364fb_ops;
+    fb_info.disp = &disp;
+    fb_info.fontname[0] = '\0';
+    fb_info.changevar = NULL;
+    fb_info.switch_con = &g364fbcon_switch;
+    fb_info.updatevar = &g364fbcon_updatevar;
+    fb_info.blank = &g364fbcon_blank;
+
+    err = register_framebuffer(&fb_info);
+    if (err < 0)
+	return;
+
+    g364fb_set_var(&fb_var, -1, &fb_info);
+
+    printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node),
+	   fb_fix.id);
+}
+
+
+static int g364fbcon_switch(int con, struct fb_info *info)
+{
+    /* Do we have to save the colormap? */
+    if (fb_display[currcon].cmap.len)
+	fb_get_cmap(&fb_display[currcon].cmap, &fb_display[currcon].var, 1,
+		    g364fb_getcolreg, info);
+
+    currcon = con;
+    /* Install new colormap */
+    do_install_cmap(con, info);
+    g364fbcon_updatevar(con, info);    
+    return 0;
+}
+
+/*
+ *  Update the `var' structure (called by fbcon.c)
+ */
+static int g364fbcon_updatevar(int con, struct fb_info *info)
+{
+    if (con == currcon) {
+	struct fb_var_screeninfo *var = &fb_display[currcon].var;
+
+	/* hardware scrolling */
+	*(unsigned int *)TOP_REG = var->yoffset * var->xres;	
+    }
+    return 0;
+}
+
+/*
+ *  Blank the display.
+ */
+static void g364fbcon_blank(int blank, struct fb_info *info)
+{
+    if (blank)
+	*(unsigned int *) CTLA_REG |= FORCE_BLANK;	
+    else
+	*(unsigned int *) CTLA_REG &= ~FORCE_BLANK;	
+}
+
+/*
+ *  Read a single color register and split it into
+ *  colors/transparent. Return != 0 for invalid regno.
+ */
+static int g364fb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+			    u_int *transp, struct fb_info *info)
+{
+    if (regno > 255)
+	return 1;
+    *red = palette[regno].red;
+    *green = palette[regno].green;
+    *blue = palette[regno].blue;
+    return 0;
+}
+
+/*
+ *  Set a single color register. The values supplied are already
+ *  rounded down to the hardware's capabilities (according to the
+ *  entries in the var structure). Return != 0 for invalid regno.
+ */
+static int g364fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			    u_int transp, struct fb_info *info)
+{
+    volatile unsigned int *ptr = (volatile unsigned int *) CLR_PAL_REG;
+
+    if (regno > 255)
+	return 1;
+    palette[regno].red = red;
+    palette[regno].green = green;
+    palette[regno].blue = blue;
+    
+    ptr[regno << 1] = (red << 16) | (green << 8) | blue;
+
+    return 0;
+}
+
+
+static void do_install_cmap(int con, struct fb_info *info)
+{
+    if (con != currcon)
+	return;
+    if (fb_display[con].cmap.len)
+	fb_set_cmap(&fb_display[con].cmap, &fb_display[con].var, 1,
+		    g364fb_setcolreg, info);
+    else
+	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+				    &fb_display[con].var, 1, g364fb_setcolreg,
+				    info);
+}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/hpfb.c m68k/drivers/video/hpfb.c
--- jes-2.1.119/drivers/video/hpfb.c	Fri Jul 10 19:21:45 1998
+++ m68k/drivers/video/hpfb.c	Mon Aug 31 00:46:03 1998
@@ -22,10 +22,10 @@
 #include <asm/blinken.h>
 #include <asm/hwtest.h>
 
-#include "fbcon-mfb.h"
-#include "fbcon-cfb2.h"
-#include "fbcon-cfb4.h"
-#include "fbcon-cfb8.h"
+#include <video/fbcon-mfb.h>
+#include <video/fbcon-cfb2.h>
+#include <video/fbcon-cfb4.h>
+#include <video/fbcon-cfb8.h>
 
 #define arraysize(x)    (sizeof(x)/sizeof(*(x)))
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/imsttfb.c m68k/drivers/video/imsttfb.c
--- jes-2.1.119/drivers/video/imsttfb.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/imsttfb.c	Mon Aug 31 00:46:04 1998
@@ -4,8 +4,11 @@
  *  This file is derived from the powermac console "imstt" driver:
  *  Copyright (C) 1997 Sigurdur Asgeirsson
  *  With additional hacking by Jeffrey Kuskin (jsk@mojave.stanford.edu)
+ *  Modified by Danilo Beuche 1998
+ *  Some register values added by Damien Doligez, INRIA Rocquencourt
  *
- *  most of the frame buffer device stuff was copied from atyfb.c
+ *  This file was written by Ryan Nielsen (ran@krazynet.com)
+ *  Most of the frame buffer device stuff was copied from atyfb.c
  *
  *  This file is subject to the terms and conditions of the GNU General Public
  *  License. See the file COPYING in the main directory of this archive for
@@ -34,108 +37,25 @@
 #include <linux/nvram.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
-#include "macmodes.h"
+#include <video/macmodes.h>
 #endif
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb24.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb24.h>
+#include <video/fbcon-cfb32.h>
 
-#ifdef CONFIG_FB_COMPAT_XPMAC
-#include <asm/vc_ioctl.h>
-
-extern struct vc_mode display_info;
-extern struct fb_info *console_fb_info;
-
-void
-set_display_info (struct display *disp)
-{
-	display_info.width = disp->var.xres;
-	display_info.height = disp->var.yres;
-	display_info.depth = disp->var.bits_per_pixel;
-	display_info.pitch = disp->var.xres * (disp->var.bits_per_pixel / 8);
-	switch (disp->var.xres) {
-		case 640:
-			display_info.mode = 6;
-			break;
-		case 832:
-			display_info.mode = 13;
-			break;
-		case 1024:
-			display_info.mode = 17;
-			break;
-		case 1152:
-			display_info.mode = 18;
-			break;
-		case 1280:
-			display_info.mode = disp->var.yres == 960 ? 19 : 20;
-			break;
-		default:
-			display_info.mode = 0;
-	}
-}
+#ifndef __powerpc__
+#define eieio()		/* Enforce In-order Execution of I/O */
 #endif
 
 enum {
-	PADDRW	= 0x00,
-	PDATA	= 0x04,
-	PPMASK	= 0x08,
-	PADDRR	= 0x0C,
-	PIDXLO	= 0x10,	
-	PIDXHI	= 0x14,	
-	PIDXDATA= 0x18,
-	PIDXCTL	= 0x1C,
-
-	PPIXREP	= 0x0A,
-	PM0	= 0x20,
-	PN0	= 0x21,
-	PP0	= 0x22,
-	PC0	= 0x23,
-	MCTL_3	= 0x72
-};
-
-struct initvalues {
-	__u8 addr, value;
-};
-
-static struct initvalues initregs[] = {
-	{ 0x02, 0x21 },	/* (0x01) Miscellaneous Clock Control */
-	{ 0x03, 0x00 },	/* (0x00) Sync Control */
-	{ 0x04, 0x00 },	/* (0x00) Horizontal Sync Position */
-	{ 0x05, 0x00 },	/* (0x00) Power Management */
-	{ 0x06, 0x03 },	/* (0x02) DAC Operation */
-	{ 0x07, 0x00 },	/* (0x00) Palette Control */
-	{ 0x08, 0x01 },	/* (0x01) System Clock Control */
-
-	/*
-	 * Note that colors in X are correct only if all video data is
-	 * passed through the palette in the DAC.  That is, "indirect
-	 * color" must be configured.  This is the case for the IBM DAC
-	 * used in the 2MB and 4MB cards, at least.
-	 */
-	{ 0x0B, 0x00 },	/* (U) 8 BPP Control */
-	{ 0x0C, 0x01 },	/* (U) 16 BPP Control; the "1" means use 555 RGB color encoding */
-	{ 0x0D, 0x00 },	/* (U) 24 BPP Packed Control */
-	{ 0x0E, 0x00 },	/* (U) 32 BPP Control */
-
-	{ 0x10, 0x05 },	/* (0x00) Pixel PLL Control 1 */
-	{ 0x11, 0x00 },	/* (0x00) Pixel PLL Control 2 */
-	{ 0x15, 0x08 },	/* (0x08) SYSCLK N (System PLL Reference Divider) */
-	{ 0x16, 0x4f },	/* (0x41) SYSCLK M (System PLL VCO Divider) */
-	{ 0x17, 0x00 },	/* (U) SYSCLK P */
-	{ 0x18, 0x00 },	/* (U) SYSCLK C */
-	{ 0x30, 0x00 },	/* (0x00) Cursor Control */
-	{ 0x60, 0xFF },	/* (U) Border Color Red */
-	{ 0x61, 0xFF },	/* (U) Border Color Green */
-	{ 0x62, 0xFF },	/* (U) Border Color Blue */
-	{ 0x70, 0x01 },	/* (0x00) Miscellaneous Control 1 */
-	{ 0x71, 0x45 },	/* (0x00) Miscellaneous Control 2 */
-	{ 0x72, 0x00 },	/* (0x00) Miscellaneous Control 3 */
-	{ 0x78, 0x00 },	/* (0x00) Key Control/DB Operation */
+	IBM = 0x00,
+	TVP = 0x01
 };
 
+/* TwinTurbo registers */
 enum {
 	S1SA	=  0, /* 0x00 */
 	S2SA	=  1, /* 0x04 */
@@ -192,143 +112,627 @@
 #endif
 };
 
-#define USE_NV_VMODE
+/* IBM ramdac registers */
+enum {
+	PADDRW	= 0x00,
+	PDATA	= 0x04,
+	PPMASK	= 0x08,
+	PADDRR	= 0x0C,
+	PIDXLO	= 0x10,	
+	PIDXHI	= 0x14,	
+	PIDXDATA= 0x18,
+	PIDXCTL	= 0x1C,
+
+	PPIXREP	= 0x0A,
+	PM0	= 0x20,
+	PN0	= 0x21,
+	PP0	= 0x22,
+	PC0	= 0x23,
+	MCTL_3	= 0x72
+};
+
+/* TI TVP 3030 RAMDAC Direct Registers */
+enum  {
+	TVPADDRW = 0x00,	/* 0  Palette/Cursor RAM Write Adress/Index */
+	TVPPDATA = 0x04,	/* 1  Palette Data RAM Data */
+	TVPPMASK = 0x08,	/* 2  Pixel Read-Mask */
+	TVPPADRR = 0x0c,	/* 3  Palette/Cursor RAM Read Adress */
+	TVPCADRW = 0x10,	/* 4  Cursor/Overscan Color Write Address */
+	TVPCDATA = 0x14,	/* 5  Cursor/Overscan Color Data */
+				/* 6  reserved */
+	TVPCADRR = 0x1c,	/* 7  Cursor/Overscan Color Read Address */
+				/* 8  reserved */
+	TVPDCCTL = 0x24,	/* 9  Direct Cursor Control */
+	TVPIDATA = 0x28,	/* 10 Index Data */
+	TVPCRDAT = 0x2c,	/* 11 Cursor RAM Data */
+	TVPCXPOL = 0x30,	/* 12 Cursor-Position X LSB */
+	TVPCXPOH = 0x34,	/* 13 Cursor-Position X MSB */
+	TVPCYPOL = 0x38,	/* 14 Cursor-Position Y LSB */
+	TVPCYPOH = 0x3c,	/* 15 Cursor-Position Y MSB */
+};
+
+/* TI TVP 3030 RAMDAC Indirect Registers */
+enum {
+	TVPIRREV = 0x01,	/* Silicon Revision [RO] */
+	TVPIRICC = 0x06,	/* Indirect Cursor Control 	(0x00) */
+	TVPIRBRC = 0x07,	/* Byte Router Control 	(0xe4) */
+	TVPIRLAC = 0x0f,	/* Latch Control 		(0x06) */
+	TVPIRTCC = 0x18,	/* True Color Control  	(0x80) */
+	TVPIRMXC = 0x19,	/* Multiplex Control		(0x98) */
+	TVPIRCLS = 0x1a,	/* Clock Selection		(0x07) */
+	TVPIRPPG = 0x1c,	/* Palette Page		(0x00) */
+	TVPIRGEC = 0x1d,	/* General Control 		(0x00) */
+	TVPIRMIC = 0x1e,	/* Miscellaneous Control	(0x00) */
+	TVPIRPLA = 0x2c,	/* PLL Address */
+	TVPIRPPD = 0x2d,	/* Pixel Clock PLL Data */
+	TVPIRMPD = 0x2e,	/* Memory Clock PLL Data */
+	TVPIRLPD = 0x2f,	/* Loop Clock PLL Data */
+	TVPIRCKL = 0x30,	/* Color-Key Overlay Low */
+	TVPIRCKH = 0x31,	/* Color-Key Overlay High */
+	TVPIRCRL = 0x32,	/* Color-Key Red Low */
+	TVPIRCRH = 0x33,	/* Color-Key Red High */
+	TVPIRCGL = 0x34,	/* Color-Key Green Low */
+	TVPIRCGH = 0x35,	/* Color-Key Green High */
+	TVPIRCBL = 0x36,	/* Color-Key Blue Low */
+	TVPIRCBH = 0x37,	/* Color-Key Blue High */
+	TVPIRCKC = 0x38,	/* Color-Key Control 		(0x00) */
+	TVPIRMLC = 0x39,	/* MCLK/Loop Clock Control	(0x18) */
+	TVPIRSEN = 0x3a,	/* Sense Test			(0x00) */
+	TVPIRTMD = 0x3b,	/* Test Mode Data */
+	TVPIRRML = 0x3c,	/* CRC Remainder LSB [RO] */
+	TVPIRRMM = 0x3d,	/* CRC Remainder MSB [RO] */
+	TVPIRRMS = 0x3e,	/* CRC  Bit Select [WO] */
+	TVPIRDID = 0x3f,	/* Device ID [RO] 		(0x30) */
+	TVPIRRES = 0xff		/* Software Reset [WO] */
+};
+
+struct initvalues {
+	__u8 addr, value;
+};
+
+static struct initvalues ibm_initregs[] = {
+	{ 0x02, 0x21 },	/* (0x01) Miscellaneous Clock Control */
+	{ 0x03, 0x00 },	/* (0x00) Sync Control */
+	{ 0x04, 0x00 },	/* (0x00) Horizontal Sync Position */
+	{ 0x05, 0x00 },	/* (0x00) Power Management */
+	{ 0x06, 0x03 },	/* (0x02) DAC Operation */
+	{ 0x07, 0x00 },	/* (0x00) Palette Control */
+	{ 0x08, 0x01 },	/* (0x01) System Clock Control */
+
+	/*
+	 * Note that colors in X are correct only if all video data is
+	 * passed through the palette in the DAC.  That is, "indirect
+	 * color" must be configured.  This is the case for the IBM DAC
+	 * used in the 2MB and 4MB cards, at least.
+	 */
+	{ 0x0b, 0x00 },	/* (U) 8 BPP Control */
+	{ 0x0c, 0x00 },	/* (U) 16 BPP Control; the "1" means use 555 RGB color encoding */
+	{ 0x0d, 0x00 },	/* (U) 24 BPP Packed Control */
+	{ 0x0e, 0x00 },	/* (U) 32 BPP Control */
+
+	{ 0x10, 0x05 },	/* (0x00) Pixel PLL Control 1 */
+	{ 0x11, 0x00 },	/* (0x00) Pixel PLL Control 2 */
+	{ 0x15, 0x08 },	/* (0x08) SYSCLK N (System PLL Reference Divider) */
+	{ 0x16, 0x4f },	/* (0x41) SYSCLK M (System PLL VCO Divider) */
+	{ 0x17, 0x00 },	/* (U) SYSCLK P */
+	{ 0x18, 0x00 },	/* (U) SYSCLK C */
+	{ 0x30, 0x00 },	/* (0x00) Cursor Control */
+	{ 0x60, 0xff },	/* (U) Border Color Red */
+	{ 0x61, 0xff },	/* (U) Border Color Green */
+	{ 0x62, 0xff },	/* (U) Border Color Blue */
+	{ 0x70, 0x01 },	/* (0x00) Miscellaneous Control 1 */
+	{ 0x71, 0x45 },	/* (0x00) Miscellaneous Control 2 */
+	{ 0x72, 0x00 },	/* (0x00) Miscellaneous Control 3 */
+	{ 0x78, 0x00 }	/* (0x00) Key Control/DB Operation */
+};
+
+static struct initvalues tvp_initregs[] = {
+	{ 0x6, 0x00 },
+	{ 0x7, 0xe4 },
+	{ 0xf, 0x06 },
+	{ 0x18, 0x80 },
+	{ 0x19, 0x4d },
+	{ 0x1a, 0x05 },
+	{ 0x1c, 0x00 },
+	{ 0x1d, 0x00 },
+	{ 0x1e, 0x08 },
+	{ 0x30, 0xff },
+	{ 0x31, 0xff },
+	{ 0x32, 0xff },
+	{ 0x33, 0xff },
+	{ 0x34, 0xff },
+	{ 0x35, 0xff },
+	{ 0x36, 0xff },
+	{ 0x37, 0xff },
+	{ 0x38, 0x00 },
+	{ TVPIRPLA, 0x00 },
+	{ TVPIRPPD, 0xc0 },
+	{ TVPIRPPD, 0xd5 },
+	{ TVPIRPPD, 0xea },
+	{ TVPIRPLA, 0x00 },
+	{ TVPIRMPD, 0xb9 },
+	{ TVPIRMPD, 0x3a },
+	{ TVPIRMPD, 0xb1 },
+	{ TVPIRPLA, 0x00 },
+	{ TVPIRLPD, 0xc1 },
+	{ TVPIRLPD, 0x3d },
+	{ TVPIRLPD, 0xf3 },
+};
+
+struct fb_info_imstt {
+	struct fb_info info;
+	struct fb_fix_screeninfo fix;
+	struct display disp;
+	struct {
+		__u8 red, green, blue;
+	} palette[256];
+	__u8 *frame_buffer_phys, *frame_buffer;
+	__u32 *dc_regs_phys, *dc_regs;
+	__u8 *cmap_regs_phys, *cmap_regs;
+	__u32 total_vram;
+	__u32 ramdac;
+	union {
+#ifdef FBCON_HAS_CFB16
+		__u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB24
+		__u32 cfb24[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+		__u32 cfb32[16];
+#endif
+	} fbcon_cmap;
+};
+
+#define USE_NV_MODES
 #define INIT_BPP	8
 #define INIT_XRES	640
 #define INIT_YRES	480
 #define MAX_XRES	1600
 #define MAX_YRES	1200
 
+static int currcon = 0;
+
 /*
+ * for the IBM ramdac:
  * Dot clock rate is 20MHz * (m + 1) / ((n + 1) * (p ? 2 * p : 1)
  * where m = clk[0], n = clk[1], p = clk[2]
  * clk[3] is c, charge pump bias which depends on the VCO frequency  
  */
 struct imstt_regvals {
-	__u16 cfg[9];
-	__u8 clk[4];
+	__u16 hes, heb, hsb, ht, ves, veb, vsb, vt, vil;
+	__u8 pclk_m, pclk_n, pclk_p;
 	__u32 pitch;
+	/* Values of the tvp which change depending on colormode x resolution */
+	__u8 mlc[3];	/* Memory Loop Config 0x39 */
+	__u8 lckl_p[3];	/* P value of LCKL PLL */
 };
 
 /* 1600x1200, 75Hz */
-static struct imstt_regvals imstt_reg_init_1600x1200x75 = {
-	{ 0x0018, 0x0040, 0x0108, 0x010c, 0x0003, 0x002a, 0x04da, 0x04dd, 0x04da },
-	{ 0x09, 0x00, 0x00, 0x02 },
+static struct imstt_regvals ibm_reg_init_1600x1200x75 = {
+	0x0018, 0x0040, 0x0108, 0x010c, 0x0003, 0x002a, 0x04da, 0x04dd, 0x04da,
+	0x09, 0x00, 0x00,
 	1600
 };
 
 /* 1280x1024, 75Hz (20) */
-static struct imstt_regvals imstt_reg_init_20 = {
-	{ 0x0012, 0x002f, 0x00cf, 0x00d3, 0x0003, 0x0029, 0x0429, 0x042a, 0x0429 },
-	{ 0x1a, 0x03, 0x00, 0x02 },
+static struct imstt_regvals ibm_reg_init_20 = {
+	0x0012, 0x002f, 0x00cf, 0x00d3, 0x0003, 0x0029, 0x0429, 0x042a, 0x0429,
+	0x1a, 0x03, 0x00,
 	1280
 };
 
 /* 1280x960, 75Hz (19) */
-static struct imstt_regvals imstt_reg_init_19 = {
-	{ 0x0012, 0x0030, 0x00d0, 0x00d2, 0x0003, 0x0027, 0x03e7, 0x03e8, 0x03e7 },
-	{ 0x3e, 0x09, 0x00, 0x02 },
+static struct imstt_regvals ibm_reg_init_19 = {
+	0x0012, 0x0030, 0x00d0, 0x00d2, 0x0003, 0x0027, 0x03e7, 0x03e8, 0x03e7,
+	0x3e, 0x09, 0x00,
 	1280
 };
 
 /* 1152x870, 75Hz (18) */
-static struct imstt_regvals imstt_reg_init_18 = {
-	{ 0x0012, 0x0022, 0x00b2, 0x00b6, 0x0003, 0x0031, 0x0397, 0x039a, 0x0397 }, 
-	{ 0x3c, 0x0b, 0x00, 0x02 },
+static struct imstt_regvals ibm_reg_init_18 = {
+	0x0012, 0x0022, 0x00b2, 0x00b6, 0x0003, 0x0031, 0x0397, 0x039a, 0x0397, 
+	0x3c, 0x0b, 0x00,
 	1152
 };
 
 /* 1024x768, 75Hz (17) */
 #if 1
-static struct imstt_regvals imstt_reg_init_17 = {
-	{ 0x000a, 0x001c, 0x009c, 0x00a6, 0x0003, 0x0020, 0x0320, 0x0323, 0x0320 }, 
-	{ 0x07, 0x00, 0x01, 0x02 },
+static struct imstt_regvals ibm_reg_init_17 = {
+	0x000a, 0x001c, 0x009c, 0x00a6, 0x0003, 0x0020, 0x0320, 0x0323, 0x0320, 
+	0x07, 0x00, 0x01,
 	1024
 };
 #else
 /* this almost works with a 14" apple multiple scan monitor */
-static struct imstt_regvals imstt_reg_init_17 = {
-	{ 0x000a, 0x001d, 0x009c, 0x00ac, 0x0003, 0x0020, 0x0320, 0x0323, 0x0320 }, 
-	{ 0x3e, 0x0a, 0x01, 0x02 },
+static struct imstt_regvals ibm_reg_init_17 = {
+	0x000a, 0x001d, 0x009c, 0x00ac, 0x0003, 0x0020, 0x0320, 0x0323, 0x0320, 
+	0x3e, 0x0a, 0x01,
 	1024
 };
 #endif
 
 /* 832x624, 75Hz (13) */
-static struct imstt_regvals imstt_reg_init_13 = {
-	{ 0x0005, 0x0020, 0x0088, 0x0090, 0x0003, 0x0028, 0x0298, 0x029b, 0x0298 },
-	{ 0x3e, 0x0a, 0x01, 0x02 },
+static struct imstt_regvals ibm_reg_init_13 = {
+	0x0005, 0x0020, 0x0088, 0x0090, 0x0003, 0x0028, 0x0298, 0x029b, 0x0298,
+	0x3e, 0x0a, 0x01,
 	832
 };
 
 /* 640x480, 67Hz (6) */
-static struct imstt_regvals imstt_reg_init_6 = {
-	{ 0x0008, 0x0012, 0x0062, 0x006c, 0x0003, 0x002a, 0x020a, 0x020c, 0x020a },
-	{ 0x78, 0x13, 0x02, 0x02 },
+static struct imstt_regvals ibm_reg_init_6 = {
+	0x0008, 0x0012, 0x0062, 0x006c, 0x0003, 0x002a, 0x020a, 0x020c, 0x020a,
+	0x78, 0x13, 0x02,
 	640
 };
 
+static struct imstt_regvals tvp_reg_init_2 = {
+	0x0002, 0x0006, 0x0026, 0x0028, 0x0003, 0x0016, 0x0196, 0x0197, 0x0196,
+	0xec, 0x2a, 0xf3,
+	512,
+	{ 0x3c, 0x3b, 0x39 }, { 0xf3, 0xf3, 0xf3 }
+};
+
+static struct imstt_regvals tvp_reg_init_6 = {
+	0x0004, 0x0009, 0x0031, 0x0036, 0x0003, 0x002a, 0x020a, 0x020d, 0x020a,
+	0xef, 0x2e, 0xb2,
+	640,
+	{ 0x39, 0x39, 0x38 }, { 0xf3, 0xf3, 0xf3 }
+};
+
+static struct imstt_regvals tvp_reg_init_12 = {
+	0x0005, 0x000e, 0x0040, 0x0042, 0x0003, 0x018, 0x270, 0x271, 0x270,
+	0xf6, 0x2e, 0xf2,
+	800,
+	{ 0x3a, 0x39, 0x38 }, { 0xf3, 0xf3, 0xf3 }
+};
+
+static struct imstt_regvals tvp_reg_init_13 = {
+	0x0004, 0x0011, 0x0045, 0x0048, 0x0003, 0x002a, 0x029a, 0x029b, 0x0000,
+	0xfe, 0x3e, 0xf1,
+	832,
+	{ 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
+};
+
+static struct imstt_regvals tvp_reg_init_17 = {
+	0x0006, 0x0210, 0x0250, 0x0053, 0x1003, 0x0021, 0x0321, 0x0324, 0x0000,
+	0xfc, 0x3a, 0xf1,
+	1024,
+	{ 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
+};
+
+static struct imstt_regvals tvp_reg_init_18 = {
+  	0x0009, 0x0011, 0x059, 0x5b, 0x0003, 0x0031, 0x0397, 0x039a, 0x0000, 
+	0xfd, 0x3a, 0xf1,
+	1152,
+	{ 0x39, 0x38, 0x38 }, { 0xf3, 0xf3, 0xf2 }
+};
+
+static struct imstt_regvals tvp_reg_init_19 = {
+	0x0009, 0x0016, 0x0066, 0x0069, 0x0003, 0x0027, 0x03e7, 0x03e8, 0x03e7,
+	0xf7, 0x36, 0xf0,
+	1280,
+	{ 0x38, 0x38, 0x38 }, { 0xf3, 0xf2, 0xf1 }
+};
+
+static struct imstt_regvals tvp_reg_init_20 = {
+	0x0009, 0x0018, 0x0068, 0x006a, 0x0003, 0x0029, 0x0429, 0x042a, 0x0000,
+	0xf0, 0x2d, 0xf0,
+	1280,
+	{ 0x38, 0x38, 0x38 }, { 0xf3, 0xf2, 0xf1 }
+};
+
 static struct imstt_regvals *
-compute_imstt_regvals (int xres, int yres)
+compute_imstt_regvals_ibm (int xres, int yres)
 {
 	struct imstt_regvals *init;
 
 	switch (xres) {
 		case 640:
-			init = &imstt_reg_init_6;
+			init = &ibm_reg_init_6;
 			break;
 		case 832:
-			init = &imstt_reg_init_13;
+			init = &ibm_reg_init_13;
 			break;
 		case 1024:
-			init = &imstt_reg_init_17;
+			init = &ibm_reg_init_17;
 			break;
 		case 1152:
-			init = &imstt_reg_init_18;
+			init = &ibm_reg_init_18;
 			break;
 		case 1280:
-			init = yres == 960 ? &imstt_reg_init_19 : &imstt_reg_init_20;
+			init = yres == 960 ? &ibm_reg_init_19 : &ibm_reg_init_20;
 			break;
 		case 1600:
-			init = &imstt_reg_init_1600x1200x75;
+			init = &ibm_reg_init_1600x1200x75;
 			break;
 		default:
 			init = 0;
 			break;
 	}
 
-#if 0
-	init->cfg[2] = init->cfg[1] + (xres / 8);
-	init->cfg[3] = init->cfg[2] + 8;	// +8 for 13, +4 for 18, +10 for others
-	init->cfg[4] = 0x0003;
-	init->cfg[7] = init->cfg[6] + 3;
-	init->cfg[8] = init->cfg[6];
-	
-	init->clk[3] = 0x02;
+	return init;
+}
 
-	init->pitch = xres;
-#endif
+static struct imstt_regvals *
+compute_imstt_regvals_tvp (int xres, int yres)
+{
+	struct imstt_regvals *init;
+
+	switch (xres) {
+		case 512:
+			init = &tvp_reg_init_2;
+			break;
+		case 640:
+			init = &tvp_reg_init_6;
+			break;
+		case 800:
+			init = &tvp_reg_init_12;
+			break;
+		case 832:
+			init = &tvp_reg_init_13;
+			break;
+		case 1024:
+			init = &tvp_reg_init_17;
+			break;
+		case 1152:
+			init = &tvp_reg_init_18;
+			break;
+		case 1280:
+			init = yres == 960 ? &tvp_reg_init_19 : &tvp_reg_init_20;
+			break;
+		default:
+			init = 0;
+			break;
+	}
 
 	return init;
 }
 
-struct fb_info_imstt {
-	struct fb_info info;
-	struct fb_fix_screeninfo fix;
-	struct fb_var_screeninfo var;
-	struct display disp;
-	struct {
-		__u8 red, green, blue;
-	} palette[256];
-	__u8 *frame_buffer_phys, *frame_buffer;
-	__u32 *dc_regs_phys, *dc_regs;
-	__u8 *cmap_regs_phys, *cmap_regs;
-	__u32 total_vram;
-};
+static struct imstt_regvals *
+compute_imstt_regvals (struct fb_info_imstt *p, int xres, int yres)
+{
+	if (p->ramdac == IBM)
+		return compute_imstt_regvals_ibm(xres, yres);
+	else
+		return compute_imstt_regvals_tvp(xres, yres);
+}
 
-static int currcon = 0;
+static void
+set_imstt_regvals_ibm (struct fb_info_imstt *p, struct imstt_regvals *init, int bpp)
+{
+	__u8 pformat = (bpp >> 3) + 2;
 
-static void set_imstt_regvals (struct fb_info_imstt *p, struct imstt_regvals *init, int bpp);
+	p->cmap_regs[PIDXHI] = 0;		eieio();
+	p->cmap_regs[PIDXLO] = PM0;		eieio();
+	p->cmap_regs[PIDXDATA] = init->pclk_m;	eieio();
+	p->cmap_regs[PIDXLO] = PN0;		eieio();
+	p->cmap_regs[PIDXDATA] = init->pclk_n;	eieio();
+	p->cmap_regs[PIDXLO] = PP0;		eieio();
+	p->cmap_regs[PIDXDATA] = init->pclk_p;	eieio();
+	p->cmap_regs[PIDXLO] = PC0;		eieio();
+	p->cmap_regs[PIDXDATA] = 0x02;		eieio();
+
+	p->cmap_regs[PIDXHI] = 0;		eieio();
+	p->cmap_regs[PIDXLO] = PPIXREP;		eieio();
+	p->cmap_regs[PIDXDATA] = pformat;	eieio();
+	p->cmap_regs[PIDXHI] = 0;		eieio();
+}
+
+static void
+set_imstt_regvals_tvp (struct fb_info_imstt *p, struct imstt_regvals *init, int bpp)
+{
+	__u8 tcc, mxc, lckl_n, mic;
+	__u8 mlc, lckl_p;
+
+	switch (bpp) {
+		case 8:
+			tcc = 0x80;
+			mxc = 0x4d;
+			lckl_n = 0xc1;
+			mlc = init->mlc[0];
+			lckl_p = init->lckl_p[0];
+			break;
+		case 16:
+			tcc = 0x44;
+			mxc = 0x55;
+			lckl_n = 0xe1;
+			mlc = init->mlc[1];
+			lckl_p = init->lckl_p[1];
+			break;
+		case 24:
+			/* ?!? */
+		case 32:
+			tcc = 0x46;
+			mxc = 0x5d;
+			lckl_n = 0xf1;
+			mlc = init->mlc[2];
+			lckl_p = init->lckl_p[2];
+			break;
+	}
+	mic = 0x08;
+
+	p->cmap_regs[TVPADDRW] = TVPIRPLA;	eieio();
+	p->cmap_regs[TVPIDATA] = 0x00;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRPPD;	eieio();
+	p->cmap_regs[TVPIDATA] = init->pclk_n;	eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRPPD;	eieio();
+	p->cmap_regs[TVPIDATA] = init->pclk_m;	eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRPPD;	eieio();
+	p->cmap_regs[TVPIDATA] = init->pclk_p;	eieio();
+
+	p->cmap_regs[TVPADDRW] = TVPIRTCC;	eieio();
+	p->cmap_regs[TVPIDATA] = tcc;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRMXC;	eieio();
+	p->cmap_regs[TVPIDATA] = mxc;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRMIC;	eieio();
+	p->cmap_regs[TVPIDATA] = mic;		eieio();
+
+	p->cmap_regs[TVPADDRW] = TVPIRPLA;	eieio();
+	p->cmap_regs[TVPIDATA] = 0x00;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRLPD;	eieio();
+	p->cmap_regs[TVPIDATA] = lckl_n;	eieio();
+
+	p->cmap_regs[TVPADDRW] = TVPIRPLA;	eieio();
+	p->cmap_regs[TVPIDATA] = 0x15;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRMLC;	eieio();
+	p->cmap_regs[TVPIDATA] = mlc;		eieio();
+
+	p->cmap_regs[TVPADDRW] = TVPIRPLA;	eieio();
+	p->cmap_regs[TVPIDATA] = 0x2a;		eieio();
+	p->cmap_regs[TVPADDRW] = TVPIRLPD;	eieio();
+	p->cmap_regs[TVPIDATA] = lckl_p;	eieio();
+}
+
+static void
+set_imstt_regvals (struct fb_info_imstt *p, struct imstt_regvals *init, int bpp)
+{
+	__u32 ctl, pitch, byteswap, scr;
+
+	if (p->ramdac == IBM)
+		set_imstt_regvals_ibm(p, init, bpp);
+	else
+		set_imstt_regvals_tvp(p, init, bpp);
+
+  /*
+   * From what I (jsk) can gather poking around with MacsBug,
+   * bits 8 and 9 in the SCR register control endianness
+   * correction (byte swapping).  These bits must be set according
+   * to the color depth as follows:
+   *     Color depth    Bit 9   Bit 8
+   *     ==========     =====   =====
+   *        8bpp          0       0
+   *       16bpp          0       1
+   *       32bpp          1       1
+   */
+	switch (bpp) {
+		case 8:
+			ctl = 0x17b1;
+			pitch = init->pitch / 4;
+			byteswap = 0x0;
+			break;
+		case 16:
+			ctl = 0x17b3;
+			pitch = init->pitch / 2;
+			byteswap = 0x1;
+			break;
+		case 24: /* FIXME */
+			ctl = 0x17b5;
+			pitch = init->pitch - (init->pitch / 4);
+			byteswap = 0x2;
+			break;
+		case 32:
+			ctl = 0x17b5;
+			pitch = init->pitch;
+			byteswap = 0x3;
+			break;
+	}
+	if (p->ramdac == TVP)
+		ctl -= 0x30;
+
+	out_le32(&p->dc_regs[HES], init->hes);
+	out_le32(&p->dc_regs[HEB], init->heb);
+	out_le32(&p->dc_regs[HSB], init->hsb);
+	out_le32(&p->dc_regs[HT], init->ht);
+	out_le32(&p->dc_regs[VES], init->ves);
+	out_le32(&p->dc_regs[VEB], init->veb);
+	out_le32(&p->dc_regs[VSB], init->vsb);
+	out_le32(&p->dc_regs[VT], init->vt);
+	out_le32(&p->dc_regs[VIL], init->vil);
+	out_le32(&p->dc_regs[HCIV], 1);
+	out_le32(&p->dc_regs[VCIV], 1);
+	out_le32(&p->dc_regs[TCDR], 4);
+	out_le32(&p->dc_regs[RRCIV], 1);
+	out_le32(&p->dc_regs[RRSC], 0x980);
+	out_le32(&p->dc_regs[RRCR], 0x11);
+
+	out_le32(&p->dc_regs[SSR], 0);
+	if (p->ramdac == IBM) {
+		out_le32(&p->dc_regs[HRIR], 0x0100);
+		out_le32(&p->dc_regs[CMR], 0x00ff);
+		out_le32(&p->dc_regs[SRGCTL], 0x0073);
+	} else {
+		out_le32(&p->dc_regs[HRIR], 0x0200);
+		out_le32(&p->dc_regs[CMR], 0x01ff);
+		out_le32(&p->dc_regs[SRGCTL], 0x0003);
+	}
+
+	switch (p->total_vram) {
+		case 0x00200000:
+			scr = 0x059d | (byteswap << 8);
+			break;
+		case 0x00400000:
+			pitch /= 2;
+			scr = 0xd0dc | (byteswap << 8);
+			break;
+		case 0x00800000:
+			pitch /= 2;
+			scr = 0x150dd | (byteswap << 8);
+			break;
+	}
+
+	out_le32(&p->dc_regs[SCR], scr);
+	out_le32(&p->dc_regs[SPR], pitch);
+
+	out_le32(&p->dc_regs[STGCTL], ctl);
+}
+
+void
+set_16 (struct fb_info_imstt *p, __u8 x)
+{
+	if (p->ramdac == IBM) {
+		p->cmap_regs[PIDXHI] = 0;	eieio();
+		p->cmap_regs[PIDXLO] = 0x0c;	eieio();
+		p->cmap_regs[PIDXDATA] = x;	eieio();
+	} else {
+		/* ?!? */
+	}
+}
+
+#define set_555(_p)	set_16(_p, 15)	/* need 220 or 224 for X */
+#define set_565(_p)	set_16(_p, 0)	/* 220, 224 is darker in X */
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+#include <asm/vc_ioctl.h>
+
+extern struct vc_mode display_info;
+extern struct fb_info *console_fb_info;
+
+static void
+set_display_info (struct display *disp)
+{
+	display_info.width = disp->var.xres;
+	display_info.height = disp->var.yres;
+	display_info.depth = disp->var.bits_per_pixel;
+	display_info.pitch = disp->line_length;
+
+	switch (disp->var.xres) {
+		case 512:
+			display_info.mode = 2;
+			break;
+		case 640:
+			display_info.mode = 6;
+			break;
+		case 800:
+			display_info.mode = 12;
+			break;
+		case 832:
+			display_info.mode = 13;
+			break;
+		case 1024:
+			display_info.mode = 17;
+			break;
+		case 1152:
+			display_info.mode = 18;
+			break;
+		case 1280:
+			display_info.mode = disp->var.yres == 960 ? 19 : 20;
+			break;
+		default:
+			display_info.mode = 0;
+	}
+}
+#endif
 
 static int
 imsttfb_getcolreg (u_int regno, u_int *red, u_int *green,
@@ -338,10 +742,11 @@
 
 	if (regno > 255)
 		return 1;
-	*red = (p->palette[regno].red<<8) | p->palette[regno].red;
-	*green = (p->palette[regno].green<<8) | p->palette[regno].green;
-	*blue = (p->palette[regno].blue<<8) | p->palette[regno].blue;
+	*red = (p->palette[regno].red << 8) | p->palette[regno].red;
+	*green = (p->palette[regno].green << 8) | p->palette[regno].green;
+	*blue = (p->palette[regno].blue << 8) | p->palette[regno].blue;
 	*transp = 0;
+
 	return 0;
 }
 
@@ -350,7 +755,8 @@
 		   u_int transp, struct fb_info *info)
 {
 	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
-	int i;
+	unsigned int bpp = fb_display[currcon].var.bits_per_pixel;
+	unsigned int i;
 
 	if (regno > 255)
 		return 1;
@@ -363,34 +769,32 @@
 	p->palette[regno].green = green;
 	p->palette[regno].blue = blue;
 
-	if (fb_display[currcon].var.bits_per_pixel == 16) {
+	/* PADDRW/PDATA are the same as TVPPADDRW/TVPPDATA */
+	if (bpp == 16) {
 		p->cmap_regs[PADDRW] = regno << 3;	eieio();
-		p->cmap_regs[PDATA] = red;		eieio();
-		p->cmap_regs[PDATA] = green;		eieio();
-		p->cmap_regs[PDATA] = blue;		eieio();
 	} else {
-		p->cmap_regs[PADDRW] = regno;	eieio();
-		p->cmap_regs[PDATA] = red;	eieio();
-		p->cmap_regs[PDATA] = green;	eieio();
-		p->cmap_regs[PDATA] = blue;	eieio();
+		p->cmap_regs[PADDRW] = regno;		eieio();
 	}
+	p->cmap_regs[PDATA] = red;	eieio();
+	p->cmap_regs[PDATA] = green;	eieio();
+	p->cmap_regs[PDATA] = blue;	eieio();
 
 	if (regno < 16)
-		switch (fb_display[currcon].var.bits_per_pixel) {
+		switch (bpp) {
 #ifdef FBCON_HAS_CFB16
 			case 16:
-				fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | regno;
+				p->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) | regno;
 				break;
 #endif
 #ifdef FBCON_HAS_CFB24
 			case 24:
-				fbcon_cfb24_cmap[regno] = (regno << 16) | (regno << 8) | regno;
+				p->fbcon_cmap.cfb24[regno] = (regno << 16) | (regno << 8) | regno;
 				break;
 #endif
 #ifdef FBCON_HAS_CFB32
 			case 32:
 				i = (regno << 8) | regno;
-				fbcon_cfb32_cmap[regno] = (i << 16) | i;
+				p->fbcon_cmap.cfb32[regno] = (i << 16) | i;
 				break;
 #endif
 		}
@@ -401,8 +805,6 @@
 static void
 do_install_cmap (int con, struct fb_info *info)
 {
-	if (con != currcon)
-		return;
 	if (fb_display[con].cmap.len)
 		fb_set_cmap(&fb_display[con].cmap, 1, imsttfb_setcolreg, info);
 	else {
@@ -429,14 +831,12 @@
 imsttfb_get_fix (struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
 {
 	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
+	struct fb_var_screeninfo *var = &fb_display[con].var;
 
 	*fix = p->fix;
-	if (con >= 0) {
-		struct fb_var_screeninfo *var = &fb_display[con].var;
-		fix->visual = var->bits_per_pixel == 8 ? FB_VISUAL_PSEUDOCOLOR
-						       : FB_VISUAL_TRUECOLOR;
-		fix->line_length = var->xres * (var->bits_per_pixel / 8);
-	}
+	fix->visual = var->bits_per_pixel == 8 ? FB_VISUAL_PSEUDOCOLOR
+					       : FB_VISUAL_DIRECTCOLOR;
+	fix->line_length = var->xres * (var->bits_per_pixel >> 3);
 
 	return 0;
 }
@@ -444,9 +844,7 @@
 static int
 imsttfb_get_var (struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
-	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
-
-	*var = con >= 0 ? fb_display[con].var : p->disp.var;
+	*var = fb_display[con].var;
 
 	return 0;
 }
@@ -456,10 +854,10 @@
 {
 	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
 	struct display *disp;
-	int oldbpp, oldxres;
+	unsigned int oldbpp, oldxres, oldyres, oldgreenlen;
 	struct imstt_regvals *init;
 
-	disp = con >= 0 ? &fb_display[con] : &p->disp;
+	disp = &fb_display[con];
 
 	if (var->xres > MAX_XRES || var->yres > MAX_YRES
 	    || var->xres_virtual > MAX_XRES || var->yres_virtual > MAX_YRES
@@ -469,18 +867,20 @@
 	    || (var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
 		return -EINVAL;
 
-	if ((var->xres * var->yres) * (var->bits_per_pixel / 8) > p->total_vram)
+	if ((var->xres * var->yres) * (var->bits_per_pixel >> 3) > p->total_vram)
 		return -EINVAL;
 
 	if (!((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW))
 		return 0;
 
-	init = compute_imstt_regvals(var->xres, var->yres);
+	init = compute_imstt_regvals(p, var->xres, var->yres);
 	if (!init)
 		return -EINVAL;
 
 	oldbpp = disp->var.bits_per_pixel;
 	oldxres = disp->var.xres;
+	oldyres = disp->var.yres;
+	oldgreenlen = disp->var.green.length;
 
 	disp->var = *var;
 
@@ -495,20 +895,17 @@
 	disp->var.width = -1;
 	disp->var.vmode = FB_VMODE_NONINTERLACED;
 	disp->var.pixclock = 10000;
-	disp->var.left_margin = p->var.right_margin = 16;
-	disp->var.upper_margin = p->var.lower_margin = 16;
-	disp->var.hsync_len = p->var.vsync_len = 8;
+	disp->var.left_margin = disp->var.right_margin = 16;
+	disp->var.upper_margin = disp->var.lower_margin = 16;
+	disp->var.hsync_len = disp->var.vsync_len = 8;
 
 	disp->screen_base = p->frame_buffer;
 	disp->inverse = 0;
 	disp->scrollmode = SCROLL_YREDRAW;
 
-	if (oldxres != disp->var.xres || oldbpp != disp->var.bits_per_pixel)
-		disp->line_length = disp->var.xres * (disp->var.bits_per_pixel / 8);
-
 	if (oldbpp != disp->var.bits_per_pixel) {
 		disp->visual = disp->var.bits_per_pixel == 8 ? FB_VISUAL_PSEUDOCOLOR
-						 	     : FB_VISUAL_TRUECOLOR;
+						 	     : FB_VISUAL_DIRECTCOLOR;
 		disp->dispsw = 0;
 		switch (disp->var.bits_per_pixel) {
 			case 8:
@@ -524,17 +921,20 @@
 				disp->dispsw = &fbcon_cfb8;
 #endif
 				break;
-			case 16:	/* RGB 555 */
-				disp->var.red.offset = 10;
+			case 16:	/* RGB 565 */
+				if (disp->var.red.offset != 10 && disp->var.red.offset != 11)
+					disp->var.red.offset = 11;
 				disp->var.red.length = 5;
 				disp->var.green.offset = 5;
-				disp->var.green.length = 5;
+				if (disp->var.green.length != 5 && disp->var.green.length != 6)
+					disp->var.green.length = 6;
 				disp->var.blue.offset = 0;
 				disp->var.blue.length = 5;
 				disp->var.transp.offset = 0;
 				disp->var.transp.length = 0;
 #ifdef FBCON_HAS_CFB16
 				disp->dispsw = &fbcon_cfb16;
+				disp->dispsw_data = p->fbcon_cmap.cfb16;
 #endif
 				break;
 			case 24:	/* RGB 888 */
@@ -548,6 +948,7 @@
 				disp->var.transp.length = 0;
 #ifdef FBCON_HAS_CFB24
 				disp->dispsw = &fbcon_cfb24;
+				disp->dispsw_data = p->fbcon_cmap.cfb24;
 #endif
 				break;
 			case 32:	/* RGBA 8888 */
@@ -561,24 +962,38 @@
 				disp->var.transp.length = 8;
 #ifdef FBCON_HAS_CFB32
 				disp->dispsw = &fbcon_cfb32;
+				disp->dispsw_data = p->fbcon_cmap.cfb32;
 #endif
 				break;
 		}
 	}
 
-	if (info->changevar)
-		(*info->changevar)(con);
+	if (oldxres != disp->var.xres || oldbpp != disp->var.bits_per_pixel)
+		disp->line_length = disp->var.xres * (disp->var.bits_per_pixel >> 3);
 
 #ifdef CONFIG_FB_COMPAT_XPMAC
 	set_display_info(disp);
 #endif
 
-	if (con == currcon && (oldxres != disp->var.xres || oldbpp != disp->var.bits_per_pixel))
-		set_imstt_regvals(p, init, disp->var.bits_per_pixel);
+	if (info->changevar)
+		(*info->changevar)(con);
 
+	if (con == currcon) {
+		if (oldgreenlen != disp->var.green.length) {
+			if (disp->var.green.length == 6)
+				set_565(p);
+			else
+				set_555(p);
+		}
+		if (oldxres != disp->var.xres || oldyres != disp->var.yres || oldbpp != disp->var.bits_per_pixel)
+			set_imstt_regvals(p, init, disp->var.bits_per_pixel);
+			
+	}
 	if (oldbpp != disp->var.bits_per_pixel) {
-		fb_alloc_cmap(&disp->cmap, 0, 0);
-		fb_set_cmap(&disp->cmap, 1, imsttfb_setcolreg, info);
+		int err = fb_alloc_cmap(&disp->cmap, 0, 0);
+		if (err)
+			return err;
+		do_install_cmap(con, info);
 	}
 
 	return 0;
@@ -631,21 +1046,22 @@
 	       u_long arg, int con, struct fb_info *info)
 {
 	int r;
+	__u8 inits[4];
+	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
 
 	switch (cmd) {
-		case 31337:
-			r = verify_area(VERIFY_WRITE, (void *)arg,
-					sizeof(struct imstt_regvals));
-			if (!r)
-				r = copy_to_user((void *)arg, &imstt_reg_init_17,
-						 sizeof(struct imstt_regvals));
-			break;
-		case 31338:
-			r = verify_area(VERIFY_READ, (void *)arg,
-					sizeof(struct imstt_regvals));
-			if (!r)
-				r = copy_from_user(&imstt_reg_init_17,
-						   (void *)arg, sizeof(struct imstt_regvals));
+		case 31340:
+			r = verify_area(VERIFY_READ, (void *)arg, 4);
+			if (!r) r = copy_from_user(inits, (void *)arg, 4);
+			p->cmap_regs[PIDXHI] = 0;		eieio();
+			p->cmap_regs[PIDXLO] = 0xb;		eieio();
+			p->cmap_regs[PIDXDATA] = inits[0];	eieio();
+			p->cmap_regs[PIDXLO] = 0xc;		eieio();
+			p->cmap_regs[PIDXDATA] = inits[1];	eieio();
+			p->cmap_regs[PIDXLO] = 0xd;		eieio();
+			p->cmap_regs[PIDXDATA] = inits[2];	eieio();
+			p->cmap_regs[PIDXLO] = 0xe;		eieio();
+			p->cmap_regs[PIDXDATA] = inits[3];	eieio();
 			break;
 		default:
 			r = -ENOIOCTLCMD;
@@ -672,19 +1088,26 @@
 {
 	struct display *old = &fb_display[currcon], *new = &fb_display[con];
 
-	if (old->cmap.len)
-		fb_get_cmap(&old->cmap, 1, imsttfb_getcolreg, info);
-	currcon = con;
 	if (old->var.xres != new->var.xres
 	    || old->var.yres != new->var.yres
 	    || old->var.bits_per_pixel != new->var.bits_per_pixel) {
-		struct imstt_regvals *init = compute_imstt_regvals(new->var.xres, new->var.yres);
-		if (!init) /* ?!? */ return 0;
-		set_imstt_regvals((struct fb_info_imstt *)info, init, new->var.bits_per_pixel);
+		struct fb_info_imstt *p = (struct fb_info_imstt *)info;
+		struct imstt_regvals *init = compute_imstt_regvals(p, new->var.xres, new->var.yres);
+		if (!init) /* ?!? */ return -1;
+		if (new->var.bits_per_pixel == 16) {
+			if (new->var.green.length == 6)
+				set_565(p);
+			else
+				set_555(p);
+		}
+		set_imstt_regvals(p, init, new->var.bits_per_pixel);
 #ifdef CONFIG_FB_COMPAT_XPMAC
 		set_display_info(new);
 #endif
 	}
+	if (old->cmap.len)
+		fb_get_cmap(&old->cmap, 1, imsttfb_getcolreg, info);
+	currcon = con;
 	do_install_cmap(con, info);
 
 	return 0;
@@ -702,139 +1125,67 @@
 	struct fb_info_imstt *p = (struct fb_info_imstt *)info;
 	long ctrl;
 
-	ctrl = ld_le32(&p->dc_regs[STGCTL]) | 0x0030;
+	ctrl = ld_le32(&p->dc_regs[STGCTL]);
 	if (blank > 0) {
 		switch (blank - 1) {
+			case VESA_NO_BLANKING:
+				printk("VESA_OFF");
+				ctrl |= (1<<8)|(1<<9)|(1<<7);
+				break;
 			case VESA_VSYNC_SUSPEND:
-				ctrl &= ~0x0020;
+				printk("VESA_VSYNC");
+				ctrl &= ~(1<<9); /* clear Bit9 (was bit 5) */
+				ctrl &= ~(1<<7);
 				break;
 			case VESA_HSYNC_SUSPEND:
-				ctrl &= ~0x0010;
-				break;
-			case VESA_NO_BLANKING:
+				printk("VESA_HSYNC");
+				ctrl &= ~(1<<8); /* clear Bit8 (was bit 4) */
+				ctrl &= ~(1<<7); 
 				break;
 			case VESA_POWERDOWN:
+				printk("VESA_PD");
+                		ctrl |= 1<<10;
+				ctrl &= ~(1<<7);
 				break;
 		}
 	}
 	out_le32(&p->dc_regs[STGCTL], ctrl);
 }
 
-static void
-set_imstt_regvals (struct fb_info_imstt *p, struct imstt_regvals *init, int bpp)
-{
-	__u32 ctl, pitch, byteswap, scr;
-	__u8 pformat;
-
-	p->cmap_regs[PIDXHI] = 0;		eieio();
-	p->cmap_regs[PIDXLO] = PM0;		eieio();
-	p->cmap_regs[PIDXDATA] = init->clk[0];	eieio();
-	p->cmap_regs[PIDXLO] = PN0;		eieio();
-	p->cmap_regs[PIDXDATA] = init->clk[1];	eieio();
-	p->cmap_regs[PIDXLO] = PP0;		eieio();
-	p->cmap_regs[PIDXDATA] = init->clk[2];	eieio();
-	p->cmap_regs[PIDXLO] = PC0;		eieio();
-	p->cmap_regs[PIDXDATA] = init->clk[3];	eieio();
-
-  /*
-   * From what I (jsk) can gather poking around with MacsBug,
-   * bits 8 and 9 in the SCR register control endianness
-   * correction (byte swapping).  These bits must be set according
-   * to the color depth as follows:
-   *     Color depth    Bit 9   Bit 8
-   *     ==========     =====   =====
-   *        8bpp          0       0
-   *       16bpp          0       1
-   *       32bpp          1       1
-   */
-	switch (bpp) {
-		case 32:
-			ctl = 0x17b5;
-			pitch = init->pitch;
-			pformat = 0x06;
-			byteswap = 0x3;
-			break;
-		case 24: /* FIXME */
-			ctl = 0x17b5;
-			pitch = (init->pitch * 3) / 4;
-			pformat = 0x05;
-			byteswap = 0x2;
-			break;
-		case 16:
-			ctl = 0x17b3;
-			pitch = init->pitch / 2;
-			pformat = 0x04;
-			byteswap = 0x1;
-			break;
-		case 8:
-		default:
-			ctl = 0x17b1;
-			pitch = init->pitch / 4;
-			pformat = 0x03;
-			byteswap = 0x00;
-			break;
-	}
-
-	out_le32(&p->dc_regs[HES], init->cfg[0]);
-	out_le32(&p->dc_regs[HEB], init->cfg[1]);
-	out_le32(&p->dc_regs[HSB], init->cfg[2]);
-	out_le32(&p->dc_regs[HT], init->cfg[3]);
-	out_le32(&p->dc_regs[VES], init->cfg[4]);
-	out_le32(&p->dc_regs[VEB], init->cfg[5]);
-	out_le32(&p->dc_regs[VSB], init->cfg[6]);
-	out_le32(&p->dc_regs[VT], init->cfg[7]);
-	out_le32(&p->dc_regs[HCIV], 1);
-	out_le32(&p->dc_regs[VCIV], 1);
-	out_le32(&p->dc_regs[TCDR], 4);
-	out_le32(&p->dc_regs[VIL], init->cfg[8]);  /* JSK 0 */
- 
-	out_le32(&p->dc_regs[SSR], 0);  /* JSK 0 */
-	out_le32(&p->dc_regs[HRIR], 0x0100);
-	out_le32(&p->dc_regs[CMR], 0x00FF);
-	out_le32(&p->dc_regs[SRGCTL], 0x0073);
-
-	if (p->total_vram == 0x000200000)
-		scr = 0x059d | (byteswap << 8);
-	else {
-		pitch /= 2;
-		scr = 0xd0dc | (byteswap << 8);
-	}
-
-	out_le32(&p->dc_regs[SCR], scr);
-	out_le32(&p->dc_regs[SPR], pitch);
-
-	p->cmap_regs[PIDXHI] = 0;		eieio();
-	p->cmap_regs[PIDXLO] = PPIXREP;		eieio();
-	p->cmap_regs[PIDXDATA] = pformat;	eieio();
-	p->cmap_regs[PIDXHI] = 0;		eieio();
-
-	out_le32(&p->dc_regs[STGCTL], ctl);
-}
-
 __initfunc(static void init_imstt(struct fb_info_imstt *p))
 {
-	int i;
-	__u32 tmp;
+	__u32 i, tmp;
 	struct imstt_regvals *init;
 
 	tmp = in_le32(&p->dc_regs[SSTATUS]);
 	/* printk("chip version %ld, ", (tmp & 0x0F00) >> 8); */
 
 	tmp = in_le32(&p->dc_regs[PRC]);
-	p->total_vram = (tmp & 0x0004) ? 0x000400000L : 0x000200000L;
+	if (p->ramdac == IBM)
+		p->total_vram = (tmp & 0x0004) ? 0x00400000 : 0x00200000;
+	else
+		p->total_vram = 0x00800000;
 
 	/* initialize the card */
 	tmp = in_le32(&p->dc_regs[STGCTL]);
 	out_le32(&p->dc_regs[STGCTL], tmp & ~0x1);
 
-	p->cmap_regs[PPMASK] = 0xFF;
 	/* set default values for DAC registers */ 
-	p->cmap_regs[PIDXHI] = 0;	eieio();
-	for (i = 0; i < sizeof(initregs) / sizeof(*initregs); i++) {
-		p->cmap_regs[PIDXLO] = initregs[i].addr;	eieio();
-		p->cmap_regs[PIDXDATA] = initregs[i].value;	eieio();
+	if (p->ramdac == IBM) {
+		p->cmap_regs[PPMASK] = 0xFF;
+		p->cmap_regs[PIDXHI] = 0;	eieio();
+		for (i = 0; i < sizeof(ibm_initregs) / sizeof(*ibm_initregs); i++) {
+			p->cmap_regs[PIDXLO] = ibm_initregs[i].addr;	eieio();
+			p->cmap_regs[PIDXDATA] = ibm_initregs[i].value;	eieio();
+		}
+	} else {
+		for (i = 0; i < sizeof(tvp_initregs) / sizeof(*tvp_initregs); i++) {
+			p->cmap_regs[TVPADDRW] = tvp_initregs[i].addr;	eieio();
+			p->cmap_regs[TVPIDATA] = tvp_initregs[i].value;	eieio();
+		}
 	}
-#if defined(USE_NV_VMODE) && (defined(CONFIG_PMAC) || defined(CONFIG_CHRP))
+
+#if defined(USE_NV_MODES) && (defined(CONFIG_PMAC) || defined(CONFIG_CHRP))
 	{
 		int vmode, cmode;
 
@@ -844,86 +1195,109 @@
 		cmode = nvram_read_byte(NV_CMODE);
 		if (cmode < CMODE_8 || cmode > CMODE_32)
 			cmode = CMODE_8;
-		if (mac_vmode_to_var(vmode, cmode, &p->var)) {
-			p->var.xres = p->var.xres_virtual = INIT_XRES;
-			p->var.yres = p->var.yres_virtual = INIT_YRES;
-			p->var.bits_per_pixel = INIT_BPP;
+		if (mac_vmode_to_var(vmode, cmode, &p->disp.var)) {
+			p->disp.var.xres = p->disp.var.xres_virtual = INIT_XRES;
+			p->disp.var.yres = p->disp.var.yres_virtual = INIT_YRES;
+			p->disp.var.bits_per_pixel = INIT_BPP;
 		}
 	}
 #else
-	p->var.xres = p->var.xres_virtual = INIT_XRES;
-	p->var.yres = p->var.yres_virtual = INIT_YRES;
-	p->var.bits_per_pixel = INIT_BPP;
-#endif
-	if ((p->var.xres * p->var.yres) * (p->var.bits_per_pixel / 8) > p->total_vram
-	    || !(init = compute_imstt_regvals(p->var.xres, p->var.yres))) {
-		printk("imsttfb: %dx%dx%d not supported\n", p->var.xres, p->var.yres, p->var.bits_per_pixel);
-		kfree(p);
-		return;
-	}
-
-	set_imstt_regvals(p, init, p->var.bits_per_pixel);
+	p->disp.var.xres = p->disp.var.xres_virtual = INIT_XRES;
+	p->disp.var.yres = p->disp.var.yres_virtual = INIT_YRES;
+	p->disp.var.bits_per_pixel = INIT_BPP;
+#endif
 
-	p->var.height = p->var.width = -1;
-	p->var.vmode = FB_VMODE_NONINTERLACED;
-	p->var.pixclock = 10000;
-	p->var.left_margin = p->var.right_margin = 16;
-	p->var.upper_margin = p->var.lower_margin = 16;
-	p->var.hsync_len = p->var.vsync_len = 8;
-	switch (p->var.bits_per_pixel) {
+	p->disp.var.height = p->disp.var.width = -1;
+	p->disp.var.vmode = FB_VMODE_NONINTERLACED;
+	p->disp.var.pixclock = 10000;
+	p->disp.var.left_margin = p->disp.var.right_margin = 16;
+	p->disp.var.upper_margin = p->disp.var.lower_margin = 16;
+	p->disp.var.hsync_len = p->disp.var.vsync_len = 8;
+	p->disp.dispsw = 0;
+	switch (p->disp.var.bits_per_pixel) {
 		case 8:
-			p->var.red.offset = 0;
-			p->var.red.length = 8;
-			p->var.green.offset = 0;
-			p->var.green.length = 8;
-			p->var.blue.offset = 0;
-			p->var.blue.length = 8;
-			p->var.transp.offset = 0;
-			p->var.transp.length = 0;
-			break;
-		case 16:	/* RGB 555 */
-			p->var.red.offset = 10;
-			p->var.red.length = 5;
-			p->var.green.offset = 5;
-			p->var.green.length = 5;
-			p->var.blue.offset = 0;
-			p->var.blue.length = 5;
-			p->var.transp.offset = 0;
-			p->var.transp.length = 0;
+			p->disp.var.red.offset = 0;
+			p->disp.var.red.length = 8;
+			p->disp.var.green.offset = 0;
+			p->disp.var.green.length = 8;
+			p->disp.var.blue.offset = 0;
+			p->disp.var.blue.length = 8;
+			p->disp.var.transp.offset = 0;
+			p->disp.var.transp.length = 0;
+#ifdef FBCON_HAS_CFB8
+			p->disp.dispsw = &fbcon_cfb8;
+#endif
+			break;
+		case 16:	/* RGB 565 */
+			if (p->disp.var.red.offset != 10 && p->disp.var.red.offset != 11)
+				p->disp.var.red.offset = 11;
+			p->disp.var.red.length = 5;
+			p->disp.var.green.offset = 5;
+			if (p->disp.var.green.length != 5 && p->disp.var.green.length != 6)
+				p->disp.var.green.length = 6;
+			p->disp.var.blue.offset = 0;
+			p->disp.var.blue.length = 5;
+			p->disp.var.transp.offset = 0;
+			p->disp.var.transp.length = 0;
+#ifdef FBCON_HAS_CFB16
+			p->disp.dispsw = &fbcon_cfb16;
+			p->disp.dispsw_data = p->fbcon_cmap.cfb16;
+#endif
 			break;
 		case 24:	/* RGB 888 */
-			p->var.red.offset = 16;
-			p->var.red.length = 8;
-			p->var.green.offset = 8;
-			p->var.green.length = 8;
-			p->var.blue.offset = 0;
-			p->var.blue.length = 8;
-			p->var.transp.offset = 0;
-			p->var.transp.length = 0;
+			p->disp.var.red.offset = 16;
+			p->disp.var.red.length = 8;
+			p->disp.var.green.offset = 8;
+			p->disp.var.green.length = 8;
+			p->disp.var.blue.offset = 0;
+			p->disp.var.blue.length = 8;
+			p->disp.var.transp.offset = 0;
+			p->disp.var.transp.length = 0;
+#ifdef FBCON_HAS_CFB24
+			p->disp.dispsw = &fbcon_cfb24;
+			p->disp.dispsw_data = p->fbcon_cmap.cfb24;
+#endif
 			break;
 		case 32:	/* RGBA 8888 */
-			p->var.red.offset = 16;
-			p->var.red.length = 8;
-			p->var.green.offset = 8;
-			p->var.green.length = 8;
-			p->var.blue.offset = 0;
-			p->var.blue.length = 8;
-			p->var.transp.offset = 24;
-			p->var.transp.length = 8;
+			p->disp.var.red.offset = 16;
+			p->disp.var.red.length = 8;
+			p->disp.var.green.offset = 8;
+			p->disp.var.green.length = 8;
+			p->disp.var.blue.offset = 0;
+			p->disp.var.blue.length = 8;
+			p->disp.var.transp.offset = 24;
+			p->disp.var.transp.length = 8;
+#ifdef FBCON_HAS_CFB32
+			p->disp.dispsw = &fbcon_cfb32;
+			p->disp.dispsw_data = p->fbcon_cmap.cfb32;
+#endif
 			break;
 	}
 
-	strcpy(p->fix.id, "IMS Twin Turbo");
+	if (p->disp.var.green.length == 6)
+		set_565(p);
+	else
+		set_555(p);
+
+	if ((p->disp.var.xres * p->disp.var.yres) * (p->disp.var.bits_per_pixel >> 3) > p->total_vram
+	    || !(init = compute_imstt_regvals(p, p->disp.var.xres, p->disp.var.yres))) {
+		printk("imsttfb: %dx%dx%d not supported\n", p->disp.var.xres, p->disp.var.yres, p->disp.var.bits_per_pixel);
+		kfree(p);
+		return;
+	}
+
+	set_imstt_regvals(p, init, p->disp.var.bits_per_pixel);
+
+	sprintf(p->fix.id, "IMS TT (%s)", p->ramdac == IBM ? "IBM" : "TVP");
 	p->fix.smem_start = (__u8 *)p->frame_buffer_phys;
 	p->fix.smem_len = p->total_vram;
 	p->fix.mmio_start = (__u8 *)p->dc_regs_phys;
 	p->fix.mmio_len = 0x40000;
 	p->fix.type = FB_TYPE_PACKED_PIXELS;
-	p->fix.visual = p->var.bits_per_pixel == 8 ? FB_VISUAL_PSEUDOCOLOR
-						   : FB_VISUAL_TRUECOLOR;
-	p->fix.line_length = p->var.xres * (p->var.bits_per_pixel / 8);
+	p->fix.visual = p->disp.var.bits_per_pixel == 8 ? FB_VISUAL_PSEUDOCOLOR
+							: FB_VISUAL_DIRECTCOLOR;
+	p->fix.line_length = p->disp.var.xres * (p->disp.var.bits_per_pixel >> 3);
 
-	p->disp.var = p->var;
 	p->disp.screen_base = p->frame_buffer;
 	p->disp.visual = p->fix.visual;
 	p->disp.type = p->fix.type;
@@ -931,31 +1305,6 @@
 	p->disp.line_length = p->fix.line_length;
 	p->disp.can_soft_blank = 1;
 	p->disp.scrollmode = SCROLL_YREDRAW;
-	switch (p->var.bits_per_pixel) {
-#ifdef FBCON_HAS_CFB8
-		case 8:
-			p->disp.dispsw = &fbcon_cfb8;
-			break;
-#endif
-#ifdef FBCON_HAS_CFB16
-		case 16:
-			p->disp.dispsw = &fbcon_cfb16;
-			break;
-#endif
-#ifdef FBCON_HAS_CFB24
-		case 24:
-			p->disp.dispsw = &fbcon_cfb24;
-			break;
-#endif
-#ifdef FBCON_HAS_CFB32
-		case 32:
-			p->disp.dispsw = &fbcon_cfb32;
-			break;
-#endif
-		default:
-			p->disp.dispsw = 0;
-			break;
-	}
 
 	strcpy(p->info.modename, p->fix.id);
 	p->info.node = -1;
@@ -967,8 +1316,8 @@
 	p->info.updatevar = &imsttfb_updatevar;
 	p->info.blank = &imsttfb_blank;
 
-	for (i = 0; i < 16; ++i) {
-		int j = color_table[i];
+	for (i = 0; i < 16; i++) {
+		unsigned int j = color_table[i];
 		p->palette[i].red = default_red[j];
 		p->palette[i].green = default_grn[j];
 		p->palette[i].blue = default_blu[j];
@@ -979,10 +1328,11 @@
 		return;
 	}
 
-	printk("fb%d: IMS Twin Turbo frame buffer\n", GET_FB_IDX(p->info.node));
+	printk("fb%d: %s frame buffer; %uMB vram\n",
+		GET_FB_IDX(p->info.node), p->fix.id, p->total_vram >> 20);
 
 #ifdef CONFIG_FB_COMPAT_XPMAC
-	strncpy(display_info.name, "IMS,tt128mb", sizeof(display_info.name));
+	strncpy(display_info.name, p->fix.id, sizeof display_info.name);
 	display_info.fb_address = (__u32)p->frame_buffer_phys;
 	display_info.cmap_adr_address = (__u32)&p->cmap_regs_phys[PADDRW];
 	display_info.cmap_data_address = (__u32)&p->cmap_regs_phys[PDATA];
@@ -995,27 +1345,36 @@
 __initfunc(void imsttfb_of_init(struct device_node *dp))
 {
 	struct fb_info_imstt *p;
-	unsigned long addr, size;
-	unsigned char bus, devfn;
-	unsigned short cmd;
-
-	if (dp->n_addrs < 2 || dp->addrs[1].size < 0x02000000)
+	int i;
+	__u32 addr, size = 0;
+	__u8 bus, devfn;
+	__u16 cmd;
+
+	for (i = 0; i < dp->n_addrs; i++) {
+		if (dp->addrs[i].size >= 0x02000000) {
+			addr = dp->addrs[i].address;
+			size = dp->addrs[i].size;
+		}
+	}
+	if (!size)
 		return;
 
-	addr = dp->addrs[1].address;
-	size = dp->addrs[1].size;
-
 	p = kmalloc(sizeof(struct fb_info_imstt), GFP_ATOMIC);
 	if (!p)
 		return;
 	memset(p, 0, sizeof(struct fb_info_imstt));
 	p->frame_buffer_phys = (__u8 *)addr;
-	p->frame_buffer = (__u8 *)__ioremap(addr, size, _PAGE_NO_CACHE);
+	p->frame_buffer = (__u8 *)ioremap(addr, size);
 	p->dc_regs_phys = (__u32 *)(p->frame_buffer_phys + 0x00800000);
 	p->dc_regs = (__u32 *)(p->frame_buffer + 0x00800000);
 	p->cmap_regs_phys = (__u8 *)(p->frame_buffer_phys + 0x00840000);
 	p->cmap_regs = (__u8 *)(p->frame_buffer + 0x00840000);
 
+	if (dp->name[11] == '8')
+		p->ramdac = TVP;
+	else
+		p->ramdac = IBM;
+
 	if (pci_device_loc(dp, &bus, &devfn) == 0) {
 		pcibios_read_config_word(bus, devfn, PCI_COMMAND, &cmd);
 		if (cmd != 0xffff) {
@@ -1024,8 +1383,21 @@
 		}
 	}
 
-	p->frame_buffer[0] = 0;
-
 	init_imstt(p);
 }
 
+__initfunc(void imsttfb_init(void))
+{
+	unsigned int i;
+	struct device_node *dp;
+	char *names[4] = {"IMS,tt128mb","IMS,tt128mbA","IMS,tt128mb8","IMS,tt128mb8A"};
+
+	if (prom_num_displays)
+		return;
+
+	for (i = 0; i < 4; i++) {
+		dp = find_devices(names[i]);
+		if (dp)
+			imsttfb_of_init(dp);
+	}
+}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/leofb.c m68k/drivers/video/leofb.c
--- jes-2.1.119/drivers/video/leofb.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/leofb.c	Mon Aug 31 00:46:04 1998
@@ -1,4 +1,4 @@
-/* $Id: leofb.c,v 1.2 1998/07/29 10:06:04 jj Exp $
+/* $Id: leofb.c,v 1.3 1998/08/23 14:21:47 mj Exp $
  * leofb.c: Leo (ZX) 24/8bit frame buffer driver
  *
  * Copyright (C) 1996,1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -20,7 +20,7 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 
 #define LEO_OFF_LC_SS0_KRN	0x00200000
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/macfb.c m68k/drivers/video/macfb.c
--- jes-2.1.119/drivers/video/macfb.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/macfb.c	Mon Aug 31 00:46:04 1998
@@ -22,12 +22,11 @@
 #include <asm/macintosh.h>
 #include <linux/fb.h>
 
-
 /* conditionalize these ?? */
-#include "fbcon-mfb.h"
-#include "fbcon-cfb2.h"
-#include "fbcon-cfb4.h"
-#include "fbcon-cfb8.h"
+#include <video/fbcon-mfb.h>
+#include <video/fbcon-cfb2.h>
+#include <video/fbcon-cfb4.h>
+#include <video/fbcon-cfb8.h>
 
 #define arraysize(x)    (sizeof(x)/sizeof(*(x)))
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/macmodes.c m68k/drivers/video/macmodes.c
--- jes-2.1.119/drivers/video/macmodes.c	Sun Aug 30 20:40:53 1998
+++ m68k/drivers/video/macmodes.c	Mon Aug 31 00:46:04 1998
@@ -12,7 +12,7 @@
 #include <linux/fb.h>
 #include <linux/string.h>
 
-#include "macmodes.h"
+#include <video/macmodes.h>
 
 struct mac_mode {
     int number;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/macmodes.h m68k/drivers/video/macmodes.h
--- jes-2.1.119/drivers/video/macmodes.h	Mon Aug 10 09:30:53 1998
+++ m68k/drivers/video/macmodes.h	Thu Jan  1 01:00:00 1970
@@ -1,60 +0,0 @@
-/*
- *  linux/drivers/video/macmodes.h -- Standard MacOS video modes
- *
- *	Copyright (C) 1998 Geert Uytterhoeven
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License. See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-
-    /*
-     *  Video mode values.
-     *  These are supposed to be the same as the values that Apple uses in
-     *  MacOS.
-     */
-
-#define VMODE_NVRAM		0
-#define VMODE_512_384_60I	1	/* 512x384, 60Hz interlaced (NTSC) */
-#define VMODE_512_384_60	2	/* 512x384, 60Hz */
-#define VMODE_640_480_50I	3	/* 640x480, 50Hz interlaced (PAL) */
-#define VMODE_640_480_60I	4	/* 640x480, 60Hz interlaced (NTSC) */
-#define VMODE_640_480_60	5	/* 640x480, 60Hz (VGA) */
-#define VMODE_640_480_67	6	/* 640x480, 67Hz */
-#define VMODE_640_870_75P	7	/* 640x870, 75Hz (portrait) */
-#define VMODE_768_576_50I	8	/* 768x576, 50Hz (PAL full frame) */
-#define VMODE_800_600_56	9	/* 800x600, 56Hz */
-#define VMODE_800_600_60	10	/* 800x600, 60Hz */
-#define VMODE_800_600_72	11	/* 800x600, 72Hz */
-#define VMODE_800_600_75	12	/* 800x600, 75Hz */
-#define VMODE_832_624_75	13	/* 832x624, 75Hz */
-#define VMODE_1024_768_60	14	/* 1024x768, 60Hz */
-#define VMODE_1024_768_70	15	/* 1024x768, 70Hz (or 72Hz?) */
-#define VMODE_1024_768_75V	16	/* 1024x768, 75Hz (VESA) */
-#define VMODE_1024_768_75	17	/* 1024x768, 75Hz */
-#define VMODE_1152_870_75	18	/* 1152x870, 75Hz */
-#define VMODE_1280_960_75	19	/* 1280x960, 75Hz */
-#define VMODE_1280_1024_75	20	/* 1280x1024, 75Hz */
-#define VMODE_MAX		20
-#define VMODE_CHOOSE		99
-
-#define CMODE_NVRAM		-1
-#define CMODE_8			0	/* 8 bits/pixel */
-#define CMODE_16		1	/* 16 (actually 15) bits/pixel */
-#define CMODE_32		2	/* 32 (actually 24) bits/pixel */
-
-
-extern int mac_vmode_to_var(int vmode, int cmode,
-			    struct fb_var_screeninfo *var);
-extern int mac_var_to_vmode(const struct fb_var_screeninfo *var, int *vmode,
-			    int *cmode);
-extern int mac_map_monitor_sense(int sense);
-
-
-    /*
-     *  Addresses in NVRAM where video mode and pixel size are stored.
-     */
-
-#define NV_VMODE		0x140f
-#define NV_CMODE		0x1410
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/mdafb.c m68k/drivers/video/mdafb.c
--- jes-2.1.119/drivers/video/mdafb.c	Mon Aug 10 09:30:53 1998
+++ m68k/drivers/video/mdafb.c	Thu Jan  1 01:00:00 1970
@@ -1,480 +0,0 @@
-/*
- *  linux/drivers/video/mdafb.c -- MDA frame buffer device
- *
- *	Adapted from vgafb, May 1998 by Andrew Apted
- *
- *  This file is based on vgacon.c and vgafb.c.  Read about their
- *  contributors there.
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License.  See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-
-/* KNOWN PROBLEMS/TO DO ==================================================== *
- *
- *	-  detecting amount of memory is not yet implemented
- *
- * ========================================================================= */
-
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/malloc.h>
-#include <linux/vmalloc.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/fb.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/console.h>
-#include <linux/selection.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include "fbcon.h"
-#include "fbcon-vga.h"
-
-
-#ifdef __powerpc__
-#define VGA_OFFSET _ISA_MEM_BASE;
-#else
-#define VGA_OFFSET 0x0
-#endif
-
-
-static int mda_font_height = 16;   /* !!! */
-
-
-static int currcon = 0;
-static struct display disp;
-static struct fb_info fb_info;
-
-static struct fb_fix_screeninfo fb_fix = { { 0, } };
-static struct fb_var_screeninfo fb_var = { 0, };
-
-
-/* Description of the hardware situation */
-static unsigned char mda_video_type;
-static unsigned long mda_video_mem_base;	/* Base of video memory */
-static unsigned long mda_video_mem_len;		/* End of video memory */
-static u16 mda_video_port_reg;			/* Video register select port */
-static u16 mda_video_port_val;			/* Video register value port */
-static unsigned long mda_video_num_columns;	/* Number of text columns */
-static unsigned long mda_video_num_lines;	/* Number of text lines */
-
-
-    /*
-     *  MDA screen access
-     */ 
-
-static inline void mda_writew(u16 val, u16 *addr)
-{
-#ifdef __powerpc__
-	st_le16(addr, val);
-#else
-	writew(val, (unsigned long)addr);
-#endif /* !__powerpc__ */
-}
-
-static inline u16 mda_readw(u16 *addr)
-{
-#ifdef __powerpc__
-	return ld_le16(addr);
-#else
-	return readw((unsigned long)addr);
-#endif /* !__powerpc__ */	
-}
-
-
-static inline void write_mda(unsigned char reg, unsigned int val)
-{
-	unsigned long flags;
-
-	save_flags(flags); cli();
-
-	outb(reg, mda_video_port_reg);
-	outb(val >> 8, mda_video_port_val);
-	outb(reg+1, mda_video_port_reg);
-	outb(val & 0xff, mda_video_port_val);
-
-	restore_flags(flags);
-}
-
-static inline void mda_set_origin(unsigned short location)
-{
-	write_mda(12, location >> 1);
-}
-
-static inline void mda_set_cursor(int location) 
-{
-	write_mda(14, location >> 1);
-}
-
-
-    /*
-     *  Move hardware mda cursor
-     */
-    
-void fbcon_mdafb_cursor(struct display *p, int mode, int x, int y)
-{
-	switch (mode) {
-		case CM_ERASE:
-			mda_set_cursor(mda_video_mem_len - 1);
-			break;
-
-		case CM_MOVE:
-		case CM_DRAW:
-			mda_set_cursor(y*p->next_line + (x << 1));
-			break;
-	}
-}
-
-
-    /*
-     *  Interface to the low level console driver
-     */
-
-void mdafb_setup(char *options, int *ints);
-static int mdafbcon_switch(int con, struct fb_info *info);
-static int mdafbcon_updatevar(int con, struct fb_info *info);
-static void mdafbcon_blank(int blank, struct fb_info *info);
-
-
-    /*
-     *  Open/Release the frame buffer device
-     */
-
-static int mdafb_open(struct fb_info *info, int user)
-{
-	MOD_INC_USE_COUNT;
-	return 0;
-}
-
-static int mdafb_release(struct fb_info *info, int user)
-{
-	MOD_DEC_USE_COUNT;
-	return 0;
-}
-
-
-    /*
-     *  Get the Fixed Part of the Display
-     */
-
-static int mdafb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			 struct fb_info *info)
-{
-	memcpy(fix, &fb_fix, sizeof(fb_fix));
-	return 0;
-}
-
-
-    /*
-     *  Get the User Defined Part of the Display
-     */
-
-static int mdafb_get_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
-{
-	memcpy(var, &fb_var, sizeof(fb_var));
-	return 0;
-}
-
-
-    /*
-     *  Set the User Defined Part of the Display
-     */
-
-static int mdafb_set_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
-{
-    struct display *display;
-
-    if (con >= 0)
-	display = &fb_display[con];
-    else
-	display = &disp;	/* used during initialization */
-
-    if (var->xres > fb_var.xres || var->yres > fb_var.yres ||
-	var->xres_virtual > fb_var.xres_virtual ||
-	var->yres_virtual > fb_var.yres_virtual ||
-	var->bits_per_pixel > fb_var.bits_per_pixel ||
-	var->nonstd || !(var->accel_flags & FB_ACCELF_TEXT) ||
-	(var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
-	return -EINVAL;
-
-    memcpy(var, &fb_var, sizeof(fb_var));
-
-    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
-	display->var = *var;
-	mda_set_origin(var->yoffset/mda_font_height*fb_fix.line_length);
-    }
-
-    return 0;
-}
-
-
-    /*
-     *  Pan or Wrap the Display
-     *
-     *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
-     */
-
-static int mdafb_pan_display(struct fb_var_screeninfo *var, int con,
-			     struct fb_info *info)
-{
-	if (var->xoffset || var->yoffset+var->yres > var->yres_virtual)
-		return -EINVAL;
-
-	mda_set_origin(var->yoffset/mda_font_height*fb_fix.line_length);
-	return 0;
-}
-
-
-    /*
-     *  Get the Colormap
-     */
-
-static int mdafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
-{
-	/* MDA is simply black and white */
-
-	return 0;
-}
-
-
-    /*
-     *  Set the Colormap
-     */
-
-static int mdafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
-{
-	/* MDA is simply black and white */
-
-	return 0;
-}
-
-
-static int mdafb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		       u_long arg, int con, struct fb_info *info)
-{
-	return -EINVAL;
-}
-
-    /*
-     *  Interface used by the world
-     */
-
-static struct fb_ops mdafb_ops = {
-	mdafb_open, mdafb_release, mdafb_get_fix, mdafb_get_var,
-	mdafb_set_var, mdafb_get_cmap, mdafb_set_cmap, mdafb_pan_display, 
-	mdafb_ioctl
-};
-
-    /*
-     *  MDA text console with hardware cursor
-     */
-
-static struct display_switch fbcon_mdafb = {
-    fbcon_vga_setup, fbcon_vga_bmove, fbcon_vga_clear, fbcon_vga_putc,
-    fbcon_vga_putcs, fbcon_vga_revc, fbcon_mdafb_cursor, NULL, NULL,
-    FONTWIDTH(8)
-};
-
-
-    /*
-     *  Initialisation
-     */
-
-__initfunc(void mdafb_init(void))
-{
-    u16 saved;
-    u16 *p;
-
-    mda_video_num_lines = 25;
-    mda_video_num_columns = 80;
-    mda_video_type = VIDEO_TYPE_MDA;
-    mda_video_mem_base = 0xb0000 + VGA_OFFSET;
-    mda_video_mem_len  = 0x01000;
-    mda_video_port_reg = 0x3b4;
-    mda_video_port_val = 0x3b5;
-
-    strcpy(fb_fix.id, "MDA-Dual-Head");
-    request_region(0x3b0, 12, "mda-2");
-    request_region(0x3bf, 1, "mda-2");
-
-    /*
-     *	Find out if there is a graphics card present.
-     *	Are there smarter methods around?
-     */
-    p = (u16 *)mda_video_mem_base;
-    saved = mda_readw(p);
-    mda_writew(0xAA55, p);
-    if (mda_readw(p) != 0xAA55) {
-	mda_writew(saved, p);
-	return;
-    }
-    mda_writew(0x55AA, p);
-    if (mda_readw(p) != 0x55AA) {
-	mda_writew(saved, p);
-	return;
-    }
-    mda_writew(saved, p);
-
-    fb_fix.smem_start = (char *) mda_video_mem_base;
-    fb_fix.smem_len = mda_video_mem_len;
-    fb_fix.type = FB_TYPE_TEXT;
-    fb_fix.type_aux = FB_AUX_TEXT_MDA;
-    fb_fix.visual = FB_VISUAL_PSEUDOCOLOR;
-    fb_fix.ypanstep = mda_font_height;
-    fb_fix.xpanstep = 0;
-    fb_fix.ywrapstep = 0;
-    fb_fix.line_length = 2 * mda_video_num_columns;
-    fb_fix.mmio_start = NULL;
-    fb_fix.mmio_len = 0;
-    fb_fix.accel = FB_ACCEL_NONE;
-
-    fb_var.xres = mda_video_num_columns*8;
-    fb_var.yres = mda_video_num_lines * mda_font_height;
-    fb_var.xres_virtual = fb_var.xres;
-    /* the cursor is put at the end of the video memory, hence the -2 */
-    fb_var.yres_virtual = ((fb_fix.smem_len-2)/fb_fix.line_length)*
-			  mda_font_height;
-
-    fb_var.xoffset = fb_var.yoffset = 0;
-    fb_var.bits_per_pixel = 1;
-    fb_var.grayscale = 1;
-    fb_var.red.offset = 0;
-    fb_var.red.length = 0;
-    fb_var.red.msb_right = 0;
-    fb_var.green.offset = 0;
-    fb_var.green.length = 0;
-    fb_var.green.msb_right = 0;
-    fb_var.blue.offset = 0;
-    fb_var.blue.length = 0;
-    fb_var.blue.msb_right = 0;
-    fb_var.transp.offset = 0;
-    fb_var.transp.length = 0;
-    fb_var.transp.msb_right = 0;
-    fb_var.nonstd = 0;
-    fb_var.activate = 0;
-    fb_var.height = fb_var.width = -1;
-    fb_var.accel_flags = FB_ACCELF_TEXT;
-    fb_var.pixclock = 39722;		/* 25.175 MHz */
-    fb_var.left_margin = 40;
-    fb_var.right_margin = 24;
-    fb_var.upper_margin = 39;
-    fb_var.lower_margin = 9;
-    fb_var.hsync_len = 96;
-    fb_var.vsync_len = 2;
-    fb_var.sync = 0;
-    fb_var.vmode = FB_VMODE_NONINTERLACED;
-
-    disp.var = fb_var;
-    disp.cmap.start = 0;
-    disp.cmap.len = 0;
-    disp.cmap.red = NULL;
-    disp.cmap.green = NULL;
-    disp.cmap.blue = NULL;
-    disp.cmap.transp = NULL;
-
-#ifdef __i386__
-    disp.screen_base = ioremap((unsigned long) fb_fix.smem_start, 
-    				fb_fix.smem_len);
-#else
-    disp.screen_base = bus_to_virt((unsigned long) fb_fix.smem_start);
-#endif
-    disp.visual = fb_fix.visual;
-    disp.type = fb_fix.type;
-    disp.type_aux = fb_fix.type_aux;
-    disp.ypanstep = fb_fix.ypanstep;
-    disp.ywrapstep = fb_fix.ywrapstep;
-    disp.line_length = fb_fix.line_length;
-    disp.can_soft_blank = 1;
-    disp.inverse = 0;
-    disp.dispsw = &fbcon_mdafb;
-
-    strcpy(fb_info.modename, fb_fix.id);
-    fb_info.node = -1;
-    fb_info.fbops = &mdafb_ops;
-    fb_info.disp = &disp;
-    fb_info.fontname[0] = '\0';
-    fb_info.changevar = NULL;
-    fb_info.switch_con = &mdafbcon_switch;
-    fb_info.updatevar = &mdafbcon_updatevar;
-    fb_info.blank = &mdafbcon_blank;
-
-    mdafb_set_var(&fb_var, -1, &fb_info);
-
-    if (register_framebuffer(&fb_info) < 0)
-	return;
-
-    printk("fb%d: MDA frame buffer device, using %dK of video memory\n",
-	   GET_FB_IDX(fb_info.node), fb_fix.smem_len>>10);
-}
-
-__initfunc(void mdafb_setup(char *options, int *ints))
-{
-	/* nothing yet */
-}
-
-    /*
-     *  Update the `var' structure (called by fbcon.c)
-     */
-
-static int mdafbcon_updatevar(int con, struct fb_info *info)
-{
-	if (con == currcon) {
-		struct fb_var_screeninfo *var = &fb_display[currcon].var;
-
-		/* hardware scrolling */
-
-		mda_set_origin(var->yoffset / mda_font_height *
-			fb_fix.line_length);
-	}
-
-	return 0;
-}
-
-static int mdafbcon_switch(int con, struct fb_info *info)
-{
-	currcon = con;
-	mdafbcon_updatevar(con, info);
-	return 0;
-}
-
-    /*
-     *  Blank the display.
-     */
-
-static void mdafbcon_blank(int blank, struct fb_info *info)
-{
-	if (blank) {
-		outb_p(0x00, 0x3b8);  /* disable video */
-	} else {
-		outb_p(0x08, 0x3b8);  /* enable video */
-	}
-}
-
-
-#ifdef MODULE
-int init_module(void)
-{
-	mdafb_init();
-	return 0;
-}
-
-void cleanup_module(void)
-{
-	unregister_framebuffer(&fb_info);
-}
-#endif /* MODULE */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/newport_con.c m68k/drivers/video/newport_con.c
--- jes-2.1.119/drivers/video/newport_con.c	Thu Jan  1 01:00:00 1970
+++ m68k/drivers/video/newport_con.c	Mon Aug 31 00:46:04 1998
@@ -0,0 +1,396 @@
+/* $Id: newport_con.c,v 1.1 1998/08/19 21:56:41 ralf Exp $
+ *
+ * newport_con.c: Abscon for newport hardware
+ * 
+ * (C) 1998 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
+ * 
+ * This driver is based on sgicons.c and cons_newport.
+ * 
+ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1997 Miguel de Icaza (miguel@nuclecu.unam.mx)
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/tty.h>
+#include <linux/kd.h>
+#include <linux/selection.h>
+#include <linux/console.h>
+#include <linux/console_struct.h>
+#include <linux/vt_kern.h>
+#include <linux/mm.h>
+
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/newport.h>
+
+struct newport_regs *npregs;
+int newport_num_lines;
+int newport_num_columns;
+int topscan;
+
+extern unsigned char vga_font[];
+
+#define BMASK(c) (c << 24)
+
+#define RENDER(regs, cp) do { \
+(regs)->go.zpattern = BMASK((cp)[0x0]); (regs)->go.zpattern = BMASK((cp)[0x1]); \
+(regs)->go.zpattern = BMASK((cp)[0x2]); (regs)->go.zpattern = BMASK((cp)[0x3]); \
+(regs)->go.zpattern = BMASK((cp)[0x4]); (regs)->go.zpattern = BMASK((cp)[0x5]); \
+(regs)->go.zpattern = BMASK((cp)[0x6]); (regs)->go.zpattern = BMASK((cp)[0x7]); \
+(regs)->go.zpattern = BMASK((cp)[0x8]); (regs)->go.zpattern = BMASK((cp)[0x9]); \
+(regs)->go.zpattern = BMASK((cp)[0xa]); (regs)->go.zpattern = BMASK((cp)[0xb]); \
+(regs)->go.zpattern = BMASK((cp)[0xc]); (regs)->go.zpattern = BMASK((cp)[0xd]); \
+(regs)->go.zpattern = BMASK((cp)[0xe]); (regs)->go.zpattern = BMASK((cp)[0xf]); \
+} while(0)
+
+#define TESTVAL 0xdeadbeef
+#define XSTI_TO_FXSTART(val) (((val) & 0xffff) << 11)
+
+static inline void newport_render_background(int xpos, int ypos, int ci)
+{
+    newport_wait();
+    npregs->set.wrmask = 0xffffffff;
+    npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+			     NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
+			     NPORT_DMODE0_STOPY);
+    npregs->set.colori = ci;
+    npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
+    npregs->go.xyendi = ((xpos + 7) << 16) | ((ypos + topscan + 15) & 0x3ff);
+}
+
+static inline void newport_init_cmap(void)
+{
+    unsigned short i;
+    
+    for(i = 0; i < 16; i++) {
+	newport_bfwait();
+	newport_cmap_setaddr(npregs, color_table[i]);
+	newport_cmap_setrgb(npregs,
+			    default_red[i],
+			    default_grn[i],
+			    default_blu[i]);
+    }
+}
+
+static inline void newport_clear_screen(int xstart, int ystart, int xend, int yend)
+{
+    newport_wait();
+    npregs->set.wrmask = 0xffffffff;
+    npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+			     NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX |
+			     NPORT_DMODE0_STOPY);
+    npregs->set.colori = 0;
+    npregs->set.xystarti = (xstart << 16) | ystart;
+    npregs->go.xyendi = (xend << 16) | yend;
+}
+
+static inline void newport_clear_lines(int ystart, int yend)
+{
+    ystart = ((ystart << 4) + topscan) & 0x3ff;
+    yend = ((yend << 4) + topscan + 15) & 0x3ff;    
+    newport_clear_screen (0, ystart, 1279, yend);
+}
+
+void newport_reset (void)
+{
+    unsigned short treg;    
+    int i;
+    
+    newport_wait();
+    treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
+    newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_EVIDEO));
+
+    treg = newport_vc2_get(npregs, VC2_IREG_CENTRY);
+    newport_vc2_set(npregs, VC2_IREG_RADDR, treg);
+    npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
+			   NPORT_DMODE_W2 | VC2_PROTOCOL);
+    for(i = 0; i < 128; i++) {
+	newport_bfwait();
+	if (i == 92 || i == 94)
+	    npregs->set.dcbdata0.hwords.s1 = 0xff00;
+	else
+	    npregs->set.dcbdata0.hwords.s1 = 0x0000;
+    }
+
+    newport_init_cmap();
+    npregs->cset.topscan = topscan = 0;
+    npregs->cset.xywin = (4096 << 16) | 4096;
+    /* Clear the screen. */
+    newport_clear_screen(0,0,1280+63,1024);
+}
+
+__initfunc(static const char *newport_startup(void))
+{
+    struct newport_regs *p;
+
+    npregs = (struct newport_regs *) (KSEG1 + 0x1f0f0000);
+	
+    p = npregs;
+    p->cset.config = NPORT_CFG_GD0;
+
+    if(newport_wait()) {
+	return NULL;
+    }
+
+    p->set.xstarti = TESTVAL; if(p->set._xstart.i != XSTI_TO_FXSTART(TESTVAL)) {
+	return NULL;
+    }
+
+    newport_reset ();
+
+    // gfx_init (display_desc);
+    newport_num_lines = ORIG_VIDEO_LINES;
+    newport_num_columns = ORIG_VIDEO_COLS;
+    
+    return "SGI Newport";
+}
+
+static void newport_init(struct vc_data *vc, int init)
+{
+    vc->vc_cols = newport_num_columns;
+    vc->vc_rows = newport_num_lines;
+    vc->vc_can_do_color = 1;
+}
+
+static void newport_clear(struct vc_data *vc, int sy, int sx, int height, int width)
+{
+    int xend = ((sx + width) << 3) - 1;
+    int ystart = ((sy << 4) + topscan) & 0x3ff;
+    int yend = (((sy + height) << 4) + topscan - 1) & 0x3ff;
+    
+    if (ystart < yend) {
+	newport_clear_screen(sx << 3, ystart, xend, yend);
+    } else {
+	newport_clear_screen(sx << 3, ystart, xend, 1023);
+	newport_clear_screen(sx << 3, 0, xend, yend);
+    }
+}
+
+static void newport_putc(struct vc_data *vc, int charattr, int ypos, int xpos)
+{
+    unsigned char *p;
+    
+    p = &vga_font[(charattr & 0xff) << 4];
+    charattr = (charattr >> 8) & 0xff;
+    xpos <<= 3;
+    ypos <<= 4;
+
+    newport_render_background(xpos, ypos, (charattr & 0xf0) >> 4);
+    
+    /* Set the color and drawing mode. */
+    newport_wait();
+    npregs->set.colori = charattr & 0xf;
+    npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+			     NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
+			     NPORT_DMODE0_L32);
+    
+    /* Set coordinates for bitmap operation. */
+    npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
+    npregs->set.xyendi = ((xpos + 7) << 16);
+    newport_wait();
+    
+    /* Go, baby, go... */
+    RENDER(npregs, p);
+}
+
+static void newport_putcs(struct vc_data *vc, const unsigned short *s, int count,
+			  int ypos, int xpos)
+{
+    while (count--)
+	newport_putc (vc, *s++, ypos, xpos++);
+}
+
+static void newport_cursor(struct vc_data *vc, int mode)
+{
+    unsigned short treg;
+    int xcurs, ycurs;
+    
+    switch (mode) {
+     case CM_ERASE:
+	treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
+	newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg & ~(VC2_CTRL_ECDISP)));
+	break;
+
+     case CM_MOVE:
+     case CM_DRAW:
+	treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
+	newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_ECDISP));
+	xcurs = (vc->vc_pos - vc->vc_visible_origin) / 2;
+	ycurs = ((xcurs / vc->vc_cols) << 4) + 31;
+	xcurs = ((xcurs % vc->vc_cols) << 3) + 21;
+	newport_vc2_set(npregs, VC2_IREG_CURSX, xcurs);
+	newport_vc2_set(npregs, VC2_IREG_CURSY, ycurs);
+    }
+}
+
+static int newport_switch(struct vc_data *vc)
+{
+    npregs->cset.topscan = topscan = 0;
+    return 1;
+}
+
+static int newport_blank(struct vc_data *c, int blank)
+{
+    unsigned short treg;
+    
+    if (blank == 0) {
+	/* unblank console */
+	treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
+	newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg | VC2_CTRL_EDISP));
+    } else {
+	/* blank console */
+	treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
+	newport_vc2_set(npregs, VC2_IREG_CONTROL, (treg & ~(VC2_CTRL_EDISP)));
+    }
+    return 1;
+}
+
+static int newport_font_op(struct vc_data *vc, struct console_font_op *f)
+{
+    return -ENOSYS;
+}
+
+static int newport_set_palette(struct vc_data *vc, unsigned char *table)
+{
+    return -EINVAL;
+}
+
+static int newport_scrolldelta(struct vc_data *vc, int lines)
+{
+    if (!lines)
+	return 0;
+
+    npregs->cset.topscan = topscan = (topscan + (lines << 4)) & 0x3ff;
+    return 1;
+}
+
+static int newport_scroll(struct vc_data *vc, int t, int b, int dir, int lines)
+{
+    int count,x,y;
+    unsigned short *s, *d;
+    unsigned short chattr;
+
+    if (t == 0 && b == vc->vc_rows) {
+	if (dir == SM_UP) {
+	    newport_scrolldelta (vc, lines);
+	    newport_clear_lines (vc->vc_rows-lines,vc->vc_rows-1);		
+	} else {
+	    newport_scrolldelta (vc, -lines);
+	    newport_clear_lines (0,lines-1);
+	}
+	return 0;
+    }
+    
+    count = (b-t-lines) * vc->vc_cols;
+    if (dir == SM_UP) {
+	x = 0; y = t;
+	s = (unsigned short *)(vc->vc_origin + vc->vc_size_row*(t+lines));
+	d = (unsigned short *)(vc->vc_origin + vc->vc_size_row*t);
+	while (count--) {
+	    chattr = scr_readw (s++);
+	    if (chattr != scr_readw(d)) {
+		newport_putc (vc, chattr, y, x);
+		scr_writew (chattr, d);
+	    }
+	    d++;
+	    if (++x == vc->vc_cols) {
+		x = 0; y++;
+	    }
+	}
+	d = (unsigned short *)(vc->vc_origin + vc->vc_size_row*(b-lines));
+	x = 0; y = b-lines;
+	for (count = 0; count < (lines * vc->vc_cols); count++) {
+	    if (scr_readw(d) != vc->vc_video_erase_char) {
+		newport_putc (vc, chattr, y, x);
+		scr_writew (vc->vc_video_erase_char, d);
+	    }
+	    d++;
+	    if (++x == vc->vc_cols) {
+		x = 0; y++;
+	    }
+	}
+    } else {
+	x = vc->vc_cols-1; y = b-1;
+	s = (unsigned short *)(vc->vc_origin + vc->vc_size_row*(b-lines)-2);
+	d = (unsigned short *)(vc->vc_origin + vc->vc_size_row*b-2);
+	while (count--) {
+	    chattr = scr_readw (s--);
+	    if (chattr != scr_readw(d)) {
+		newport_putc (vc, chattr, y, x);
+		scr_writew (chattr, d);
+	    }
+	    d--;
+	    if (x-- == 0) {
+		x = vc->vc_cols-1; y--;
+	    }
+	}
+	d = (unsigned short *)(vc->vc_origin + vc->vc_size_row*t);
+	x = 0; y = t;
+	for (count = 0; count < (lines * vc->vc_cols); count++) {
+	    if (scr_readw(d) != vc->vc_video_erase_char) {
+		newport_putc (vc, vc->vc_video_erase_char, y, x);
+		scr_writew (vc->vc_video_erase_char, d);
+	    }
+	    d++;
+	    if (++x == vc->vc_cols) {
+		x = 0; y++;
+	    }
+	}
+    }
+    return 1;
+}
+
+static void newport_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, int h, int w)
+{
+    short xs, ys, xe, ye, xoffs, yoffs, tmp;
+
+    xs = sx << 3; xe = ((sx+w) << 3)-1;
+    /*
+     * as bmove is only used to move stuff around in the same line
+     * (h == 1), we don't care about wrap arounds caused by topscan != 0
+     */
+    ys = ((sy << 4) + topscan) & 0x3ff; ye = (((sy+h) << 4)-1+topscan) & 0x3ff;
+    xoffs = (dx - sx) << 3;
+    yoffs = (dy - sy) << 4;
+    if (xs > xe && xoffs > 0) {
+	/* move to the right, exchange starting points */
+	tmp = xe; xe = xs; xs = tmp;
+    }
+    newport_wait();
+    npregs->set.drawmode0 = (NPORT_DMODE0_S2S | NPORT_DMODE0_BLOCK |
+			     NPORT_DMODE0_STOPX | NPORT_DMODE0_STOPY);
+    npregs->set.xystarti = (xs << 16) | ys;
+    npregs->set.xyendi = (xe << 16) | ye;
+    npregs->go.xymove = (xoffs << 16) | yoffs;
+}
+
+static int newport_dummy(struct vc_data *c)
+{
+    return 0;
+}
+
+#define DUMMY (void *) newport_dummy
+
+struct consw newport_con = {
+    newport_startup,
+    newport_init,
+    DUMMY,                          /* con_deinit */
+    newport_clear,
+    newport_putc,
+    newport_putcs,
+    newport_cursor,
+    newport_scroll,
+    newport_bmove,
+    newport_switch,
+    newport_blank,
+    newport_font_op,
+    newport_set_palette,
+    newport_scrolldelta,
+    DUMMY, /* newport_set_origin, */
+    DUMMY, /* newport_save_screen */
+    NULL, /* newport_build_attr */
+    NULL  /* newport_invert_region */
+};
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/offb.c m68k/drivers/video/offb.c
--- jes-2.1.119/drivers/video/offb.c	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/offb.c	Mon Aug 31 00:46:04 1998
@@ -32,9 +32,9 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "macmodes.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/macmodes.h>
 
 
 static int currcon = 0;
@@ -286,6 +286,9 @@
 #ifdef CONFIG_FB_CONTROL
 extern void control_of_init(struct device_node *dp);
 #endif /* CONFIG_FB_CONTROL */
+#ifdef CONFIG_FB_VALKYRIE
+extern void valkyrie_of_init(struct device_node *dp);
+#endif /* CONFIG_FB_VALKYRIE */
 #ifdef CONFIG_FB_PLATINUM
 extern void platinum_of_init(struct device_node *dp);
 #endif /* CONFIG_FB_PLATINUM */
@@ -338,6 +341,12 @@
 			continue;
 		}
 #endif /* CONFIG_FB_CONTROL */
+#ifdef CONFIG_FB_VALKYRIE
+		if(!strcmp(dp->name, "valkyrie")) {
+			valkyrie_of_init(dp);
+			continue;
+		}
+#endif /* CONFIG_FB_VALKYRIE */
 #ifdef CONFIG_FB_PLATINUM
 	    if (!strncmp(dp->name, "platinum",8)) {
 		platinum_of_init(dp);
@@ -390,6 +399,11 @@
 		continue;
 	    }
 	    address = (u_long)dp->addrs[i].address;
+
+		/* kludge for valkyrie */
+	    if (strcmp(dp->name, "valkyrie") == 0) 
+			address += 0x1000;
+
 	}
 	fix->smem_start = (char *)address;
 	fix->type = FB_TYPE_PACKED_PIXELS;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/platinumfb.c m68k/drivers/video/platinumfb.c
--- jes-2.1.119/drivers/video/platinumfb.c	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/platinumfb.c	Mon Aug 31 00:46:04 1998
@@ -41,12 +41,12 @@
 #include <asm/pgtable.h>
 #include <asm/adb.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb32.h>
+#include <video/macmodes.h>
 
-#include "macmodes.h"
 #include "platinumfb.h"
 
 static char fontname[40] __initdata = { 0 };
@@ -66,15 +66,6 @@
 struct fb_info_platinum {
 	struct fb_info			fb_info;
 	struct display			disp;
-#ifdef FBCON_HAS_CFB8
-	struct display_switch		disp8;
-#endif
-#ifdef FBCON_HAS_CFB16
-	struct display_switch		disp16;
-#endif
-#ifdef FBCON_HAS_CFB32
-	struct display_switch		disp32;
-#endif
 	struct fb_par_platinum		default_par;
 	struct fb_par_platinum		current_par;
 
@@ -95,6 +86,15 @@
 	unsigned long			total_vram;
 	int				clktype;
 	int				dactype;
+
+	union {
+#ifdef FBCON_HAS_CFB16
+		u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+		u32 cfb32[16];
+#endif
+	} fbcon_cmap;
 };
 
 /*
@@ -268,17 +268,19 @@
 	    switch(par.cmode) {
 #ifdef FBCON_HAS_CFB8
 	     case CMODE_8:
-		display->dispsw = &info->disp8;
+		display->dispsw = &fbcon_cfb8;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB16
 	     case CMODE_16:
-		display->dispsw = &info->disp16;
+		display->dispsw = &fbcon_cfb16;
+		display->dispsw_data = info->fbcon_cmap.cfb16;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB32
 	     case CMODE_32:
-		display->dispsw = &info->disp32;
+		display->dispsw = &fbcon_cfb32;
+		display->dispsw_data = info->fbcon_cmap.cfb32;
 		break;
 #endif
 	     default:
@@ -451,10 +453,10 @@
 
 	if(regno < 16) {
 #ifdef FBCON_HAS_CFB16
-		fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | (regno << 0);
+		info->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) | (regno << 0);
 #endif
 #ifdef FBCON_HAS_CFB32
-		fbcon_cfb32_cmap[regno] = (regno << 24) | (regno << 16) | (regno << 8) | regno;
+		info->fbcon_cmap.cfb32[regno] = (regno << 24) | (regno << 16) | (regno << 8) | regno;
 #endif
 	}
 	return 0;
@@ -637,17 +639,6 @@
 		info->palette[j].green = default_grn[k];
 		info->palette[j].blue = default_blu[k];
 	}
-
-#ifdef FBCON_HAS_CFB8
-	info->disp8 = fbcon_cfb8;
-#endif
-#ifdef FBCON_HAS_CFB16
-	info->disp16 = fbcon_cfb16;
-#endif
-#ifdef FBCON_HAS_CFB32
-	info->disp32 = fbcon_cfb32;
-#endif
-
 	platinum_set_var(&var, -1, &info->fb_info);
 
 	if (register_framebuffer(&info->fb_info) < 0)
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/promcon.c m68k/drivers/video/promcon.c
--- jes-2.1.119/drivers/video/promcon.c	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/promcon.c	Mon Aug 31 00:46:04 1998
@@ -1,4 +1,4 @@
-/* $Id: promcon.c,v 1.10 1998/07/24 15:31:53 jj Exp $
+/* $Id: promcon.c,v 1.12 1998/08/23 20:19:01 mj Exp $
  * Console driver utilizing PROM sun terminal emulation
  *
  * Copyright (C) 1998  Eddie C. Dost  (ecd@skynet.be)
@@ -178,8 +178,6 @@
 	if (!init) {
 		if (conp->vc_cols != pw + 1 || conp->vc_rows != ph + 1)
 			vc_resize_con(ph + 1, pw + 1, conp->vc_num);
-		else if (conp->vc_num == fg_console)
-			update_screen(fg_console);
 	}
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/retz3fb.c m68k/drivers/video/retz3fb.c
--- jes-2.1.119/drivers/video/retz3fb.c	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/retz3fb.c	Mon Aug 31 00:46:04 1998
@@ -37,11 +37,11 @@
 #include <asm/irq.h>
 #include <asm/pgtable.h>
 
-#include "retz3fb.h"
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
 
+#include "retz3fb.h"
 
 /* #define DEBUG if(1) */
 #define DEBUG if(0)
@@ -1280,12 +1280,6 @@
 	display->ywrapstep = fix.ywrapstep;
 	display->can_soft_blank = 1;
 	display->inverse = z3fb_inverse;
-
-	/*
-	 * This seems to be about 20% faster.
-	 */
-	display->scrollmode = SCROLL_YREDRAW;
-
 	switch (display->var.bits_per_pixel) {
 #ifdef FBCON_HAS_CFB8
 	case 8:
@@ -1634,8 +1628,8 @@
  */
 
 #ifdef FBCON_HAS_CFB8
-static void fbcon_retz3_8_bmove(struct display *p, int sy, int sx,
-				int dy, int dx, int height, int width)
+static void fbcon_retz3_8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+	                int height, int width)
 {
 	int fontwidth = fontwidth(p);
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/s3blit.h m68k/drivers/video/s3blit.h
--- jes-2.1.119/drivers/video/s3blit.h	Sun Feb  8 22:35:54 1998
+++ m68k/drivers/video/s3blit.h	Thu Jan  1 01:00:00 1970
@@ -1,74 +0,0 @@
-/* s3 commands */
-#define S3_BITBLT       0xc011
-#define S3_TWOPOINTLINE 0x2811
-#define S3_FILLEDRECT   0x40b1
-
-#define S3_FIFO_EMPTY 0x0400
-#define S3_HDW_BUSY   0x0200
-
-/* Enhanced register mapping (MMIO mode) */
-
-#define S3_READ_SEL      0xbee8 /* offset f */
-#define S3_MULT_MISC     0xbee8 /* offset e */
-#define S3_ERR_TERM      0x92e8
-#define S3_FRGD_COLOR    0xa6e8
-#define S3_BKGD_COLOR    0xa2e8
-#define S3_PIXEL_CNTL    0xbee8 /* offset a */
-#define S3_FRGD_MIX      0xbae8
-#define S3_BKGD_MIX      0xb6e8
-#define S3_CUR_Y         0x82e8
-#define S3_CUR_X         0x86e8
-#define S3_DESTY_AXSTP   0x8ae8
-#define S3_DESTX_DIASTP  0x8ee8
-#define S3_MIN_AXIS_PCNT 0xbee8 /* offset 0 */
-#define S3_MAJ_AXIS_PCNT 0x96e8
-#define S3_CMD           0x9ae8
-#define S3_GP_STAT       0x9ae8
-#define S3_ADVFUNC_CNTL  0x4ae8
-#define S3_WRT_MASK      0xaae8
-#define S3_RD_MASK       0xaee8
-
-/* Enhanced register mapping (Packed MMIO mode, write only) */
-#define S3_ALT_CURXY     0x8100
-#define S3_ALT_CURXY2    0x8104
-#define S3_ALT_STEP      0x8108
-#define S3_ALT_STEP2     0x810c
-#define S3_ALT_ERR       0x8110
-#define S3_ALT_CMD       0x8118
-#define S3_ALT_MIX       0x8134
-#define S3_ALT_PCNT      0x8148
-#define S3_ALT_PAT       0x8168
-
-/* Drawing modes */
-#define S3_NOTCUR          0x0000
-#define S3_LOGICALZERO     0x0001
-#define S3_LOGICALONE      0x0002
-#define S3_LEAVEASIS       0x0003
-#define S3_NOTNEW          0x0004
-#define S3_CURXORNEW       0x0005
-#define S3_NOT_CURXORNEW   0x0006
-#define S3_NEW             0x0007
-#define S3_NOTCURORNOTNEW  0x0008
-#define S3_CURORNOTNEW     0x0009
-#define S3_NOTCURORNEW     0x000a
-#define S3_CURORNEW        0x000b
-#define S3_CURANDNEW       0x000c
-#define S3_NOTCURANDNEW    0x000d
-#define S3_CURANDNOTNEW    0x000e
-#define S3_NOTCURANDNOTNEW 0x000f
-
-#define S3_CRTC_ADR    0x03d4
-#define S3_CRTC_DATA   0x03d5
-
-#define S3_REG_LOCK2 0x39
-#define S3_HGC_MODE  0x45
-
-#define S3_HWGC_ORGX_H 0x46
-#define S3_HWGC_ORGX_L 0x47
-#define S3_HWGC_ORGY_H 0x48
-#define S3_HWGC_ORGY_L 0x49
-#define S3_HWGC_DX     0x4e
-#define S3_HWGC_DY     0x4f
-
-
-#define S3_LAW_CTL 0x58
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/sbusfb.c m68k/drivers/video/sbusfb.c
--- jes-2.1.119/drivers/video/sbusfb.c	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/sbusfb.c	Mon Aug 31 00:46:04 1998
@@ -41,7 +41,9 @@
 
 #include <asm/uaccess.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
+
+#define DEFAULT_CURSOR_BLINK_RATE       (2*HZ/5)
 
     /*
      *  Interface used by the world
@@ -53,6 +55,7 @@
 static int currcon;
 static int defx_margin = -1, defy_margin = -1;
 static char fontname[40] __initdata = { 0 };
+static int curblink __initdata = 1;
 static struct {
 	int depth;
 	int xres, yres;
@@ -447,20 +450,36 @@
 
 static unsigned char hw_cursor_cmap[2] = { 0, 0xff };
 
+static void
+sbusfb_cursor_timer_handler(unsigned long dev_addr)
+{
+	struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)dev_addr;
+        
+	if (!fb->setcursor) return;
+                                
+	if (fb->cursor.mode != 2) {
+		fb->cursor.enable ^= 1;
+		fb->setcursor(fb);
+	}
+	
+	fb->cursor.timer.expires = jiffies + fb->cursor.blink_rate;
+	add_timer(&fb->cursor.timer);
+}
+
 static void sbusfb_cursor(struct display *p, int mode, int x, int y)
 {
 	struct fb_info_sbusfb *fb = sbusfbinfod(p);
 	
 	switch (mode) {
 	case CM_ERASE:
+		fb->cursor.mode = 2;
 		fb->cursor.enable = 0;
 		(*fb->setcursor)(fb);
-		fb->hw_cursor_shown = 0;
 		break;
 				  
 	case CM_MOVE:
 	case CM_DRAW:
-		if (!fb->hw_cursor_shown) {
+		if (fb->cursor.mode) {
 			fb->cursor.size.fbx = fontwidth(p);
 			fb->cursor.size.fby = fontheight(p);
 			fb->cursor.chot.fbx = 0;
@@ -473,7 +492,7 @@
 			fb->cursor.bits[1][fontheight(p) - 1] = (0xffffffff << (32 - fontwidth(p)));
 			(*fb->setcursormap) (fb, hw_cursor_cmap, hw_cursor_cmap, hw_cursor_cmap);
 			(*fb->setcurshape) (fb);
-			fb->hw_cursor_shown = 1;
+			fb->cursor.mode = 0;
 		}
 		if (fontwidthlog(p))
 			fb->cursor.cpos.fbx = (x << fontwidthlog(p)) + fb->x_margin;
@@ -665,7 +684,7 @@
  			lastconsole = info->display_fg->vc_num; 
  			if (vt_cons[lastconsole]->vc_mode == KD_TEXT)
  				return -EINVAL; /* Don't let graphics programs hide our nice text cursor */
-			fb->hw_cursor_shown = 0; /* Forget state of our text cursor */
+			fb->cursor.mode = 2; /* Forget state of our text cursor */
 		}
 		return sbus_hw_scursor ((struct fbcursor *) arg, fb);
 
@@ -719,7 +738,8 @@
 					break;
 			memcpy(fontname, p+5, i);
 			fontname[i] = 0;
-		}
+		} else if (!strncmp(p, "noblink", 7))
+			curblink = 0;
 		while (*p && *p != ' ' && *p != ',') p++;
 		if (*p != ',') break;
 		p++;
@@ -740,7 +760,7 @@
 	if (lastconsole != con && 
 	    (fontwidth(&fb_display[lastconsole]) != fontwidth(&fb_display[con]) ||
 	     fontheight(&fb_display[lastconsole]) != fontheight(&fb_display[con])))
-		fb->hw_cursor_shown = 0;
+		fb->cursor.mode = 1;
 	x_margin = (fb_display[con].var.xres_virtual - fb_display[con].var.xres) / 2;
 	y_margin = (fb_display[con].var.yres_virtual - fb_display[con].var.yres) / 2;
 	if (fb->margins)
@@ -791,9 +811,9 @@
 
 	if (!fb->color_map || regno > 255)
 		return 1;
-	*red = (fb->color_map CM(regno, 0)<<8) || fb->color_map CM(regno, 0);
-	*green = (fb->color_map CM(regno, 1)<<8) || fb->color_map CM(regno, 1);
-	*blue = (fb->color_map CM(regno, 2)<<8) || fb->color_map CM(regno, 2);
+	*red = (fb->color_map CM(regno, 0)<<8) | fb->color_map CM(regno, 0);
+	*green = (fb->color_map CM(regno, 1)<<8) | fb->color_map CM(regno, 1);
+	*blue = (fb->color_map CM(regno, 2)<<8) | fb->color_map CM(regno, 2);
 	*transp = 0;
 	return 0;
 }
@@ -867,7 +887,7 @@
 	p->var.xres = w - 2*x_margin;
 	p->var.yres = h - 2*y_margin;
 	
-	fb->hw_cursor_shown = 0;
+	fb->cursor.mode = 1;
 	
 	if (fb->margins)
 		fb->margins(fb, p, x_margin, y_margin);
@@ -1042,8 +1062,17 @@
 		goto sizechange;
 
 	disp->dispsw = &fb->dispsw;
-	if (fb->setcursor)
+	if (fb->setcursor) {
 		fb->dispsw.cursor = sbusfb_cursor;
+		if (curblink) {
+			fb->cursor.blink_rate = DEFAULT_CURSOR_BLINK_RATE;
+			init_timer(&fb->cursor.timer);
+			fb->cursor.timer.expires = jiffies + fb->cursor.blink_rate;
+			fb->cursor.timer.data = (unsigned long)fb;
+			fb->cursor.timer.function = sbusfb_cursor_timer_handler;
+			add_timer(&fb->cursor.timer);
+		}
+	}
 	fb->dispsw.set_font = sbusfb_set_font;
 	fb->setup = fb->dispsw.setup;
 	fb->dispsw.setup = sbusfb_disp_setup;
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/sbusfb.h m68k/drivers/video/sbusfb.h
--- jes-2.1.119/drivers/video/sbusfb.h	Sun Aug 30 20:40:54 1998
+++ m68k/drivers/video/sbusfb.h	Thu Jan  1 01:00:00 1970
@@ -1,135 +0,0 @@
-#include <asm/sbus.h>
-#include <asm/oplib.h>
-#include <asm/fbio.h>
-
-#include "fbcon.h"
-
-struct bt_regs {
-	volatile unsigned int addr;           /* address register */
-	volatile unsigned int color_map;      /* color map */
-	volatile unsigned int control;        /* control register */
-	volatile unsigned int cursor;         /* cursor map register */
-};
-
-struct fb_info_creator {
-	struct ffb_fbc *fbc;
-	struct ffb_dac *dac;
-	int dac_rev;
-	int xy_margin;
-};
-struct fb_info_cgsix {
-	struct bt_regs *bt;
-	struct cg6_fbc *fbc;
-	struct cg6_thc *thc;
-	struct cg6_tec *tec;
-	volatile u32 *fhc;
-};
-struct fb_info_bwtwo {
-	struct bw2_regs *regs;
-};
-struct fb_info_cgthree {
-	struct cg3_regs *regs;
-};
-struct fb_info_tcx {
-	struct bt_regs *bt;
-	struct tcx_thc *thc;
-	struct tcx_tec *tec;
-	u32 *cplane;
-};
-struct fb_info_leo {
-	struct leo_lx_krn *lx_krn;
-	struct leo_lc_ss0_usr *lc_ss0_usr;
-	struct leo_ld_ss0 *ld_ss0;
-	struct leo_ld_ss1 *ld_ss1;
-	struct leo_cursor *cursor;
-	unsigned int extent;
-};
-struct fb_info_cgfourteen {
-	struct cg14_regs *regs;
-	struct cg14_cursor *cursor;
-	struct cg14_clut *clut;
-	int ramsize;
-	int mode;
-};
-
-struct cg_cursor {
-	short	enable;         /* cursor is enabled */
-	struct	fbcurpos cpos;  /* position */
-	struct	fbcurpos chot;  /* hot-spot */
-	struct	fbcurpos size;  /* size of mask & image fields */
-	struct	fbcurpos hwsize; /* hw max size */
-	int	bits[2][128];   /* space for mask & image bits */
-	char	color [6];      /* cursor colors */
-};
-
-struct sbus_mmap_map {
-	unsigned long voff;
-	unsigned long poff;
-	unsigned long size;
-};
-
-#define SBUS_MMAP_FBSIZE(n) (-n)
-#define SBUS_MMAP_EMPTY	0x80000000
-
-struct fb_info_sbusfb {
-	struct fb_info info;
-	struct fb_fix_screeninfo fix;
-	struct fb_var_screeninfo var;
-	struct display disp;
-	struct display_switch dispsw;
-	struct fbtype type;
-	struct linux_sbus_device *sbdp;
-	int prom_node, prom_parent;
-	union {
-		struct fb_info_creator ffb;
-		struct fb_info_cgsix cg6;
-		struct fb_info_bwtwo bw2;
-		struct fb_info_cgthree cg3;
-		struct fb_info_tcx tcx;
-		struct fb_info_leo leo;
-		struct fb_info_cgfourteen cg14;
-	} s;
-	unsigned char *color_map;
-	struct cg_cursor cursor;
-	unsigned char hw_cursor_shown;
-	unsigned char open;
-	unsigned char mmaped;
-	unsigned char blanked;
-	int x_margin;
-	int y_margin;
-	int vtconsole;
-	int consolecnt;
-	int graphmode;
-	int emulations[4];
-	struct sbus_mmap_map *mmap_map;
-	unsigned long physbase;
-	int iospace;
-	/* Methods */
-	void (*setup)(struct display *);
-	void (*setcursor)(struct fb_info_sbusfb *);
-	void (*setcurshape)(struct fb_info_sbusfb *);
-	void (*setcursormap)(struct fb_info_sbusfb *, unsigned char *, unsigned char *, unsigned char *);
-	void (*loadcmap)(struct fb_info_sbusfb *, int, int);
-	void (*blank)(struct fb_info_sbusfb *);
-	void (*unblank)(struct fb_info_sbusfb *);
-	void (*margins)(struct fb_info_sbusfb *, struct display *, int, int);
-	void (*reset)(struct fb_info_sbusfb *);
-	void (*fill)(struct fb_info_sbusfb *, struct display *, int, int, unsigned short *);
-	void (*switch_from_graph)(struct fb_info_sbusfb *);
-	void (*restore_palette)(struct fb_info_sbusfb *);
-	int (*ioctl)(struct fb_info_sbusfb *, unsigned int, unsigned long);
-};
-
-extern char *creatorfb_init(struct fb_info_sbusfb *);
-extern char *cgsixfb_init(struct fb_info_sbusfb *);
-extern char *cgthreefb_init(struct fb_info_sbusfb *);
-extern char *tcxfb_init(struct fb_info_sbusfb *);
-extern char *leofb_init(struct fb_info_sbusfb *);
-extern char *bwtwofb_init(struct fb_info_sbusfb *);
-extern char *cgfourteenfb_init(struct fb_info_sbusfb *);
-
-#define sbusfbinfod(disp) ((struct fb_info_sbusfb *)(disp->fb_info))
-#define sbusfbinfo(info) ((struct fb_info_sbusfb *)(info))
-#define CM(i, j) [3*(i)+(j)]
-
-#define SBUSFBINIT_SIZECHANGE ((char *)-1)
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/skeletonfb.c m68k/drivers/video/skeletonfb.c
--- jes-2.1.119/drivers/video/skeletonfb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/skeletonfb.c	Mon Aug 31 00:46:04 1998
@@ -17,8 +17,9 @@
 #include <linux/malloc.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
+#include <linux/init.h>
 
-#include "fbcon.h"
+#include <video/fbcon.h>
 
 
     /*
@@ -83,13 +84,15 @@
      *  it as the default video mode
      */
 
+    struct xxxfb_par par;
+
     /* ... */
     xxx_get_par(&par);
     xxx_encode_var(&default_var, &par);
 }
 
 static int xxx_encode_fix(struct fb_fix_screeninfo *fix, struct xxxfb_par *par,
-			  const struct fb_info *fb_info)
+			  const struct fb_info *info)
 {
     /*
      *  This function should fill in the 'fix' structure based on the values
@@ -101,7 +104,7 @@
 }
 
 static int xxx_decode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
-			  const struct fb_info *fb_info)
+			  const struct fb_info *info)
 {
     /*
      *  Get the video params out of 'var'. If a value doesn't fit, round it up,
@@ -122,7 +125,7 @@
 }
 
 static int xxx_encode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
-			  const struct fb_info *fb_info)
+			  const struct fb_info *info)
 {
     /*
      *  Fill the 'var' structure based on the values in 'par' and maybe other
@@ -133,7 +136,7 @@
     return 0;
 }
 
-static void xxx_get_par(struct xxxfb_par *par, const struct fb_info *fb_info)
+static void xxx_get_par(struct xxxfb_par *par, const struct fb_info *info)
 {
     /*
      *  Fill the hardware's 'par' structure.
@@ -146,7 +149,7 @@
     }
 }
 
-static void xxx_set_par(struct xxxfb_par *par, const struct fb_info *fb_info)
+static void xxx_set_par(struct xxxfb_par *par, const struct fb_info *info)
 {
     /*
      *  Set the hardware according to 'par'.
@@ -159,7 +162,7 @@
 
 static int xxx_getcolreg(unsigned regno, unsigned *red, unsigned *green,
 			 unsigned *blue, unsigned *transp,
-			 const struct fb_info *fb_info)
+			 const struct fb_info *info)
 {
     /*
      *  Read a single color register and split it into colors/transparent.
@@ -173,7 +176,7 @@
 
 static int xxx_setcolreg(unsigned regno, unsigned red, unsigned green,
 			 unsigned blue, unsigned transp,
-			 const struct fb_info *fb_info)
+			 const struct fb_info *info)
 {
     /*
      *  Set a single color register. The values supplied have a 16 bit
@@ -186,30 +189,29 @@
 	 *  Make the first 16 colors of the palette available to fbcon
 	 */
 	if (is_cfb15)		/* RGB 555 */
-	    fbcon_cfb16_cmap[regno] = ((red & 0xf800) >> 1) |
-				      ((green & 0xf800) >> 6) |
-				      ((blue & 0xf800) >> 11);
+	    ...fbcon_cmap.cfb16[regno] = ((red & 0xf800) >> 1) |
+					 ((green & 0xf800) >> 6) |
+					 ((blue & 0xf800) >> 11);
 	if (is_cfb16)		/* RGB 565 */
-	    fbcon_cfb16_cmap[regno] = (red & 0xf800) |
-				      ((green & 0xfc00) >> 5) |
-				      ((blue & 0xf800) >> 11);
+	    ...fbcon_cmap.cfb16[regno] = (red & 0xf800) |
+					 ((green & 0xfc00) >> 5) |
+					 ((blue & 0xf800) >> 11);
 	if (is_cfb24)		/* RGB 888 */
-	    fbcon_cfb24_cmap[regno] = ((red & 0xff00) << 8) |
-				      (green & 0xff00) |
-				      ((blue & 0xff00) >> 8);
+	    ...fbcon_cmap.cfb24[regno] = ((red & 0xff00) << 8) |
+					 (green & 0xff00) |
+					 ((blue & 0xff00) >> 8);
 	if (is_cfb32)		/* RGBA 8888 */
-	    fbcon_cfb32_cmap[regno] = ((red & 0xff00) << 16) |
-				      ((green & 0xff00) << 8) |
-				      (blue & 0xff00) |
-				      ((transp & 0xff00) >> 8);
+	    ...fbcon_cmap.cfb32[regno] = ((red & 0xff00) << 16) |
+					 ((green & 0xff00) << 8) |
+					 (blue & 0xff00) |
+					 ((transp & 0xff00) >> 8);
     }
     /* ... */
     return 0;
 }
 
 static int xxx_pan_display(struct fb_var_screeninfo *var,
-			   struct xxxfb_par *par,
-			   const struct fb_info *fb_info)
+			   struct xxxfb_par *par, const struct fb_info *info)
 {
     /*
      *  Pan (or wrap, depending on the `vmode' field) the display using the
@@ -221,7 +223,7 @@
     return 0;
 }
 
-static int xxx_blank(int blank_mode, const struct fb_info *fb_info)
+static int xxx_blank(int blank_mode, const struct fb_info *info)
 {
     /*
      *  Blank the screen if blank_mode != 0, else unblank. If blank == NULL
@@ -238,30 +240,45 @@
     return 0;
 }
 
-static struct display_switch *xxx_get_dispsw(const void *par,
-					     struct fb_info_gen *info)
+static void xxx_set_dispsw(const void *par, struct display *disp,
+			   struct fb_info_gen *info)
 {
     /*
-     *  Return a pointer to appropriate low level text console operations for
-     *  the video mode `par' of your video hardware. These can be generic
-     *  software routines, or hardware accelerated routines specifically
-     *  tailored for your hardware.
+     *  Fill in a pointer to appropriate low level text console operations (and
+     *  optionally a pointer to help data) for the video mode `par' of your
+     *  video hardware. These can be generic software routines, or hardware
+     *  accelerated routines specifically tailored for your hardware.
      *  If you don't have any appropriate operations, simple fill in the NULL
      *  pointer, and there will be no text output.
      */
 #ifdef FBCON_HAS_CFB8
-    if (is_cfb8)
-	return &fbcon_cfb8;
+    if (is_cfb8) {
+	disp->dispsw = fbcon_cfb8;
+	return;
+    }
 #endif
 #ifdef FBCON_HAS_CFB16
-    if (is_cfb16)
-	return &fbcon_cfb16;
+    if (is_cfb16) {
+	disp->dispsw = fbcon_cfb16;
+	disp->dispsw_data = ...fbcon_cmap.cfb16;	/* console palette */
+	return;
+    }
+#endif
+#ifdef FBCON_HAS_CFB24
+    if (is_cfb24) {
+	disp->dispsw = fbcon_cfb24;
+	disp->dispsw_data = ...fbcon_cmap.cfb24;	/* console palette */
+	return;
+    }
 #endif
 #ifdef FBCON_HAS_CFB32
-    if (is_cfb32)
-	return &fbcon_cfb32;
+    if (is_cfb32) {
+	disp->dispsw = fbcon_cfb32;
+	disp->dispsw_data = ...fbcon_cmap.cfb32;	/* console palette */
+	return;
+    }
 #endif
-    return NULL;
+    disp->dispsw = NULL;
 }
 
 
@@ -284,27 +301,25 @@
 
 __initfunc(void xxxfb_init(void))
 {
-    struct fb_var_screeninfo var;
-
-    fb_info.fbhw = &xxx_switch;
-    fbhw->detect();
-    strcpy(fb_info.modename, "XXX");
-    fb_info.changevar = NULL;
-    fb_info.node = -1;
-    fb_info.fbops = &xxxfb_ops;
-    fb_info.disp = disp;
-    fb_info.switch_con = &xxxfb_switch;
-    fb_info.updatevar = &xxxfb_update_var;
-    fb_info.blank = &xxxfb_blank;
+    fb_info.gen.fbhw = &xxx_switch;
+    fb_info.gen.fbhw->detect();
+    strcpy(fb_info.gen.info.modename, "XXX");
+    fb_info.gen.info.changevar = NULL;
+    fb_info.gen.info.node = -1;
+    fb_info.gen.info.fbops = &xxxfb_ops;
+    fb_info.gen.info.disp = &disp;
+    fb_info.gen.info.switch_con = &xxxfb_switch;
+    fb_info.gen.info.updatevar = &xxxfb_update_var;
+    fb_info.gen.info.blank = &xxxfb_blank;
     /* This should give a reasonable default video mode */
-    fbgen_get_var(&disp.var, -1, &fb_info.gen);
-    fbgen_do_set_var(var, 1, &fbinfo.gen);
-    fbgen_set_disp(-1, &fb_info.gen.info);
+    fbgen_get_var(&disp.var, -1, &fb_info.gen.info);
+    fbgen_do_set_var(&disp.var, 1, &fb_info.gen);
+    fbgen_set_disp(-1, &fb_info.gen);
     fbgen_install_cmap(0, &fb_info.gen);
     if (register_framebuffer(&fb_info.gen.info) < 0)
 	return;
-    printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.node),
-	   fb_info.modename);
+    printk("fb%d: %s frame buffer device\n", GET_FB_IDX(fb_info.gen.info.node),
+	   fb_info.gen.info.modename);
 
     /* uncomment this if your driver cannot be unloaded */
     /* MOD_INC_USE_COUNT; */
@@ -322,7 +337,7 @@
      *  clean up all instances.
      */
 
-    unregister_framebuffer(&fb_info);
+    unregister_framebuffer(info);
     /* ... */
 }
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/tcxfb.c m68k/drivers/video/tcxfb.c
--- jes-2.1.119/drivers/video/tcxfb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/tcxfb.c	Mon Aug 31 00:46:04 1998
@@ -1,4 +1,4 @@
-/* $Id: tcxfb.c,v 1.4 1998/08/10 08:26:14 jj Exp $
+/* $Id: tcxfb.c,v 1.5 1998/08/23 14:22:05 mj Exp $
  * tcxfb.c: TCX 24/8bit frame buffer driver
  *
  * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz)
@@ -21,10 +21,10 @@
 #include <linux/init.h>
 #include <linux/selection.h>
 
-#include "sbusfb.h"
+#include <video/sbusfb.h>
 #include <asm/io.h>
 
-#include "fbcon-cfb8.h"
+#include <video/fbcon-cfb8.h>
 
 /* THC definitions */
 #define TCX_THC_MISC_REV_SHIFT       16
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/tgafb.c m68k/drivers/video/tgafb.c
--- jes-2.1.119/drivers/video/tgafb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/tgafb.c	Mon Aug 31 00:46:04 1998
@@ -15,7 +15,7 @@
 
 /* KNOWN PROBLEMS/TO DO ===================================================== *
  *
- *	- How to set a single color register?
+ *	- How to set a single color register on 24-plane cards?
  *
  *	- Hardware cursor (useful for other graphics boards too)
  *
@@ -38,9 +38,9 @@
 #include <linux/selection.h>
 #include <asm/io.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb32.h>
 
 
 /* TGA hardware description (minimal) */
@@ -242,6 +242,7 @@
 static struct display disp;
 static struct fb_info fb_info;
 static struct { u_char red, green, blue, pad; } palette[256];
+static u32 fbcon_cfb32_cmap[16];
 
 static struct fb_fix_screeninfo fb_fix = { { "DEC TGA ", } };
 static struct fb_var_screeninfo fb_var = { 0, };
@@ -408,8 +409,7 @@
     else if (fb_display[con].cmap.len) /* non default colormap? */
 	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
     else
-	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
-		     cmap, kspc ? 0 : 2);
+	fb_copy_cmap(fb_default_cmap(256), cmap, kspc ? 0 : 2);
     return 0;
 }
 
@@ -423,8 +423,7 @@
     int err;
 
     if (!fb_display[con].cmap.len) {	/* no colormap allocated? */
-	if ((err = fb_alloc_cmap(&fb_display[con].cmap,
-				 1<<fb_display[con].var.bits_per_pixel, 0)))
+	if ((err = fb_alloc_cmap(&fb_display[con].cmap, 256, 0)))
 	    return err;
     }
     if (con == currcon) {		/* current console? */
@@ -747,6 +746,7 @@
 	case 1: /* 24-plane */
 	case 3: /* 24plusZ */
 	    disp.dispsw = &fbcon_cfb32;
+	    disp.dispsw_data = &fbcon_cfb32_cmap;
 	    break;
 #endif
 	default:
@@ -821,9 +821,9 @@
 {
     if (regno > 255)
 	return 1;
-    *red = (palette[regno].red<<8) || palette[regno].red;
-    *green = (palette[regno].green<<8) || palette[regno].green;
-    *blue = (palette[regno].blue<<8) || palette[regno].blue;
+    *red = (palette[regno].red<<8) | palette[regno].red;
+    *green = (palette[regno].green<<8) | palette[regno].green;
+    *blue = (palette[regno].blue<<8) | palette[regno].blue;
     *transp = 0;
     return 0;
 }
@@ -893,8 +893,7 @@
     if (fb_display[con].cmap.len)
 	fb_set_cmap(&fb_display[con].cmap, 1, tgafb_setcolreg, info);
     else
-	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
-				    1, tgafb_setcolreg, info);
+	fb_set_cmap(fb_default_cmap(256), 1, tgafb_setcolreg, info);
 #if 1
     if (tga_type != 0)
         tga_update_palette();
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/valkyriefb.c m68k/drivers/video/valkyriefb.c
--- jes-2.1.119/drivers/video/valkyriefb.c	Thu Jan  1 01:00:00 1970
+++ m68k/drivers/video/valkyriefb.c	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,895 @@
+/*
+ *  valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display
+ *
+ *  Created 8 August 1998 by Martin Costabel and Kevin Schoedel
+ *
+ *  Vmode-switching changes and vmode 15/17 modifications created 29 August
+ *  1998 by Barry Nathan <barryn@pobox.com>.
+ *
+ *  Derived directly from:
+ *
+ *   controlfb.c -- frame buffer device for the PowerMac 'control' display
+ *   Copyright (C) 1998 Dan Jacobowitz <dan@debian.org>
+ *
+ *   pmc-valkyrie.c -- Console support for PowerMac "valkyrie" display adaptor.
+ *   Copyright (C) 1997 Paul Mackerras.
+ *
+ *  and indirectly:
+ *
+ *  Frame buffer structure from:
+ *    drivers/video/chipsfb.c -- frame buffer device for
+ *    Chips & Technologies 65550 chip.
+ *
+ *    Copyright (C) 1998 Paul Mackerras
+ *
+ *    This file is derived from the Powermac "chips" driver:
+ *    Copyright (C) 1997 Fabio Riccardi.
+ *    And from the frame buffer device for Open Firmware-initialized devices:
+ *    Copyright (C) 1997 Geert Uytterhoeven.
+ *
+ *  Hardware information from:
+ *    control.c: Console support for PowerMac "control" display adaptor.
+ *    Copyright (C) 1996 Paul Mackerras
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License. See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/malloc.h>
+#include <linux/vmalloc.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/fb.h>
+#include <linux/selection.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/nvram.h>
+#ifdef CONFIG_FB_COMPAT_XPMAC
+#include <asm/vc_ioctl.h>
+#endif
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/pgtable.h>
+#include <asm/adb.h>
+#include <asm/cuda.h>
+
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/macmodes.h>
+
+#include "valkyriefb.h"
+
+static int can_soft_blank = 1;
+
+static int default_vmode = VMODE_NVRAM;
+static int default_cmode = CMODE_NVRAM;
+static char fontname[40] __initdata = { 0 };
+
+static int currcon = 0;
+static int switching = 0;
+
+struct fb_par_valkyrie {
+	int	vmode, cmode;
+	int	xres, yres;
+	int	vxres, vyres;
+	int	xoffset, yoffset;
+};
+
+struct fb_info_valkyrie {
+	struct fb_info			info;
+	struct fb_fix_screeninfo	fix;
+	struct fb_var_screeninfo	var;
+	struct display			disp;
+	struct fb_par_valkyrie		par;
+	struct {
+	    __u8 red, green, blue;
+	}			palette[256];
+	
+	struct cmap_regs	*cmap_regs;
+	unsigned long		cmap_regs_phys;
+	
+	struct valkyrie_regs	*valkyrie_regs;
+	unsigned long		valkyrie_regs_phys;
+	
+	__u8			*frame_buffer;
+	unsigned long		frame_buffer_phys;
+	
+	int			sense;
+	unsigned long		total_vram;
+#ifdef FBCON_HAS_CFB16
+	u16 fbcon_cfb16_cmap[16];
+#endif
+};
+
+/*
+ * Exported functions
+ */
+void valkyriefb_init(void);
+void valkyrie_of_init(struct device_node *dp);
+void valkyriefb_setup(char *options, int *ints);
+
+static int valkyrie_open(struct fb_info *info, int user);
+static int valkyrie_release(struct fb_info *info, int user);
+static int valkyrie_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info);
+static int valkyrie_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int valkyrie_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info);
+static int valkyrie_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info);
+static int valkyrie_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+static int valkyrie_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info);
+static int valkyrie_ioctl(struct inode *inode, struct file *file, u_int cmd,
+		       u_long arg, int con, struct fb_info *info);
+
+static int read_valkyrie_sense(struct fb_info_valkyrie *p);
+static inline int valkyrie_vram_reqd(int video_mode, int color_mode);
+static void set_valkyrie_clock(unsigned char *params);
+static void valkyrie_set_par(const struct fb_par_valkyrie *p, struct fb_info_valkyrie *info);
+static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var);
+static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
+	struct fb_par_valkyrie *par, const struct fb_info *fb_info);
+
+static void valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p);
+static void valkyrie_par_to_display(struct fb_par_valkyrie *par,
+  struct display *disp, struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p);
+static void valkyrie_init_display(struct display *disp);
+static void valkyrie_par_to_fix(struct fb_par_valkyrie *par, struct fb_fix_screeninfo *fix,
+	struct fb_info_valkyrie *p);
+static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p);
+
+static struct fb_ops valkyriefb_ops = {
+	valkyrie_open,
+	valkyrie_release,
+	valkyrie_get_fix,
+	valkyrie_get_var,
+	valkyrie_set_var,
+	valkyrie_get_cmap,
+	valkyrie_set_cmap,
+	valkyrie_pan_display,
+	valkyrie_ioctl
+};
+
+static int valkyriefb_getcolreg(u_int regno, u_int *red, u_int *green,
+			     u_int *blue, u_int *transp, struct fb_info *info);
+static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			     u_int transp, struct fb_info *info);
+static void do_install_cmap(int con, struct fb_info *info);
+
+
+__openfirmware
+
+
+static int valkyrie_open(struct fb_info *info, int user)
+{
+	MOD_INC_USE_COUNT;
+	return 0;
+}
+
+static int valkyrie_release(struct fb_info *info, int user)
+{
+	MOD_DEC_USE_COUNT;
+	return 0;
+}
+
+static int valkyrie_get_fix(struct fb_fix_screeninfo *fix, int con,
+			 struct fb_info *info)
+{
+	struct fb_info_valkyrie *cp = (struct fb_info_valkyrie *) info;
+
+	*fix = cp->fix;
+	return 0;
+}
+
+static int valkyrie_get_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+	struct fb_info_valkyrie *cp = (struct fb_info_valkyrie *) info;
+
+	*var = cp->var;
+	return 0;
+}
+
+/* Sets everything according to var */
+static int valkyrie_set_var(struct fb_var_screeninfo *var, int con,
+			 struct fb_info *info)
+{
+	struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
+	struct display *disp;
+	struct fb_par_valkyrie par;
+	int depthchange, err;
+
+	disp = (con >= 0) ? &fb_display[con] : &p->disp;
+	if ((err = valkyrie_var_to_par(var, &par, info))) {
+		 /* printk (KERN_ERR "Error in valkyrie_set_var, calling valkyrie_var_to_par: %d.\n", err); */
+		return err;
+	}
+	
+	if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) {
+		/* printk("Not activating, in valkyrie_set_var.\n"); */
+		valkyrie_par_to_var(&par, var);
+		return 0;
+	}
+
+	/*
+	 * I know, we want to use fb_display[con], but grab certain info
+	 * from p->var instead.
+	 */
+#define DIRTY(x) (p->var.x != var->x)
+	depthchange = DIRTY(bits_per_pixel);
+	/* adding "&& !DIRTY(pixclock)" corrects vmode-switching problems */
+	if(!DIRTY(xres) && !DIRTY(yres) && !DIRTY(xres_virtual) &&
+	   !DIRTY(yres_virtual) && !DIRTY(bits_per_pixel) && !DIRTY(pixclock)) {
+	   	valkyrie_par_to_var(&par, var);
+		p->var = disp->var = *var;
+		return 0;
+	}
+
+	p->par = par;
+	valkyrie_par_to_var(&par, var);
+	p->var = *var;
+	valkyrie_par_to_fix(&par, &p->fix, p);
+	valkyrie_par_to_display(&par, disp, &p->fix, p);
+	p->disp = *disp;
+	
+	if (info->changevar && !switching) {
+		/* Don't want to do this if just switching consoles. */
+		(*info->changevar)(con);
+	}
+	if (con == currcon)
+		valkyrie_set_par(&par, p);
+	if (depthchange)
+		if ((err = fb_alloc_cmap(&disp->cmap, 0, 0)))
+			return err;
+	if (depthchange || switching)
+		do_install_cmap(con, info);
+	return 0;
+}
+
+static int valkyrie_pan_display(struct fb_var_screeninfo *var, int con,
+			     struct fb_info *info)
+{
+	if (var->xoffset != 0 || var->yoffset != 0)
+		return -EINVAL;
+	return 0;
+}
+
+static int valkyrie_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			  struct fb_info *info)
+{
+	if (con == currcon)	{
+		/* current console? */
+		return fb_get_cmap(cmap, kspc, valkyriefb_getcolreg, info);
+	}
+	if (fb_display[con].cmap.len) { /* non default colormap? */
+		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc? 0: 2);
+	}
+	else {
+		int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256;
+		fb_copy_cmap(fb_default_cmap(size), cmap, kspc ? 0 : 2);
+	}
+	return 0;
+}
+
+static int valkyrie_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			 struct fb_info *info)
+{
+	struct display *disp = &fb_display[con];
+	int err;
+
+	if (disp->cmap.len == 0) {
+		int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256;
+		err = fb_alloc_cmap(&disp->cmap, size, 0);
+		if (err) {
+			return err;
+		}
+	}
+
+	if (con == currcon) {
+		return fb_set_cmap(cmap, kspc, valkyriefb_setcolreg, info);
+	}
+	fb_copy_cmap(cmap, &disp->cmap, kspc ? 0 : 1);
+	return 0;
+}
+
+static int valkyrie_ioctl(struct inode *inode, struct file *file, u_int cmd,
+		       u_long arg, int con, struct fb_info *info)
+{
+	return -EINVAL;
+}
+
+static int valkyriefb_switch(int con, struct fb_info *fb)
+{
+	struct fb_info_valkyrie *info = (struct fb_info_valkyrie *) fb;
+	struct fb_par_valkyrie par;
+
+	if (fb_display[currcon].cmap.len)
+		fb_get_cmap(&fb_display[currcon].cmap, 1, valkyriefb_getcolreg,
+			    fb);
+	currcon = con;
+#if 1
+	valkyrie_var_to_par(&fb_display[currcon].var, &par, fb);
+	valkyrie_set_par(&par, info);
+	do_install_cmap(con, fb);
+#else
+	/* I see no reason not to do this.  Minus info->changevar(). */
+	/* DOH.  This makes valkyrie_set_var compare, you guessed it, */
+	/* fb_display[con].var (first param), and fb_display[con].var! */
+	/* Perhaps I just fixed that... */
+	switching = 1;
+	valkyrie_set_var(&fb_display[con].var, con, info);
+	switching = 0;
+#endif
+	return 0;
+}
+
+static int valkyriefb_updatevar(int con, struct fb_info *info)
+{
+	return 0;
+}
+
+static void valkyriefb_blank(int blank_mode, struct fb_info *info)
+{
+/*
+ *  Blank the screen if blank_mode != 0, else unblank. If blank_mode == NULL
+ *  then the caller blanks by setting the CLUT (Color Look Up Table) to all
+ *  black. Return 0 if blanking succeeded, != 0 if un-/blanking failed due
+ *  to e.g. a video mode which doesn't support it. Implements VESA suspend
+ *  and powerdown modes on hardware that supports disabling hsync/vsync:
+ *    blank_mode == 2: suspend vsync
+ *    blank_mode == 3: suspend hsync
+ *    blank_mode == 4: powerdown
+ */
+	struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
+	struct valkyrie_regvals	*init;
+	unsigned char vmode;
+
+	if (p->disp.can_soft_blank
+	 && ((vmode = p->par.vmode) > 0)
+	 && (vmode <= VMODE_MAX)
+	 && ((init = valkyrie_reg_init[vmode - 1]) != NULL)) {
+		if (blank_mode)
+			--blank_mode;
+		switch (blank_mode) {
+		default:	/* unblank */
+			out_8(&p->valkyrie_regs->mode.r, init->mode);
+			break;
+		case VESA_VSYNC_SUSPEND:
+		case VESA_HSYNC_SUSPEND:
+			/*
+			 * [kps] Value extracted from MacOS. I don't know
+			 * whether this bit disables hsync or vsync, or
+			 * whether the hardware can do the other as well.
+			 */
+			out_8(&p->valkyrie_regs->mode.r, init->mode | 0x40);
+			break;
+		case VESA_POWERDOWN:
+			out_8(&p->valkyrie_regs->mode.r, 0x66);
+			break;
+		}
+	}
+}
+
+static int valkyriefb_getcolreg(u_int regno, u_int *red, u_int *green,
+			     u_int *blue, u_int *transp, struct fb_info *info)
+{
+	struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
+
+	if (regno > 255)
+		return 1;
+	*red = (p->palette[regno].red<<8) | p->palette[regno].red;
+	*green = (p->palette[regno].green<<8) | p->palette[regno].green;
+	*blue = (p->palette[regno].blue<<8) | p->palette[regno].blue;
+
+	return 0;
+}
+
+static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			     u_int transp, struct fb_info *info)
+{
+	struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
+	volatile struct cmap_regs *cmap_regs = p->cmap_regs;
+
+
+	if (regno > 255)
+		return 1;
+	red >>= 8;
+	green >>= 8;
+	blue >>= 8;
+	p->palette[regno].red = red;
+	p->palette[regno].green = green;
+	p->palette[regno].blue = blue;
+
+	/* tell clut which address to fill */
+	out_8(&p->cmap_regs->addr, regno);
+	udelay(1);
+	/* send one color channel at a time */
+	out_8(&cmap_regs->lut, red);
+	out_8(&cmap_regs->lut, green);
+	out_8(&cmap_regs->lut, blue);
+
+	if (regno < 16) {
+#ifdef FBCON_HAS_CFB16
+		p->fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | regno;
+#endif
+	}
+
+	return 0;
+}
+
+static void do_install_cmap(int con, struct fb_info *info)
+{
+	if (con != currcon)
+		return;
+	if (fb_display[con].cmap.len) {
+		fb_set_cmap(&fb_display[con].cmap, 1, valkyriefb_setcolreg,
+			    info);
+	}
+	else {
+		int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256;
+		fb_set_cmap(fb_default_cmap(size), 1, valkyriefb_setcolreg,
+			    info);
+	}
+}
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+extern struct vc_mode display_info;
+extern struct fb_info *console_fb_info;
+#endif /* CONFIG_FB_COMPAT_XPMAC */
+
+static int valkyrie_vram_reqd(int video_mode, int color_mode)
+{
+	int pitch;
+	
+	if ((pitch = valkyrie_reg_init[video_mode-1]->pitch[color_mode]) == 0)
+		pitch = 2 * valkyrie_reg_init[video_mode-1]->pitch[0];
+	return valkyrie_reg_init[video_mode-1]->vres * pitch;
+}
+
+static void set_valkyrie_clock(unsigned char *params)
+{
+	struct adb_request req;
+	int i;
+
+	for (i = 0; i < 3; ++i) {
+		cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
+			     0x50, i + 1, params[i]);
+		while (!req.complete)
+			cuda_poll();
+	}
+}
+
+__initfunc(static void init_valkyrie(struct fb_info_valkyrie *p))
+{
+	struct fb_par_valkyrie *par = &p->par;
+	struct fb_var_screeninfo var;
+	int j, k;
+
+	p->sense = read_valkyrie_sense(p);
+	printk("Monitor sense value = 0x%x, ", p->sense);
+
+	/* Try to pick a video mode out of NVRAM if we have one. */
+	if (default_vmode == VMODE_NVRAM) {
+		default_vmode = nvram_read_byte(NV_VMODE);
+		if (default_vmode <= 0
+		 || default_vmode > VMODE_MAX
+		 || !valkyrie_reg_init[default_vmode - 1])
+			default_vmode = VMODE_CHOOSE;
+	}
+	if (default_vmode == VMODE_CHOOSE)
+		default_vmode = mac_map_monitor_sense(p->sense);
+	if (!valkyrie_reg_init[default_vmode - 1])
+		default_vmode = VMODE_640_480_67;
+	if (default_cmode == CMODE_NVRAM)
+		default_cmode = nvram_read_byte(NV_CMODE);
+
+	/*
+	 * Reduce the pixel size if we don't have enough VRAM or bandwitdh.
+	 */
+	if (default_cmode < CMODE_8
+	 || default_cmode > CMODE_16
+	 || valkyrie_reg_init[default_vmode-1]->pitch[default_cmode] == 0
+	 || valkyrie_vram_reqd(default_vmode, default_cmode) > p->total_vram)
+		default_cmode = CMODE_8;
+	
+	printk("using video mode %d and color mode %d.\n", default_vmode, default_cmode);
+
+	mac_vmode_to_var(default_vmode, default_cmode, &var);
+	if (valkyrie_var_to_par(&var, par, &p->info)) {
+	    printk(KERN_ERR "valkyriefb: can't set default video mode\n");
+	    return ;
+	}
+	
+	valkyrie_init_fix(&p->fix, p);
+	valkyrie_par_to_fix(&p->par, &p->fix, p);
+	valkyrie_par_to_var(&p->par, &p->var);
+	valkyrie_init_display(&p->disp);
+	valkyrie_par_to_display(&p->par, &p->disp, &p->fix, p);
+	valkyrie_init_info(&p->info, p);
+
+	/* Initialize colormap */
+	for (j = 0; j < 16; j++) {
+		k = color_table[j];
+		p->palette[j].red = default_red[k];
+		p->palette[j].green = default_grn[k];
+		p->palette[j].blue = default_blu[k];
+	}
+	
+	valkyrie_set_var (&var, -1, &p->info);
+
+	if (register_framebuffer(&p->info) < 0) {
+		kfree(p);
+		return;
+	}
+	
+	printk("fb%d: valkyrie frame buffer device\n", GET_FB_IDX(p->info.node));	
+}
+
+static void valkyrie_set_par(const struct fb_par_valkyrie *par,
+			     struct fb_info_valkyrie *p)
+{
+	struct valkyrie_regvals	*init;
+	volatile struct valkyrie_regs *valkyrie_regs = p->valkyrie_regs;
+	int vmode, cmode;
+	
+	vmode = par->vmode;
+	cmode = par->cmode;
+	
+	if (vmode <= 0
+	 || vmode > VMODE_MAX
+	 || (init = valkyrie_reg_init[vmode - 1]) == NULL)
+		panic("valkyrie: display mode %d not supported", vmode);
+
+	/* Reset the valkyrie */
+	out_8(&valkyrie_regs->status.r, 0);
+	udelay(100);
+
+	/* Initialize display timing registers */
+	out_8(&valkyrie_regs->mode.r, init->mode | 0x80);
+	out_8(&valkyrie_regs->depth.r, cmode + 3);
+	set_valkyrie_clock(init->clock_params);
+	udelay(100);
+
+	/* Turn on display */
+	out_8(&valkyrie_regs->mode.r, init->mode);
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+	/* And let the world know the truth. */
+	if (!console_fb_info || console_fb_info == &p->info) {
+		display_info.height = p->var.yres;
+		display_info.width = p->var.xres;
+		display_info.depth = (cmode == CMODE_16) ? 16 : 8;
+		display_info.pitch = p->fix.line_length;
+		display_info.mode = vmode;
+		strncpy(display_info.name, "valkyrie",
+			sizeof(display_info.name));
+		display_info.fb_address = p->frame_buffer_phys + 0x1000;
+		display_info.cmap_adr_address = p->cmap_regs_phys;
+		display_info.cmap_data_address = p->cmap_regs_phys + 8;
+		display_info.disp_reg_address = p->valkyrie_regs_phys;
+		console_fb_info = &p->info;
+	}
+#endif /* CONFIG_FB_COMPAT_XPMAC */
+}
+
+__initfunc(void valkyriefb_init(void))
+{
+#ifndef CONFIG_FB_OF
+	struct device_node *dp;
+
+	dp = find_devices("valkyrie");
+	if (dp != 0)
+		valkyrie_of_init(dp);
+#endif /* CONFIG_FB_OF */
+}
+
+__initfunc(void valkyrie_of_init(struct device_node *dp))
+{
+	struct fb_info_valkyrie	*p;
+	unsigned long addr, size;
+	
+	if(dp->n_addrs != 1)
+		panic("expecting 1 address for valkyrie (got %d)", dp->n_addrs);
+
+	p = kmalloc(sizeof(*p), GFP_ATOMIC);
+	if (p == 0)
+		return;
+	memset(p, 0, sizeof(*p));
+
+	/* Map in frame buffer and registers */
+	addr = dp->addrs[0].address;
+	size = 4096;
+	p->frame_buffer_phys  = addr;
+	p->frame_buffer  = __ioremap(addr, 0x100000, _PAGE_WRITETHRU);
+	p->cmap_regs_phys     = addr + 0x304000;
+	p->cmap_regs     = ioremap(p->cmap_regs_phys,     size);
+	p->valkyrie_regs_phys = addr + 0x30a000;
+	p->valkyrie_regs = ioremap(p->valkyrie_regs_phys, size);
+
+	/*
+	 * kps: As far as I know, all Valkyries have fixed usable VRAM.
+	 */
+	p->total_vram = 0x100000;
+
+	init_valkyrie(p);
+}
+
+/*
+ * Get the monitor sense value.
+ */
+static int read_valkyrie_sense(struct fb_info_valkyrie *p)
+{
+	int sense, in;
+
+    out_8(&p->valkyrie_regs->msense.r, 0);   /* release all lines */
+    __delay(20000);
+    sense = ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x70) << 4;
+    /* drive each sense line low in turn and collect the other 2 */
+    out_8(&p->valkyrie_regs->msense.r, 4);   /* drive A low */
+    __delay(20000);
+    sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x30);
+    out_8(&p->valkyrie_regs->msense.r, 2);   /* drive B low */
+    __delay(20000);
+    sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x40) >> 3;
+	sense |= (in & 0x10) >> 2;
+    out_8(&p->valkyrie_regs->msense.r, 1);   /* drive C low */
+    __delay(20000);
+    sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x60) >> 5;
+
+    out_8(&p->valkyrie_regs->msense.r, 7);
+
+	return sense;
+}
+
+/*
+ * This routine takes a user-supplied var,
+ * and picks the best vmode/cmode from it.
+ */
+static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
+	struct fb_par_valkyrie *par, const struct fb_info *fb_info)
+
+/* [bkn] I did a major overhaul of this function.
+ *
+ * Much of the old code was "swiped by jonh from atyfb.c". Because
+ * macmodes has mac_var_to_vmode, I felt that it would be better to
+ * rework this function to use that, instead of reinventing the wheel to
+ * add support for vmode 17. This was reinforced by the fact that
+ * the previously swiped atyfb.c code is no longer there.
+ *
+ * So, I swiped and adapted platinum_var_to_par (from platinumfb.c), replacing
+ * most, but not all, of the old code in the process. One side benefit of
+ * swiping the platinumfb code is that we now have more comprehensible error
+ * messages when a vmode/cmode switch fails. (Most of the error messages are
+ * platinumfb.c, but I added two of my own, and I also changed some commas
+ * into colons to make the messages more consistent with other Linux error
+ * messages.) In addition, I think the new code *might* fix some vmode-
+ * switching oddities, but I'm not sure.
+ *
+ * There may be some more opportunities for cleanup in here, but this is a
+ * good start...
+ */
+
+{
+	int bpp = var->bits_per_pixel;
+	struct valkyrie_regvals *init;
+	struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) fb_info;
+
+    /* these are old variables that are no longer needed with my new code
+       [bkn]
+
+	int xres = var->xres;
+	int yres = var->yres;
+     */
+
+    /*
+     *  Get the video params out of 'var'. If a value doesn't fit, round it up,
+     *  if it's too big, return -EINVAL.
+     *
+     *  Suggestion: Round up in the following order: bits_per_pixel, xres,
+     *  yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale,
+     *  bitfields, horizontal timing, vertical timing.
+     */
+
+	if(mac_var_to_vmode(var, &par->vmode, &par->cmode) != 0) {
+		printk(KERN_ERR "valkyrie_var_to_par: mac_var_to_vmode unsuccessful.\n");
+		printk(KERN_ERR "valkyrie_var_to_par: var->xres = %d\n", var->xres);
+		printk(KERN_ERR "valkyrie_var_to_par: var->yres = %d\n", var->yres);
+		printk(KERN_ERR "valkyrie_var_to_par: var->xres_virtual = %d\n", var->xres_virtual);
+		printk(KERN_ERR "valkyrie_var_to_par: var->yres_virtual = %d\n", var->yres_virtual);
+		printk(KERN_ERR "valkyrie_var_to_par: var->bits_per_pixel = %d\n", var->bits_per_pixel);
+		printk(KERN_ERR "valkyrie_var_to_par: var->pixclock = %d\n", var->pixclock);
+		printk(KERN_ERR "valkyrie_var_to_par: var->vmode = %d\n", var->vmode);
+		return -EINVAL;
+	}
+
+	/* Check if we know about the wanted video mode */
+	if(!valkyrie_reg_init[par->vmode-1]) {
+		printk(KERN_ERR "valkyrie_var_to_par: vmode %d not valid.\n", par->vmode);
+		return -EINVAL;
+	}
+
+	par->xres = var->xres;
+	par->yres = var->yres;
+	par->xoffset = 0;
+	par->yoffset = 0;
+	par->vxres = par->xres;
+	par->vyres = par->yres;
+	
+	if (var->xres_virtual > var->xres || var->yres_virtual > var->yres
+		|| var->xoffset != 0 || var->yoffset != 0) {
+		return -EINVAL;
+	}
+
+	if (bpp <= 8)
+		par->cmode = CMODE_8;
+	else if (bpp <= 16)
+		par->cmode = CMODE_16;
+	else {
+		printk(KERN_ERR "valkyrie_var_to_par: cmode %d not supported.\n", par->cmode);
+		return -EINVAL;
+	}
+
+	init = valkyrie_reg_init[par->vmode-1];
+	if (init->pitch[par->cmode] == 0) {
+		printk(KERN_ERR "valkyrie_var_to_par: vmode %d does not support cmode %d.\n", par->vmode, par->cmode);
+		return -EINVAL;
+	}
+
+	if (valkyrie_vram_reqd(par->vmode, par->cmode) > p->total_vram) {
+		printk(KERN_ERR "valkyrie_var_to_par: not enough ram for vmode %d, cmode %d.\n", par->vmode, par->cmode);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var)
+{
+	return mac_vmode_to_var(par->vmode, par->cmode, var);
+}
+
+static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p)
+{
+	memset(fix, 0, sizeof(*fix));
+	strcpy(fix->id, "valkyrie");
+	fix->mmio_start = (char *)p->valkyrie_regs_phys;
+	fix->mmio_len = sizeof(struct valkyrie_regs);
+	fix->type = FB_TYPE_PACKED_PIXELS;
+	
+	fix->type_aux = 0;
+	fix->ywrapstep = 0;
+	fix->ypanstep = 0;
+	fix->xpanstep = 0;
+	
+}
+
+/* Fix must already be inited above */
+static void valkyrie_par_to_fix(struct fb_par_valkyrie *par,
+	struct fb_fix_screeninfo *fix,
+	struct fb_info_valkyrie *p)
+{
+	fix->smem_start = (void *)(p->frame_buffer_phys + 0x1000);
+#if 1
+	fix->smem_len = valkyrie_vram_reqd(par->vmode, par->cmode);
+#else
+	fix->smem_len = p->total_vram;
+#endif
+	fix->visual = (par->cmode == CMODE_8) ?
+		FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
+	fix->line_length = par->vxres << par->cmode;
+		/* ywrapstep, xpanstep, ypanstep */
+}
+
+static void valkyrie_init_display(struct display *disp)
+{
+	memset(disp, 0, sizeof(*disp));
+	disp->type = /* fix->type */ FB_TYPE_PACKED_PIXELS;
+	disp->can_soft_blank = can_soft_blank;
+	disp->scrollmode = SCROLL_YREDRAW;
+}
+
+static void valkyrie_par_to_display(struct fb_par_valkyrie *par,
+  struct display *disp, struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p)
+{
+	disp->var = p->var;
+	disp->screen_base = (char *) p->frame_buffer + 0x1000;
+	disp->visual = fix->visual;
+	disp->line_length = fix->line_length;
+
+	if(disp->scrollmode != SCROLL_YREDRAW) {
+		printk(KERN_ERR "Scroll mode not YREDRAW in valkyrie_par_to_display\n");
+		disp->scrollmode = SCROLL_YREDRAW;
+	}
+	switch (par->cmode) {
+#ifdef FBCON_HAS_CFB8
+                case CMODE_8:
+                        disp->dispsw = &fbcon_cfb8;
+                        break;
+#endif
+#ifdef FBCON_HAS_CFB16
+                case CMODE_16:
+                        disp->dispsw = &fbcon_cfb16;
+                        disp->dispsw_data = p->fbcon_cfb16_cmap;
+                        break;
+#endif
+                default:
+                        disp->dispsw = NULL;
+                        break;
+        }
+}
+
+static void valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p)
+{
+	strcpy(info->modename, p->fix.id);
+	info->node = -1;	/* ??? danj */
+	info->fbops = &valkyriefb_ops;
+	info->disp = &p->disp;
+	strcpy(info->fontname, fontname);
+	info->changevar = NULL;
+	info->switch_con = &valkyriefb_switch;
+	info->updatevar = &valkyriefb_updatevar;
+	info->blank = &valkyriefb_blank;
+}
+
+
+/*
+ * Parse user speficied options (`video=valkyriefb:')
+ */
+__initfunc(void valkyriefb_setup(char *options, int *ints))
+{
+	char *this_opt;
+
+	if (!options || !*options)
+		return;
+
+	for (this_opt = strtok(options, ","); this_opt;
+	     this_opt = strtok(NULL, ",")) {
+		if (!strncmp(this_opt, "font:", 5)) {
+			char *p;
+			int i;
+
+			p = this_opt + 5;
+			for (i = 0; i < sizeof(fontname) - 1; i++)
+				if (!*p || *p == ' ' || *p == ',')
+					break;
+			memcpy(fontname, this_opt + 5, i);
+			fontname[i] = 0;
+		}
+		else if (!strncmp(this_opt, "vmode:", 6)) {
+	    		int vmode = simple_strtoul(this_opt+6, NULL, 0);
+	    	if (vmode > 0 && vmode <= VMODE_MAX)
+				default_vmode = vmode;
+		}
+		else if (!strncmp(this_opt, "cmode:", 6)) {
+			int depth = simple_strtoul(this_opt+6, NULL, 0);
+			switch (depth) {
+			 case 8:
+			    default_cmode = CMODE_8;
+			    break;
+			 case 15:
+			 case 16:
+			    default_cmode = CMODE_16;
+			    break;
+			}
+		}
+		/* XXX - remove these options once blanking has been tested */
+		else if (!strncmp(this_opt, "noblank", 7)) {
+			can_soft_blank = 0;
+		}
+		else if (!strncmp(this_opt, "blank", 5)) {
+			can_soft_blank = 1;
+		}
+	}
+}
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/valkyriefb.h m68k/drivers/video/valkyriefb.h
--- jes-2.1.119/drivers/video/valkyriefb.h	Thu Jan  1 01:00:00 1970
+++ m68k/drivers/video/valkyriefb.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,186 @@
+/*
+ * valkyriefb.h: Constants of all sorts for valkyriefb
+ *
+ * Created 8 August 1998 by Martin Costabel and Kevin Schoedel
+ *
+ * Vmode-switching changes and vmode 15/17 modifications created 29 August
+ * 1998 by Barry Nathan <barryn@pobox.com>.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Based directly on:
+ *
+ *  controlfb.h: Constants of all sorts for controlfb
+ *  Copyright (C) 1998 Daniel Jacobowitz <dan@debian.org>
+ *
+ *  pmc-valkyrie.h: Console support for PowerMac "control" display adaptor.
+ *  Copyright (C) 1997 Paul Mackerras.
+ *
+ *  pmc-valkyrie.c: Console support for PowerMac "control" display adaptor.
+ *  Copyright (C) 1997 Paul Mackerras.
+ *
+ * and indirectly from:
+ *
+ *  pmc-control.h: Console support for PowerMac "control" display adaptor.
+ *  Copyright (C) 1997 Paul Mackerras.
+ *
+ *  pmc-control.c: Console support for PowerMac "control" display adaptor.
+ *  Copyright (C) 1996 Paul Mackerras.
+ *
+ *  platinumfb.c: Console support for PowerMac "platinum" display adaptor.
+ *  Copyright (C) 1998 Jon Howell
+ */
+
+/*
+ * Structure of the registers for the Valkyrie colormap registers.
+ */
+struct cmap_regs {
+	unsigned char addr;
+	char pad1[7];
+	unsigned char lut;
+};
+
+/*
+ * Structure of the registers for the "valkyrie" display adaptor.
+ */
+
+struct vpreg {			/* padded register */
+	unsigned char r;
+	char pad[7];
+};
+
+
+struct valkyrie_regs {
+	struct vpreg mode;
+	struct vpreg depth;
+	struct vpreg status;
+	struct vpreg reg3;
+	struct vpreg intr;
+	struct vpreg reg5;
+	struct vpreg intr_enb;
+	struct vpreg msense;
+};
+
+/*
+ * Register initialization tables for the valkyrie display.
+ *
+ * Dot clock rate is
+ * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0].
+ */
+struct valkyrie_regvals {
+	unsigned char mode;
+	unsigned char clock_params[3];
+	int	pitch[2];		/* bytes/line, indexed by color_mode */
+	int	hres;
+	int	vres;
+};
+
+/* Register values for 1024x768, 75Hz mode (17) */
+/* I'm not sure which mode this is (16 or 17), so I'm defining it as 17,
+ * since the equivalent mode in controlfb (which I adapted this from) is
+ * also 17. Just because MacOS can't do this on Valkyrie doesn't mean we
+ * can't! :)
+ *
+ * I was going to use 12, 31, 3, which I found by myself, but instead I'm
+ * using 11, 28, 3 like controlfb, for consistency's sake.
+ */
+
+static struct valkyrie_regvals valkyrie_reg_init_17 = {
+    15, 
+    { 11, 28, 3 },  /* pixel clock = 79.55MHz for V=74.50Hz */
+    { 1024, 0 },
+	1024, 768
+};
+
+/* Register values for 1024x768, 72Hz mode (15) */
+/* This used to be 12, 30, 3 for pixel clock = 78.12MHz for V=72.12Hz, but
+ * that didn't match MacOS in the same video mode on this chip, and it also
+ * caused the 15" Apple Studio Display to not work in this mode. While this
+ * mode still doesn't match MacOS exactly (as far as I can tell), it's a lot
+ * closer now, and it works with the Apple Studio Display.
+ *
+ * Yes, even though MacOS calls it "72Hz", in reality it's about 70Hz.
+ */
+static struct valkyrie_regvals valkyrie_reg_init_15 = {
+    15,
+    { 12, 29, 3 },  /* pixel clock = 75.52MHz for V=69.71Hz? */
+		    /* I interpolated the V=69.71 from the vmode 14 and old 15
+		     * numbers. Is this result correct?
+		     */
+    { 1024, 0 },
+	1024, 768
+};
+
+/* Register values for 1024x768, 60Hz mode (14) */
+static struct valkyrie_regvals valkyrie_reg_init_14 = {
+    14,
+    { 15, 31, 3 },  /* pixel clock = 64.58MHz for V=59.62Hz */
+    { 1024, 0 },
+	1024, 768
+};
+
+/* Register values for 832x624, 75Hz mode (13) */
+static struct valkyrie_regvals valkyrie_reg_init_13 = {
+    9,
+    { 23, 42, 3 },  /* pixel clock = 57.07MHz for V=74.27Hz */
+    { 832, 0 },
+	832, 624
+};
+
+/* Register values for 800x600, 72Hz mode (11) */
+static struct valkyrie_regvals valkyrie_reg_init_11 = {
+    13,
+    { 17, 27, 3 },  /* pixel clock = 49.63MHz for V=71.66Hz */
+    { 800, 0 },
+	800, 600
+};
+
+/* Register values for 800x600, 60Hz mode (10) */
+static struct valkyrie_regvals valkyrie_reg_init_10 = {
+    12,
+    { 20, 53, 2 },  /* pixel clock = 41.41MHz for V=59.78Hz */
+    { 800, 1600 },
+	800, 600
+};
+
+/* Register values for 640x480, 67Hz mode (6) */
+static struct valkyrie_regvals valkyrie_reg_init_6 = {
+    6,
+    { 14, 27, 2 },  /* pixel clock = 30.13MHz for V=66.43Hz */
+    { 640, 1280 },
+	640, 480
+};
+
+/* Register values for 640x480, 60Hz mode (5) */
+static struct valkyrie_regvals valkyrie_reg_init_5 = {
+    11,
+    { 23, 37, 2 },  /* pixel clock = 25.14MHz for V=59.85Hz */
+    { 640, 1280 },
+	640, 480
+};
+
+static struct valkyrie_regvals *valkyrie_reg_init[VMODE_MAX] = {
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	&valkyrie_reg_init_5,
+	&valkyrie_reg_init_6,
+	NULL,
+	NULL,
+	NULL,
+	&valkyrie_reg_init_10,
+	&valkyrie_reg_init_11,
+	NULL,
+	&valkyrie_reg_init_13,
+	&valkyrie_reg_init_14,
+	&valkyrie_reg_init_15,
+	NULL,
+	&valkyrie_reg_init_17,
+	NULL,
+	NULL,
+	NULL
+};
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/vesafb.c m68k/drivers/video/vesafb.c
--- jes-2.1.119/drivers/video/vesafb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/vesafb.c	Mon Aug 31 00:46:04 1998
@@ -26,10 +26,10 @@
 #include <asm/io.h>
 #include <asm/mtrr.h>
 
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb32.h>
 
 #define dac_reg	(0x3c8)
 #define dac_val	(0x3c9)
@@ -77,12 +77,22 @@
 
 static struct display disp;
 static struct fb_info fb_info;
-static struct { u_char red, green, blue, pad; } palette[256];
+static struct { u_short blue, green, red, pad; } palette[256];
+static union {
+#ifdef FBCON_HAS_CFB16
+    u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+    u32 cfb32[16];
+#endif
+} fbcon_cmap;
 
 static int             inverse   = 0;
 static int             currcon   = 0;
 
-static int             ypan,ywrap = 0;
+static int             pmi_setpal = 1;	/* pmi for palette changes ??? */
+static int             ypan       = 1;
+static int             ywrap      = 0;
 static unsigned short  *pmi_base  = 0;
 static void            (*pmi_start)(void);
 static void            (*pmi_pal)(void);
@@ -122,7 +132,6 @@
 	if (ywrap && var->yoffset > var->yres_virtual)
 		return -EINVAL;
 
-	/* printk("vesafb: pan: x,y=%d,%d\n",var->xoffset,var->yoffset); */
 	offset = (var->yoffset * video_linelength + var->xoffset) / 4;
 
         __asm__ __volatile__(
@@ -156,8 +165,8 @@
 	fix->type = video_type;
 	fix->visual = video_visual;
 	fix->xpanstep  = 0;
-	fix->ypanstep  = ypan  ? 1 : 0;
-	fix->ywrapstep = ywrap ? 1 : 0;
+	fix->ypanstep  = (ywrap || ypan)  ? 1 : 0;
+	fix->ywrapstep =  ywrap           ? 1 : 0;
 	fix->line_length=video_linelength;
 	return 0;
 }
@@ -208,11 +217,13 @@
 	case 15:
 	case 16:
 		sw = &fbcon_cfb16;
+		display->dispsw_data = fbcon_cmap.cfb16;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB32
 	case 32:
 		sw = &fbcon_cfb32;
+		display->dispsw_data = fbcon_cmap.cfb32;
 		break;
 #endif
 	default:
@@ -242,21 +253,47 @@
 	 *  Return != 0 for invalid regno.
 	 */
 
-	int t;
-
 	if (regno >= video_cmap_len)
 		return 1;
 
-	t = palette[regno].red;
-	*red = (t<<10) | (t<<4) | (t>>2);
-	t = palette[regno].green;
-	*green = (t<<10) | (t<<4) | (t>>2);
-	t = palette[regno].blue;
-	*blue = (t<<10) | (t<<4) | (t>>2);
+	*red   = palette[regno].red;
+	*green = palette[regno].green;
+	*blue  = palette[regno].blue;
 	*transp = 0;
 	return 0;
 }
 
+#ifdef FBCON_HAS_CFB8
+
+static void vesa_setpalette(int regno, unsigned red, unsigned green, unsigned blue)
+{
+	struct { u_char blue, green, red, pad; } entry;
+
+	if (pmi_setpal) {
+		entry.red   = red   >> 10;
+		entry.green = green >> 10;
+		entry.blue  = blue  >> 10;
+		entry.pad   = 0;
+	        __asm__ __volatile__(
+                "call *(%%esi)"
+                : /* no return value */
+                : "a" (0x4f09),         /* EAX */
+                  "b" (0),              /* EBX */
+                  "c" (1),              /* ECX */
+                  "d" (regno),          /* EDX */
+                  "D" (&entry),         /* EDI */
+                  "S" (&pmi_pal));      /* ESI */
+	} else {
+		/* without protected mode interface, try VGA registers... */
+		outb_p(regno,       dac_reg);
+		outb_p(red   >> 10, dac_val);
+		outb_p(green >> 10, dac_val);
+		outb_p(blue  >> 10, dac_val);
+	}
+}
+
+#endif
+
 static int vesa_setcolreg(unsigned regno, unsigned red, unsigned green,
 			  unsigned blue, unsigned transp,
 			  struct fb_info *fb_info)
@@ -271,10 +308,6 @@
 	if (regno >= video_cmap_len)
 		return 1;
 
-	red >>= 10;
-        green >>= 10;
-        blue >>= 10;
-
 	palette[regno].red   = red;
 	palette[regno].green = green;
 	palette[regno].blue  = blue;
@@ -282,18 +315,25 @@
 	switch (video_bpp) {
 #ifdef FBCON_HAS_CFB8
 	case 8:
-		/* Hmm, can we do it _always_ this way ??? */
-		outb_p(regno, dac_reg);
-		outb_p(red, dac_val);
-		outb_p(green, dac_val);
-		outb_p(blue, dac_val);
+		vesa_setpalette(regno,red,green,blue);
 		break;
 #endif
 #ifdef FBCON_HAS_CFB16
 	case 15:
 	case 16:
-		fbcon_cfb16_cmap[regno] =
-			(red << vesafb_defined.red.offset) | (green << 5) | blue;
+		if (vesafb_defined.red.offset == 10) {
+			/* 1:5:5:5 */
+			fbcon_cmap.cfb16[regno] =
+				((red   & 0xf800) >>  1) |
+				((green & 0xf800) >>  6) |
+				((blue  & 0xf800) >> 11);
+		} else {
+			/* 0:5:6:5 */
+			fbcon_cmap.cfb16[regno] =
+				((red   & 0xf800)      ) |
+				((green & 0xfc00) >>  5) |
+				((blue  & 0xf800) >> 11);
+		}
 		break;
 #endif
 #ifdef FBCON_HAS_CFB24
@@ -303,7 +343,10 @@
 #endif
 #ifdef FBCON_HAS_CFB32
 	case 32:
-		fbcon_cfb32_cmap[regno] =
+		red   >>= 8;
+		green >>= 8;
+		blue  >>= 8;
+		fbcon_cmap.cfb32[regno] =
 			(red   << vesafb_defined.red.offset)   |
 			(green << vesafb_defined.green.offset) |
 			(blue  << vesafb_defined.blue.offset);
@@ -385,8 +428,6 @@
 	for(this_opt=strtok(options,","); this_opt; this_opt=strtok(NULL,",")) {
 		if (!*this_opt) continue;
 		
-		printk("vesafb_setup: option %s\n", this_opt);
-		
 		if (! strcmp(this_opt, "inverse"))
 			inverse=1;
 		else if (! strcmp(this_opt, "redraw"))
@@ -395,6 +436,8 @@
 			ywrap=0,ypan=1;
 		else if (! strcmp(this_opt, "ywrap"))
 			ywrap=1,ypan=0;
+		else if (! strcmp(this_opt, "nopal"))
+			pmi_setpal=0;
 		else if (!strncmp(this_opt, "font:", 5))
 			strcpy(fb_info.fontname, this_opt+5);
 	}
@@ -411,7 +454,7 @@
 	/* Install new colormap */
 	do_install_cmap(con, info);
 	vesafb_update_var(con,info);
-	return 0;
+	return 1;
 }
 
 /* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
@@ -447,45 +490,46 @@
 		printk("vesafb: protected mode interface info at %04x:%04x\n",
 		       screen_info.vesapm_seg,screen_info.vesapm_off);
 	}
+
 	if (screen_info.vesapm_seg < 0xc000)
-		ywrap = ypan = 0; /* not available or some DOS TSR ... */
-	if (screen_info.pages < 2)
-		ywrap = ypan = 0; /* need at least two screen pages */
+		ywrap = ypan = pmi_setpal = 0; /* not available or some DOS TSR ... */
 
-	if (ypan || ywrap) {
+	if (ypan || ywrap || pmi_setpal) {
 		pmi_base  = (unsigned short*)(__PAGE_OFFSET+((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
 		pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
 		pmi_pal   = (void*)((char*)pmi_base + pmi_base[2]);
 		printk("vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
-		printk("vesafb: pmi: ports = ");
-			for (i = pmi_base[3]/2; pmi_base[i] != 0xffff; i++)
-				printk("%x ",pmi_base[i]);
-		printk(", memory = ");
-			for (i++; pmi_base[i] != 0xffff; i+=3)
-				printk("%lx+%x ",
-				       ((unsigned long)pmi_base[i]<<16)
-					   + pmi_base[i+1], pmi_base[i+3]);
-		printk("\n");
+		if (pmi_base[3]) {
+			printk("vesafb: pmi: ports = ");
+				for (i = pmi_base[3]/2; pmi_base[i] != 0xffff; i++)
+					printk("%x ",pmi_base[i]);
+			printk("\n");
+			if (pmi_base[i] != 0xffff) {
+				/*
+				 * memory areas not supported (yet?)
+				 *
+				 * Rules are: we have to set up a descriptor for the requested
+				 * memory area and pass it in the ES register to the BIOS function.
+				 */
+				printk("vesafb: can't handle memory requests, pmi disabled\n");
+				ywrap = ypan = pmi_setpal = 0;
+			}
+		}
 	}
 
 	vesafb_defined.xres=video_width;
 	vesafb_defined.yres=video_height;
 	vesafb_defined.xres_virtual=video_width;
-	vesafb_defined.yres_virtual=video_height;
+	vesafb_defined.yres_virtual=video_size / video_linelength;
 	vesafb_defined.bits_per_pixel=video_bpp;
 
-	if (ypan) {
-		printk("vesafb: scrolling: ypan using protected mode interface\n");
-		vesafb_defined.yres_virtual = video_height * screen_info.pages;
-	} else if (ywrap) {
-		printk("vesafb: scrolling: ywrap using protected mode interface\n");
-#if 0
-		vesafb_defined.yres_virtual = video_height * screen_info.pages; /* available pages */
-#else
-		vesafb_defined.yres_virtual = video_size / video_linelength; /* whole video memory */
-#endif
+	if ((ypan || ywrap) && vesafb_defined.yres_virtual > video_height) {
+		printk("vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n",
+		       ywrap ? "ywrap" : "ypan",vesafb_defined.yres_virtual);
 	} else {
 		printk("vesafb: scrolling: redraw\n");
+		vesafb_defined.yres_virtual = video_height;
+		ypan = ywrap = 0;
 	}
 
 	if (video_bpp > 8) {
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/vfb.c m68k/drivers/video/vfb.c
--- jes-2.1.119/drivers/video/vfb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/vfb.c	Mon Aug 31 00:46:04 1998
@@ -22,13 +22,13 @@
 #include <linux/fb.h>
 #include <linux/init.h>
 
-#include "fbcon-mfb.h"
-#include "fbcon-cfb2.h"
-#include "fbcon-cfb4.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
-#include "fbcon-cfb24.h"
-#include "fbcon-cfb32.h"
+#include <video/fbcon-mfb.h>
+#include <video/fbcon-cfb2.h>
+#include <video/fbcon-cfb4.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
+#include <video/fbcon-cfb24.h>
+#include <video/fbcon-cfb32.h>
 
 
 #define arraysize(x)	(sizeof(x)/sizeof(*(x)))
@@ -49,6 +49,17 @@
 static struct display disp;
 static struct fb_info fb_info;
 static struct { u_char red, green, blue, pad; } palette[256];
+static union {
+#ifdef FBCON_HAS_CFB16
+    u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB24
+    u32 cfb24[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+    u32 cfb32[16];
+#endif
+} fbcon_cmap;
 static char vfb_name[16] = "Virtual FB";
 
 static struct fb_var_screeninfo vfb_default = {
@@ -282,16 +293,19 @@
 #ifdef FBCON_HAS_CFB16
 		case 16:
 		    display->dispsw = &fbcon_cfb16;
+		    display->dispsw_data = fbcon_cmap.cfb16;
 		    break;
 #endif
 #ifdef FBCON_HAS_CFB24
 		case 24:
 		    display->dispsw = &fbcon_cfb24;
+		    display->dispsw_data = fbcon_cmap.cfb24;
 		    break;
 #endif
 #ifdef FBCON_HAS_CFB32
 		case 32:
 		    display->dispsw = &fbcon_cfb32;
+		    display->dispsw_data = fbcon_cmap.cfb32;
 		    break;
 #endif
 		default:
@@ -576,9 +590,9 @@
 {
     if (regno > 255)
 	return 1;
-    *red = (palette[regno].red<<8) || palette[regno].red;
-    *green = (palette[regno].green<<8) || palette[regno].green;
-    *blue = (palette[regno].blue<<8) || palette[regno].blue;
+    *red = (palette[regno].red<<8) | palette[regno].red;
+    *green = (palette[regno].green<<8) | palette[regno].green;
+    *blue = (palette[regno].blue<<8) | palette[regno].blue;
     *transp = 0;
     return 0;
 }
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/vgacon.c m68k/drivers/video/vgacon.c
--- jes-2.1.119/drivers/video/vgacon.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/vgacon.c	Mon Aug 31 00:46:04 1998
@@ -453,8 +453,6 @@
 	 */
 	vga_video_num_columns = c->vc_cols;
 	vga_video_num_lines = c->vc_rows;
-	if (vga_is_gfx)
-		return 1;
 	if (!vga_is_gfx)
 		scr_memcpyw_to((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf, c->vc_screenbuf_size);
 	return 0;	/* Redrawing not needed */
@@ -475,8 +473,7 @@
 static int vgacon_set_palette(struct vc_data *c, unsigned char *table)
 {
 #ifdef CAN_LOAD_PALETTE
-
-	if (vga_video_type != VIDEO_TYPE_VGAC || vga_palette_blanked)
+	if (vga_video_type != VIDEO_TYPE_VGAC || vga_palette_blanked || !CON_IS_VISIBLE(c))
 		return -EINVAL;
 	vga_set_palette(c, table);
 	return 0;
@@ -638,10 +635,11 @@
 			vga_palette_blanked = 1;
 			return 0;
 		}
-		scr_memsetw((void *)vga_vram_base, BLANK, vc_cons[0].d->vc_screenbuf_size);
+		vgacon_set_origin(c);
+		scr_memsetw((void *)vga_vram_base, BLANK, c->vc_screenbuf_size);
 		return 1;
 	case -1:			/* Entering graphic mode */
-		scr_memsetw((void *)vga_vram_base, BLANK, vc_cons[0].d->vc_screenbuf_size);
+		scr_memsetw((void *)vga_vram_base, BLANK, c->vc_screenbuf_size);
 		vga_is_gfx = 1;
 		return 1;
 	default:			/* VESA blanking */
@@ -936,8 +934,6 @@
 		c->vc_x = ORIG_X;
 		c->vc_y = ORIG_Y;
 	}
-	if (vga_is_gfx)
-		return;
 	if (!vga_is_gfx)
 		scr_memcpyw_from((u16 *) c->vc_screenbuf, (u16 *) c->vc_origin, c->vc_screenbuf_size);
 }
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/vgafb.c m68k/drivers/video/vgafb.c
--- jes-2.1.119/drivers/video/vgafb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/vgafb.c	Thu Jan  1 01:00:00 1970
@@ -1,768 +0,0 @@
-/*
- *  linux/drivers/video/vgafb.c -- VGA frame buffer device
- *
- *	Created 28 Mar 1998 by Geert Uytterhoeven
- *	Hardware cursor support added on 14 Apr 1998 by Emmanuel Marty
- *
- *  This file is heavily based on vgacon.c. Read about its contributors there.
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License.  See the file COPYING in the main directory of this archive for
- *  more details.
- */
-
-
-
-
-/* KNOWN PROBLEMS/TO DO ===================================================== *
- *
- *	- add support for loadable fonts and VESA blanking
- *
- *	- for now only VGA _text_ mode is supported
- *
- * KNOWN PROBLEMS/TO DO ==================================================== */
-
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/malloc.h>
-#include <linux/vmalloc.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/fb.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/selection.h>
-#include <linux/console.h>
-#include <linux/vt_kern.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include "fbcon.h"
-#include "fbcon-vga.h"
-
-
-#define BLANK 0x0020
-
-#define CAN_LOAD_EGA_FONTS	/* undefine if the user must not do this */
-#define CAN_LOAD_PALETTE	/* undefine if the user must not do this */
-
-#define dac_reg	(0x3c8)
-#define dac_val	(0x3c9)
-
-#ifdef __powerpc__
-#define VGA_OFFSET _ISA_MEM_BASE;
-#else
-#define VGA_OFFSET 0x0
-#endif
-
-
-static int currcon = 0;
-static struct display disp;
-static struct fb_info fb_info;
-static struct { u_char red, green, blue, pad; } palette[16];
-
-static struct fb_fix_screeninfo fb_fix = { { 0, } };
-static struct fb_var_screeninfo fb_var = { 0, };
-
-
-/* Description of the hardware situation */
-static unsigned char vga_video_type;
-static unsigned long vga_video_mem_base;	/* Base of video memory */
-static unsigned long vga_video_mem_term;	/* End of video memory */
-static u16 vga_video_port_reg;			/* Video register select port */
-static u16 vga_video_port_val;			/* Video register value port */
-static unsigned long vga_video_num_columns;	/* Number of text columns */
-static unsigned long vga_video_num_lines;	/* Number of text lines */
-static int vga_can_do_color = 0;
-
-
-    /*
-     *  VGA screen access
-     */ 
-
-static inline void vga_writew(u16 val, u16 *addr)
-{
-#ifdef __powerpc__
-    st_le16(addr, val);
-#else
-    writew(val, (unsigned long)addr);
-#endif /* !__powerpc__ */
-}
-
-static inline u16 vga_readw(u16 *addr)
-{
-#ifdef __powerpc__
-    return ld_le16(addr);
-#else
-    return readw((unsigned long)addr);
-#endif /* !__powerpc__ */	
-}
-
-/*
- * By replacing the four outb_p with two back to back outw, we can reduce
- * the window of opportunity to see text mislocated to the RHS of the
- * console during heavy scrolling activity. However there is the remote
- * possibility that some pre-dinosaur hardware won't like the back to back
- * I/O. Since the Xservers get away with it, we should be able to as well.
- */
-static inline void write_vga(unsigned char reg, unsigned int val)
-{
-#ifndef SLOW_VGA
-    unsigned int v1, v2;
-
-    v1 = reg + (val & 0xff00);
-    v2 = reg + 1 + ((val << 8) & 0xff00);
-    outw(v1, vga_video_port_reg);
-    outw(v2, vga_video_port_reg);
-#else
-    outb_p(reg, vga_video_port_reg);
-    outb_p(val >> 8, vga_video_port_val);
-    outb_p(reg+1, vga_video_port_reg);
-    outb_p(val & 0xff, vga_video_port_val);
-#endif
-}
-
-static inline void vga_set_origin(unsigned short location)
-{
-	write_vga(12, location >> 1);
-}
-
-static inline void vga_set_cursor(int location)
-{
-    write_vga(14, location >> 1);
-}
-
-static void vga_set_split(unsigned short linenum)
-{
-	unsigned long flags;
-	unsigned char overflow, fontsize;
-	
-	if (vga_video_type != VIDEO_TYPE_VGAC) {
-		return;
-	}
-
-	save_flags(flags); cli();
-
-	outb_p(0x07, vga_video_port_reg);
-	overflow = inb_p(vga_video_port_val);
-
-	outb_p(0x09, vga_video_port_reg);
-	fontsize = inb_p(vga_video_port_val);
-	
-	overflow &= ~0x10; overflow |= (linenum & 0x100) ? 0x10 : 0;
-	fontsize &= ~0x40; fontsize |= (linenum & 0x200) ? 0x40 : 0;
-	linenum  &=  0xff;
-
-	outb_p(0x18, vga_video_port_reg);
-	outb_p(linenum, vga_video_port_val);
-
-	outb_p(0x07, vga_video_port_reg);
-	outb_p(overflow, vga_video_port_val);
-
-	outb_p(0x09, vga_video_port_reg);
-	outb_p(fontsize, vga_video_port_val);
-
-	restore_flags(flags);
-}
-
-static inline void vga_set_palreg(u_int regno, u_int red, 
-				  u_int green, u_int blue)
-{
-	unsigned long flags;
-
-	save_flags(flags); cli();
-	
-	outb_p(regno, dac_reg);
-	outb_p(red,   dac_val);
-	outb_p(green, dac_val);
-	outb_p(blue,  dac_val);
-	
-	restore_flags(flags);
-}
-
-
-    /*
-     *  Interface used by the world
-     */
-
-static int vgafb_open(struct fb_info *info, int user);
-static int vgafb_release(struct fb_info *info, int user);
-static int vgafb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			 struct fb_info *info);
-static int vgafb_get_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info);
-static int vgafb_set_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info);
-static int vgafb_pan_display(struct fb_var_screeninfo *var, int con,
-			     struct fb_info *info);
-static int vgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info);
-static int vgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info);
-static int vgafb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		       u_long arg, int con, struct fb_info *info);
-
-
-    /*
-     *  Interface to the low level console driver
-     */
-
-void vgafb_init(void);
-void vgafb_setup(char *options, int *ints);
-static int vgafbcon_switch(int con, struct fb_info *info);
-static int vgafbcon_updatevar(int con, struct fb_info *info);
-static void vgafbcon_blank(int blank, struct fb_info *info);
-
-
-    /*
-     *  VGA text console with hardware cursor
-     */
-
-static struct display_switch fbcon_vgafb;
-
-
-    /*
-     *  Internal routines
-     */
-
-static int vgafb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-			   u_int *transp, struct fb_info *info);
-static int vgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			   u_int transp, struct fb_info *info);
-static void do_install_cmap(int con, struct fb_info *info);
-
-
-static struct fb_ops vgafb_ops = {
-    vgafb_open, vgafb_release, vgafb_get_fix, vgafb_get_var, vgafb_set_var,
-    vgafb_get_cmap, vgafb_set_cmap, vgafb_pan_display, vgafb_ioctl
-};
-
-
-    /*
-     *  Open/Release the frame buffer device
-     */
-
-static int vgafb_open(struct fb_info *info, int user)
-
-{
-    /*
-     *  Nothing, only a usage count for the moment
-     */
-
-    MOD_INC_USE_COUNT;
-    return(0);
-}
-
-static int vgafb_release(struct fb_info *info, int user)
-{
-    MOD_DEC_USE_COUNT;
-    return(0);
-}
-
-
-    /*
-     *  Get the Fixed Part of the Display
-     */
-
-static int vgafb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			 struct fb_info *info)
-{
-    memcpy(fix, &fb_fix, sizeof(fb_fix));
-    return 0;
-}
-
-
-    /*
-     *  Get the User Defined Part of the Display
-     */
-
-static int vgafb_get_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
-{
-    memcpy(var, &fb_var, sizeof(fb_var));
-    return 0;
-}
-
-
-    /*
-     *  Set the User Defined Part of the Display
-     */
-
-static int vgafb_set_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
-{
-    struct display *display;
-    int oldbpp = -1, err;
-
-    if (con >= 0)
-	display = &fb_display[con];
-    else
-	display = &disp;	/* used during initialization */
-
-    if (var->xres > fb_var.xres || var->yres > fb_var.yres ||
-	var->xres_virtual > fb_var.xres_virtual ||
-	var->yres_virtual > fb_var.yres_virtual ||
-	var->bits_per_pixel > fb_var.bits_per_pixel ||
-	var->nonstd || !(var->accel_flags & FB_ACCELF_TEXT) ||
-	(var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
-	return -EINVAL;
-    memcpy(var, &fb_var, sizeof(fb_var));
-
-    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
-	oldbpp = display->var.bits_per_pixel;
-	display->var = *var;
-	vga_set_origin(var->yoffset/video_font_height*fb_fix.line_length);
-    }
-
-    if (oldbpp != var->bits_per_pixel) {
-	if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
-	    return err;
-	do_install_cmap(con, info);
-    }
-    return 0;
-}
-
-
-    /*
-     *  Pan or Wrap the Display
-     *
-     *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
-     */
-
-static int vgafb_pan_display(struct fb_var_screeninfo *var, int con,
-			     struct fb_info *info)
-{
-    if (var->xoffset || var->yoffset+var->yres > var->yres_virtual)
-	return -EINVAL;
-
-    vga_set_origin(var->yoffset/video_font_height*fb_fix.line_length);
-    return 0;
-}
-
-
-    /*
-     *  Get the Colormap
-     */
-
-static int vgafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
-{
-    if (con == currcon) /* current console? */
-	return fb_get_cmap(cmap, kspc, vgafb_getcolreg, info);
-    else if (fb_display[con].cmap.len) /* non default colormap? */
-	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
-    else
-	fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
-		     cmap, kspc ? 0 : 2);
-    return 0;
-}
-
-
-    /*
-     *  Set the Colormap
-     */
-
-static int vgafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
-{
-    int err;
-
-    if (!fb_display[con].cmap.len) {    /* no colormap allocated? */
-	if ((err = fb_alloc_cmap(&fb_display[con].cmap,
-				 1<<fb_display[con].var.bits_per_pixel, 0)))
-	    return err;
-    }
-    if (con == currcon) {		/* current console? */
-	err = fb_set_cmap(cmap, kspc, vgafb_setcolreg, info);
-	return err;
-    } else
-	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
-    return 0;
-}
-
-
-static int vgafb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-		       u_long arg, int con, struct fb_info *info)
-{
-    return -EINVAL;
-}
-
-
-    /*
-     *  Move hardware vga cursor
-     */
-
-static void fbcon_vgafb_cursor(struct display *p, int mode, int x, int y)
-{
-    switch (mode) {
-	case CM_ERASE:
-	   vga_set_cursor(vga_video_mem_term - vga_video_mem_base - 1);
-	   break;
-
-	case CM_MOVE:
-	case CM_DRAW:
-	   vga_set_cursor(y*p->next_line + (x << 1));
-	   break;
-    }
-}
-
-
-    /*
-     *  Initialisation
-     */
-
-__initfunc(void vgafb_init(void))
-{
-    u16 saved;
-    u16 *p;
-
-    if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB)
-	return;
-
-    vga_video_num_lines = ORIG_VIDEO_LINES;
-    vga_video_num_columns = ORIG_VIDEO_COLS;
-
-    if (ORIG_VIDEO_MODE == 7) {		/* Is this a monochrome display? */
-	vga_video_mem_base = 0xb0000 + VGA_OFFSET;
-	vga_video_port_reg = 0x3b4;
-	vga_video_port_val = 0x3b5;
-	if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
-	    vga_video_type = VIDEO_TYPE_EGAM;
-	    vga_video_mem_term = 0xb8000 + VGA_OFFSET;
-	    strcpy(fb_fix.id, "EGA+");
-	    request_region(0x3b0, 16, "ega");
-	} else {
-	    vga_video_type = VIDEO_TYPE_MDA;
-	    vga_video_mem_term = 0xb1000 + VGA_OFFSET;
-	    strcpy(fb_fix.id, "*MDA");
-	    request_region(0x3b0, 12, "mda");
-	    request_region(0x3bf, 1, "mda");
-	}
-    } else {				/* If not, it is color. */
-	vga_can_do_color = 1;
-	vga_video_mem_base = 0xb8000  + VGA_OFFSET;
-	vga_video_port_reg = 0x3d4;
-	vga_video_port_val = 0x3d5;
-	if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
-	    int i;
-
-	    vga_video_mem_term = 0xc0000 + VGA_OFFSET;
-
-	    if (!ORIG_VIDEO_ISVGA) {
-		vga_video_type = VIDEO_TYPE_EGAC;
-		strcpy(fb_fix.id, "EGA");
-		request_region(0x3c0, 32, "ega");
-	    } else {
-		vga_video_type = VIDEO_TYPE_VGAC;
-		strcpy(fb_fix.id, "VGA+");
-		request_region(0x3c0, 32, "vga+");
-
-#ifdef VGA_CAN_DO_64KB
-		/*
-		 * get 64K rather than 32K of video RAM.
-		 * This doesn't actually work on all "VGA"
-		 * controllers (it seems like setting MM=01
-		 * and COE=1 isn't necessarily a good idea)
-		 */
-		vga_video_mem_base = 0xa0000  + VGA_OFFSET;
-		vga_video_mem_term = 0xb0000  + VGA_OFFSET;
-		outb_p(6, 0x3ce);
-		outb_p(6, 0x3cf);
-#endif
-
-		/*
-		 * Normalise the palette registers, to point
-		 * the 16 screen colours to the first 16
-		 * DAC entries.
-		 */
-
-		for (i = 0; i < 16; i++) {
-		    inb_p(0x3da);
-		    outb_p(i, 0x3c0);
-		    outb_p(i, 0x3c0);
-		}
-		outb_p(0x20, 0x3c0);
-
-		/* now set the DAC registers back to their
-		 * default values */
-
-		for (i = 0; i < 16; i++) {
-		    vga_set_palreg(color_table[i], default_red[i],
-		    		   default_grn[i], default_blu[i]);
-		}
-	    }
-	} else {
-		vga_video_type = VIDEO_TYPE_CGA;
-		vga_video_mem_term = 0xba000 + VGA_OFFSET;
-		strcpy(fb_fix.id, "*CGA");
-		request_region(0x3d4, 2, "cga");
-	}
-    }
-
-    /*
-     *	Find out if there is a graphics card present.
-     *	Are there smarter methods around?
-     */
-    p = (u16 *)vga_video_mem_base;
-    saved = vga_readw(p);
-    vga_writew(0xAA55, p);
-    if (vga_readw(p) != 0xAA55) {
-	vga_writew(saved, p);
-	return;
-    }
-    vga_writew(0x55AA, p);
-    if (vga_readw(p) != 0x55AA) {
-	vga_writew(saved, p);
-	return;
-    }
-    vga_writew(saved, p);
-
-    if (vga_video_type == VIDEO_TYPE_VGAC
-	|| vga_video_type == VIDEO_TYPE_EGAC
-	|| vga_video_type == VIDEO_TYPE_EGAM) {
-	    video_font_height = ORIG_VIDEO_POINTS;
-    } else {
-            video_font_height = 16;
-    }
-
-    /* This may be suboptimal but is a safe bet - go with it */
-    video_scan_lines = video_font_height * vga_video_num_lines;
-
-    fb_fix.smem_start = (char *) vga_video_mem_base;
-    fb_fix.smem_len = vga_video_mem_term - vga_video_mem_base;
-    fb_fix.type = FB_TYPE_TEXT;
-    fb_fix.type_aux = vga_can_do_color ? FB_AUX_TEXT_CGA : FB_AUX_TEXT_MDA;
-    fb_fix.visual = FB_VISUAL_PSEUDOCOLOR;
-    fb_fix.xpanstep = 0;
-    fb_fix.ypanstep = video_font_height;
-    fb_fix.ywrapstep = 0;
-    fb_fix.line_length = 2*vga_video_num_columns;
-    fb_fix.mmio_start = NULL;
-    fb_fix.mmio_len = 0;
-    fb_fix.accel = FB_ACCEL_NONE;
-
-    fb_var.xres = vga_video_num_columns*8;
-    fb_var.yres = vga_video_num_lines*video_font_height;
-    fb_var.xres_virtual = fb_var.xres;
-    /* the cursor is put at the end of the video memory, hence the -2 */
-    fb_var.yres_virtual = ((fb_fix.smem_len-2)/fb_fix.line_length)*
-			  video_font_height;
-
-    fb_var.xoffset = fb_var.yoffset = 0;
-    fb_var.bits_per_pixel = vga_can_do_color ? 4 : 1;
-    fb_var.grayscale = !vga_can_do_color;
-    fb_var.red.offset = 0;
-    fb_var.red.length = 6;
-    fb_var.red.msb_right = 0;
-    fb_var.green.offset = 0;
-    fb_var.green.length = 6;
-    fb_var.green.msb_right = 0;
-    fb_var.blue.offset = 0;
-    fb_var.blue.length = 6;
-    fb_var.blue.msb_right = 0;
-    fb_var.transp.offset = 0;
-    fb_var.transp.length = 0;
-    fb_var.transp.msb_right = 0;
-    fb_var.nonstd = 0;
-    fb_var.activate = 0;
-    fb_var.height = fb_var.width = -1;
-    fb_var.accel_flags = FB_ACCELF_TEXT;
-    fb_var.pixclock = 39722;		/* 25.175 MHz */
-    fb_var.left_margin = 40;
-    fb_var.right_margin = 24;
-    fb_var.upper_margin = 39;
-    fb_var.lower_margin = 9;
-    fb_var.hsync_len = 96;
-    fb_var.vsync_len = 2;
-    fb_var.sync = 0;
-    fb_var.vmode = FB_VMODE_NONINTERLACED;
-
-    disp.var = fb_var;
-    disp.cmap.start = 0;
-    disp.cmap.len = 0;
-    disp.cmap.red = NULL;
-    disp.cmap.green = NULL;
-    disp.cmap.blue = NULL;
-    disp.cmap.transp = NULL;
-
-#ifdef __i386__
-    disp.screen_base = ioremap((unsigned long) fb_fix.smem_start,
-				fb_fix.smem_len);
-#else
-    disp.screen_base = bus_to_virt((unsigned long) fb_fix.smem_start);
-#endif
-    disp.visual = fb_fix.visual;
-    disp.type = fb_fix.type;
-    disp.type_aux = fb_fix.type_aux;
-    disp.ypanstep = fb_fix.ypanstep;
-    disp.ywrapstep = fb_fix.ywrapstep;
-    disp.line_length = fb_fix.line_length;
-    disp.can_soft_blank = vga_can_do_color;
-    disp.inverse = 0;
-    disp.dispsw = &fbcon_vgafb;
-
-    strcpy(fb_info.modename, fb_fix.id);
-    fb_info.node = -1;
-    fb_info.fbops = &vgafb_ops;
-    fb_info.disp = &disp;
-    fb_info.fontname[0] = '\0';
-    fb_info.changevar = NULL;
-    fb_info.switch_con = &vgafbcon_switch;
-    fb_info.updatevar = &vgafbcon_updatevar;
-    fb_info.blank = &vgafbcon_blank;
-
-    vgafb_set_var(&fb_var, -1, &fb_info);
-
-    if (register_framebuffer(&fb_info) < 0)
-	return;
-
-    printk("fb%d: VGA frame buffer device, using %dK of video memory\n",
-	   GET_FB_IDX(fb_info.node), fb_fix.smem_len>>10);
-}
-
-__initfunc(void vgafb_setup(char *options, int *ints))
-{
-    /* nothing yet */
-}
-
-    /*
-     *  Update the `var' structure (called by fbcon.c)
-     */
-
-static int vgafbcon_updatevar(int con, struct fb_info *info)
-{
-	if (con == currcon) {
-		struct fb_var_screeninfo *var = &fb_display[currcon].var;
-
-		/* hardware scrolling */
-
-		vga_set_origin(var->yoffset / video_font_height *
-			fb_fix.line_length);
-
-		vga_set_split(var->yres - ((var->vmode & FB_VMODE_YWRAP) ?
-			var->yoffset+1 : 0));
-	}
-
-	return 0;
-}
-
-static int vgafbcon_switch(int con, struct fb_info *info)
-{
-    /* Do we have to save the colormap? */
-    if (fb_display[currcon].cmap.len)
-	fb_get_cmap(&fb_display[currcon].cmap, 1, vgafb_getcolreg, info);
-
-    currcon = con;
-    /* Install new colormap */
-    do_install_cmap(con, info);
-    vgafbcon_updatevar(con, info);
-    return 0;
-}
-
-    /*
-     *  Blank the display.
-     */
-
-static void vgafbcon_blank(int blank, struct fb_info *info)
-{
-    int i;
-
-    if (blank)
-	for (i = 0; i < 16; i++) {
-	    vga_set_palreg(i, 0, 0, 0);
-	}
-    else
-	for (i = 0; i < 16; i++) {
-	    vga_set_palreg(i, palette[i].red, palette[i].green,
-			      palette[i].blue);
-	}
-}
-
-
-    /*
-     *  Read a single color register and split it into
-     *  colors/transparent. Return != 0 for invalid regno.
-     */
-
-static int vgafb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
-			 u_int *transp, struct fb_info *info)
-{
-    int t;
-
-    if (regno > 15)
-	return 1;
-    t = palette[regno].red;
-    *red = (t<<10) | (t<<4) | (t>>2);
-    t = palette[regno].green;
-    *green = (t<<10) | (t<<4) | (t>>2);
-    t = palette[regno].blue;
-    *blue = (t<<10) | (t<<4) | (t>>2);
-    *transp = 0;
-    return 0;
-}
-
-
-    /*
-     *  Set a single color register. The values supplied are already
-     *  rounded down to the hardware's capabilities (according to the
-     *  entries in the var structure). Return != 0 for invalid regno.
-     */
-
-static int vgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			 u_int transp, struct fb_info *info)
-{
-    if (regno > 15)
-	return 1;
-    red >>= 10;
-    green >>= 10;
-    blue >>= 10;
-    palette[regno].red = red;
-    palette[regno].green = green;
-    palette[regno].blue = blue;
-
-    vga_set_palreg(regno, red, green, blue);
-
-    return 0;
-}
-
-static void do_install_cmap(int con, struct fb_info *info)
-{
-    if (con != currcon)
-	return;
-    if (fb_display[con].cmap.len)
-	fb_set_cmap(&fb_display[con].cmap, 1, vgafb_setcolreg, info);
-    else
-	fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
-				    1, vgafb_setcolreg, info);
-}
-
-
-    /*
-     *  VGA text console with hardware cursor
-     */
-
-static struct display_switch fbcon_vgafb = {
-    fbcon_vga_setup, fbcon_vga_bmove, fbcon_vga_clear, fbcon_vga_putc,
-    fbcon_vga_putcs, fbcon_vga_revc, fbcon_vgafb_cursor, NULL, NULL,
-    FONTWIDTH(8)
-};
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    vgafb_init();
-    return 0;
-}
-
-void cleanup_module(void)
-{
-    unregister_framebuffer(&fb_info);
-}
-#endif /* MODULE */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/drivers/video/virgefb.c m68k/drivers/video/virgefb.c
--- jes-2.1.119/drivers/video/virgefb.c	Sun Aug 30 20:40:55 1998
+++ m68k/drivers/video/virgefb.c	Mon Aug 31 00:46:04 1998
@@ -33,10 +33,10 @@
 #include <asm/pgtable.h>
 #include <asm/amigahw.h>
 
-#include "s3blit.h"
-#include "fbcon.h"
-#include "fbcon-cfb8.h"
-#include "fbcon-cfb16.h"
+#include <video/s3blit.h>
+#include <video/fbcon.h>
+#include <video/fbcon-cfb8.h>
+#include <video/fbcon-cfb16.h>
 
 
 #ifdef VIRGEFBDEBUG
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/linux/console_struct.h m68k/include/linux/console_struct.h
--- jes-2.1.119/include/linux/console_struct.h	Mon Aug 10 09:35:02 1998
+++ m68k/include/linux/console_struct.h	Mon Aug 31 00:45:48 1998
@@ -104,3 +104,5 @@
 #define CUR_SWMASK	0xfff0
 
 #define CUR_DEFAULT CUR_UNDERLINE
+
+#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/linux/fb.h m68k/include/linux/fb.h
--- jes-2.1.119/include/linux/fb.h	Sun Aug 30 20:41:32 1998
+++ m68k/include/linux/fb.h	Mon Aug 31 00:59:12 1998
@@ -230,50 +230,51 @@
     */
 
 struct display {
-   /* Filled in by the frame buffer device */
+    /* Filled in by the frame buffer device */
 
-   struct fb_var_screeninfo var;    /* variable infos. yoffset and vmode */
-                                    /* are updated by fbcon.c */
-   struct fb_cmap cmap;             /* colormap */
-   char *screen_base;               /* pointer to top of virtual screen */    
+    struct fb_var_screeninfo var;   /* variable infos. yoffset and vmode */
+				    /* are updated by fbcon.c */
+    struct fb_cmap cmap;            /* colormap */
+    char *screen_base;              /* pointer to top of virtual screen */    
 				    /* (virtual address) */
-   int visual;
-   int type;                        /* see FB_TYPE_* */
-   int type_aux;                    /* Interleave for interleaved Planes */
-   u_short ypanstep;                /* zero if no hardware ypan */
-   u_short ywrapstep;               /* zero if no hardware ywrap */
-   u_long line_length;              /* length of a line in bytes */
-   u_short can_soft_blank;          /* zero if no hardware blanking */
-   u_short inverse;                 /* != 0 text black on white as default */
+    int visual;
+    int type;                       /* see FB_TYPE_* */
+    int type_aux;                   /* Interleave for interleaved Planes */
+    u_short ypanstep;               /* zero if no hardware ypan */
+    u_short ywrapstep;              /* zero if no hardware ywrap */
+    u_long line_length;             /* length of a line in bytes */
+    u_short can_soft_blank;         /* zero if no hardware blanking */
+    u_short inverse;                /* != 0 text black on white as default */
+    struct display_switch *dispsw;  /* low level operations */
+    void *dispsw_data;		    /* optional dispsw helper data */
 
 #if 0
-   struct fb_fix_cursorinfo fcrsr;
-   struct fb_var_cursorinfo *vcrsr;
-   struct fb_cursorstate crsrstate;
+    struct fb_fix_cursorinfo fcrsr;
+    struct fb_var_cursorinfo *vcrsr;
+    struct fb_cursorstate crsrstate;
 #endif
 
-   /* Filled in by the low-level console driver */
+    /* Filled in by the low-level console driver */
 
-   struct vc_data *conp;            /* pointer to console data */
-   struct fb_info *fb_info;         /* frame buffer for this console */
-   int vrows;                       /* number of virtual rows */
-   unsigned short cursor_x;	    /* current cursor position */
-   unsigned short cursor_y;
-   int fgcol;                       /* text colors */
-   int bgcol;
-   u_long next_line;                /* offset to one line below */
-   u_long next_plane;               /* offset to next plane */
-   u_char *fontdata;                /* Font associated to this display */
-   unsigned short _fontheightlog;
-   unsigned short _fontwidthlog;
-   unsigned short _fontheight;
-   unsigned short _fontwidth;
-   int userfont;                    /* != 0 if fontdata kmalloc()ed */
-   struct display_switch *dispsw;   /* low level operations */
-   u_short scrollmode;              /* Scroll Method */
-   short yscroll;                   /* Hardware scrolling */
-   unsigned char fgshift, bgshift;
-   unsigned short charmask;	    /* 0xff or 0x1ff */
+    struct vc_data *conp;           /* pointer to console data */
+    struct fb_info *fb_info;        /* frame buffer for this console */
+    int vrows;                      /* number of virtual rows */
+    unsigned short cursor_x;	    /* current cursor position */
+    unsigned short cursor_y;
+    int fgcol;                      /* text colors */
+    int bgcol;
+    u_long next_line;               /* offset to one line below */
+    u_long next_plane;              /* offset to next plane */
+    u_char *fontdata;               /* Font associated to this display */
+    unsigned short _fontheightlog;
+    unsigned short _fontwidthlog;
+    unsigned short _fontheight;
+    unsigned short _fontwidth;
+    int userfont;                   /* != 0 if fontdata kmalloc()ed */
+    u_short scrollmode;             /* Scroll Method */
+    short yscroll;                  /* Hardware scrolling */
+    unsigned char fgshift, bgshift;
+    unsigned short charmask;	    /* 0xff or 0x1ff */
 };
 
 
@@ -321,8 +322,8 @@
     int (*pan_display)(const struct fb_var_screeninfo *var,
 		       struct fb_info_gen *info);
     int (*blank)(int blank_mode, struct fb_info_gen *info);
-    struct display_switch *(*get_dispsw)(const void *par,
-					 struct fb_info_gen *info);
+    void (*set_dispsw)(const void *par, struct display *disp,
+		       struct fb_info_gen *info);
 };
 
 struct fb_info_gen {
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/linux/selection.h m68k/include/linux/selection.h
--- jes-2.1.119/include/linux/selection.h	Sun Aug 30 20:41:33 1998
+++ m68k/include/linux/selection.h	Mon Aug 31 00:45:48 1998
@@ -21,7 +21,6 @@
 #define video_num_columns	(vc_cons[currcons].d->vc_cols)
 #define video_num_lines		(vc_cons[currcons].d->vc_rows)
 #define video_size_row		(vc_cons[currcons].d->vc_size_row)
-#define video_screen_size	(vc_cons[currcons].d->vc_screenbuf_size)
 #define can_do_color		(vc_cons[currcons].d->vc_can_do_color)
 
 extern int console_blanked;
@@ -31,7 +30,6 @@
 extern int default_grn[];
 extern int default_blu[];
 
-extern void do_unblank_screen(void);
 extern unsigned short *screen_pos(int currcons, int w_offset, int viewed);
 extern u16 screen_glyph(int currcons, int offset);
 extern void complement_pos(int currcons, int offset);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/linux/tty.h m68k/include/linux/tty.h
--- jes-2.1.119/include/linux/tty.h	Sun Aug 30 20:41:33 1998
+++ m68k/include/linux/tty.h	Mon Aug 31 21:07:41 1998
@@ -9,7 +9,7 @@
  * These constants are also useful for user-level apps (e.g., VC
  * resizing).
  */
-#define MIN_NR_CONSOLES	1       /* must be at least 1 */
+#define MIN_NR_CONSOLES 1       /* must be at least 1 */
 #define MAX_NR_CONSOLES	63	/* serial lines start at 64 */
 #define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
 		/* Note: the ioctl VT_GETSTATE does not work for
@@ -88,7 +88,10 @@
 	unsigned char  blue_pos;		/* 0x2b */
 	unsigned char  rsvd_size;		/* 0x2c */
 	unsigned char  rsvd_pos;		/* 0x2d */
-						/* 0x2e -- 0x3f reserved for future expansion */
+	unsigned short vesapm_seg;		/* 0x2e */
+	unsigned short vesapm_off;		/* 0x30 */
+	unsigned short pages;			/* 0x32 */
+						/* 0x34 -- 0x3f reserved for future expansion */
 };
 
 extern struct screen_info screen_info;
@@ -393,10 +396,6 @@
 /* pcxx.c */
 
 extern int pcxe_open(struct tty_struct *tty, struct file *filp);
-
-/* console.c */
-
-extern void update_screen(int new_console);
 
 /* printk.c */
 
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/linux/vt_kern.h m68k/include/linux/vt_kern.h
--- jes-2.1.119/include/linux/vt_kern.h	Sun Aug 30 20:41:33 1998
+++ m68k/include/linux/vt_kern.h	Mon Aug 31 20:54:35 1998
@@ -30,7 +30,7 @@
 	struct wait_queue *paste_wait;
 } *vt_cons[MAX_NR_CONSOLES];
 
-extern void (*kd_mksound)(unsigned int hz, unsigned int ticks);
+void (*kd_mksound)(unsigned int hz, unsigned int ticks);
 
 /* console.c */
 
@@ -43,19 +43,20 @@
 #define vc_resize_all(l, c) vc_resize(l, c, 0, MAX_NR_CONSOLES-1)
 #define vc_resize_con(l, c, x) vc_resize(l, c, x, x)
 void vc_disallocate(unsigned int console);
-void poke_blanked_console(void);
-void set_vesa_blanking(unsigned long arg);
-void vesa_blank(void);
-void vesa_powerdown(void);
 void reset_palette(int currcons);
-void set_palette(void);
-void do_blank_screen(int nopowersave);
+void set_palette(int currcons);
+void do_blank_screen(int gfx_mode);
+void unblank_screen(void);
+void poke_blanked_console(void);
 int con_font_op(int currcons, struct console_font_op *op);
 int con_set_cmap(unsigned char *cmap);
 int con_get_cmap(unsigned char *cmap);
 void scrollback(int);
 void scrollfront(int);
 void update_region(int currcons, unsigned long start, int count);
+void redraw_screen(int new_console, int is_switch);
+#define update_screen(x) redraw_screen(x, 0)
+#define switch_screen(x) redraw_screen(x, 1)
 
 struct tty_struct;
 int tioclinux(struct tty_struct *tty, unsigned long arg);
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-afb.h m68k/include/video/fbcon-afb.h
--- jes-2.1.119/include/video/fbcon-afb.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-afb.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Amiga bitplanes (afb)
+ */
+
+#ifndef _VIDEO_FBCON_AFB_H
+#define _VIDEO_FBCON_AFB_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_AFB) || defined(CONFIG_FBCON_AFB_MODULE)
+#define FBCON_HAS_AFB
+#endif
+#else
+#if defined(CONFIG_FBCON_AFB)
+#define FBCON_HAS_AFB
+#endif
+#endif
+
+extern struct display_switch fbcon_afb;
+extern void fbcon_afb_setup(struct display *p);
+extern void fbcon_afb_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			    int height, int width);
+extern void fbcon_afb_clear(struct vc_data *conp, struct display *p, int sy,
+			    int sx, int height, int width);
+extern void fbcon_afb_putc(struct vc_data *conp, struct display *p, int c,
+			   int yy, int xx);
+extern void fbcon_afb_putcs(struct vc_data *conp, struct display *p,
+			    const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_afb_revc(struct display *p, int xx, int yy);
+
+#endif
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb16.h m68k/include/video/fbcon-cfb16.h
--- jes-2.1.119/include/video/fbcon-cfb16.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb16.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,33 @@
+/*
+ *  FBcon low-level driver for 16 bpp packed pixel (cfb16)
+ */
+
+#ifndef _VIDEO_FBCON_CFB16_H
+#define _VIDEO_FBCON_CFB16_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB16_MODULE)
+#define FBCON_HAS_CFB16
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB16)
+#define FBCON_HAS_CFB16
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb16;
+extern void fbcon_cfb16_setup(struct display *p);
+extern void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy,
+			      int dx, int height, int width);
+extern void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy,
+			      int sx, int height, int width);
+extern void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c,
+			     int yy, int xx);
+extern void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p,
+			      const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb16_revc(struct display *p, int xx, int yy);
+extern void fbcon_cfb16_clear_margins(struct vc_data *conp, struct display *p);
+
+#endif /* _VIDEO_FBCON_CFB16_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb2.h m68k/include/video/fbcon-cfb2.h
--- jes-2.1.119/include/video/fbcon-cfb2.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb2.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for 2 bpp packed pixel (cfb2)
+ */
+
+#ifndef _VIDEO_FBCON_CFB2_H
+#define _VIDEO_FBCON_CFB2_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB2) || defined(CONFIG_FBCON_CFB2_MODULE)
+#define FBCON_HAS_CFB2
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB2)
+#define FBCON_HAS_CFB2
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb2;
+extern void fbcon_cfb2_setup(struct display *p);
+extern void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			     int height, int width);
+extern void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy,
+			     int sx, int height, int width);
+extern void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c,
+			    int yy, int xx);
+extern void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p,
+			     const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb2_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_CFB2_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb24.h m68k/include/video/fbcon-cfb24.h
--- jes-2.1.119/include/video/fbcon-cfb24.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb24.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,33 @@
+/*
+ *  FBcon low-level driver for 24 bpp packed pixel (cfb24)
+ */
+
+#ifndef _VIDEO_FBCON_CFB24_H
+#define _VIDEO_FBCON_CFB24_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB24) || defined(CONFIG_FBCON_CFB24_MODULE)
+#define FBCON_HAS_CFB24
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB24)
+#define FBCON_HAS_CFB24
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb24;
+extern void fbcon_cfb24_setup(struct display *p);
+extern void fbcon_cfb24_bmove(struct display *p, int sy, int sx, int dy,
+			      int dx, int height, int width);
+extern void fbcon_cfb24_clear(struct vc_data *conp, struct display *p, int sy,
+			      int sx, int height, int width);
+extern void fbcon_cfb24_putc(struct vc_data *conp, struct display *p, int c,
+			     int yy, int xx);
+extern void fbcon_cfb24_putcs(struct vc_data *conp, struct display *p,
+			      const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb24_revc(struct display *p, int xx, int yy);
+extern void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p);
+
+#endif /* _VIDEO_FBCON_CFB24_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb32.h m68k/include/video/fbcon-cfb32.h
--- jes-2.1.119/include/video/fbcon-cfb32.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb32.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,33 @@
+/*
+ *  FBcon low-level driver for 32 bpp packed pixel (cfb32)
+ */
+
+#ifndef _VIDEO_FBCON_CFB32_H
+#define _VIDEO_FBCON_CFB32_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB32) || defined(CONFIG_FBCON_CFB32_MODULE)
+#define FBCON_HAS_CFB32
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB32)
+#define FBCON_HAS_CFB32
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb32;
+extern void fbcon_cfb32_setup(struct display *p);
+extern void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy,
+			      int dx, int height, int width);
+extern void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy,
+			      int sx, int height, int width);
+extern void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c,
+			     int yy, int xx);
+extern void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p,
+			      const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb32_revc(struct display *p, int xx, int yy);
+extern void fbcon_cfb32_clear_margins(struct vc_data *conp, struct display *p);
+
+#endif /* _VIDEO_FBCON_CFB32_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb4.h m68k/include/video/fbcon-cfb4.h
--- jes-2.1.119/include/video/fbcon-cfb4.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb4.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for 4 bpp packed pixel (cfb4)
+ */
+
+#ifndef _VIDEO_FBCON_CFB4_H
+#define _VIDEO_FBCON_CFB4_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB4) || defined(CONFIG_FBCON_CFB4_MODULE)
+#define FBCON_HAS_CFB4
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB4)
+#define FBCON_HAS_CFB4
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb4;
+extern void fbcon_cfb4_setup(struct display *p);
+extern void fbcon_cfb4_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			     int height, int width);
+extern void fbcon_cfb4_clear(struct vc_data *conp, struct display *p, int sy,
+			     int sx, int height, int width);
+extern void fbcon_cfb4_putc(struct vc_data *conp, struct display *p, int c,
+			    int yy, int xx);
+extern void fbcon_cfb4_putcs(struct vc_data *conp, struct display *p,
+			     const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb4_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_CFB4_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-cfb8.h m68k/include/video/fbcon-cfb8.h
--- jes-2.1.119/include/video/fbcon-cfb8.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-cfb8.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,33 @@
+/*
+ *  FBcon low-level driver for 8 bpp packed pixel (cfb8)
+ */
+
+#ifndef _VIDEO_FBCON_CFB8_H
+#define _VIDEO_FBCON_CFB8_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FBCON_CFB8_MODULE)
+#define FBCON_HAS_CFB8
+#endif
+#else
+#if defined(CONFIG_FBCON_CFB8)
+#define FBCON_HAS_CFB8
+#endif
+#endif
+
+extern struct display_switch fbcon_cfb8;
+extern void fbcon_cfb8_setup(struct display *p);
+extern void fbcon_cfb8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			     int height, int width);
+extern void fbcon_cfb8_clear(struct vc_data *conp, struct display *p, int sy,
+			     int sx, int height, int width);
+extern void fbcon_cfb8_putc(struct vc_data *conp, struct display *p, int c,
+			    int yy, int xx);
+extern void fbcon_cfb8_putcs(struct vc_data *conp, struct display *p,
+			     const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_cfb8_revc(struct display *p, int xx, int yy);
+extern void fbcon_cfb8_clear_margins(struct vc_data *conp, struct display *p);
+
+#endif /* _VIDEO_FBCON_CFB8_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-ilbm.h m68k/include/video/fbcon-ilbm.h
--- jes-2.1.119/include/video/fbcon-ilbm.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-ilbm.h	Mon Aug 31 23:10:58 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Amiga interleaved bitplanes (ilbm)
+ */
+
+#ifndef _VIDEO_FBCON_ILBM_H
+#define _VIDEO_FBCON_ILBM_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_ILBM) || defined(CONFIG_FBCON_ILBM_MODULE)  
+#define FBCON_HAS_ILBM 
+#endif
+#else
+#if defined(CONFIG_FBCON_ILBM) 
+#define FBCON_HAS_ILBM 
+#endif
+#endif
+
+extern struct display_switch fbcon_ilbm;
+extern void fbcon_ilbm_setup(struct display *p);
+extern void fbcon_ilbm_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			     int height, int width);
+extern void fbcon_ilbm_clear(struct vc_data *conp, struct display *p, int sy,
+			     int sx, int height, int width);
+extern void fbcon_ilbm_putc(struct vc_data *conp, struct display *p, int c,
+			    int yy, int xx);
+extern void fbcon_ilbm_putcs(struct vc_data *conp, struct display *p,
+			     const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_ilbm_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_ILBM_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-iplan2p2.h m68k/include/video/fbcon-iplan2p2.h
--- jes-2.1.119/include/video/fbcon-iplan2p2.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-iplan2p2.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Atari interleaved bitplanes (2 planes) (iplan2p2)
+ */
+
+#ifndef _VIDEO_FBCON_IPLAN2P2_H
+#define _VIDEO_FBCON_IPLAN2P2_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P2_MODULE)
+#define FBCON_HAS_IPLAN2P2
+#endif
+#else
+#if defined(CONFIG_FBCON_IPLAN2P2)
+#define FBCON_HAS_IPLAN2P2
+#endif
+#endif
+
+extern struct display_switch fbcon_iplan2p2;
+extern void fbcon_iplan2p2_setup(struct display *p);
+extern void fbcon_iplan2p2_bmove(struct display *p, int sy, int sx, int dy,
+				 int dx, int height, int width);
+extern void fbcon_iplan2p2_clear(struct vc_data *conp, struct display *p,
+				 int sy, int sx, int height, int width);
+extern void fbcon_iplan2p2_putc(struct vc_data *conp, struct display *p, int c,
+				int yy, int xx);
+extern void fbcon_iplan2p2_putcs(struct vc_data *conp, struct display *p,
+				 const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_iplan2p2_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_IPLAN2P2_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-iplan2p4.h m68k/include/video/fbcon-iplan2p4.h
--- jes-2.1.119/include/video/fbcon-iplan2p4.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-iplan2p4.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Atari interleaved bitplanes (4 planes) (iplan2p4)
+ */
+
+#ifndef _VIDEO_FBCON_IPLAN2P4_H
+#define _VIDEO_FBCON_IPLAN2P4_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_IPLAN2P4) || defined(CONFIG_FBCON_IPLAN2P4_MODULE)
+#define FBCON_HAS_IPLAN2P4
+#endif
+#else
+#if defined(CONFIG_FBCON_IPLAN2P4)
+#define FBCON_HAS_IPLAN2P4
+#endif
+#endif
+
+extern struct display_switch fbcon_iplan2p4;
+extern void fbcon_iplan2p4_setup(struct display *p);
+extern void fbcon_iplan2p4_bmove(struct display *p, int sy, int sx, int dy,
+				 int dx, int height, int width);
+extern void fbcon_iplan2p4_clear(struct vc_data *conp, struct display *p,
+				 int sy, int sx, int height, int width);
+extern void fbcon_iplan2p4_putc(struct vc_data *conp, struct display *p, int c,
+				int yy, int xx);
+extern void fbcon_iplan2p4_putcs(struct vc_data *conp, struct display *p,
+				 const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_iplan2p4_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_IPLAN2P4_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-iplan2p8.h m68k/include/video/fbcon-iplan2p8.h
--- jes-2.1.119/include/video/fbcon-iplan2p8.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-iplan2p8.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Atari interleaved bitplanes (8 planes) (iplan2p8)
+ */
+
+#ifndef _VIDEO_FBCON_IPLAN2P8_H
+#define _VIDEO_FBCON_IPLAN2P8_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_IPLAN2P8) || defined(CONFIG_FBCON_IPLAN2P8_MODULE)
+#define FBCON_HAS_IPLAN2P8
+#endif
+#else
+#if defined(CONFIG_FBCON_IPLAN2P8)
+#define FBCON_HAS_IPLAN2P8
+#endif
+#endif
+
+extern struct display_switch fbcon_iplan2p8;
+extern void fbcon_iplan2p8_setup(struct display *p);
+extern void fbcon_iplan2p8_bmove(struct display *p, int sy, int sx, int dy,
+				 int dx, int height, int width);
+extern void fbcon_iplan2p8_clear(struct vc_data *conp, struct display *p,
+				 int sy, int sx, int height, int width);
+extern void fbcon_iplan2p8_putc(struct vc_data *conp, struct display *p, int c,
+				int yy, int xx);
+extern void fbcon_iplan2p8_putcs(struct vc_data *conp, struct display *p,
+				 const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_iplan2p8_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_IPLAN2P8_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-mac.h m68k/include/video/fbcon-mac.h
--- jes-2.1.119/include/video/fbcon-mac.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-mac.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Mac variable bpp packed pixels (mac)
+ */
+
+#ifndef _VIDEO_FBCON_MAC_H
+#define _VIDEO_FBCON_MAC_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_MAC) || defined(CONFIG_FBCON_MAC_MODULE)
+#define FBCON_HAS_MAC
+#endif
+#else
+#if defined(CONFIG_FBCON_MAC)
+#define FBCON_HAS_MAC
+#endif
+#endif
+
+extern struct display_switch fbcon_mac;
+extern void fbcon_mac_setup(struct display *p);
+extern void fbcon_mac_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			    int height, int width);
+extern void fbcon_mac_clear(struct vc_data *conp, struct display *p, int sy,
+			    int sx, int height, int width);
+extern void fbcon_mac_putc(struct vc_data *conp, struct display *p, int c,
+			   int yy, int xx);
+extern void fbcon_mac_putcs(struct vc_data *conp, struct display *p,
+			    const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_mac_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_MAC_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-mfb.h m68k/include/video/fbcon-mfb.h
--- jes-2.1.119/include/video/fbcon-mfb.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-mfb.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for Monochrome (mfb)
+ */
+
+#ifndef _VIDEO_FBCON_MFB_H
+#define _VIDEO_FBCON_MFB_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_MFB) || defined(CONFIG_FBCON_MFB_MODULE)
+#define FBCON_HAS_MFB
+#endif
+#else
+#if defined(CONFIG_FBCON_MFB)
+#define FBCON_HAS_MFB
+#endif
+#endif
+
+extern struct display_switch fbcon_mfb;
+extern void fbcon_mfb_setup(struct display *p);
+extern void fbcon_mfb_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			    int height, int width);
+extern void fbcon_mfb_clear(struct vc_data *conp, struct display *p, int sy,
+			    int sx, int height, int width);
+extern void fbcon_mfb_putc(struct vc_data *conp, struct display *p, int c,
+			   int yy, int xx);
+extern void fbcon_mfb_putcs(struct vc_data *conp, struct display *p,
+			    const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_mfb_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_MFB_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon-vga.h m68k/include/video/fbcon-vga.h
--- jes-2.1.119/include/video/fbcon-vga.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon-vga.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,32 @@
+/*
+ *  FBcon low-level driver for VGA characters/attributes
+ */
+
+#ifndef _VIDEO_FBCON_VGA_H
+#define _VIDEO_FBCON_VGA_H
+
+#include <linux/config.h>
+
+#ifdef MODULE
+#if defined(CONFIG_FBCON_VGA) || defined(CONFIG_FBCON_VGA_MODULE)
+#define FBCON_HAS_VGA
+#endif
+#else
+#if defined(CONFIG_FBCON_VGA)
+#define FBCON_HAS_VGA
+#endif
+#endif
+
+extern struct display_switch fbcon_vga;
+extern void fbcon_vga_setup(struct display *p);
+extern void fbcon_vga_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			    int height, int width);
+extern void fbcon_vga_clear(struct vc_data *conp, struct display *p, int sy,
+			    int sx, int height, int width);
+extern void fbcon_vga_putc(struct vc_data *conp, struct display *p, int c,
+			   int yy, int xx);
+extern void fbcon_vga_putcs(struct vc_data *conp, struct display *p,
+			    const unsigned short *s, int count, int yy, int xx);
+extern void fbcon_vga_revc(struct display *p, int xx, int yy);
+
+#endif /* _VIDEO_FBCON_VGA_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/fbcon.h m68k/include/video/fbcon.h
--- jes-2.1.119/include/video/fbcon.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/fbcon.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,446 @@
+/*
+ *  linux/drivers/video/fbcon.h -- Low level frame buffer based console driver
+ *
+ *	Copyright (C) 1997 Geert Uytterhoeven
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive
+ *  for more details.
+ */
+
+#ifndef _VIDEO_FBCON_H
+#define _VIDEO_FBCON_H
+
+#include <linux/config.h>
+#include <linux/console_struct.h>
+
+
+    /*                                  
+     *  `switch' for the Low Level Operations
+     */
+ 
+struct display_switch {                                                
+    void (*setup)(struct display *p);
+    void (*bmove)(struct display *p, int sy, int sx, int dy, int dx,
+		  int height, int width);
+    /* for clear, conp may be NULL, which means use a blanking (black) color */
+    void (*clear)(struct vc_data *conp, struct display *p, int sy, int sx,
+		  int height, int width);
+    void (*putc)(struct vc_data *conp, struct display *p, int c, int yy,
+    		 int xx);
+    void (*putcs)(struct vc_data *conp, struct display *p, const unsigned short *s,
+		  int count, int yy, int xx);     
+    void (*revc)(struct display *p, int xx, int yy);
+    void (*cursor)(struct display *p, int mode, int xx, int yy);
+    int  (*set_font)(struct display *p, int width, int height);
+    void (*clear_margins)(struct vc_data *conp, struct display *p);
+    unsigned int fontwidthmask;      /* 1 at (1 << (width - 1)) if width is supported */
+}; 
+
+#define fontheight(p) ((p)->_fontheight)
+#define fontheightlog(p) ((p)->_fontheightlog)
+
+#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
+
+/* fontwidth w is supported by dispsw */
+#define FONTWIDTH(w)	(1 << ((8) - 1))
+/* fontwidths w1-w2 inclusive are supported by dispsw */
+#define FONTWIDTHRANGE(w1,w2)	FONTWIDTH(8)
+
+#define fontwidth(p) (8)
+#define fontwidthlog(p) (0)
+
+#else
+
+/* fontwidth w is supported by dispsw */
+#define FONTWIDTH(w)	(1 << ((w) - 1))
+/* fontwidths w1-w2 inclusive are supported by dispsw */
+#define FONTWIDTHRANGE(w1,w2)	(FONTWIDTH(w2+1) - FONTWIDTH(w1))
+
+#define fontwidth(p) ((p)->_fontwidth)
+#define fontwidthlog(p) ((p)->_fontwidthlog)
+
+#endif
+
+    /*
+     *  Attribute Decoding
+     */
+
+/* Color */
+#define attr_fgcol(p,s)    \
+	(((s) >> ((p)->fgshift)) & 0x0f)
+#define attr_bgcol(p,s)    \
+	(((s) >> ((p)->bgshift)) & 0x0f)
+#define	attr_bgcol_ec(p,conp) \
+	((conp) ? (((conp)->vc_video_erase_char >> ((p)->bgshift)) & 0x0f) : 0)
+
+/* Monochrome */
+#define attr_bold(p,s) \
+	((s) & 0x200)
+#define attr_reverse(p,s) \
+	(((s) & 0x800) ^ ((p)->inverse ? 0x800 : 0))
+#define attr_underline(p,s) \
+	((s) & 0x400)
+#define attr_blink(p,s) \
+	((s) & 0x8000)
+	
+    /*
+     *  Scroll Method
+     */
+     
+/* Internal flags */
+#define __SCROLL_YPAN		0x001
+#define __SCROLL_YWRAP		0x002
+#define __SCROLL_YMOVE		0x003
+#define __SCROLL_YREDRAW	0x004
+#define __SCROLL_YMASK		0x00f
+#define __SCROLL_YFIXED		0x010
+#define __SCROLL_YNOMOVE	0x020
+#define __SCROLL_YPANREDRAW	0x040
+
+/* Only these should be used by the drivers */
+/* Which one should you use? If you have a fast card and slow bus,
+   then probably just 0 to indicate fbcon should choose between
+   YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus
+   and even better if your card can do fonting (1->8/32bit painting),
+   you should consider either SCROLL_YREDRAW (if your card is
+   able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE.
+   The best is to test it with some real life scrolling (usually, not
+   all lines on the screen are filled completely with non-space characters,
+   and REDRAW performs much better on such lines, so don't cat a file
+   with every line covering all screen columns, it would not be the right
+   benchmark).
+ */
+#define SCROLL_YREDRAW		(__SCROLL_YFIXED|__SCROLL_YREDRAW)
+#define SCROLL_YNOMOVE		(__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
+
+extern void fbcon_redraw_bmove(struct display *, int, int, int, int, int, int);
+
+
+/* ================================================================= */
+/*                      Utility Assembler Functions                  */
+/* ================================================================= */
+
+
+#ifdef __mc68000__
+
+/* ====================================================================== */
+
+/* Those of a delicate disposition might like to skip the next couple of
+ * pages.
+ *
+ * These functions are drop in replacements for memmove and
+ * memset(_, 0, _). However their five instances add at least a kilobyte
+ * to the object file. You have been warned.
+ *
+ * Not a great fan of assembler for the sake of it, but I think
+ * that these routines are at least 10 times faster than their C
+ * equivalents for large blits, and that's important to the lowest level of
+ * a graphics driver. Question is whether some scheme with the blitter
+ * would be faster. I suspect not for simple text system - not much
+ * asynchrony.
+ *
+ * Code is very simple, just gruesome expansion. Basic strategy is to
+ * increase data moved/cleared at each step to 16 bytes to reduce
+ * instruction per data move overhead. movem might be faster still
+ * For more than 15 bytes, we try to align the write direction on a
+ * longword boundary to get maximum speed. This is even more gruesome.
+ * Unaligned read/write used requires 68020+ - think this is a problem?
+ *
+ * Sorry!
+ */
+
+
+/* ++roman: I've optimized Robert's original versions in some minor
+ * aspects, e.g. moveq instead of movel, let gcc choose the registers,
+ * use movem in some places...
+ * For other modes than 1 plane, lots of more such assembler functions
+ * were needed (e.g. the ones using movep or expanding color values).
+ */
+
+/* ++andreas: more optimizations:
+   subl #65536,d0 replaced by clrw d0; subql #1,d0 for dbcc
+   addal is faster than addaw
+   movep is rather expensive compared to ordinary move's
+   some functions rewritten in C for clarity, no speed loss */
+
+static __inline__ void *mymemclear_small(void *s, size_t count)
+{
+   if (!count)
+      return(0);
+
+   __asm__ __volatile__(
+         "lsrl   #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movew %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t"
+      "1: subql  #1,%1 ; jcs 3f\n\t"
+      "2: moveml %2/%3/%4/%5,%0@-\n\t"
+         "dbra %1,2b\n\t"
+      "3:"
+         : "=a" (s), "=d" (count)
+         :  "d" (0), "d" (0), "d" (0), "d" (0),
+            "0" ((char *)s+count), "1" (count)
+  );
+
+   return(0);
+}
+
+
+static __inline__ void *mymemclear(void *s, size_t count)
+{
+   if (!count)
+      return(0);
+
+   if (count < 16) {
+      __asm__ __volatile__(
+            "lsrl   #1,%1 ; jcc 1f ; clrb %0@+\n\t"
+         "1: lsrl   #1,%1 ; jcc 1f ; clrw %0@+\n\t"
+         "1: lsrl   #1,%1 ; jcc 1f ; clrl %0@+\n\t"
+         "1: lsrl   #1,%1 ; jcc 1f ; clrl %0@+ ; clrl %0@+\n\t"
+         "1:"
+            : "=a" (s), "=d" (count)
+            : "0" (s), "1" (count)
+     );
+   } else {
+      long tmp;
+      __asm__ __volatile__(
+            "movel %1,%2\n\t"
+            "lsrl   #1,%2 ; jcc 1f ; clrb %0@+ ; subqw #1,%1\n\t"
+            "lsrl   #1,%2 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
+            "clrw   %0@+  ; subqw  #2,%1 ; jra 2f\n\t"
+         "1: lsrl   #1,%2 ; jcc 2f\n\t"
+            "clrw   %0@+  ; subqw  #2,%1\n\t"
+         "2: movew %1,%2; lsrl #2,%1 ; jeq 6f\n\t"
+            "lsrl   #1,%1 ; jcc 3f ; clrl %0@+\n\t"
+         "3: lsrl   #1,%1 ; jcc 4f ; clrl %0@+ ; clrl %0@+\n\t"
+         "4: subql  #1,%1 ; jcs 6f\n\t"
+         "5: clrl %0@+; clrl %0@+ ; clrl %0@+ ; clrl %0@+\n\t"
+            "dbra %1,5b   ; clrw %1; subql #1,%1; jcc 5b\n\t"
+         "6: movew %2,%1; btst #1,%1 ; jeq 7f ; clrw %0@+\n\t"
+         "7:            ; btst #0,%1 ; jeq 8f ; clrb %0@+\n\t"
+         "8:"
+            : "=a" (s), "=d" (count), "=d" (tmp)
+            : "0" (s), "1" (count)
+     );
+   }
+
+   return(0);
+}
+
+
+static __inline__ void *mymemset(void *s, size_t count)
+{
+   if (!count)
+      return(0);
+
+   __asm__ __volatile__(
+         "lsrl   #1,%1 ; jcc 1f ; moveb %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movew %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@-\n\t"
+      "1: lsrl   #1,%1 ; jcc 1f ; movel %2,%0@- ; movel %2,%0@-\n\t"
+      "1: subql  #1,%1 ; jcs 3f\n\t"
+      "2: moveml %2/%3/%4/%5,%0@-\n\t"
+         "dbra %1,2b\n\t"
+      "3:"
+         : "=a" (s), "=d" (count)
+         :  "d" (-1), "d" (-1), "d" (-1), "d" (-1),
+            "0" ((char *) s + count), "1" (count)
+  );
+
+   return(0);
+}
+
+
+static __inline__ void *mymemmove(void *d, const void *s, size_t count)
+{
+   if (d < s) {
+      if (count < 16) {
+         __asm__ __volatile__(
+               "lsrl   #1,%2 ; jcc 1f ; moveb %1@+,%0@+\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movew %1@+,%0@+\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@+,%0@+\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t"
+            "1:"
+               : "=a" (d), "=a" (s), "=d" (count)
+               : "0" (d), "1" (s), "2" (count)
+        );
+      } else {
+         long tmp;
+         __asm__ __volatile__(
+               "movel  %0,%3\n\t"
+               "lsrl   #1,%3 ; jcc 1f ; moveb %1@+,%0@+ ; subqw #1,%2\n\t"
+               "lsrl   #1,%3 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
+               "movew  %1@+,%0@+  ; subqw  #2,%2 ; jra 2f\n\t"
+            "1: lsrl   #1,%3 ; jcc 2f\n\t"
+               "movew  %1@+,%0@+  ; subqw  #2,%2\n\t"
+            "2: movew  %2,%-; lsrl #2,%2 ; jeq 6f\n\t"
+               "lsrl   #1,%2 ; jcc 3f ; movel %1@+,%0@+\n\t"
+            "3: lsrl   #1,%2 ; jcc 4f ; movel %1@+,%0@+ ; movel %1@+,%0@+\n\t"
+            "4: subql  #1,%2 ; jcs 6f\n\t"
+            "5: movel  %1@+,%0@+;movel %1@+,%0@+\n\t"
+               "movel  %1@+,%0@+;movel %1@+,%0@+\n\t"
+               "dbra   %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t"
+            "6: movew  %+,%2; btst #1,%2 ; jeq 7f ; movew %1@+,%0@+\n\t"
+            "7:              ; btst #0,%2 ; jeq 8f ; moveb %1@+,%0@+\n\t"
+            "8:"
+               : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
+               : "0" (d), "1" (s), "2" (count)
+        );
+      }
+   } else {
+      if (count < 16) {
+         __asm__ __volatile__(
+               "lsrl   #1,%2 ; jcc 1f ; moveb %1@-,%0@-\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movew %1@-,%0@-\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@-,%0@-\n\t"
+            "1: lsrl   #1,%2 ; jcc 1f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t"
+            "1:"
+               : "=a" (d), "=a" (s), "=d" (count)
+               : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count)
+        );
+      } else {
+         long tmp;
+         __asm__ __volatile__(
+               "movel %0,%3\n\t"
+               "lsrl   #1,%3 ; jcc 1f ; moveb %1@-,%0@- ; subqw #1,%2\n\t"
+               "lsrl   #1,%3 ; jcs 2f\n\t"  /* %0 increased=>bit 2 switched*/
+               "movew  %1@-,%0@-  ; subqw  #2,%2 ; jra 2f\n\t"
+            "1: lsrl   #1,%3 ; jcc 2f\n\t"
+               "movew  %1@-,%0@-  ; subqw  #2,%2\n\t"
+            "2: movew %2,%-; lsrl #2,%2 ; jeq 6f\n\t"
+               "lsrl   #1,%2 ; jcc 3f ; movel %1@-,%0@-\n\t"
+            "3: lsrl   #1,%2 ; jcc 4f ; movel %1@-,%0@- ; movel %1@-,%0@-\n\t"
+            "4: subql  #1,%2 ; jcs 6f\n\t"
+            "5: movel %1@-,%0@-;movel %1@-,%0@-\n\t"
+               "movel %1@-,%0@-;movel %1@-,%0@-\n\t"
+               "dbra %2,5b ; clrw %2; subql #1,%2; jcc 5b\n\t"
+            "6: movew %+,%2; btst #1,%2 ; jeq 7f ; movew %1@-,%0@-\n\t"
+            "7:              ; btst #0,%2 ; jeq 8f ; moveb %1@-,%0@-\n\t"
+            "8:"
+               : "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
+               : "0" ((char *) d + count), "1" ((char *) s + count), "2" (count)
+        );
+      }
+   }
+
+   return(0);
+}
+
+
+/* ++andreas: Simple and fast version of memmove, assumes size is
+   divisible by 16, suitable for moving the whole screen bitplane */
+static __inline__ void fast_memmove(char *dst, const char *src, size_t size)
+{
+  if (!size)
+    return;
+  if (dst < src)
+    __asm__ __volatile__
+      ("1:"
+       "  moveml %0@+,%/d0/%/d1/%/a0/%/a1\n"
+       "  moveml %/d0/%/d1/%/a0/%/a1,%1@\n"
+       "  addql #8,%1; addql #8,%1\n"
+       "  dbra %2,1b\n"
+       "  clrw %2; subql #1,%2\n"
+       "  jcc 1b"
+       : "=a" (src), "=a" (dst), "=d" (size)
+       : "0" (src), "1" (dst), "2" (size / 16 - 1)
+       : "d0", "d1", "a0", "a1", "memory");
+  else
+    __asm__ __volatile__
+      ("1:"
+       "  subql #8,%0; subql #8,%0\n"
+       "  moveml %0@,%/d0/%/d1/%/a0/%/a1\n"
+       "  moveml %/d0/%/d1/%/a0/%/a1,%1@-\n"
+       "  dbra %2,1b\n"
+       "  clrw %2; subql #1,%2\n"
+       "  jcc 1b"
+       : "=a" (src), "=a" (dst), "=d" (size)
+       : "0" (src + size), "1" (dst + size), "2" (size / 16 - 1)
+       : "d0", "d1", "a0", "a1", "memory");
+}
+
+#else /* !m68k */
+
+    /*
+     *  Anyone who'd like to write asm functions for other CPUs?
+     */
+
+static __inline__ void *mymemclear_small(void *s, size_t count)
+{
+    return(memset(s, 0, count));
+}
+
+static __inline__ void *mymemclear(void *s, size_t count)
+{
+    return(memset(s, 0, count));
+}
+
+static __inline__ void *mymemset(void *s, size_t count)
+{
+    return(memset(s, 255, count));
+}
+
+#ifdef __i386__
+static __inline__ void fast_memmove(void *d, const void *s, size_t count)
+{
+    if (d < s) {
+__asm__ __volatile__ (
+	"cld\n\t"
+	"shrl $1,%%ecx\n\t"
+	"jnc 1f\n\t"
+	"movsb\n"
+	"1:\tshrl $1,%%ecx\n\t"
+	"jnc 2f\n\t"
+	"movsw\n"
+	"2:\trep\n\t"
+	"movsl"
+	: /* no output */
+	:"c"(count),"D"((long)d),"S"((long)s)
+	:"cx","di","si","memory");
+    } else {
+__asm__ __volatile__ (
+	"std\n\t"
+	"shrl $1,%%ecx\n\t"
+	"jnc 1f\n\t"
+	"movb 3(%%esi),%%al\n\t"
+	"movb %%al,3(%%edi)\n\t"
+	"decl %%esi\n\t"
+	"decl %%edi\n"
+	"1:\tshrl $1,%%ecx\n\t"
+	"jnc 2f\n\t"
+	"movw 2(%%esi),%%ax\n\t"
+	"movw %%ax,2(%%edi)\n\t"
+	"decl %%esi\n\t"
+	"decl %%edi\n\t"
+	"decl %%esi\n\t"
+	"decl %%edi\n"
+	"2:\trep\n\t"
+	"movsl\n\t"
+	"cld"
+	: /* no output */
+	:"c"(count),"D"(count-4+(long)d),"S"(count-4+(long)s)
+	:"ax","cx","di","si","memory");
+    }
+}
+
+static __inline__ void *mymemmove(char *dst, const char *src, size_t size)
+{
+    fast_memmove(dst, src, size);
+    return dst;
+}
+#else
+static __inline__ void *mymemmove(void *d, const void *s, size_t count)
+{
+    return(memmove(d, s, count));
+}
+
+static __inline__ void fast_memmove(char *dst, const char *src, size_t size)
+{
+    memmove(dst, src, size);
+}
+#endif	/* !i386 */
+
+#endif /* !m68k */
+
+#endif /* _VIDEO_FBCON_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/font.h m68k/include/video/font.h
--- jes-2.1.119/include/video/font.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/font.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,66 @@
+/*
+ *  font.h -- `Soft' font definitions
+ *
+ *  Created 1995 by Geert Uytterhoeven
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License.  See the file COPYING in the main directory of this archive
+ *  for more details.
+ */
+
+#ifndef _VIDEO_FONT_H
+#define _VIDEO_FONT_H
+
+#ifdef __ASSEMBLY__
+
+#ifdef __mc68000__
+#define FBCON_FONT_DESC_idx	0
+#define FBCON_FONT_DESC_name	(FBCON_FONT_DESC_idx   +4)
+#define FBCON_FONT_DESC_width	(FBCON_FONT_DESC_name  +4)
+#define FBCON_FONT_DESC_height	(FBCON_FONT_DESC_width +4)
+#define FBCON_FONT_DESC_data	(FBCON_FONT_DESC_height+4)
+#define FBCON_FONT_DESC_pref	(FBCON_FONT_DESC_data  +4)
+#endif
+
+#else /* __ASSEMBLY__ */
+
+#include <linux/types.h>
+
+struct fbcon_font_desc {
+    int idx;
+    char *name;
+    int width, height;
+    void *data;
+    int pref;
+};
+
+#define VGA8x8_IDX	0
+#define VGA8x16_IDX	1
+#define PEARL8x8_IDX	2
+#define VGA6x11_IDX	3
+#define SUN8x16_IDX	4
+#define SUN12x22_IDX	5
+#define ACORN8x8_IDX	6
+
+extern struct fbcon_font_desc	font_vga_8x8,
+				font_vga_8x16,
+				font_pearl_8x8,
+				font_vga_6x11,
+				font_sun_8x16,
+				font_sun_12x22,
+				font_acorn_8x8;
+
+/* Find a font with a specific name */
+
+extern struct fbcon_font_desc *fbcon_find_font(char *name);
+
+/* Get the default font for a specific screen size */
+
+extern struct fbcon_font_desc *fbcon_get_default_font(int xres, int yres);
+
+/* Max. length for the name of a predefined font */
+#define MAX_FONT_NAME	32
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* _VIDEO_FONT_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/macmodes.h m68k/include/video/macmodes.h
--- jes-2.1.119/include/video/macmodes.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/macmodes.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,64 @@
+/*
+ *  linux/drivers/video/macmodes.h -- Standard MacOS video modes
+ *
+ *	Copyright (C) 1998 Geert Uytterhoeven
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License. See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#ifndef _VIDEO_MACMODES_H
+#define _VIDEO_MACMODES_H
+
+    /*
+     *  Video mode values.
+     *  These are supposed to be the same as the values that Apple uses in
+     *  MacOS.
+     */
+
+#define VMODE_NVRAM		0
+#define VMODE_512_384_60I	1	/* 512x384, 60Hz interlaced (NTSC) */
+#define VMODE_512_384_60	2	/* 512x384, 60Hz */
+#define VMODE_640_480_50I	3	/* 640x480, 50Hz interlaced (PAL) */
+#define VMODE_640_480_60I	4	/* 640x480, 60Hz interlaced (NTSC) */
+#define VMODE_640_480_60	5	/* 640x480, 60Hz (VGA) */
+#define VMODE_640_480_67	6	/* 640x480, 67Hz */
+#define VMODE_640_870_75P	7	/* 640x870, 75Hz (portrait) */
+#define VMODE_768_576_50I	8	/* 768x576, 50Hz (PAL full frame) */
+#define VMODE_800_600_56	9	/* 800x600, 56Hz */
+#define VMODE_800_600_60	10	/* 800x600, 60Hz */
+#define VMODE_800_600_72	11	/* 800x600, 72Hz */
+#define VMODE_800_600_75	12	/* 800x600, 75Hz */
+#define VMODE_832_624_75	13	/* 832x624, 75Hz */
+#define VMODE_1024_768_60	14	/* 1024x768, 60Hz */
+#define VMODE_1024_768_70	15	/* 1024x768, 70Hz (or 72Hz?) */
+#define VMODE_1024_768_75V	16	/* 1024x768, 75Hz (VESA) */
+#define VMODE_1024_768_75	17	/* 1024x768, 75Hz */
+#define VMODE_1152_870_75	18	/* 1152x870, 75Hz */
+#define VMODE_1280_960_75	19	/* 1280x960, 75Hz */
+#define VMODE_1280_1024_75	20	/* 1280x1024, 75Hz */
+#define VMODE_MAX		20
+#define VMODE_CHOOSE		99
+
+#define CMODE_NVRAM		-1
+#define CMODE_8			0	/* 8 bits/pixel */
+#define CMODE_16		1	/* 16 (actually 15) bits/pixel */
+#define CMODE_32		2	/* 32 (actually 24) bits/pixel */
+
+
+extern int mac_vmode_to_var(int vmode, int cmode,
+			    struct fb_var_screeninfo *var);
+extern int mac_var_to_vmode(const struct fb_var_screeninfo *var, int *vmode,
+			    int *cmode);
+extern int mac_map_monitor_sense(int sense);
+
+
+    /*
+     *  Addresses in NVRAM where video mode and pixel size are stored.
+     */
+
+#define NV_VMODE		0x140f
+#define NV_CMODE		0x1410
+
+#endif /* _VIDEO_MACMODES_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/s3blit.h m68k/include/video/s3blit.h
--- jes-2.1.119/include/video/s3blit.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/s3blit.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,79 @@
+#ifndef _VIDEO_S3BLIT_H
+#define _VIDEO_S3BLIT_H
+
+/* s3 commands */
+#define S3_BITBLT       0xc011
+#define S3_TWOPOINTLINE 0x2811
+#define S3_FILLEDRECT   0x40b1
+
+#define S3_FIFO_EMPTY 0x0400
+#define S3_HDW_BUSY   0x0200
+
+/* Enhanced register mapping (MMIO mode) */
+
+#define S3_READ_SEL      0xbee8 /* offset f */
+#define S3_MULT_MISC     0xbee8 /* offset e */
+#define S3_ERR_TERM      0x92e8
+#define S3_FRGD_COLOR    0xa6e8
+#define S3_BKGD_COLOR    0xa2e8
+#define S3_PIXEL_CNTL    0xbee8 /* offset a */
+#define S3_FRGD_MIX      0xbae8
+#define S3_BKGD_MIX      0xb6e8
+#define S3_CUR_Y         0x82e8
+#define S3_CUR_X         0x86e8
+#define S3_DESTY_AXSTP   0x8ae8
+#define S3_DESTX_DIASTP  0x8ee8
+#define S3_MIN_AXIS_PCNT 0xbee8 /* offset 0 */
+#define S3_MAJ_AXIS_PCNT 0x96e8
+#define S3_CMD           0x9ae8
+#define S3_GP_STAT       0x9ae8
+#define S3_ADVFUNC_CNTL  0x4ae8
+#define S3_WRT_MASK      0xaae8
+#define S3_RD_MASK       0xaee8
+
+/* Enhanced register mapping (Packed MMIO mode, write only) */
+#define S3_ALT_CURXY     0x8100
+#define S3_ALT_CURXY2    0x8104
+#define S3_ALT_STEP      0x8108
+#define S3_ALT_STEP2     0x810c
+#define S3_ALT_ERR       0x8110
+#define S3_ALT_CMD       0x8118
+#define S3_ALT_MIX       0x8134
+#define S3_ALT_PCNT      0x8148
+#define S3_ALT_PAT       0x8168
+
+/* Drawing modes */
+#define S3_NOTCUR          0x0000
+#define S3_LOGICALZERO     0x0001
+#define S3_LOGICALONE      0x0002
+#define S3_LEAVEASIS       0x0003
+#define S3_NOTNEW          0x0004
+#define S3_CURXORNEW       0x0005
+#define S3_NOT_CURXORNEW   0x0006
+#define S3_NEW             0x0007
+#define S3_NOTCURORNOTNEW  0x0008
+#define S3_CURORNOTNEW     0x0009
+#define S3_NOTCURORNEW     0x000a
+#define S3_CURORNEW        0x000b
+#define S3_CURANDNEW       0x000c
+#define S3_NOTCURANDNEW    0x000d
+#define S3_CURANDNOTNEW    0x000e
+#define S3_NOTCURANDNOTNEW 0x000f
+
+#define S3_CRTC_ADR    0x03d4
+#define S3_CRTC_DATA   0x03d5
+
+#define S3_REG_LOCK2 0x39
+#define S3_HGC_MODE  0x45
+
+#define S3_HWGC_ORGX_H 0x46
+#define S3_HWGC_ORGX_L 0x47
+#define S3_HWGC_ORGY_H 0x48
+#define S3_HWGC_ORGY_L 0x49
+#define S3_HWGC_DX     0x4e
+#define S3_HWGC_DY     0x4f
+
+
+#define S3_LAW_CTL 0x58
+
+#endif /* _VIDEO_S3BLIT_H */
diff -u --recursive --exclude-from=/home/geert/diff-excludes-linux --new-file jes-2.1.119/include/video/sbusfb.h m68k/include/video/sbusfb.h
--- jes-2.1.119/include/video/sbusfb.h	Thu Jan  1 01:00:00 1970
+++ m68k/include/video/sbusfb.h	Mon Aug 31 23:10:59 1998
@@ -0,0 +1,138 @@
+#include <linux/timer.h>
+#include <asm/sbus.h>
+#include <asm/oplib.h>
+#include <asm/fbio.h>
+
+#include <video/fbcon.h>
+
+struct bt_regs {
+	volatile unsigned int addr;           /* address register */
+	volatile unsigned int color_map;      /* color map */
+	volatile unsigned int control;        /* control register */
+	volatile unsigned int cursor;         /* cursor map register */
+};
+
+struct fb_info_creator {
+	struct ffb_fbc *fbc;
+	struct ffb_dac *dac;
+	int dac_rev;
+	int xy_margin;
+};
+struct fb_info_cgsix {
+	struct bt_regs *bt;
+	struct cg6_fbc *fbc;
+	struct cg6_thc *thc;
+	struct cg6_tec *tec;
+	volatile u32 *fhc;
+};
+struct fb_info_bwtwo {
+	struct bw2_regs *regs;
+};
+struct fb_info_cgthree {
+	struct cg3_regs *regs;
+};
+struct fb_info_tcx {
+	struct bt_regs *bt;
+	struct tcx_thc *thc;
+	struct tcx_tec *tec;
+	u32 *cplane;
+};
+struct fb_info_leo {
+	struct leo_lx_krn *lx_krn;
+	struct leo_lc_ss0_usr *lc_ss0_usr;
+	struct leo_ld_ss0 *ld_ss0;
+	struct leo_ld_ss1 *ld_ss1;
+	struct leo_cursor *cursor;
+	unsigned int extent;
+};
+struct fb_info_cgfourteen {
+	struct cg14_regs *regs;
+	struct cg14_cursor *cursor;
+	struct cg14_clut *clut;
+	int ramsize;
+	int mode;
+};
+
+struct cg_cursor {
+	char	enable;         /* cursor is enabled */
+	char	mode;		/* cursor mode */
+	struct	fbcurpos cpos;  /* position */
+	struct	fbcurpos chot;  /* hot-spot */
+	struct	fbcurpos size;  /* size of mask & image fields */
+	struct	fbcurpos hwsize; /* hw max size */
+	int	bits[2][128];   /* space for mask & image bits */
+	char	color [6];      /* cursor colors */
+	struct	timer_list timer; /* cursor timer */
+	int	blink_rate;	/* cursor blink rate */
+};
+
+struct sbus_mmap_map {
+	unsigned long voff;
+	unsigned long poff;
+	unsigned long size;
+};
+
+#define SBUS_MMAP_FBSIZE(n) (-n)
+#define SBUS_MMAP_EMPTY	0x80000000
+
+struct fb_info_sbusfb {
+	struct fb_info info;
+	struct fb_fix_screeninfo fix;
+	struct fb_var_screeninfo var;
+	struct display disp;
+	struct display_switch dispsw;
+	struct fbtype type;
+	struct linux_sbus_device *sbdp;
+	int prom_node, prom_parent;
+	union {
+		struct fb_info_creator ffb;
+		struct fb_info_cgsix cg6;
+		struct fb_info_bwtwo bw2;
+		struct fb_info_cgthree cg3;
+		struct fb_info_tcx tcx;
+		struct fb_info_leo leo;
+		struct fb_info_cgfourteen cg14;
+	} s;
+	unsigned char *color_map;
+	struct cg_cursor cursor;
+	unsigned char open;
+	unsigned char mmaped;
+	unsigned char blanked;
+	int x_margin;
+	int y_margin;
+	int vtconsole;
+	int consolecnt;
+	int graphmode;
+	int emulations[4];
+	struct sbus_mmap_map *mmap_map;
+	unsigned long physbase;
+	int iospace;
+	/* Methods */
+	void (*setup)(struct display *);
+	void (*setcursor)(struct fb_info_sbusfb *);
+	void (*setcurshape)(struct fb_info_sbusfb *);
+	void (*setcursormap)(struct fb_info_sbusfb *, unsigned char *, unsigned char *, unsigned char *);
+	void (*loadcmap)(struct fb_info_sbusfb *, int, int);
+	void (*blank)(struct fb_info_sbusfb *);
+	void (*unblank)(struct fb_info_sbusfb *);
+	void (*margins)(struct fb_info_sbusfb *, struct display *, int, int);
+	void (*reset)(struct fb_info_sbusfb *);
+	void (*fill)(struct fb_info_sbusfb *, struct display *, int, int, unsigned short *);
+	void (*switch_from_graph)(struct fb_info_sbusfb *);
+	void (*restore_palette)(struct fb_info_sbusfb *);
+	int (*ioctl)(struct fb_info_sbusfb *, unsigned int, unsigned long);
+};
+
+extern char *creatorfb_init(struct fb_info_sbusfb *);
+extern char *cgsixfb_init(struct fb_info_sbusfb *);
+extern char *cgthreefb_init(struct fb_info_sbusfb *);
+extern char *tcxfb_init(struct fb_info_sbusfb *);
+extern char *leofb_init(struct fb_info_sbusfb *);
+extern char *bwtwofb_init(struct fb_info_sbusfb *);
+extern char *cgfourteenfb_init(struct fb_info_sbusfb *);
+
+#define sbusfbinfod(disp) ((struct fb_info_sbusfb *)(disp->fb_info))
+#define sbusfbinfo(info) ((struct fb_info_sbusfb *)(info))
+#define CM(i, j) [3*(i)+(j)]
+
+#define SBUSFBINIT_SIZECHANGE ((char *)-1)

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

