Date: Tue, 13 Jan 1998 10:27:49 +0100 (CET)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: L68K: More frame buffer patches...
Sender: owner-linux-m68k@phil.uni-sb.de


Here are some more patches to clean up the frame buffer...

  - Moved the accelerated fbcon-* drivers to their corresponding frame buffer
    device.
  - Generic fbcon-* drivers can no longer be modules, but of course frame
    buffer devices still can.
  - Moved the #@@!@# console defines from include/linux/console_struct.h
    to drivers/char/console_macros.h. I don't know why they ever got in
    include/linux, since they are used by {console,console.new}.c only. Now
    we can restart using simple variable names like `x', `y' and `color'.
  - Changed return type of basic console operations from int to void since they
    are supposed to succeed (console.h).
  - Split cyberfb.c into cyberfb.c (CV64, i.e. Trio) and virgefb.c (CV64/3D
    i.e. ViRGE).
  - Removed some intelligence from fbcon.c: pointers to low level console
    operations (struct display_switch) are no longer filled in by fbcon.c.
    This is now done by the frame buffer device itself since the frame buffer
    device knows best which operations are suitable. Can someone verify this
    for atafb?
    You can use this feature to disguise a real (VGA?) text mode frame buffer
    device like a graphical frame buffer device. Now we only need to propagate
    the KDSETMODE ioctl to the frame buffer device to have support for
    graphics<->text switching on boards that have the appropriate hardware.
  - If you're running on a Mac and the fontwidth isn't 8, fbcon.c will override
    the dispsw to fbcon_mac to support 6x11 fonts (this is a hack).
  - More 64-bit cleanups.

The patch is relative to Linux/m68k-yesterday (i.e. after mine and Andreas'
patches).

--- m68k-2.1.77/include/linux/fb.h.orig	Fri Jan  9 01:33:23 1998
+++ m68k-2.1.77/include/linux/fb.h	Tue Jan 13 00:08:24 1998
@@ -260,59 +260,28 @@
     /*
      *  This structure abstracts from the underlying hardware. It is not
      *  mandatory but used by the `generic' frame buffer operations.
+     *  Read drivers/video/skeletonfb.c for more information.
      */
 
 struct fbgen_hwswitch {
-    int (*detect)(void);
-    /* This function should detect the current video mode settings and	*/
-    /* store them in xxxfb_predefined[0] for later reference by the	*/
-    /* user. Return the index+1 of an equivalent predefined mode or 0	*/
-    /* if there is no such.						*/
-
+    void (*detect)(void);
     int (*encode_fix)(struct fb_fix_screeninfo *fix, const void *par,
 		      struct fb_info_gen *info);
-    /* This function should fill in the 'fix' structure based on the	*/
-    /* values in the 'par' structure.					*/
-
     int (*decode_var)(const struct fb_var_screeninfo *var, void *par,
 		      struct fb_info_gen *info);
-    /* Get the video params out of 'var'. If a value doesn't fit, round	*/
-    /* it up, if it's too big, return EINVAL.				*/
-    /* Round up in the following order: bits_per_pixel, xres, yres,	*/
-    /* xres_virtual, yres_virtual, xoffset, yoffset, grayscale,		*/
-    /* bitfields, horizontal timing, vertical timing.			*/
-
     int (*encode_var)(struct fb_var_screeninfo *var, const void *par,
 		      struct fb_info_gen *info);
-    /* Fill the 'var' structure based on the values in 'par' and maybe	*/
-    /* other values read out of the hardware.				*/
-
     void (*get_par)(void *par, struct fb_info_gen *info);
-    /* Fill the hardware's 'par' structure.				*/
-
     void (*set_par)(const void *par, struct fb_info_gen *info);
-    /* Set the hardware according to 'par'.				*/
-
     int (*getcolreg)(unsigned regno, unsigned *red, unsigned *green,
 		     unsigned *blue, unsigned *transp, struct fb_info *info);
-    /* Read a single color register and split it into			*/
-    /* colors/transparent. Return != 0 for invalid regno.		*/
-
     int (*setcolreg)(unsigned regno, unsigned red, unsigned green,
 		     unsigned blue, unsigned transp, struct fb_info *info);
-    /* 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.	*/
-
     int (*pan_display)(const struct fb_var_screeninfo *var,
 		       struct fb_info_gen *info);
-    /* Pan the display (using the current `par' structure).		*/
-
     int (*blank)(int blank_mode, struct fb_info_gen *info);
-    /* Blank the screen if blank_mode != 0, else unblank. If NULL then	*/
-    /* blanking is done by setting the CLUT to black. Return != 0 if	*/
-    /* un-/blanking failed due to e.g. video mode which doesn't support	*/
-    /* it. */
+    struct display_switch *(*get_dispsw)(const void *par,
+					 struct fb_info_gen *info);
 };
 
 struct fb_info_gen {
--- m68k-2.1.77/include/linux/console_struct.h.orig	Fri Jan  9 01:33:19 1998
+++ m68k-2.1.77/include/linux/console_struct.h	Sun Jan 11 23:48:10 1998
@@ -95,79 +95,3 @@
 };
 
 extern struct vc vc_cons [MAX_NR_CONSOLES];
-
-#define cons_num	(vc_cons[currcons].d->vc_num)
-#define sw		(vc_cons[currcons].d->vc_sw)
-#define screenbuf_size	(vc_cons[currcons].d->vc_screenbuf_size)
-#define origin		(vc_cons[currcons].d->vc_origin)
-#define scr_end	(vc_cons[currcons].d->vc_scr_end)
-#define pos		(vc_cons[currcons].d->vc_pos)
-#define top		(vc_cons[currcons].d->vc_top)
-#define bottom		(vc_cons[currcons].d->vc_bottom)
-#define x		(vc_cons[currcons].d->vc_x)
-#define y		(vc_cons[currcons].d->vc_y)
-#define vc_state	(vc_cons[currcons].d->vc_state)
-#define npar		(vc_cons[currcons].d->vc_npar)
-#define par		(vc_cons[currcons].d->vc_par)
-#define ques		(vc_cons[currcons].d->vc_ques)
-#define attr		(vc_cons[currcons].d->vc_attr)
-#define saved_x	(vc_cons[currcons].d->vc_saved_x)
-#define saved_y	(vc_cons[currcons].d->vc_saved_y)
-#define translate	(vc_cons[currcons].d->vc_translate)
-#define G0_charset	(vc_cons[currcons].d->vc_G0_charset)
-#define G1_charset	(vc_cons[currcons].d->vc_G1_charset)
-#define saved_G0	(vc_cons[currcons].d->vc_saved_G0)
-#define saved_G1	(vc_cons[currcons].d->vc_saved_G1)
-#define utf		(vc_cons[currcons].d->vc_utf)
-#define utf_count	(vc_cons[currcons].d->vc_utf_count)
-#define utf_char	(vc_cons[currcons].d->vc_utf_char)
-#define video_mem_start (vc_cons[currcons].d->vc_video_mem_start)
-#define video_mem_end	(vc_cons[currcons].d->vc_video_mem_end)
-#define video_erase_char (vc_cons[currcons].d->vc_video_erase_char)
-#define disp_ctrl	(vc_cons[currcons].d->vc_disp_ctrl)
-#define toggle_meta	(vc_cons[currcons].d->vc_toggle_meta)
-#define decscnm	(vc_cons[currcons].d->vc_decscnm)
-#define decom		(vc_cons[currcons].d->vc_decom)
-#define decawm		(vc_cons[currcons].d->vc_decawm)
-#define deccm		(vc_cons[currcons].d->vc_deccm)
-#define decim		(vc_cons[currcons].d->vc_decim)
-#define deccolm	(vc_cons[currcons].d->vc_deccolm)
-#define need_wrap	(vc_cons[currcons].d->vc_need_wrap)
-#define has_scrolled	(vc_cons[currcons].d->vc_has_scrolled)
-#define kmalloced	(vc_cons[currcons].d->vc_kmalloced)
-#define report_mouse	(vc_cons[currcons].d->vc_report_mouse)
-#define color		(vc_cons[currcons].d->vc_color)
-#define s_color	(vc_cons[currcons].d->vc_s_color)
-#define def_color	(vc_cons[currcons].d->vc_def_color)
-#define 	foreground	(color & 0x0f)
-#define 	background	(color & 0xf0)
-#define charset	(vc_cons[currcons].d->vc_charset)
-#define s_charset	(vc_cons[currcons].d->vc_s_charset)
-#define	intensity	(vc_cons[currcons].d->vc_intensity)
-#define	underline	(vc_cons[currcons].d->vc_underline)
-#define	blink		(vc_cons[currcons].d->vc_blink)
-#define	reverse		(vc_cons[currcons].d->vc_reverse)
-#define	s_intensity	(vc_cons[currcons].d->vc_s_intensity)
-#define	s_underline	(vc_cons[currcons].d->vc_s_underline)
-#define	s_blink		(vc_cons[currcons].d->vc_s_blink)
-#define	s_reverse	(vc_cons[currcons].d->vc_s_reverse)
-#define	ulcolor		(vc_cons[currcons].d->vc_ulcolor)
-#define	halfcolor	(vc_cons[currcons].d->vc_halfcolor)
-#define tab_stop	(vc_cons[currcons].d->vc_tab_stop)
-#define palette		(vc_cons[currcons].d->vc_palette)
-#define bell_pitch	(vc_cons[currcons].d->vc_bell_pitch)
-#define bell_duration	(vc_cons[currcons].d->vc_bell_duration)
-
-#define cursor_type	(vc_cons[currcons].d->vc_cursor_type)
-#define CUR_DEF		0
-#define CUR_NONE	1
-#define CUR_UNDERLINE	2
-#define CUR_LOWER_THIRD	3
-#define CUR_LOWER_HALF	4
-#define CUR_TWO_THIRDS	5
-#define CUR_BLOCK	6
-#define CUR_HWMASK	0x0f
-#define CUR_SWMASK	0xfff0
-
-#define vcmode		(vt_cons[currcons]->vc_mode)
-#define structsize	(sizeof(struct vc_data) + sizeof(struct vt_struct))
--- m68k-2.1.77/include/linux/console.h.orig	Fri Jan  9 01:22:51 1998
+++ m68k-2.1.77/include/linux/console.h	Sun Jan 11 23:58:41 1998
@@ -29,13 +29,13 @@
 struct consw {
 	unsigned long	(*con_startup)(unsigned long, const char **);
 	void	(*con_init)(struct vc_data *);
-	int	(*con_deinit)(struct vc_data *);
-	int	(*con_clear)(struct vc_data *, int, int, int, int);
-	int	(*con_putc)(struct vc_data *, int, int, int);
-	int	(*con_putcs)(struct vc_data *, const char *, int, int, int);
-	int	(*con_cursor)(struct vc_data *, int);
-	int	(*con_scroll)(struct vc_data *, int, int, int, int);
-	int	(*con_bmove)(struct vc_data *, int, int, int, int, int, int);
+	void	(*con_deinit)(struct vc_data *);
+	void	(*con_clear)(struct vc_data *, int, int, int, int);
+	void	(*con_putc)(struct vc_data *, int, int, int);
+	void	(*con_putcs)(struct vc_data *, const char *, int, int, int);
+	void	(*con_cursor)(struct vc_data *, int);
+	void	(*con_scroll)(struct vc_data *, int, int, int, int);
+	void	(*con_bmove)(struct vc_data *, int, int, int, int, int, int);
 	int	(*con_switch)(struct vc_data *);
 	int	(*con_blank)(int);
 	int	(*con_get_font)(struct vc_data *, int *, int *, char *);
--- m68k-2.1.77/drivers/char/fbmem.c.orig	Fri Jan  9 01:19:33 1998
+++ m68k-2.1.77/drivers/char/fbmem.c	Sun Jan 11 01:29:53 1998
@@ -61,7 +61,12 @@
 extern unsigned long mach64fb_init(unsigned long mem_start);
 extern void mach64fb_setup(char *options, int *ints);
 extern unsigned long tgafb_init(unsigned long mem_start);
+extern unsigned long virgefb_init(unsigned long mem_start);
+extern void virgefb_setup(char *options, int *ints);
 extern void resolver_video_setup(char *options, int *ints);
+extern unsigned long s3triofb_init(unsigned long mem_start);
+extern void s3trio_video_setup(char *options, int *ints);
+
 
 static struct {
 	const char *name;
@@ -98,13 +103,20 @@
 #ifdef CONFIG_FB_MACH64
       { "mach64", mach64fb_init, mach64fb_setup },
 #endif
+#ifdef CONFIG_FB_S3TRIO
+        { "s3trio",s3triofb_init,s3trio_video_setup },
+#endif 
 #ifdef CONFIG_FB_TGA
       { "tga", tgafb_init, NULL },
 #endif
+#ifdef CONFIG_FB_CYBER
+	{ "virge", virgefb_init, virgefb_setup },
+#endif
 #ifdef CONFIG_GSP_RESOLVER
 	/* Not a real frame buffer device... */
 	{ "resolver", NULL, resolver_video_setup },
 #endif
+
 };
 
 #define NUM_FB_DRIVERS	(sizeof(fb_drivers)/sizeof(*fb_drivers))
--- m68k-2.1.77/drivers/char/console_macros.h.orig	Sun Jan 11 23:14:18 1998
+++ m68k-2.1.77/drivers/char/console_macros.h	Sun Jan 11 23:48:45 1998
@@ -0,0 +1,75 @@
+#define cons_num	(vc_cons[currcons].d->vc_num)
+#define sw		(vc_cons[currcons].d->vc_sw)
+#define screenbuf_size	(vc_cons[currcons].d->vc_screenbuf_size)
+#define origin		(vc_cons[currcons].d->vc_origin)
+#define scr_end	(vc_cons[currcons].d->vc_scr_end)
+#define pos		(vc_cons[currcons].d->vc_pos)
+#define top		(vc_cons[currcons].d->vc_top)
+#define bottom		(vc_cons[currcons].d->vc_bottom)
+#define x		(vc_cons[currcons].d->vc_x)
+#define y		(vc_cons[currcons].d->vc_y)
+#define vc_state	(vc_cons[currcons].d->vc_state)
+#define npar		(vc_cons[currcons].d->vc_npar)
+#define par		(vc_cons[currcons].d->vc_par)
+#define ques		(vc_cons[currcons].d->vc_ques)
+#define attr		(vc_cons[currcons].d->vc_attr)
+#define saved_x	(vc_cons[currcons].d->vc_saved_x)
+#define saved_y	(vc_cons[currcons].d->vc_saved_y)
+#define translate	(vc_cons[currcons].d->vc_translate)
+#define G0_charset	(vc_cons[currcons].d->vc_G0_charset)
+#define G1_charset	(vc_cons[currcons].d->vc_G1_charset)
+#define saved_G0	(vc_cons[currcons].d->vc_saved_G0)
+#define saved_G1	(vc_cons[currcons].d->vc_saved_G1)
+#define utf		(vc_cons[currcons].d->vc_utf)
+#define utf_count	(vc_cons[currcons].d->vc_utf_count)
+#define utf_char	(vc_cons[currcons].d->vc_utf_char)
+#define video_mem_start (vc_cons[currcons].d->vc_video_mem_start)
+#define video_mem_end	(vc_cons[currcons].d->vc_video_mem_end)
+#define video_erase_char (vc_cons[currcons].d->vc_video_erase_char)
+#define disp_ctrl	(vc_cons[currcons].d->vc_disp_ctrl)
+#define toggle_meta	(vc_cons[currcons].d->vc_toggle_meta)
+#define decscnm	(vc_cons[currcons].d->vc_decscnm)
+#define decom		(vc_cons[currcons].d->vc_decom)
+#define decawm		(vc_cons[currcons].d->vc_decawm)
+#define deccm		(vc_cons[currcons].d->vc_deccm)
+#define decim		(vc_cons[currcons].d->vc_decim)
+#define deccolm	(vc_cons[currcons].d->vc_deccolm)
+#define need_wrap	(vc_cons[currcons].d->vc_need_wrap)
+#define has_scrolled	(vc_cons[currcons].d->vc_has_scrolled)
+#define kmalloced	(vc_cons[currcons].d->vc_kmalloced)
+#define report_mouse	(vc_cons[currcons].d->vc_report_mouse)
+#define color		(vc_cons[currcons].d->vc_color)
+#define s_color	(vc_cons[currcons].d->vc_s_color)
+#define def_color	(vc_cons[currcons].d->vc_def_color)
+#define 	foreground	(color & 0x0f)
+#define 	background	(color & 0xf0)
+#define charset	(vc_cons[currcons].d->vc_charset)
+#define s_charset	(vc_cons[currcons].d->vc_s_charset)
+#define	intensity	(vc_cons[currcons].d->vc_intensity)
+#define	underline	(vc_cons[currcons].d->vc_underline)
+#define	blink		(vc_cons[currcons].d->vc_blink)
+#define	reverse		(vc_cons[currcons].d->vc_reverse)
+#define	s_intensity	(vc_cons[currcons].d->vc_s_intensity)
+#define	s_underline	(vc_cons[currcons].d->vc_s_underline)
+#define	s_blink		(vc_cons[currcons].d->vc_s_blink)
+#define	s_reverse	(vc_cons[currcons].d->vc_s_reverse)
+#define	ulcolor		(vc_cons[currcons].d->vc_ulcolor)
+#define	halfcolor	(vc_cons[currcons].d->vc_halfcolor)
+#define tab_stop	(vc_cons[currcons].d->vc_tab_stop)
+#define palette		(vc_cons[currcons].d->vc_palette)
+#define bell_pitch	(vc_cons[currcons].d->vc_bell_pitch)
+#define bell_duration	(vc_cons[currcons].d->vc_bell_duration)
+
+#define cursor_type	(vc_cons[currcons].d->vc_cursor_type)
+#define CUR_DEF		0
+#define CUR_NONE	1
+#define CUR_UNDERLINE	2
+#define CUR_LOWER_THIRD	3
+#define CUR_LOWER_HALF	4
+#define CUR_TWO_THIRDS	5
+#define CUR_BLOCK	6
+#define CUR_HWMASK	0x0f
+#define CUR_SWMASK	0xfff0
+
+#define vcmode		(vt_cons[currcons]->vc_mode)
+#define structsize	(sizeof(struct vc_data) + sizeof(struct vt_struct))
--- m68k-2.1.77/drivers/char/console.new.c.orig	Fri Jan  9 01:23:46 1998
+++ m68k-2.1.77/drivers/char/console.new.c	Sun Jan 11 23:50:23 1998
@@ -147,6 +147,8 @@
 #define INCLUDE_LINUX_LOGO_DATA
 #include <asm/linux_logo.h>
 
+#include "console_macros.h"
+
 
 struct consw *conswitchp = NULL;
 
--- m68k-2.1.77/drivers/char/console.c.orig	Sun Dec  7 22:21:53 1997
+++ m68k-2.1.77/drivers/char/console.c	Sun Jan 11 23:49:53 1998
@@ -117,6 +117,8 @@
 #include <linux/selection.h>
 #include <linux/console_struct.h>
 
+#include "console_macros.h"
+
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
 #endif
--- m68k-2.1.77/drivers/video/amifb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/amifb.c	Sun Jan 11 01:11:13 1998
@@ -60,6 +60,10 @@
 #include <asm/amigaints.h>
 #include <asm/setup.h>
 
+#include "fbcon-afb.h"
+#include "fbcon-ilbm.h"
+
+
 #define DEBUG
 
 #if !defined(CONFIG_FB_AMIGA_OCS) && !defined(CONFIG_FB_AMIGA_ECS) && !defined(CONFIG_FB_AMIGA_AGA)
@@ -1495,6 +1499,10 @@
 			display->line_length = fix.line_length;
 			display->can_soft_blank = 1;
 			display->inverse = amifb_inverse;
+			if (amifb_ilbm)
+			    display->dispsw = &fbcon_ilbm;
+			else
+			    display->dispsw = &fbcon_afb;
 			if (fb_info.changevar)
 				(*fb_info.changevar)(con);
 		}
--- m68k-2.1.77/drivers/video/atafb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/atafb.c	Sun Jan 11 17:30:24 1998
@@ -71,6 +71,14 @@
 #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"
+
+
 #define SWITCH_ACIA 0x01		/* modes for switch on OverScan */
 #define SWITCH_SND6 0x40
 #define SWITCH_SND7 0x80
@@ -239,10 +247,6 @@
 extern int fontwidth_8x16;
 extern unsigned char fontdata_8x16[];
 
-/* import first 16 colors from fbcon.c */
-extern unsigned short cfb16_cmap[16];
-
-
 /* ++roman: This structure abstracts from the underlying hardware (ST(e),
  * TT, or Falcon.
  *
@@ -2428,6 +2432,7 @@
 atafb_set_disp(int con, struct fb_info *info)
 {
 	struct fb_fix_screeninfo fix;
+	struct fb_var_screeninfo var;
 	struct display *display;
 
 	if (con >= 0)
@@ -2436,6 +2441,7 @@
 		display = &disp;	/* used during initialization */
 
 	atafb_get_fix(&fix, con, info);
+	atafb_get_var(&var, con, info);
 	if (con == -1)
 		con=0;
 	display->screen_base = (u_char *)fix.smem_start;
@@ -2452,6 +2458,42 @@
 		display->can_soft_blank = 1;
 	display->inverse =
 	    (fix.visual == FB_VISUAL_MONO01 ? !inverse : inverse);
+	switch (fix.type) {
+	    case FB_TYPE_INTERLEAVED_PLANES:
+		switch (var.bits_per_pixel) {
+		    case 2:
+			display->dispsw = &fbcon_iplan2p2;
+			break;
+		    case 4:
+			display->dispsw = &fbcon_iplan2p4;
+			break;
+		    case 8:
+			display->dispsw = &fbcon_iplan2p8;
+			break;
+		    default:
+			display->dispsw = NULL;
+			break;
+		}
+		break;
+	    case FB_TYPE_PACKED_PIXELS:
+		switch (var.bits_per_pixel) {
+		    case 1:
+			display->dispsw = &fbcon_mfb;
+			break;
+		    case 8:
+			display->dispsw = &fbcon_cfb8;
+			break;
+		    case 16:
+			display->dispsw = &fbcon_cfb16;
+			break;
+		    default:
+			display->dispsw = NULL;
+			break;
+		}
+	    default:
+		display->dispsw = NULL;
+		break;
+	}
 }
 
 static int
--- m68k-2.1.77/drivers/video/dnfb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/dnfb.c	Sun Jan 11 15:54:54 1998
@@ -15,6 +15,9 @@
 #include <linux/fb.h>
 #include <linux/module.h>
 
+#include "fbcon-mfb.h"
+
+
 /* apollo video HW definitions */
 
 /*
@@ -303,6 +306,7 @@
    disp[con].can_soft_blank = 1;
    disp[con].inverse = 0;
    disp[con].line_length = fix.line_length;
+   disp[con].dispsw = &fbcon_mfb;
 }
   
 unsigned long dnfb_init(unsigned long mem_start)
--- m68k-2.1.77/drivers/video/fbcon-afb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-afb.c	Sun Jan 11 17:32:01 1998
@@ -16,74 +16,161 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
+#include "fbcon-afb.h"
 
 
     /*
-     *  Prototypes
-     */
-
-static int open_afb(struct display *p);
-static void release_afb(void);
-static void bmove_afb(struct display *p, int sy, int sx, int dy, int dx,
-	              int height, int width);
-static void clear_afb(struct vc_data *conp, struct display *p, int sy, int sx,
-	              int height, int width);
-static void putc_afb(struct vc_data *conp, struct display *p, int c, int yy,
-	             int xx);
-static void putcs_afb(struct vc_data *conp, struct display *p, const char *s,
-	              int count, int yy, int xx);
-static void rev_char_afb(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_afb = {
-    open_afb, release_afb, bmove_afb, clear_afb, putc_afb, putcs_afb,
-    rev_char_afb
-};
-
-    /*
      *  Bitplanes ŕ la Amiga
      */
 
-static u_char expand_table[1024];
+static u8 expand_table[1024] = {
+    /*  bg = fg = 0 */
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    /* bg = 0, fg = 1 */
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+    0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+    0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+    0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+    0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+    0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+    0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+    0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+    0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+    0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+    0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+    0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+    0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+    0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+    0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+    0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+    0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+    0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
+    /* bg = 1, fg = 0 */
+    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+    0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0,
+    0xef, 0xee, 0xed, 0xec, 0xeb, 0xea, 0xe9, 0xe8,
+    0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, 0xe1, 0xe0,
+    0xdf, 0xde, 0xdd, 0xdc, 0xdb, 0xda, 0xd9, 0xd8,
+    0xd7, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd1, 0xd0,
+    0xcf, 0xce, 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc8,
+    0xc7, 0xc6, 0xc5, 0xc4, 0xc3, 0xc2, 0xc1, 0xc0,
+    0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
+    0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0,
+    0xaf, 0xae, 0xad, 0xac, 0xab, 0xaa, 0xa9, 0xa8,
+    0xa7, 0xa6, 0xa5, 0xa4, 0xa3, 0xa2, 0xa1, 0xa0,
+    0x9f, 0x9e, 0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98,
+    0x97, 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90,
+    0x8f, 0x8e, 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88,
+    0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80,
+    0x7f, 0x7e, 0x7d, 0x7c, 0x7b, 0x7a, 0x79, 0x78,
+    0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71, 0x70,
+    0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, 0x68,
+    0x67, 0x66, 0x65, 0x64, 0x63, 0x62, 0x61, 0x60,
+    0x5f, 0x5e, 0x5d, 0x5c, 0x5b, 0x5a, 0x59, 0x58,
+    0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, 0x50,
+    0x4f, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49, 0x48,
+    0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, 0x40,
+    0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38,
+    0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30,
+    0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28,
+    0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20,
+    0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,
+    0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
+    0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
+    0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
+    /* bg = fg = 1 */
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
 
-static int open_afb(struct display *p)
+void fbcon_afb_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PLANES)
-	return -EINVAL;
-
     if (p->line_length)
 	p->next_line = p->line_length;
     else
 	p->next_line = p->var.xres_virtual>>3;
     p->next_plane = p->var.yres_virtual*p->next_line;
-    MOD_INC_USE_COUNT;
-    if (!expand_table[1023]) {
-	/* initialise the table */
-	u_short i;
-	for (i = 0; i < 256; i++) {
-	    expand_table[i] = 0;	/* bg = fg = 0 */
-	    expand_table[i+256] = i;	/* bg = 0, fg = 1 */
-	    expand_table[i+512] = ~i;	/* bg = 1, fg = 0 */
-	    expand_table[i+768] = 0xff;	/* bg = fg = 1 */
-	}
-    }
-    return 0;
 }
 
-static void release_afb(void)
+void fbcon_afb_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		     int height, int width)
 {
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_afb(struct display *p, int sy, int sx, int dy, int dx,
-	              int height, int width)
-{
-    u_char *src, *dest, *src0, *dest0;
+    u8 *src, *dest, *src0, *dest0;
     u_short i, j;
 
     if (sx == 0 && dx == 0 && width == p->next_line) {
@@ -130,10 +217,10 @@
     }
 }
 
-static void clear_afb(struct vc_data *conp, struct display *p, int sy, int sx,
-	              int height, int width)
+void fbcon_afb_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		     int height, int width)
 {
-    u_char *dest, *dest0;
+    u8 *dest, *dest0;
     u_short i, j;
     int bg;
 
@@ -156,10 +243,10 @@
     } while (--i);
 }
 
-static void putc_afb(struct vc_data *conp, struct display *p, int c, int yy,
-	             int xx)
+void fbcon_afb_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		    int xx)
 {
-    u_char *dest, *dest0, *cdat, *cdat0, *expand;
+    u8 *dest, *dest0, *cdat, *cdat0, *expand;
     u_short i, j;
     int fg, bg;
 
@@ -195,13 +282,13 @@
      *  (cfr. fbcon_putcs_ilbm())
      */
 
-static void putcs_afb(struct vc_data *conp, struct display *p, const char *s,
-	              int count, int yy, int xx)
+void fbcon_afb_putcs(struct vc_data *conp, struct display *p, const char *s,
+		     int count, int yy, int xx)
 {
-    u_char *dest, *dest0, *dest1, *expand;
-    u_char *cdat1, *cdat2, *cdat3, *cdat4, *cdat10, *cdat20, *cdat30, *cdat40;
+    u8 *dest, *dest0, *dest1, *expand;
+    u8 *cdat1, *cdat2, *cdat3, *cdat4, *cdat10, *cdat20, *cdat30, *cdat40;
     u_short i, j;
-    u_char c1, c2, c3, c4;
+    u8 c1, c2, c3, c4;
     int fg0, bg0, fg, bg;
 
     dest0 = p->screen_base+yy*p->fontheight*p->next_line+xx;
@@ -290,9 +377,9 @@
 	}
 }
 
-static void rev_char_afb(struct display *p, int xx, int yy)
+void fbcon_afb_revc(struct display *p, int xx, int yy)
 {
-    u_char *dest, *dest0;
+    u8 *dest, *dest0;
     u_short i, j;
     int mask;
 
@@ -321,18 +408,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_afb(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_afb, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_afb);
-}
-#endif /* MODULE */
+struct display_switch fbcon_afb = {
+    fbcon_afb_setup, fbcon_afb_bmove, fbcon_afb_clear, fbcon_afb_putc,
+    fbcon_afb_putcs, fbcon_afb_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_afb);
+EXPORT_SYMBOL(fbcon_afb_setup);
+EXPORT_SYMBOL(fbcon_afb_bmove);
+EXPORT_SYMBOL(fbcon_afb_clear);
+EXPORT_SYMBOL(fbcon_afb_putc);
+EXPORT_SYMBOL(fbcon_afb_putcs);
+EXPORT_SYMBOL(fbcon_afb_revc);
--- m68k-2.1.77/drivers/video/fbcon-aty.c.orig	Fri Jan  9 01:24:19 1998
+++ m68k-2.1.77/drivers/video/fbcon-aty.c	Mon Jan 12 23:12:56 1998
@@ -1,213 +0,0 @@
-/*
- *  linux/drivers/video/fbcon-aty.c -- Low level frame buffer operations for 8
- *				       bpp packed pixels on ATI (accelerated)
- *
- *	Copyright (C) 1997 Geert Uytterhoeven
- *
- *  This driver is based on fbcon-cfb8.c and on fbcon-mach64.c by Bernd Harries
- *
- *  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/module.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/string.h>
-#include <linux/config.h>
-#include <linux/fb.h>
-
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_aty(struct display *p);
-static void release_aty(void);
-static void bmove_aty(struct display *p, int sy, int sx, int dy, int dx,
-		      int height, int width);
-static void clear_aty(struct vc_data *conp, struct display *p, int sy, int sx,
-		      int height, int width);
-static void putc_aty(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_aty(struct vc_data *conp, struct display *p, const char *s,
-		      int count, int yy, int xx);
-static void rev_char_aty(struct display *p, int xx, int yy);
-
-
-    /*
-     *  Accelerated functions in atyfb.c
-     */
-
-extern void aty_waitblit(void);
-extern void aty_rectcopy(int srcx, int srcy, int dstx, int dsty, u_int width,
-			 u_int height);
-extern void aty_rectfill(int dstx, int dsty, u_int width, u_int height,
-			 u_int fcolor);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_aty = {
-    open_aty, release_aty, bmove_aty, clear_aty, putc_aty, putcs_aty,
-    rev_char_aty
-};
-
-
-    /*
-     *  8 bpp packed pixels
-     */
-
-static u32 nibbletab_aty[] = {
-#if defined(__BIG_ENDIAN)
-    0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
-    0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, 
-    0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 
-    0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
-#elif defined(__LITTLE_ENDIAN)
-    0x00000000, 0xff000000, 0x00ff0000, 0xffff0000, 
-    0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00, 
-    0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff, 
-    0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff
-#else
-#error FIXME: No endianness??
-#endif
-};
-
-static int open_aty(struct display *p)
-{
-    printk("open_aty: probing...\n");
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 8 ||
-	(p->visual != FB_VISUAL_PSEUDOCOLOR &&
-	 p->visual != FB_VISUAL_STATIC_PSEUDOCOLOR) ||
-	p->var.accel != FB_ACCEL_ATY)
-	return -EINVAL;
-
-    printk("open_aty: using ATY acceleration\n");
-    p->next_line = p->var.xres_virtual;
-    p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_aty(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_aty(struct display *p, int sy, int sx, int dy, int dx,
-		      int height, int width)
-{
-    sx *= p->fontwidth;
-    sy *= p->fontheight;
-    dx *= p->fontwidth;
-    dy *= p->fontheight;
-    width *= p->fontwidth;
-    height *= p->fontheight;
-
-    aty_rectcopy(sx, sy, dx, dy, width, height);
-}
-
-static void clear_aty(struct vc_data *conp, struct display *p, int sy, int sx,
-		      int height, int width)
-{
-    u32 bgx = attr_bgcol_ec(p, conp);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-
-    sx *= p->fontwidth;
-    sy *= p->fontheight;
-    width *= p->fontwidth;
-    height *= p->fontheight;
-
-    aty_rectfill(sx, sy, width, height, bgx);
-}
-
-static void putc_aty(struct vc_data *conp, struct display *p, int c, int yy,
-		     int xx)
-{
-    u_char *dest, *cdat;
-    int bytes = p->next_line, rows;
-    u32 eorx, fgx, bgx;
-
-    c &= 0xff;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    cdat = p->fontdata + c * p->fontheight;
-    fgx = attr_fgcol(p, conp);
-    bgx = attr_bgcol(p, conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-
-    aty_waitblit();
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u32 *)dest)[0] = (nibbletab_aty[*cdat >> 4] & eorx) ^ bgx;
-	((u32 *)dest)[1] = (nibbletab_aty[*cdat++ & 0xf] & eorx) ^ bgx;
-    }
-}
-
-static void putcs_aty(struct vc_data *conp, struct display *p, const char *s,
-		      int count, int yy, int xx)
-{
-    u_char *cdat, c, *dest, *dest0;
-    int rows, bytes = p->next_line;
-    u32 eorx, fgx, bgx;
-
-    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    fgx = attr_fgcol(p, conp);
-    bgx = attr_bgcol(p, conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-
-    aty_waitblit();
-    while (count--) {
-	c = *s++;
-	cdat = p->fontdata + c * p->fontheight;
-
-	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-	    ((u32 *)dest)[0] = (nibbletab_aty[*cdat >> 4] & eorx) ^ bgx;
-	    ((u32 *)dest)[1] = (nibbletab_aty[*cdat++ & 0xf] & eorx) ^ bgx;
-	}
-	dest0+=8;
-    }
-}
-
-static void rev_char_aty(struct display *p, int xx, int yy)
-{
-    u_char *dest;
-    int bytes = p->next_line, rows;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u32 *)dest)[0] ^= 0x0f0f0f0f;
-	((u32 *)dest)[1] ^= 0x0f0f0f0f;
-    }
-}
-
-
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_aty(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_aty, 1));
-}
-
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_aty);
-}
-#endif /* MODULE */
--- m68k-2.1.77/drivers/video/fbcon-cfb2.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb2.c	Sun Jan 11 17:32:01 1998
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/video/cfb2.c -- Low level frame buffer operations for 8 bpp
+ *  linux/drivers/video/cfb2.c -- Low level frame buffer operations for 2 bpp
  *				  packed pixels
  *
  *	Created 26 Dec 1997 by Michael Schmitz
@@ -17,152 +17,116 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
+#include "fbcon-cfb2.h"
 
 
     /*
-     *  Prototypes
+     *  2 bpp packed pixels
      */
 
-static int open_cfb2(struct display *p);
-static void release_cfb2(void);
-static void bmove_cfb2(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_cfb2(struct vc_data *conp, struct display *p, int sy,
-		       int sx, int height, int width);
-static void putc_cfb2(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_cfb2(struct vc_data *conp, struct display *p,
-		       const char *s, int count, int yy, int xx);
-static void rev_char_cfb2(struct display *p, int xx, int yy);
-
-
     /*
-     *  `switch' for the low level operations
+     *  IFF the font is even pixel aligned (that is to say each
+     *  character start is a byte start in the pixel pairs). That
+     *  avoids us having to mask bytes and means we won't be here
+     *  all week. On a MacII that matters _lots_
      */
 
-static struct display_switch dispsw_cfb2 = {
-    open_cfb2, release_cfb2, bmove_cfb2, clear_cfb2, putc_cfb2, putcs_cfb2,
-    rev_char_cfb2
+static u16 nibbletab_cfb2[] = {
+    0x0000,0x0003,0x000c,0x000f,
+    0x0030,0x0033,0x003c,0x003f,
+    0x00c0,0x00c3,0x00cc,0x00cf,
+    0x00f0,0x00f3,0x00fc,0x00ff,
+
+    0x0300,0x0303,0x030c,0x030f,
+    0x0330,0x0333,0x033c,0x033f,
+    0x03c0,0x03c3,0x03cc,0x03cf,
+    0x03f0,0x03f3,0x03fc,0x03ff,
+
+    0x0c00,0x0c03,0x0c0c,0x0c0f,
+    0x0c30,0x0c33,0x0c3c,0x0c3f,
+    0x0cc0,0x0cc3,0x0ccc,0x0ccf,
+    0x0cf0,0x0cf3,0x0cfc,0x0cff,
+
+    0x0f00,0x0f03,0x0f0c,0x000f,
+    0x0f30,0x0f33,0x0f3c,0x003f,
+    0x0fc0,0x0fc3,0x0fcc,0x00cf,
+    0x0ff0,0x0ff3,0x0ffc,0x0fff,
+
+    /* */
+    0x3000,0x3003,0x300c,0x300f,
+    0x3030,0x3033,0x303c,0x303f,
+    0x30c0,0x30c3,0x30cc,0x30cf,
+    0x30f0,0x30f3,0x30fc,0x30ff,
+
+    0x3300,0x3303,0x330c,0x330f,
+    0x3330,0x3333,0x333c,0x333f,
+    0x33c0,0x33c3,0x33cc,0x33cf,
+    0x33f0,0x33f3,0x33fc,0x33ff,
+
+    0x3c00,0x3c03,0x3c0c,0x3c0f,
+    0x3c30,0x3c33,0x3c3c,0x3c3f,
+    0x3cc0,0x3cc3,0x3ccc,0x3ccf,
+    0x3cf0,0x3cf3,0x3cfc,0x3cff,
+
+    0x3f00,0x3f03,0x3f0c,0x3f0f,
+    0x3f30,0x3f33,0x3f3c,0x3f3f,
+    0x3fc0,0x3fc3,0x3fcc,0x3fcf,
+    0x3ff0,0x3ff3,0x3ffc,0x3fff,
+
+    /* */
+    0xc000,0xc003,0xc00c,0xc00f,
+    0xc030,0xc033,0xc03c,0xc03f,
+    0xc0c0,0xc0c3,0xc0cc,0xc0cf,
+    0xc0f0,0xc0f3,0xc0fc,0xc0ff,
+
+    0xc300,0xc303,0xc30c,0xc30f,
+    0xc330,0xc333,0xc33c,0xc33f,
+    0xc3c0,0xc3c3,0xc3cc,0xc3cf,
+    0xc3f0,0xc3f3,0xc3fc,0xc3ff,
+
+    0xcc00,0xcc03,0xcc0c,0xcc0f,
+    0xcc30,0xcc33,0xcc3c,0xcc3f,
+    0xccc0,0xccc3,0xcccc,0xcccf,
+    0xccf0,0xccf3,0xccfc,0xccff,
+
+    0xcf00,0xcf03,0xcf0c,0xcf0f,
+    0xcf30,0xcf33,0xcf3c,0xcf3f,
+    0xcfc0,0xcfc3,0xcfcc,0xcfcf,
+    0xcff0,0xcff3,0xcffc,0xcfff,
+
+    /* */
+    0xf000,0xf003,0xf00c,0xf00f,
+    0xf030,0xf033,0xf03c,0xf03f,
+    0xf0c0,0xf0c3,0xf0cc,0xf0cf,
+    0xf0f0,0xf0f3,0xf0fc,0xf0ff,
+
+    0xf300,0xf303,0xf30c,0xf30f,
+    0xf330,0xf333,0xf33c,0xf33f,
+    0xf3c0,0xf3c3,0xf3cc,0xf3cf,
+    0xf3f0,0xf3f3,0xf3fc,0xf3ff,
+
+    0xfc00,0xfc03,0xfc0c,0xfc0f,
+    0xfc30,0xfc33,0xfc3c,0xfc3f,
+    0xfcc0,0xfcc3,0xfccc,0xfccf,
+    0xfcf0,0xfcf3,0xfcfc,0xfcff,
+
+    0xff00,0xff03,0xff0c,0xff0f,
+    0xff30,0xff33,0xff3c,0xff3f,
+    0xffc0,0xffc3,0xffcc,0xffcf,
+    0xfff0,0xfff3,0xfffc,0xffff
 };
 
-
-    /*
-     *  4 bpp packed pixels
-     */
-
-   /*
-    *		IFF the font is even pixel aligned (that is to say each
-    *		character start is a byte start in the pixel pairs). That
-    *		avoids us having to mask bytes and means we won't be here
-    *		all week. On a MacII that matters _lots_
-    */
-
-static u_short nibbletab_cfb2[]={
-0x0000,0x0003,0x000c,0x000f,
-0x0030,0x0033,0x003c,0x003f,
-0x00c0,0x00c3,0x00cc,0x00cf,
-0x00f0,0x00f3,0x00fc,0x00ff,
-
-0x0300,0x0303,0x030c,0x030f,
-0x0330,0x0333,0x033c,0x033f,
-0x03c0,0x03c3,0x03cc,0x03cf,
-0x03f0,0x03f3,0x03fc,0x03ff,
-
-0x0c00,0x0c03,0x0c0c,0x0c0f,
-0x0c30,0x0c33,0x0c3c,0x0c3f,
-0x0cc0,0x0cc3,0x0ccc,0x0ccf,
-0x0cf0,0x0cf3,0x0cfc,0x0cff,
-
-0x0f00,0x0f03,0x0f0c,0x000f,
-0x0f30,0x0f33,0x0f3c,0x003f,
-0x0fc0,0x0fc3,0x0fcc,0x00cf,
-0x0ff0,0x0ff3,0x0ffc,0x0fff,
-
-/* */
-0x3000,0x3003,0x300c,0x300f,
-0x3030,0x3033,0x303c,0x303f,
-0x30c0,0x30c3,0x30cc,0x30cf,
-0x30f0,0x30f3,0x30fc,0x30ff,
-
-0x3300,0x3303,0x330c,0x330f,
-0x3330,0x3333,0x333c,0x333f,
-0x33c0,0x33c3,0x33cc,0x33cf,
-0x33f0,0x33f3,0x33fc,0x33ff,
-
-0x3c00,0x3c03,0x3c0c,0x3c0f,
-0x3c30,0x3c33,0x3c3c,0x3c3f,
-0x3cc0,0x3cc3,0x3ccc,0x3ccf,
-0x3cf0,0x3cf3,0x3cfc,0x3cff,
-
-0x3f00,0x3f03,0x3f0c,0x3f0f,
-0x3f30,0x3f33,0x3f3c,0x3f3f,
-0x3fc0,0x3fc3,0x3fcc,0x3fcf,
-0x3ff0,0x3ff3,0x3ffc,0x3fff,
-
-/* */
-0xc000,0xc003,0xc00c,0xc00f,
-0xc030,0xc033,0xc03c,0xc03f,
-0xc0c0,0xc0c3,0xc0cc,0xc0cf,
-0xc0f0,0xc0f3,0xc0fc,0xc0ff,
-
-0xc300,0xc303,0xc30c,0xc30f,
-0xc330,0xc333,0xc33c,0xc33f,
-0xc3c0,0xc3c3,0xc3cc,0xc3cf,
-0xc3f0,0xc3f3,0xc3fc,0xc3ff,
-
-0xcc00,0xcc03,0xcc0c,0xcc0f,
-0xcc30,0xcc33,0xcc3c,0xcc3f,
-0xccc0,0xccc3,0xcccc,0xcccf,
-0xccf0,0xccf3,0xccfc,0xccff,
-
-0xcf00,0xcf03,0xcf0c,0xcf0f,
-0xcf30,0xcf33,0xcf3c,0xcf3f,
-0xcfc0,0xcfc3,0xcfcc,0xcfcf,
-0xcff0,0xcff3,0xcffc,0xcfff,
-
-/* */
-0xf000,0xf003,0xf00c,0xf00f,
-0xf030,0xf033,0xf03c,0xf03f,
-0xf0c0,0xf0c3,0xf0cc,0xf0cf,
-0xf0f0,0xf0f3,0xf0fc,0xf0ff,
-
-0xf300,0xf303,0xf30c,0xf30f,
-0xf330,0xf333,0xf33c,0xf33f,
-0xf3c0,0xf3c3,0xf3cc,0xf3cf,
-0xf3f0,0xf3f3,0xf3fc,0xf3ff,
-
-0xfc00,0xfc03,0xfc0c,0xfc0f,
-0xfc30,0xfc33,0xfc3c,0xfc3f,
-0xfcc0,0xfcc3,0xfccc,0xfccf,
-0xfcf0,0xfcf3,0xfcfc,0xfcff,
-
-0xff00,0xff03,0xff0c,0xff0f,
-0xff30,0xff33,0xff3c,0xff3f,
-0xffc0,0xffc3,0xffcc,0xffcf,
-0xfff0,0xfff3,0xfffc,0xffff};
-
-static int open_cfb2(struct display *p)
+void fbcon_cfb2_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 2)
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual>>2;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cfb2(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_cfb2(struct display *p, int sy, int sx, int dy, int dx,
-                       int height, int width)
+void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width)
 {
 	int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
-	u_char *src,*dst;
+	u8 *src,*dst;
 
 	if (sx == 0 && dx == 0 && width * 2 == bytes) {
 		mymemmove(p->screen_base + dy * linesize,
@@ -193,12 +157,12 @@
 	}
 }
 
-static void clear_cfb2(struct vc_data *conp, struct display *p, int sy,
-                       int sx, int height, int width)
+void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width)
 {
-	u_char *dest0,*dest;
+	u8 *dest0,*dest;
 	int bytes=p->next_line,lines=height * p->fontheight, rows, i;
-	u_long bgx;
+	u32 bgx;
 
 /*	if(p->screen_base!=0xFDD00020)
 		mac_boom(1);*/
@@ -212,7 +176,7 @@
 
 	if (sx == 0 && width * 2 == bytes) {
 		for (i = 0 ; i < lines * width ; i++) {
-			((u_long *)dest)[0]=bgx;
+			((u32 *)dest)[0]=bgx;
 			dest+=2;
 		}
 	} else {
@@ -221,19 +185,19 @@
 			dest=dest0;
 			for (i = 0 ; i < width ; i++) {
 				/* memset ?? */
-				((u_long *)dest)[0]=bgx;
+				((u32 *)dest)[0]=bgx;
 				dest+=2;
 			}
 		}
 	}
 }
 
-static void putc_cfb2(struct vc_data *conp, struct display *p, int c, int yy,
-                      int xx)
+void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		     int xx)
 {
-	u_char *dest,*cdat;
+	u8 *dest,*cdat;
 	int bytes=p->next_line,rows;
-	ulong eorx,fgx,bgx;
+	u32 eorx,fgx,bgx;
 
 	c &= 0xff;
 
@@ -251,23 +215,23 @@
 	eorx = fgx ^ bgx;
 
 	for (rows = p->fontheight ; rows-- ; dest += bytes) {
-		((u_short *)dest)[0]=
+		((u16 *)dest)[0]=
 			(nibbletab_cfb2[*cdat >> 6] & eorx) ^ bgx;
-		((u_short *)dest)[1]=
+		((u16 *)dest)[1]=
 			(nibbletab_cfb2[(*cdat >> 4) & 0x3] & eorx) ^ bgx;
-		((u_short *)dest)[2]=
+		((u16 *)dest)[2]=
 			(nibbletab_cfb2[(*cdat >> 2) & 0x3] & eorx) ^ bgx;
-		((u_short *)dest)[4]=
+		((u16 *)dest)[4]=
 			(nibbletab_cfb2[*cdat++ & 0x3] & eorx) ^ bgx;
 	}
 }
 
-static void putcs_cfb2(struct vc_data *conp, struct display *p,
-                       const char *s, int count, int yy, int xx)
+void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx)
 {
-	u_char *cdat, c, *dest, *dest0;
+	u8 *cdat, c, *dest, *dest0;
 	int rows,bytes=p->next_line;
-	u_long eorx, fgx, bgx;
+	u32 eorx, fgx, bgx;
 
 	dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 2;
 	fgx=3/*attr_fgcol(p,conp)*/;
@@ -286,43 +250,49 @@
 		cdat = p->fontdata + c * p->fontheight;
 
 		for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-			((u_short *)dest)[0]=
+			((u16 *)dest)[0]=
 			(nibbletab_cfb2[*cdat >> 6] & eorx) ^ bgx;
-			((u_short *)dest)[1]=
+			((u16 *)dest)[1]=
 				(nibbletab_cfb2[(*cdat >> 4) & 0x3] & eorx) ^ bgx;
-			((u_short *)dest)[2]=
+			((u16 *)dest)[2]=
 				(nibbletab_cfb2[(*cdat >> 2) & 0x3] & eorx) ^ bgx;
-			((u_short *)dest)[1]=
+			((u16 *)dest)[1]=
 			(nibbletab_cfb2[*cdat++ & 0x3] & eorx) ^ bgx;
 		}
 		dest0+=2;
 	}
 }
 
-static void rev_char_cfb2(struct display *p, int xx, int yy)
+void fbcon_cfb2_revc(struct display *p, int xx, int yy)
 {
-	u_char *dest;
+	u8 *dest;
 	int bytes=p->next_line, rows;
 
 	dest = p->screen_base + yy * p->fontheight * bytes + xx * 2;
 	for (rows = p->fontheight ; rows-- ; dest += bytes) {
-		((u_long *)dest)[0] ^= 0x33333333;
+		((u32 *)dest)[0] ^= 0x33333333;
 	}
 }
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cfb2(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cfb2, 0));
-}
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cfb2);
-}
-#endif /* MODULE */
+    /*
+     *  `switch' for the low level operations
+     */
+
+struct display_switch fbcon_cfb2 = {
+    fbcon_cfb2_setup, fbcon_cfb2_bmove, fbcon_cfb2_clear, fbcon_cfb2_putc,
+    fbcon_cfb2_putcs, fbcon_cfb2_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
 
+EXPORT_SYMBOL(fbcon_cfb2);
+EXPORT_SYMBOL(fbcon_cfb2_setup);
+EXPORT_SYMBOL(fbcon_cfb2_bmove);
+EXPORT_SYMBOL(fbcon_cfb2_clear);
+EXPORT_SYMBOL(fbcon_cfb2_putc);
+EXPORT_SYMBOL(fbcon_cfb2_putcs);
+EXPORT_SYMBOL(fbcon_cfb2_revc);
--- m68k-2.1.77/drivers/video/fbcon-ilbm.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-ilbm.c	Sun Jan 11 17:32:02 1998
@@ -16,34 +16,7 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_ilbm(struct display *p);
-static void release_ilbm(void);
-static void bmove_ilbm(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_ilbm(struct vc_data *conp, struct display *p, int sy, int sx,
-		       int height, int width);
-static void putc_ilbm(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_ilbm(struct vc_data *conp, struct display *p, const char *s,
-		       int count, int yy, int xx);
-static void rev_char_ilbm(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_ilbm = {
-    open_ilbm, release_ilbm, bmove_ilbm, clear_ilbm, putc_ilbm, putcs_ilbm,
-    rev_char_ilbm
-};
+#include "fbcon-ilbm.h"
 
 
     /*
@@ -57,11 +30,8 @@
      *  much performance loss?
      */
 
-static int open_ilbm(struct display *p)
+void fbcon_ilbm_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_INTERLEAVED_PLANES || p->type_aux == 2)
-	return -EINVAL;
-
     if (p->line_length) {
 	p->next_line = p->line_length*p->var.bits_per_pixel;
 	p->next_plane = p->line_length;
@@ -69,24 +39,17 @@
 	p->next_line = p->type_aux;
 	p->next_plane = p->type_aux/p->var.bits_per_pixel;
     }
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_ilbm(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_ilbm(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width)
+void fbcon_ilbm_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width)
 {
     if (sx == 0 && dx == 0 && width == p->next_plane)
 	mymemmove(p->screen_base+dy*p->fontheight*p->next_line,
 		  p->screen_base+sy*p->fontheight*p->next_line,
 		  height*p->fontheight*p->next_line);
     else {
-	u_char *src, *dest;
+	u8 *src, *dest;
 	u_int i;
 
 	if (dy <= sy) {
@@ -109,10 +72,10 @@
     }
 }
 
-static void clear_ilbm(struct vc_data *conp, struct display *p, int sy, int sx,
-		       int height, int width)
+void fbcon_ilbm_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width)
 {
-    u_char *dest;
+    u8 *dest;
     u_int i, rows;
     int bg, bg0;
 
@@ -131,12 +94,12 @@
     }
 }
 
-static void putc_ilbm(struct vc_data *conp, struct display *p, int c, int yy,
-			     int xx)
+void fbcon_ilbm_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		     int xx)
 {
-    u_char *dest, *cdat;
+    u8 *dest, *cdat;
     u_int rows, i;
-    u_char d;
+    u8 d;
     int fg0, bg0, fg, bg;
 
     c &= 0xff;
@@ -182,12 +145,12 @@
      *  -- Geert
      */
 
-static void putcs_ilbm(struct vc_data *conp, struct display *p, const char *s,
-		       int count, int yy, int xx)
+void fbcon_ilbm_putcs(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx)
 {
-    u_char *dest0, *dest, *cdat1, *cdat2, *cdat3, *cdat4;
+    u8 *dest0, *dest, *cdat1, *cdat2, *cdat3, *cdat4;
     u_int rows, i;
-    u_char c1, c2, c3, c4;
+    u8 c1, c2, c3, c4;
     u32 d;
     int fg0, bg0, fg, bg;
 
@@ -264,9 +227,9 @@
 	}
 }
 
-static void rev_char_ilbm(struct display *p, int xx, int yy)
+void fbcon_ilbm_revc(struct display *p, int xx, int yy)
 {
-    u_char *dest, *dest0;
+    u8 *dest, *dest0;
     u_int rows, i;
     int mask;
 
@@ -290,18 +253,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_ilbm(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_ilbm, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_ilbm);
-}
-#endif /* MODULE */
+struct display_switch fbcon_ilbm = {
+    fbcon_ilbm_setup, fbcon_ilbm_bmove, fbcon_ilbm_clear, fbcon_ilbm_putc,
+    fbcon_ilbm_putcs, fbcon_ilbm_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_ilbm);
+EXPORT_SYMBOL(fbcon_ilbm_setup);
+EXPORT_SYMBOL(fbcon_ilbm_bmove);
+EXPORT_SYMBOL(fbcon_ilbm_clear);
+EXPORT_SYMBOL(fbcon_ilbm_putc);
+EXPORT_SYMBOL(fbcon_ilbm_putcs);
+EXPORT_SYMBOL(fbcon_ilbm_revc);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p2.c.orig	Mon Jan 12 21:30:58 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p2.c	Mon Jan 12 21:48:33 1998
@@ -19,34 +19,7 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_iplan2p2(struct display *p);
-static void release_iplan2p2(void);
-static void bmove_iplan2p2(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width);
-static void clear_iplan2p2(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width);
-static void putc_iplan2p2(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx);
-static void putcs_iplan2p2(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx);
-static void rev_char_iplan2p2(struct display *display, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_iplan2p2 = {
-    open_iplan2p2, release_iplan2p2, bmove_iplan2p2, clear_iplan2p2,
-    putc_iplan2p2, putcs_iplan2p2, rev_char_iplan2p2
-};
+#include "fbcon-iplan2p2.h"
 
 
     /*
@@ -130,8 +103,7 @@
 
 /* This expands a 2 bit color into a short for movepw (2 plane) operations. */
 
-static const u16 two2byte[] =
-{
+static const u16 two2byte[] = {
     0x0000, 0xff00, 0x00ff, 0xffff
 };
 
@@ -140,12 +112,12 @@
     return two2byte[c];
 }
 
+
 /* This expands a 2 bit color into one long for a movel operation
  * (2 planes).
  */
 
-static const u32 two2word[] =
-{
+static const u32 two2word[] = {
 #ifndef __LITTLE_ENDIAN
     0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
 #else
@@ -171,25 +143,14 @@
 }
 
 
-static int open_iplan2p2(struct display *p)
+void fbcon_iplan2p2_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_INTERLEAVED_PLANES || p->type_aux != 2 ||
-	p->var.bits_per_pixel != 2)
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual>>2;
     p->next_plane = 2;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_iplan2p2(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_iplan2p2(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width)
+void fbcon_iplan2p2_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			  int height, int width)
 {
     /*  bmove() has to distinguish two major cases: If both, source and
      *  destination, start at even addresses or both are at odd
@@ -289,8 +250,8 @@
     }
 }
 
-static void clear_iplan2p2(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width)
+void fbcon_iplan2p2_clear(struct vc_data *conp, struct display *p, int sy,
+			  int sx, int height, int width)
 {
     u32 offset;
     u8 *start;
@@ -335,8 +296,8 @@
     }
 }
 
-static void putc_iplan2p2(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx)
+void fbcon_iplan2p2_putc(struct vc_data *conp, struct display *p, int c,
+			 int yy, int xx)
 {
     u8 *dest;
     u8 *cdat;
@@ -359,8 +320,8 @@
     }
 }
 
-static void putcs_iplan2p2(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx)
+void fbcon_iplan2p2_putcs(struct vc_data *conp, struct display *p,
+			  const char *s, int count, int yy, int xx)
 {
     u8 *dest, *dest0;
     u8 *cdat, c;
@@ -386,7 +347,7 @@
     }
 }
 
-static void rev_char_iplan2p2(struct display *p, int xx, int yy)
+void fbcon_iplan2p2_revc(struct display *p, int xx, int yy)
 {
     u8 *dest;
     int j;
@@ -408,18 +369,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_iplan2p2(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_iplan2p2, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_iplan2p2);
-}
-#endif /* MODULE */
+struct display_switch fbcon_iplan2p2 = {
+    fbcon_iplan2p2_setup, fbcon_iplan2p2_bmove, fbcon_iplan2p2_clear,
+    fbcon_iplan2p2_putc, fbcon_iplan2p2_putcs, fbcon_iplan2p2_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_iplan2p2);
+EXPORT_SYMBOL(fbcon_iplan2p2_setup);
+EXPORT_SYMBOL(fbcon_iplan2p2_bmove);
+EXPORT_SYMBOL(fbcon_iplan2p2_clear);
+EXPORT_SYMBOL(fbcon_iplan2p2_putc);
+EXPORT_SYMBOL(fbcon_iplan2p2_putcs);
+EXPORT_SYMBOL(fbcon_iplan2p2_revc);
--- m68k-2.1.77/drivers/video/fbcon-mac.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-mac.c	Sun Jan 11 17:32:02 1998
@@ -20,58 +20,26 @@
 #include <linux/fb.h>
 #include <linux/delay.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_mac(struct display *p);
-static void release_mac(void);
-static void bmove_mac(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_mac(struct vc_data *conp, struct display *p, int sy,
-		       int sx, int height, int width);
-static void putc_mac(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_mac(struct vc_data *conp, struct display *p,
-		       const char *s, int count, int yy, int xx);
-static void rev_char_mac(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_mac = {
-    open_mac, release_mac, bmove_mac, clear_mac, putc_mac, putcs_mac,
-    rev_char_mac
-};
+#include "fbcon-mac.h"
 
 
     /*
      *  variable bpp packed pixels
      */
 
-static int open_mac(struct display *p)
-{
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->fontwidth == 8)
-	return -EINVAL;
+static void plot_pixel_mac(struct display *p, int bw, int pixel_x,
+			   int pixel_y);
+static int get_pixel_mac(struct display *p, int pixel_x, int pixel_y);
 
+void fbcon_mac_setup(struct display *p)
+{
     if (p->line_length)
 	p->next_line = p->line_length;
     else
     	p->next_line = p->var.xres_virtual>>3;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
 }
 
-static void release_mac(void)
-{
-    MOD_DEC_USE_COUNT;
-}
 
    /*
     *    Macintosh
@@ -80,17 +48,17 @@
 #define PIXEL_WHITE_MAC          1
 #define PIXEL_INVERT_MAC         2
 
-static void bmove_mac(struct display *p, int sy, int sx, int dy, int dx,
-                       int height, int width)
+void fbcon_mac_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		     int height, int width)
 {
    int i, j;
-   u_char *dest, *src;
+   u8 *dest, *src;
    int l,r,t,b,w,lo,s;
    int dl,dr,dt,db,dw,dlo;
    int move_up;
 
-   src = (u_char *) (p->screen_base + sy * p->fontheight * p->next_line);
-   dest = (u_char *) (p->screen_base + dy * p->fontheight * p->next_line);
+   src = (u8 *) (p->screen_base + sy * p->fontheight * p->next_line);
+   dest = (u8 *) (p->screen_base + dy * p->fontheight * p->next_line);
 
    if( sx == 0 && width == p->conp->vc_cols) {
      s = height * p->fontheight * p->next_line;
@@ -126,7 +94,7 @@
        unsigned long cnt;
        sprintf( err_str, "ERROR: Shift algorithm: sx=%d,sy=%d,dx=%d,dy=%d,w=%d,h=%d,bpp=%d",
 		sx,sy,dx,dy,width,height,p->var.bits_per_pixel);
-       putcs_mac(p->conp, p, err_str, strlen(err_str), 0, 0);
+       fbcon_mac_putcs(p->conp, p, err_str, strlen(err_str), 0, 0);
        /* pause for the user */
        for(cnt = 0; cnt < 50000; cnt++)
 		udelay(100);
@@ -214,18 +182,18 @@
 }
 
 
-static void clear_mac(struct vc_data *conp, struct display *p, int sy, int sx,
-                       int height, int width)
+void fbcon_mac_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		     int height, int width)
 {
    int pixel;
    int i, j;
    int inverse;
-   u_char *dest;
+   u8 *dest;
    int l,r,t,b,w,lo,s;
 
    inverse = attr_reverse(p,conp);
    pixel = inverse ? PIXEL_WHITE_MAC : PIXEL_BLACK_MAC;
-   dest = (u_char *) (p->screen_base + sy * p->fontheight * p->next_line);
+   dest = (u8 *) (p->screen_base + sy * p->fontheight * p->next_line);
 
    if( sx == 0 && width == p->conp->vc_cols) {
      s = height * p->fontheight * p->next_line;
@@ -292,12 +260,12 @@
 }
 
 
-static void putc_mac(struct vc_data *conp, struct display *p, int c, int yy,
-                      int xx)
+void fbcon_mac_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		    int xx)
 {
-   u_char *cdat;
+   u8 *cdat;
    u_int rows, bold, ch_reverse, ch_underline;
-   u_char d;
+   u8 d;
    int j;
 
    c &= 0xff;
@@ -325,19 +293,19 @@
 }
 
 
-static void putcs_mac(struct vc_data *conp, struct display *p, const char *s,
-                       int count, int yy, int xx)
+void fbcon_mac_putcs(struct vc_data *conp, struct display *p, const char *s,
+		     int count, int yy, int xx)
 {
-   u_char c;
+   u8 c;
 
    while (count--) {
       c = *s++;
-      putc_mac(conp, p, c, yy, xx++);
+      fbcon_mac_putc(conp, p, c, yy, xx++);
    }
 }
 
 
-static void rev_char_mac(struct display *p, int xx, int yy)
+void fbcon_mac_revc(struct display *p, int xx, int yy)
 {
    u_int rows, j;
 
@@ -357,9 +325,9 @@
  */
 static void plot_pixel_mac(struct display *p, int bw, int pixel_x, int pixel_y)
 {
-  u_char *dest, bit;
-  u_short *dest16, pix16;
-  u_long *dest32, pix32;
+  u8 *dest, bit;
+  u16 *dest16, pix16;
+  u32 *dest32, pix32;
 
   if (pixel_x < 0 || pixel_y < 0 || pixel_x >= 832 || pixel_y >= 624) {
     int cnt;
@@ -371,7 +339,7 @@
 
   switch (p->var.bits_per_pixel) {
   case 1:
-    dest = (u_char *) ((pixel_x >> 3) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x >> 3) + p->screen_base + pixel_y * p->next_line);
     bit = 0x80 >> (pixel_x & 7);
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -389,7 +357,7 @@
     break;
 
   case 2:
-    dest = (u_char *) ((pixel_x >> 2) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x >> 2) + p->screen_base + pixel_y * p->next_line);
     bit = 0xC0 >> ((pixel_x & 3) << 1);
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -407,7 +375,7 @@
     break;
 
   case 4:
-    dest = (u_char *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
     bit = 0xF0 >> ((pixel_x & 1) << 2);
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -425,7 +393,7 @@
     break;
 
   case 8:
-    dest = (u_char *) (pixel_x + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) (pixel_x + p->screen_base + pixel_y * p->next_line);
     bit = 0xFF;
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -443,7 +411,7 @@
     break;
 
   case 16:
-    dest16 = (u_short *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
+    dest16 = (u16 *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
     pix16 = 0xFFFF;
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -461,7 +429,7 @@
     break;
 
   case 32:
-    dest32 = (u_long *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
+    dest32 = (u32 *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
     pix32 = 0xFFFFFFFF;
     switch (bw) {
     case PIXEL_BLACK_MAC:
@@ -482,37 +450,37 @@
 
 static int get_pixel_mac(struct display *p, int pixel_x, int pixel_y)
 {
-  u_char *dest, bit;
-  u_short *dest16;
-  u_long *dest32;
-  u_char pixel;
+  u8 *dest, bit;
+  u16 *dest16;
+  u32 *dest32;
+  u8 pixel;
 
   switch (p->var.bits_per_pixel) {
   case 1:
-    dest = (u_char *) ((pixel_x / 8) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x / 8) + p->screen_base + pixel_y * p->next_line);
     bit = 0x80 >> (pixel_x & 7);
     pixel = *dest & bit;
     break;
   case 2:
-    dest = (u_char *) ((pixel_x / 4) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x / 4) + p->screen_base + pixel_y * p->next_line);
     bit = 0xC0 >> (pixel_x & 3);
     pixel = *dest & bit;
     break;
   case 4:
-    dest = (u_char *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) ((pixel_x / 2) + p->screen_base + pixel_y * p->next_line);
     bit = 0xF0 >> (pixel_x & 1);
     pixel = *dest & bit;
     break;
   case 8:
-    dest = (u_char *) (pixel_x + p->screen_base + pixel_y * p->next_line);
+    dest = (u8 *) (pixel_x + p->screen_base + pixel_y * p->next_line);
     pixel = *dest;
     break;
   case 16:
-    dest16 = (u_short *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
+    dest16 = (u16 *) ((pixel_x *2) + p->screen_base + pixel_y * p->next_line);
     pixel = *dest16 ? 1 : 0;
     break;
   case 32:
-    dest32 = (u_long *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
+    dest32 = (u32 *) ((pixel_x *4) + p->screen_base + pixel_y * p->next_line);
     pixel = *dest32 ? 1 : 0;
     break;
   }
@@ -520,19 +488,25 @@
   return pixel ? PIXEL_BLACK_MAC : PIXEL_WHITE_MAC;
 }
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_mac(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_mac, 0));
-}
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_mac);
-}
-#endif /* MODULE */
+    /*
+     *  `switch' for the low level operations
+     */
+
+struct display_switch fbcon_mac = {
+    fbcon_mac_setup, fbcon_mac_bmove, fbcon_mac_clear, fbcon_mac_putc,
+    fbcon_mac_putcs, fbcon_mac_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
 
+EXPORT_SYMBOL(fbcon_mac);
+EXPORT_SYMBOL(fbcon_mac_setup);
+EXPORT_SYMBOL(fbcon_mac_bmove);
+EXPORT_SYMBOL(fbcon_mac_clear);
+EXPORT_SYMBOL(fbcon_mac_putc);
+EXPORT_SYMBOL(fbcon_mac_putcs);
+EXPORT_SYMBOL(fbcon_mac_revc);
--- m68k-2.1.77/drivers/video/fbcon-mfb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-mfb.c	Sun Jan 11 17:32:02 1998
@@ -16,61 +16,24 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_mfb(struct display *p);
-static void release_mfb(void);
-static void bmove_mfb(struct display *p, int sy, int sx, int dy, int dx,
-		      int height, int width);
-static void clear_mfb(struct vc_data *conp, struct display *p, int sy, int sx,
-		      int height, int width);
-static void putc_mfb(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_mfb(struct vc_data *conp, struct display *p, const char *s,
-		      int count, int yy, int xx);
-static void rev_char_mfb(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_mfb = {
-    open_mfb, release_mfb, bmove_mfb, clear_mfb, putc_mfb, putcs_mfb,
-    rev_char_mfb
-};
+#include "fbcon-mfb.h"
 
 
     /*
      *  Monochrome
      */
 
-static int open_mfb(struct display *p)
+void fbcon_mfb_setup(struct display *p)
 {
-    if (p->var.bits_per_pixel != 1)
-	return -EINVAL;
-
     if (p->line_length)
 	p->next_line = p->line_length;
     else
 	p->next_line = p->var.xres_virtual>>3;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
 }
 
-static void release_mfb(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_mfb(struct display *p, int sy, int sx, int dy, int dx,
-		      int height, int width)
+void fbcon_mfb_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		     int height, int width)
 {
     u_char *src, *dest;
     u_int rows;
@@ -98,8 +61,8 @@
     }
 }
 
-static void clear_mfb(struct vc_data *conp, struct display *p, int sy, int sx,
-		      int height, int width)
+void fbcon_mfb_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		     int height, int width)
 {
     u_char *dest;
     u_int rows;
@@ -119,8 +82,8 @@
 		mymemclear_small(dest, width);
 }
 
-static void putc_mfb(struct vc_data *conp, struct display *p, int c, int yy,
-		     int xx)
+void fbcon_mfb_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		    int xx)
 {
     u_char *dest, *cdat;
     u_int rows, bold, revs, underl;
@@ -146,8 +109,8 @@
     }
 }
 
-static void putcs_mfb(struct vc_data *conp, struct display *p, const char *s,
-		      int count, int yy, int xx)
+void fbcon_mfb_putcs(struct vc_data *conp, struct display *p, const char *s,
+		     int count, int yy, int xx)
 {
     u_char *dest, *dest0, *cdat;
     u_int rows, bold, revs, underl;
@@ -175,7 +138,7 @@
     }
 }
 
-static void rev_char_mfb(struct display *p, int xx, int yy)
+void fbcon_mfb_revc(struct display *p, int xx, int yy)
 {
     u_char *dest;
     u_int rows;
@@ -186,18 +149,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_mfb(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_mfb, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_mfb);
-}
-#endif /* MODULE */
+struct display_switch fbcon_mfb = {
+    fbcon_mfb_setup, fbcon_mfb_bmove, fbcon_mfb_clear, fbcon_mfb_putc,
+    fbcon_mfb_putcs, fbcon_mfb_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_mfb);
+EXPORT_SYMBOL(fbcon_mfb_setup);
+EXPORT_SYMBOL(fbcon_mfb_bmove);
+EXPORT_SYMBOL(fbcon_mfb_clear);
+EXPORT_SYMBOL(fbcon_mfb_putc);
+EXPORT_SYMBOL(fbcon_mfb_putcs);
+EXPORT_SYMBOL(fbcon_mfb_revc);
--- m68k-2.1.77/drivers/video/fbcon-virge.c.orig	Fri Jan  9 01:24:45 1998
+++ m68k-2.1.77/drivers/video/fbcon-virge.c	Mon Jan 12 23:12:43 1998
@@ -1,225 +0,0 @@
-/*
- *  linux/drivers/video/fbcon-virge.c -- Low level frame buffer operations
- *			     for the CyberVision64/3D (accelerated)
- *
- *	Created 28 Dec 1997 by Andre Heynatz
- *
- *      based on fbcon-cyber.c (same dir) and fbcon.c from Linux 2.0.31pre3
- *      (both written by Geert Uytterhoeven and others)
- *
- *  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.
- */
-
-#define FBCONVIRGEDEBUG
-
-#include <linux/module.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/string.h>
-#include <linux/config.h>
-#include <linux/fb.h>
-
-#include "fbcon.h"
-#include "s3blit.h"
-
-#ifdef FBCONVIRGEDEBUG
-#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
-#else
-#define DPRINTK(fmt, args...)
-#endif
-
-    /*
-     *  Prototypes
-     */
-
-static int open_cyber3d(struct display *p);
-static void release_cyber3d(void);
-static void bmove_cyber3d(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width);
-static void clear_cyber3d(struct vc_data *conp, struct display *p, int sy, int sx,
-	                int height, int width);
-/* TODO:
-static void putc_cyber3d(struct vc_data *conp, struct display *p, int c, int yy,
-	               int xx);
-static void putcs_cyber3d(struct vc_data *conp, struct display *p, const char *s,
-	                int count, int yy, int xx);
-static void rev_char_cyber3d(struct display *p, int xx, int yy);
-*/
-/* prototypes for cfb8 functions, can be done without replicating code,
-   remove them if they are replaced by native functions */
-
-static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
-                       int xx);
-static void putcs_cfb8(struct vc_data *conp, struct display *p, const char *s,
-                        int count, int yy, int xx);
-static void rev_char_cfb8(struct display *p, int xx, int yy);
-
-    /*
-     *  Acceleration functions in cyberfb.c
-     */
-
-extern void Cyber3D_WaitQueue(unsigned short fifo);
-extern void Cyber_WaitBlit(void);
-extern void Cyber3D_BitBLT(unsigned short curx, unsigned short cury,
-			 unsigned short destx, unsigned short desty,
-			 unsigned short width, unsigned short height,
-			 unsigned short mode);
-extern void Cyber3D_RectFill(unsigned short xx, unsigned short yy,
-			   unsigned short width, unsigned short height,
-			     /* unsigned short mode, */ unsigned short fillcolor);
-extern void Cyber_MoveCursor(unsigned short xx, unsigned short yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_cyber3d = {
-   open_cyber3d, release_cyber3d, bmove_cyber3d, clear_cyber3d, putc_cfb8,
-   putcs_cfb8, rev_char_cfb8
-};
-
-    /*
-     *  CyberVision64/3D (accelerated)
-     */
-
-static int open_cyber3d(struct display *p)
-{
-    if (p->type != FB_TYPE_PACKED_PIXELS ||
-        p->var.accel != FB_ACCEL_CYBERVISION3D) {
-        DPRINTK("accelerated driver not wanted\n");
-        return -EINVAL;
-    }
-    p->next_line = p->var.xres_virtual*p->var.bits_per_pixel>>3;
-    p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cyber3d(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_cyber3d(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width)
-{
-        sx *= 8; dx *= 8; width *= 8;
-        Cyber3D_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
-                       (u_short)(dy*p->fontheight), (u_short)width,
-                       (u_short)(height*p->fontheight), (u_short)S3_NEW);
-}
-
-static void clear_cyber3d(struct vc_data *conp, struct display *p,
-                          int sy, int sx, int height, int width)
-{
-        unsigned char bg;
-
-        sx *= 8; width *= 8;
-        bg = attr_bgcol_ec(p,conp);
-        Cyber3D_RectFill((u_short)sx, (u_short)(sy*p->fontheight),
-                         (u_short)width, (u_short)(height*p->fontheight),
-                         (u_short)bg);
-}
-
-/* the following structures are copies from fbcon-cfb8.c
-   remove them if there are no functions from fbcon-cfb8 left */
-
-static u_long nibbletab_cfb8[] = {
-    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
-    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
-    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
-    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
-};
-
-/* the following functions are copies from fbcon-cfb8.c
-   TODO: rewrite them for the Cybervision64/3D
-*/
-
-static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
-                      int xx)
-{
-    u_char *dest,*cdat;
-    int bytes=p->next_line,rows;
-    ulong eorx,fgx,bgx;
-
-    c &= 0xff;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    cdat = p->fontdata + c * p->fontheight;
-
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-        ((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-        ((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
-    }
-}
-
-static void putcs_cfb8(struct vc_data *conp, struct display *p, const char *s,
-                       int count, int yy, int xx)
-{
-    u_char *cdat, c, *dest, *dest0;
-    int rows,bytes=p->next_line;
-    u_long eorx, fgx, bgx;
-
-    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-    while (count--) {
-        c = *s++;
-        cdat = p->fontdata + c * p->fontheight;
-
-        for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-            ((u_long *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-            ((u_long *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^
-                                 bgx;
-        }
-        dest0+=8;
-    }
-}
-
-static void rev_char_cfb8(struct display *p, int xx, int yy)
-{
-    u_char *dest;
-    int bytes=p->next_line, rows;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-        ((u_long *)dest)[0] ^= 0x0f0f0f0f;
-        ((u_long *)dest)[1] ^= 0x0f0f0f0f;
-    }
-}
-
-
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cyber3d(void)
-#endif
-{
-     DPRINTK("registering accelerated driver\n");
-     return(fbcon_register_driver(&dispsw_cyber3d, 1));
-}
-
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cyber3d);
-}
-#endif /* MODULE */
-
-
--- m68k-2.1.77/drivers/video/fbcon.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon.c	Mon Jan 12 23:34:25 1998
@@ -28,28 +28,18 @@
  *  The low level operations for the various display memory organizations are
  *  now in separate source files.
  *
- *  Currently only the following organizations are supported:
+ *  Currently the following organizations are supported:
  *
- *    - non-accelerated:
- *
- *	  o mfb		 Monochrome
- *	  o ilbm	 Interleaved bitplanes ŕ la Amiga
- *	  o afb		 Bitplanes ŕ la Amiga
- *	  o iplan2p[248] Interleaved bitplanes ŕ la Atari (2, 4 and 8 planes)
- *	  o cfb{8,16}    Packed pixels (8 and 16 bpp)
- *
- *    - accelerated:
- *
- *	  o cyber	 CyberVision64 packed pixels (accelerated)
- *        o virge        CyberVision64/3D packed pixels (accelerated)
- *	  o retz3	 Retina Z3 packed pixels (accelerated)
- *	  o mach64	 ATI Mach 64 packed pixels (accelerated)
- *	  o aty		 ATI Mach 64 packed pixels (accelerated)
+ *    o afb			Amiga bitplanes
+ *    o cfb{2,4,8,16,32}	Packed pixels
+ *    o ilbm			Amiga interleaved bitplanes
+ *    o iplan2p[248]		Atari interleaved bitplanes
+ *    o mfb			Monochrome
  *
  *  To do:
  *
  *    - Implement 16 plane mode (iplan2p16)
- *    - Add support for 24/32 bit packed pixels (cfb{24,32})
+ *    - Add support for 24 bit packed pixels (cfb24)
  *    - Hardware cursor
  *
  *
@@ -79,9 +69,6 @@
 #include <linux/vt_kern.h>
 #include <linux/selection.h>
 #include <linux/init.h>
-#ifdef CONFIG_KERNELD
-#include <linux/kerneld.h>
-#endif
 
 #include <asm/irq.h>
 #include <asm/system.h>
@@ -103,6 +90,7 @@
 #include <asm/linux_logo.h>
 
 #include "fbcon.h"
+#include "fbcon-mac.h"	/* for 6x11 font on mac */
 #include "font.h"
 
 #ifdef FBCONDEBUG
@@ -160,26 +148,24 @@
 static unsigned long fbcon_startup(unsigned long kmem_start,
 				   const char **display_desc);
 static void fbcon_init(struct vc_data *conp);
-static int fbcon_deinit(struct vc_data *conp);
+static void fbcon_deinit(struct vc_data *conp);
 static int fbcon_changevar(int con);
-static int fbcon_clear(struct vc_data *conp, int sy, int sx, int height,
+static void fbcon_clear(struct vc_data *conp, int sy, int sx, int height,
 		       int width);
-static int fbcon_putc(struct vc_data *conp, int c, int ypos, int xpos);
-static int fbcon_putcs(struct vc_data *conp, const char *s, int count,
-		       int ypos, int xpos);
-static int fbcon_cursor(struct vc_data *conp, int mode);
-static int fbcon_scroll(struct vc_data *conp, int t, int b,
-			int dir, int count);
-static int fbcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
-		       int height, int width);
+static void fbcon_putc(struct vc_data *conp, int c, int ypos, int xpos);
+static void fbcon_putcs(struct vc_data *conp, const char *s, int count,
+			int ypos, int xpos);
+static void fbcon_cursor(struct vc_data *conp, int mode);
+static void fbcon_scroll(struct vc_data *conp, int t, int b, int dir,
+			 int count);
+static void fbcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+			int height, int width);
 static int fbcon_switch(struct vc_data *conp);
 static int fbcon_blank(int blank);
 static int fbcon_get_font(struct vc_data *conp, int *w, int *h, char *data);
 static int fbcon_set_font(struct vc_data *conp, int w, int h, char *data);
 static int fbcon_set_palette(struct vc_data *conp, unsigned char *table);
 static int fbcon_scrolldelta(int lines);
-int fbcon_register_driver(struct display_switch *dispsw, int is_accel);
-int fbcon_unregister_driver(struct display_switch *dispsw);
 
 
 /*
@@ -207,13 +193,7 @@
 				 struct display *p, int count);
 static void fbcon_bmove_rec(struct display *p, int sy, int sx, int dy, int dx,
 			    int height, int width, u_int y_break);
-static struct display_switch *probe_list(struct display_switch *dispsw,
-					 struct display *disp);
 
-#ifdef CONFIG_KERNELD
-static void request_driver(struct display *disp, int is_accel);
-#endif
-static struct display_switch *fbcon_get_driver(struct display *disp);
 static int fbcon_show_logo(void);
 
 #if FLASHING_CURSOR
@@ -250,68 +230,8 @@
  *  Low Level Operations
  */
 
-static struct display_switch dispsw_dummy;
+static struct display_switch fbcon_dummy;
 
-#ifdef CONFIG_FBCON_MFB
-extern int fbcon_init_mfb(void);
-#endif
-#ifdef CONFIG_FBCON_ILBM
-extern int fbcon_init_ilbm(void);
-#endif
-#ifdef CONFIG_FBCON_AFB
-extern int fbcon_init_afb(void);
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P2
-extern int fbcon_init_iplan2p2(void);
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P4
-extern int fbcon_init_iplan2p4(void);
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P8
-extern int fbcon_init_iplan2p8(void);
-#endif
-#ifdef CONFIG_FBCON_CFB2
-extern int fbcon_init_cfb2(void);
-#endif
-#ifdef CONFIG_FBCON_CFB4
-extern int fbcon_init_cfb4(void);
-#endif
-#ifdef CONFIG_FBCON_CFB8
-extern int fbcon_init_cfb8(void);
-#endif
-#ifdef CONFIG_FBCON_CFB16
-extern int fbcon_init_cfb16(void);
-#endif
-#ifdef CONFIG_FBCON_CFB24
-extern int fbcon_init_cfb24(void);
-#endif
-#ifdef CONFIG_FBCON_CFB32
-extern int fbcon_init_cfb32(void);
-#endif
-#ifdef CONFIG_FBCON_CYBER
-extern int fbcon_init_cyber(void);
-#endif
-#ifdef CONFIG_FBCON_VIRGE
-extern int fbcon_init_cyber3d(void);
-#endif
-#ifdef CONFIG_FBCON_VIRGE
-extern int fbcon_init_cyber3d(void);
-#endif
-#ifdef CONFIG_FBCON_RETINAZ3
-extern int fbcon_init_retz3(void);
-#endif
-#ifdef CONFIG_FBCON_MACH64
-extern int fbcon_init_mach64(void);
-#endif
-#ifdef CONFIG_FBCON_TRIO
-extern int fbcon_init_trio(void);
-#endif
-#ifdef CONFIG_FBCON_ATY
-extern int fbcon_init_aty(void);
-#endif
-#ifdef CONFIG_FBCON_MAC
-extern int fbcon_init_mac(void);
-#endif
 
 __initfunc(static unsigned long fbcon_startup(unsigned long kmem_start,
 					      const char **display_desc))
@@ -325,68 +245,6 @@
             DPRINTK("no framebuffer registered\n");
 	    return kmem_start;
     }
-    /* Initialize all built-in low level drivers */
-#ifdef CONFIG_FBCON_RETINAZ3
-    fbcon_init_retz3();
-#endif
-#ifdef CONFIG_FBCON_MFB
-    fbcon_init_mfb();
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P2
-    fbcon_init_iplan2p2();
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P4
-    fbcon_init_iplan2p4();
-#endif
-#ifdef CONFIG_FBCON_IPLAN2P8
-    fbcon_init_iplan2p8();
-#endif
-#ifdef CONFIG_FBCON_ILBM
-    fbcon_init_ilbm();
-#endif
-#ifdef CONFIG_FBCON_AFB
-    fbcon_init_afb();
-#endif
-#ifdef CONFIG_FBCON_CFB2
-    fbcon_init_cfb2();
-#endif
-#ifdef CONFIG_FBCON_CFB4
-    fbcon_init_cfb4();
-#endif
-#ifdef CONFIG_FBCON_CFB8
-    fbcon_init_cfb8();
-#endif
-#ifdef CONFIG_FBCON_CFB16
-    fbcon_init_cfb16();
-#endif
-#ifdef CONFIG_FBCON_CFB24
-    fbcon_init_cfb24();
-#endif
-#ifdef CONFIG_FBCON_CFB32
-    fbcon_init_cfb32();
-#endif
-#ifdef CONFIG_FBCON_CYBER
-    fbcon_init_cyber();
-#endif
-#ifdef CONFIG_FBCON_VIRGE
-    fbcon_init_cyber3d();
-#endif
-#ifdef CONFIG_FBCON_VIRGE
-    fbcon_init_cyber3d();
-#endif
-#ifdef CONFIG_FBCON_MACH64
-    fbcon_init_mach64();
-#endif
-#ifdef CONFIG_FBCON_TRIO
-    fbcon_init_trio();
-#endif
-#ifdef CONFIG_FBCON_ATY
-    fbcon_init_aty();
-#endif
-#ifdef CONFIG_FBCON_MAC
-    fbcon_init_mac();
-#endif
-
     *display_desc = "frame buffer device";
 
 #ifdef CONFIG_AMIGA
@@ -479,16 +337,13 @@
 }
 
 
-static int fbcon_deinit(struct vc_data *conp)
+static void fbcon_deinit(struct vc_data *conp)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
 
-    if (p->dispsw)
-	    p->dispsw->release();
-    p->dispsw = 0;
+    p->dispsw = NULL;
     p->conp = 0;
-    return(0);
 }
 
 
@@ -518,7 +373,6 @@
     struct display *p = &fb_display[con];
     struct vc_data *conp = p->conp;
     int nr_rows, nr_cols;
-    struct display_switch *old_dispsw, *new_dispsw;
 
     p->var.xoffset = p->var.yoffset = p->yscroll = 0;  /* reset wrap/pan */
 
@@ -527,10 +381,18 @@
 		      &p->fontdata) || p->fontwidth != 8)
 	getdefaultfont(p->var.xres, p->var.yres, NULL, &p->fontwidth,
 		       &p->fontheight, &p->fontdata);
-    if (p->fontwidth != 8 && !MACH_IS_MAC) {
-	/* ++Geert: changed from panic() to `correct and continue' */
-	printk(KERN_ERR "fbcon_setup: No support for fontwidth != 8");
-	p->fontwidth = 8;
+    if (p->fontwidth != 8) {
+#ifdef CONFIG_MAC
+	if (MACH_IS_MAC)
+	    /* ++Geert: hack to make 6x11 fonts work on mac */
+	    p->dispsw = &fbcon_mac;
+	else
+#endif
+	{
+	    /* ++Geert: changed from panic() to `correct and continue' */
+	    printk(KERN_ERR "fbcon_setup: No support for fontwidth != 8");
+	    p->dispsw = &fbcon_dummy;
+	}
     }
     updatescrollmode(p);
 
@@ -548,18 +410,12 @@
     p->vrows = p->var.yres_virtual/p->fontheight;
     conp->vc_can_do_color = p->var.bits_per_pixel != 1;
 
-    new_dispsw = fbcon_get_driver(p);
-    if (!new_dispsw) {
+    if (!p->dispsw) {
 	printk(KERN_WARNING "fbcon_setup: type %d (aux %d, depth %d) not "
 	       "supported\n", p->type, p->type_aux, p->var.bits_per_pixel);
-	dispsw_dummy.open(p);
-	new_dispsw = &dispsw_dummy;
+	p->dispsw = &fbcon_dummy;
     }
-    /* Be careful when changing dispsw, it might be the current console.  */
-    old_dispsw = p->dispsw;
-    p->dispsw = new_dispsw;
-    if (old_dispsw)
-	old_dispsw->release();
+    p->dispsw->setup(p);
 
     if (setcol) {
 	p->fgcol = p->var.bits_per_pixel > 2 ? 7 : (1<<p->var.bits_per_pixel)-1;
@@ -605,18 +461,18 @@
 }
 
 
-static int fbcon_clear(struct vc_data *conp, int sy, int sx, int height,
-			      int width)
+static void fbcon_clear(struct vc_data *conp, int sy, int sx, int height,
+			int width)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
     u_int y_break;
 
     if (!p->can_soft_blank && console_blanked)
-	return(0);
+	return;
 
     if (!height || !width)
-	return 0;
+	return;
 
     if ((sy <= p->cursor_y) && (p->cursor_y < sy+height) &&
 	(sx <= p->cursor_x) && (p->cursor_x < sx+width))
@@ -631,47 +487,41 @@
 	p->dispsw->clear(conp, p, real_y(p, sy+b), sx, height-b, width);
     } else
 	p->dispsw->clear(conp, p, real_y(p, sy), sx, height, width);
-
-    return(0);
 }
 
 
-static int fbcon_putc(struct vc_data *conp, int c, int ypos, int xpos)
+static void fbcon_putc(struct vc_data *conp, int c, int ypos, int xpos)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
 
     if (!p->can_soft_blank && console_blanked)
-	    return 0;
+	    return;
 
     if ((p->cursor_x == xpos) && (p->cursor_y == ypos))
 	    CURSOR_UNDRAWN();
 
     p->dispsw->putc(conp, p, c, real_y(p, ypos), xpos);
-
-    return 0;
 }
 
 
-static int fbcon_putcs(struct vc_data *conp, const char *s, int count,
+static void fbcon_putcs(struct vc_data *conp, const char *s, int count,
 		       int ypos, int xpos)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
 
     if (!p->can_soft_blank && console_blanked)
-	    return 0;
+	    return;
 
     if ((p->cursor_y == ypos) && (xpos <= p->cursor_x) &&
 	(p->cursor_x < (xpos + count)))
 	    CURSOR_UNDRAWN();
     p->dispsw->putcs(conp, p, s, count, real_y(p, ypos), xpos);
-
-    return(0);
 }
 
 
-static int fbcon_cursor(struct vc_data *conp, int mode)
+static void fbcon_cursor(struct vc_data *conp, int mode)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
@@ -679,9 +529,9 @@
     /* Avoid flickering if there's no real change. */
     if (p->cursor_x == conp->vc_x && p->cursor_y == conp->vc_y &&
 	(mode == CM_ERASE) == !cursor_on)
-	return 0;
+	return;
     if (CURSOR_UNDRAWN ())
-	p->dispsw->rev_char(p, p->cursor_x, real_y(p, p->cursor_y));
+	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;
 
@@ -696,8 +546,6 @@
 	    cursor_on = 1;
 	    break;
     }
-
-    return(0);
 }
 
 
@@ -714,7 +562,7 @@
 	 * switching code should set vbl_cursor_cnt to an appropriate value.
 	 */
 	p = &fb_display[fg_console];
-	p->dispsw->rev_char(p, p->cursor_x, real_y(p, p->cursor_y));
+	p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
 	cursor_drawn ^= 1;
 	vbl_cursor_cnt = cursor_blink_rate;
     }
@@ -804,16 +652,17 @@
 }
 
 
-static int fbcon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
+static void fbcon_scroll(struct vc_data *conp, int t, int b, int dir,
+			 int count)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
 
     if (!p->can_soft_blank && console_blanked)
-	return(0);
+	return;
 
     if (!count)
-	return 0;
+	return;
 
     fbcon_cursor(conp, CM_ERASE);
 
@@ -941,22 +790,20 @@
 	    fbcon_clear(conp, 0, t, conp->vc_rows, count);
 	    break;
     }
-
-    return(0);
 }
 
 
-static int fbcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
-		       int height, int width)
+static void fbcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+			int height, int width)
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
 
     if (!p->can_soft_blank && console_blanked)
-	return(0);
+	return;
 
     if (!width || !height)
-	return 0;
+	return;
 
     if (((sy <= p->cursor_y) && (p->cursor_y < sy+height) &&
 	 (sx <= p->cursor_x) && (p->cursor_x < sx+width)) ||
@@ -972,8 +819,6 @@
      *  over again, so we use fbcon_bmove_rec()
      */
     fbcon_bmove_rec(p, sy, sx, dy, dx, height, width, p->vrows-p->yscroll);
-
-    return(0);
 }
 
 
@@ -1447,148 +1292,18 @@
 
 
 /*
- *  Driver registration
- */
-
-static struct display_switch *drivers = NULL, *accel_drivers = NULL;
-
-int fbcon_register_driver(struct display_switch *dispsw, int is_accel)
-{
-    struct display_switch **list;
-
-    list = is_accel ? &accel_drivers : &drivers;
-    dispsw->next = *list;
-    *list = dispsw;
-    return 0;
-}
-
-int fbcon_unregister_driver(struct display_switch *dispsw)
-{
-    struct display_switch **list;
-
-    for (list = &accel_drivers; *list; list = &(*list)->next)
-	if (*list == dispsw) {
-	    *list = dispsw->next;
-	    dispsw->next = NULL;
-	    return 0;
-	}
-    for (list = &drivers; *list; list = &(*list)->next)
-	if (*list == dispsw) {
-	    *list = dispsw->next;
-	    dispsw->next = NULL;
-	    return 0;
-	}
-    return -EINVAL;
-}
-
-
-static struct display_switch *probe_list(struct display_switch *dispsw,
-					 struct display *disp)
-{
-    while (dispsw) {
-	if (!dispsw->open(disp))
-	    return(dispsw);
-	dispsw = dispsw->next;
-    }
-    return(NULL);
-}
-
-
-#ifdef CONFIG_KERNELD
-static void request_driver(struct display *disp, int is_accel)
-{
-    char modname[30];
-    int len;
-    const char *type;
-
-    if (disp->var.bits_per_pixel == 1)
-	type = "mfb";
-    else
-	switch (disp->type) {
-	    case FB_TYPE_INTERLEAVED_PLANES:
-		if (disp->type_aux == 2)
-		    type = "iplan2p%d";
-		else
-		    type = "ilbm";
-		break;
-	    case FB_TYPE_PLANES:
-		type = "afb";
-		break;
-	    case FB_TYPE_PACKED_PIXELS:
-		type = "cfb%d";
-		break;
-	    default:
-		return;
-	}
-    len = sprintf(modname, "fbcon-");
-    len += sprintf(modname+len, type, disp->var.bits_per_pixel);
-    if (is_accel)
-	len += sprintf(modname+len, "-%d", disp->var.accel);
-    request_module(modname);
-}
-#endif /* CONFIG_KERNELD */
-
-
-static struct display_switch *fbcon_get_driver(struct display *disp)
-{
-    struct display_switch *dispsw;
-
-    if (disp->var.accel != FB_ACCEL_NONE) {
-	/* First try an accelerated driver */
-	dispsw = probe_list(accel_drivers, disp);
-#ifdef CONFIG_KERNELD
-	if (!dispsw) {
-	    request_driver(disp, 1);
-	    dispsw = probe_list(accel_drivers, disp);
-	}
-#endif
-	if (dispsw)
-	    return(dispsw);
-    }
-
-    /* Then try an unaccelerated driver */
-    dispsw = probe_list(drivers, disp);
-#ifdef CONFIG_KERNELD
-    if (!dispsw) {
-	request_driver(disp, 0);
-	dispsw = probe_list(drivers, disp);
-    }
-#endif
-    return(dispsw);
-}
-
-
-/*
  *  Dummy Low Level Operations
  */
 
-static int open_dummy(struct display *p)
-{
-    if (p->line_length)
-	p->next_line = p->line_length;
-    else
-	p->next_line = p->var.xres_virtual>>3;
-    p->next_plane = 0;
-    p->var.bits_per_pixel = 1;
-    return 0;
-}
-
-static void misc_dummy(void) {}
-
-static struct display_switch dispsw_dummy = {
-    open_dummy,
-    /* release_dummy */
-    misc_dummy,
-    /* bmove_dummy */
-    (void (*)(struct display *, int, int, int, int, int, int))misc_dummy,
-    /* clear_dummy */
-    (void (*)(struct vc_data *, struct display *, int, int, int, int))misc_dummy,
-    /* putc_dummy */
-    (void (*)(struct vc_data *, struct display *, int, int, int))misc_dummy,
-    /* putcs_dummy */
-    (void (*)(struct vc_data *, struct display *, const char *, int, int, int))misc_dummy,
-    /* rev_char_dummy */
-    (void (*)(struct display *, int, int))misc_dummy,
+static void fbcon_dummy_op(void) {}
+
+static struct display_switch fbcon_dummy = {
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_setup */
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_bmove */
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_clear */
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_putc */
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_putcs */
+    (void *)fbcon_dummy_op,	/* fbcon_dummy_revc */
 };
 
 
@@ -1597,5 +1312,3 @@
  */
 
 EXPORT_SYMBOL(fb_display);
-EXPORT_SYMBOL(fbcon_register_driver);
-EXPORT_SYMBOL(fbcon_unregister_driver);
--- m68k-2.1.77/drivers/video/fbgen.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbgen.c	Sun Jan 11 19:49:26 1998
@@ -262,13 +262,11 @@
 }
 
 
-    /*
-     *  Set the display parameters for a video mode
-     */
-
 void fbgen_set_disp(int con, struct fb_info_gen *info)
 {
+    struct fbgen_hwswitch *fbhw = info->fbhw;
     struct fb_fix_screeninfo fix;
+    char par[info->parsize];
     struct display *display;
 
     if (con >= 0)
@@ -276,9 +274,12 @@
     else
 	display = &disp;	/* used during initialization */
 
-    fbgen_get_fix(&fix, con, &info->info);
     if (con == -1)
-	con = 0;
+	fbhw->get_par(&par, info);
+    else
+	fbhw->decode_var(&fb_display[con].var, &par, info);
+    memset(&fix, 0, sizeof(struct fb_fix_screeninfo));
+    fbhw->encode_fix(&fix, &par, info);
 
     display->screen_base = fix.smem_start;
     display->visual = fix.visual;
@@ -292,6 +293,7 @@
 	display->can_soft_blank = 1;
     else
 	display->can_soft_blank = 0;
+    display->dispsw = fbhw->get_dispsw(&par, info);
 #if 0 /* FIXME: generic inverse is not supported yet */
     display->inverse = (fix.visual == FB_VISUAL_MONO01 ? !inverse : inverse);
 #else
--- m68k-2.1.77/drivers/video/macfb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/macfb.c	Sun Jan 11 16:02:56 1998
@@ -23,6 +23,10 @@
 #include <asm/macintosh.h>
 #include <linux/fb.h>
 
+#include "fbcon-cfb2.h"
+#include "fbcon-cfb4.h"
+#include "fbcon-cfb8.h"
+
 #define arraysize(x)    (sizeof(x)/sizeof(*(x)))
 
 static struct fb_var_screeninfo macfb_defined={
@@ -214,6 +218,20 @@
 	display->can_soft_blank = 0;
 	display->inverse = inverse;
 
+	switch (mac_depth) {
+	    case 2:
+		display->dispsw = &fbcon_cfb2;
+		break;
+	    case 4:
+		display->dispsw = &fbcon_cfb4;
+		break;
+	    case 8:
+		display->dispsw = &fbcon_cfb8;
+		break;
+	    default:
+		display->dispsw = NULL;
+		break;
+	}
 }
 
 static int macfb_set_var(struct fb_var_screeninfo *var, int con,
--- m68k-2.1.77/drivers/video/skeletonfb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/skeletonfb.c	Mon Jan 12 23:10:46 1998
@@ -16,106 +16,170 @@
 #include <linux/tty.h>
 #include <linux/malloc.h>
 #include <linux/delay.h>
+#include <linux/fb.h>
+
+#include "fbcon.h"
 
 
     /*
-     *  This is just simple example code.
+     *  This is just simple sample code.
      *
      *  No warranty that it actually compiles.
-     *  Even less warranty that it actually works.
+     *  Even less warranty that it actually works :-)
      */
 
 
-static int default_par = 0;	/* default resolution (0=none) */
-
-static struct xxxfb_info {
+struct xxxfb_info {
+    /*
+     *  Choose _one_ of the two alternatives:
+     *
+     *    1. Use the generic frame buffer operations (fbgen_*).
+     */
     struct fb_info_gen gen;
+    /*
+     *    2. Provide your own frame buffer operations.
+     */
+    struct fb_info info;
+
     /* Here starts the frame buffer device dependent part */
     /* You can use this to store e.g. the board number if you support */
     /* multiple boards */
-} fb_info;
+};
 
-static int currcon = 0;
 
-static struct display disp;
+struct xxxfb_par {
+    /*
+     *  The hardware specific data in this structure uniquely defines a video
+     *  mode.
+     *
+     *  If your hardware supports only one video mode, you can leave it empty.
+     */
+};
+
 
-static struct xxxfb_par {
-    ...
-} current_par;
+    /*
+     *  If your driver supports multiple boards, you should make these arrays,
+     *  or allocate them dynamically (using mem_start for builtin drivers, and
+     *  kmalloc() for loaded modules).
+     */
 
+static struct xxxfb_info fb_info;
+static struct xxxfb_par current_par;
 static int current_par_valid = 0;
+static struct display disp;
 
+static struct fb_var_screeninfo default_var;
 
-int inverse = 0;
+static int currcon = 0;
+static int inverse = 0;
 
 
-/* ------------------- chipset specific functions ---------------------- */
+/* ------------------- chipset specific functions -------------------------- */
 
 
-static int xxx_detect(void)
+static void xxx_detect(void)
 {
-    ...
+    /*
+     *  This function should detect the current video mode settings and store
+     *  it as the default video mode
+     */
+
+    /* ... */
     xxx_get_par(&par);
-    xxx_encode_var(&xxxfb_predefined[0], &par);
-    return 1;
+    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)
 {
-    ...
+    /*
+     *  This function should fill in the 'fix' structure based on the values
+     *  in the `par' structure.
+     */
+
+    /* ... */
     return 0;
 }
 
 static int xxx_decode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
 			  const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  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.
+     */
+
+    /* ... */
     return 0;
 }
 
 static int xxx_encode_var(struct fb_var_screeninfo *var, struct xxxfb_par *par,
 			  const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  Fill the 'var' structure based on the values in 'par' and maybe other
+     *  values read out of the hardware.
+     */
+
+    /* ... */
     return 0;
 }
 
 static void xxx_get_par(struct xxxfb_par *par, const struct fb_info *fb_info)
 {
+    /*
+     *  Fill the hardware's 'par' structure.
+     */
+
     if (current_par_valid)
 	*par = current_par;
     else {
-	...
+	/* ... */
     }
 }
 
 static void xxx_set_par(struct xxxfb_par *par, const struct fb_info *fb_info)
 {
+    /*
+     *  Set the hardware according to 'par'.
+     */
+
     current_par = *par;
     current_par_valid = 1;
-    ...
+    /* ... */
 }
 
 static int xxx_getcolreg(unsigned regno, unsigned *red, unsigned *green,
 			 unsigned *blue, unsigned *transp,
 			 const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  Read a single color register and split it into colors/transparent.
+     *  Return != 0 for invalid regno.
+     */
+
+    /* ... */
     return 0;
 }
 
-/* make colors available to fbcon */
-unsigned u16 packed16_cmap[16];
-unsigned u32 packed24_cmap[16];
-unsigned u32 packed32_cmap[16];
-
 static int xxx_setcolreg(unsigned regno, unsigned red, unsigned green,
 			 unsigned blue, unsigned transp,
 			 const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  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.
+     */
+
     if (regno < 16) {
+	/*
+	 *  Make the first 16 colors of the palette available to fbcon
+	 */
 	if (is_cfb15)		/* RGB 555 */
 	    packed16_cmap[regno] = be16_to_cpu((red << 10) | (green << 5) |
 					       blue);
@@ -129,6 +193,7 @@
 	    packed32_cmap[regno] = be32_to_cpu((red << 24) | (green << 16) |
 					       (blue << 8) | transp);
     }
+    /* ... */
     return 0;
 }
 
@@ -136,33 +201,60 @@
 			   struct xxxfb_par *par,
 			   const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  Pan (or wrap, depending on the `vmode' field) the display using the
+     *  `xoffset' and `yoffset' fields of the `var' structure.
+     *  If the values don't fit, return -EINVAL.
+     */
+
+    /* ... */
     return 0;
 }
 
 static int xxx_blank(int blank_mode, const struct fb_info *fb_info)
 {
-    ...
+    /*
+     *  Blank the screen if blank_mode != 0, else unblank. If blank == 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
+     */
+
+    /* ... */
     return 0;
 }
 
+static struct display_switch *xxx_get_dispsw(const void *par,
+					     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 operations, 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.
+     */
+    return &fbcon_cfb8;
+}
+
 
 /* ------------ Interfaces to hardware functions ------------ */
 
 
 struct fbgen_hwswitch xxx_switch = {
     xxx_detect, xxx_encode_fix, xxx_decode_var, xxx_encode_var, xxx_get_par,
-    xxx_set_par, xxx_getcolreg, xxx_setcolreg, xxx_blank
+    xxx_set_par, xxx_getcolreg, xxx_setcolreg, xxx_blank, xxx_dispsw
 };
 
 
 
-/* =========================================================== */
-/* ============== Hardware Independant Functions ============= */
-/* =========================================================== */
-
+/* ------------ Hardware Independant Functions ------------ */
 
-/* ----------------------------------------------------------------------------
 
     /*
      *  Initialization
@@ -174,7 +266,7 @@
     struct fb_var_screeninfo var;
 
     fb_info.fbhw = &xxx_switch;
-    detected_mode = fbhw->detect();
+    fbhw->detect();
     strcpy(fb_info.modename, "XXX");
     fb_info.changevar = NULL;
     fb_info.node = -1;
@@ -184,13 +276,13 @@
     fb_info.updatevar = &xxxfb_update_var;
     fb_info.blank = &xxxfb_blank;
     /* This should give a reasonable default video mode */
-    xxxfb_get_var(&disp.var, -1, &fb_info);
-    fb_do_set_var(var, 1);
-    err = register_framebuffer(&fb_info);
+    fbgen_get_var(&disp.var, -1, &fb_info.gen);
+    fbgen_do_set_var(var, 1, &fbinfo.gen);
+    err = register_framebuffer(&fb_info.gen.info);
     if (err < 0)
 	return err;
-    xxxfb_set_disp(-1, &fb_info);
-    fb_install_cmap(0);
+    fbgen_set_disp(-1, &fb_info.gen.info);
+    fbgen_install_cmap(0, &fb_info.gen);
     printk("%s frame buffer device\n", fb_info.modename);
 
     /* uncomment this if your driver cannot be unloaded */
@@ -201,16 +293,32 @@
 
 
     /*
+     *  Cleanup
+     */
+
+void xxxfb_cleanup(struct fb_info *info)
+{
+    /*
+     *  If your driver supports multiple boards, you should unregister and
+     *  clean up all instances.
+     */
+
+    unregister_framebuffer(&fb_info);
+    /* ... */
+}
+
+
+    /*
      *  Setup
      */
 
 __initfunc(void xxxfb_setup(char *options, int *ints))
 {
-    /* Parse user speficied options (`video=xxxfb:')
+    /* Parse user speficied options (`video=xxxfb:') */
 }
 
 
-/* ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
 
 
     /*
@@ -232,7 +340,8 @@
 
 
     /*
-     *  In most cases the `generic' routines should be satisfactory
+     *  In most cases the `generic' routines (fbgen_*) should be satisfactory.
+     *  However, you're free to fill in your own replacements.
      */
 
 static struct fb_ops xxxfb_ops = {
@@ -241,7 +350,7 @@
 };
 
 
-/* ----------------------------------------------------------------------------
+/* ------------------------------------------------------------------------- */
 
 
     /*
@@ -256,8 +365,6 @@
 
 void cleanup_module(void)
 {
-    /* Not reached because the usecount will never be decremented to zero */
-    unregister_framebuffer(&fb_info);
-    /* TODO: further clean up ... */
+    xxxfb_cleanup(void);
 }
 #endif /* MODULE */
--- m68k-2.1.77/drivers/video/vfb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/vfb.c	Mon Jan 12 23:00:51 1998
@@ -22,6 +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-cfb32.h"
+
 
 #define arraysize(x)	(sizeof(x)/sizeof(*(x)))
 
@@ -249,6 +256,34 @@
 	    display->line_length = fix.line_length;
 	    display->can_soft_blank = 1;
 	    display->inverse = 0;
+	    switch (var->bits_per_pixel) {
+		case 1:
+		    display->dispsw = &fbcon_mfb;
+		    break;
+		case 2:
+		    display->dispsw = &fbcon_cfb2;
+		    break;
+		case 4:
+		    display->dispsw = &fbcon_cfb4;
+		    break;
+		case 8:
+		    display->dispsw = &fbcon_cfb8;
+		    break;
+		case 16:
+		    display->dispsw = &fbcon_cfb16;
+		    break;
+#if 0
+		case 24:
+		    display->dispsw = &fbcon_cfb24;
+		    break;
+#endif
+		case 32:
+		    display->dispsw = &fbcon_cfb32;
+		    break;
+		default:
+		    display->dispsw = NULL;
+		    break;
+	    }
 	    if (fb_info.changevar)
 		(*fb_info.changevar)(con);
 	}
@@ -454,6 +489,8 @@
 	case 1:
 	    fix->visual = FB_VISUAL_MONO01;
 	    break;
+	case 2:
+	case 4:
 	case 8:
 	    fix->visual = FB_VISUAL_PSEUDOCOLOR;
 	    break;
--- m68k-2.1.77/drivers/video/vgacon.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/vgacon.c	Mon Jan 12 23:06:13 1998
@@ -87,16 +87,16 @@
 static unsigned long vgacon_startup(unsigned long kmem_start,
 				   const char **display_desc);
 static void vgacon_init(struct vc_data *conp);
-static int vgacon_deinit(struct vc_data *conp);
-static int vgacon_clear(struct vc_data *conp, int sy, int sx, int height,
-		       int width);
-static int vgacon_putc(struct vc_data *conp, int c, int ypos, int xpos);
-static int vgacon_putcs(struct vc_data *conp, const char *s, int count,
-		       int ypos, int xpos);
-static int vgacon_cursor(struct vc_data *conp, int mode);
-static int vgacon_scroll(struct vc_data *conp, int t, int b,
-			int dir, int count);
-static int vgacon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+static void vgacon_deinit(struct vc_data *conp);
+static void vgacon_clear(struct vc_data *conp, int sy, int sx, int height,
+			 int width);
+static void vgacon_putc(struct vc_data *conp, int c, int ypos, int xpos);
+static void vgacon_putcs(struct vc_data *conp, const char *s, int count,
+			 int ypos, int xpos);
+static void vgacon_cursor(struct vc_data *conp, int mode);
+static void vgacon_scroll(struct vc_data *conp, int t, int b, int dir,
+			  int count);
+static void vgacon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
 		       int height, int width);
 static int vgacon_switch(struct vc_data *conp);
 static int vgacon_blank(int blank);
@@ -357,22 +357,21 @@
     conp->vc_can_do_color = vga_can_do_color;
 }
 
-static int vgacon_deinit(struct vc_data *conp)
+static void vgacon_deinit(struct vc_data *conp)
 {
-    return 0;
 }
 
 
 /* ====================================================================== */
 
-static int vgacon_clear(struct vc_data *conp, int sy, int sx, int height,
-			      int width)
+static void vgacon_clear(struct vc_data *conp, int sy, int sx, int height,
+			 int width)
 {
     int rows;
     unsigned long dest;
 
     if (console_blanked)
-	return 0;
+	return;
 
     dest = vga_video_mem_base + sy*vga_video_size_row + sx*2;
     if (sx == 0 && width == vga_video_num_columns)      
@@ -380,41 +379,38 @@
     else
         for (rows = height; rows-- ; dest += vga_video_size_row)
 	    vga_memsetw((void *)dest, conp->vc_video_erase_char, width);
-    return 0;
 }
 
 
-static int vgacon_putc(struct vc_data *conp, int c, int ypos, int xpos)
+static void vgacon_putc(struct vc_data *conp, int c, int ypos, int xpos)
 {
     u_short *p;
 
     if (console_blanked)
-	    return 0;
+	return;
 
     p = (u_short *)(vga_video_mem_base+ypos*vga_video_size_row+xpos*2);
     vga_writew(conp->vc_attr << 8 | c, p);
-    return 0;
 }
 
 
-static int vgacon_putcs(struct vc_data *conp, const char *s, int count,
-		       int ypos, int xpos)
+static void vgacon_putcs(struct vc_data *conp, const char *s, int count,
+			 int ypos, int xpos)
 {
     u_short *p;
     u_short sattr;
 
     if (console_blanked)
-	    return 0;
+	return;
 
     p = (u_short *)(vga_video_mem_base+ypos*vga_video_size_row+xpos*2);
     sattr = conp->vc_attr << 8;
     while (count--)
 	vga_writew(sattr | *s++, p++);
-    return 0;
 }
 
 
-static int vgacon_cursor(struct vc_data *conp, int mode)
+static void vgacon_cursor(struct vc_data *conp, int mode)
 {
     switch (mode) {
 	case CM_ERASE:
@@ -426,14 +422,14 @@
 	    write_vga(14, conp->vc_y*vga_video_num_columns+conp->vc_x);
 	    break;
     }
-    return 0;
 }
 
 
-static int vgacon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
+static void vgacon_scroll(struct vc_data *conp, int t, int b, int dir,
+			  int count)
 {
     if (console_blanked)
-	return 0;
+	return;
 
     vgacon_cursor(conp, CM_ERASE);
 
@@ -468,19 +464,17 @@
 	    vgacon_clear(conp, 0, t, conp->vc_rows, count);
 	    break;
     }
-
-    return 0;
 }
 
 
-static int vgacon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
-		       int height, int width)
+static void vgacon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+			 int height, int width)
 {
     unsigned long src, dst;
     int rows;
 
     if (console_blanked)
-	return 0;
+	return;
 
     if (sx == 0 && dx == 0 && width == vga_video_num_columns) {
 	src = vga_video_mem_base + sy * vga_video_size_row;
@@ -504,7 +498,6 @@
 	    dst -= vga_video_size_row;
 	}
     }
-    return 0;
 }
 
 
@@ -521,7 +514,7 @@
 	return 0;
     } else {
 	/* Tell console.c that it has to restore the screen itself */
-	return(1);
+	return 1;
     }
     return 0;
 }
--- m68k-2.1.77/drivers/video/fbcon.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon.h	Sun Jan 11 23:52:19 1998
@@ -8,6 +8,9 @@
  *  for more details.
  */
 
+#ifndef __VIDEO_FBCON_H
+#define __VIDEO_FBCON_H
+
 #include <linux/console_struct.h>
 
 
@@ -16,8 +19,7 @@
      */
  
 struct display_switch {                                                
-    int (*open)(struct display *p);
-    void (*release)(void);
+    void (*setup)(struct display *p);
     void (*bmove)(struct display *p, int sy, int sx, int dy, int dx,
 		  int height, int width);
     void (*clear)(struct vc_data *conp, struct display *p, int sy, int sx,
@@ -26,20 +28,11 @@
     		 int xx);
     void (*putcs)(struct vc_data *conp, struct display *p, const char *s,
 		  int count, int yy, int xx);     
-    void (*rev_char)(struct display *p, int xx, int yy);
-    struct display_switch *next;
+    void (*revc)(struct display *p, int xx, int yy);
 }; 
 
 
     /*
-     *  Driver registration
-     */
-
-extern int fbcon_register_driver(struct display_switch *dispsw, int is_accel);
-int fbcon_unregister_driver(struct display_switch *dispsw);
-
-
-    /*
      *  Attribute Decoding
      */
 
@@ -335,3 +328,5 @@
 }
 
 #endif /* !m68k */
+
+#endif /* __VIDEO_FBCON_H */
--- m68k-2.1.77/drivers/video/Config.in.orig	Fri Jan  9 01:27:57 1998
+++ m68k-2.1.77/drivers/video/Config.in	Tue Jan 13 00:05:54 1998
@@ -7,14 +7,17 @@
   mainmenu_option next_comment
   comment 'Frame buffer devices'
 
- if [ "$CONFIG_AMIGA" = "y" ]; then
+  if [ "$CONFIG_APOLLO" = "y" ]; then
+    define_bool CONFIG_FB_APOLLO y
+  fi
+  if [ "$CONFIG_AMIGA" = "y" ]; then
     bool 'Amiga native chipset support' CONFIG_FB_AMIGA
     if [ "$CONFIG_FB_AMIGA" != "n" ]; then
       bool 'Amiga OCS chipset support' CONFIG_FB_AMIGA_OCS
       bool 'Amiga ECS chipset support' CONFIG_FB_AMIGA_ECS
       bool 'Amiga AGA chipset support' CONFIG_FB_AMIGA_AGA
     fi
-    tristate 'Amiga Cybervision support' CONFIG_FB_CYBER
+    tristate 'Amiga CyberVision support' CONFIG_FB_CYBER
     if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
       bool 'Amiga CyberVision3D support (experimental)' CONFIG_FB_CV3D
       tristate 'Amiga RetinaZ3 support' CONFIG_FB_RETINAZ3
@@ -24,46 +27,42 @@
     bool 'Atari native chipset support' CONFIG_FB_ATARI
     tristate 'Mach64 Frame Buffer support' CONFIG_FB_MACH64
   fi
-  if [ "$CONFIG_MAC" = "y" ]; then
-    define_bool CONFIG_FB_MAC y
-  fi
   if [ "$CONFIG_CHRP" = "y" -o "$CONFIG_PMAC" = "y" ]; then
     bool 'Open Firmware frame buffer device support' CONFIG_FB_OPEN_FIRMWARE
+    bool 'S3 Trio frame buffer device support' CONFIG_FB_S3TRIO
+    if [ "$CONFIG_FB_OPEN_FIRMWARE" = "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 'ATI Mach64 display support' CONFIG_FB_ATY
+#     bool 'IMS Twin Turbo display support' CONFIG_FB_IMSTT
+#     bool 'Chips 65550 display support' CONFIG_FB_CT65550
+#     bool 'S3 Trio display support' CONFIG_FB_S3TRIO
+    fi
   fi 
-  if [ "$CONFIG_FB_OPEN_FIRMWARE" = "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 'ATI Mach64 display support' CONFIG_FB_ATY
-#   bool 'IMS Twin Turbo display support' CONFIG_FB_IMSTT
-#   bool 'Chips 65550 display support' CONFIG_FB_CT65550
-#   bool 'S3 Trio display support' CONFIG_FB_S3TRIO
+  if [ "$CONFIG_MAC" = "y" ]; then
+    define_bool CONFIG_FB_MAC y
   fi
   if [ "$CONFIG_TGA_CONSOLE" = "y" ]; then
     define_bool CONFIG_FB_TGA y
   fi
-  tristate 'Virtual Frame Buffer support' CONFIG_FB_VIRTUAL
+  tristate 'Virtual Frame Buffer support (ONLY FOR TESTING!)' CONFIG_FB_VIRTUAL
 
   bool 'Advanced low level driver options' CONFIG_FBCON_ADVANCED
   if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then
-    tristate 'Monochrome support' CONFIG_FBCON_MFB
-    tristate 'Interleaved bitplanes support' CONFIG_FBCON_ILBM
-    tristate 'Normal bitplanes support' CONFIG_FBCON_AFB
-    tristate 'Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
-    tristate 'Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
-    tristate 'Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
-    tristate '2 bpp packed pixel support' CONFIG_FBCON_CFB2
-    tristate '4 bpp packed pixel support' CONFIG_FBCON_CFB4
-    tristate '8 bpp packed pixel support' CONFIG_FBCON_CFB8
-    tristate '16 bpp packed pixel support' CONFIG_FBCON_CFB16
-#   tristate '24 bpp packed pixel support' CONFIG_FBCON_CFB24
-    tristate '32 bpp packed pixel support' CONFIG_FBCON_CFB32
-    tristate 'Mac packed pixel support' CONFIG_FBCON_MAC
-    tristate 'Cybervision support (accelerated)' CONFIG_FBCON_CYBER
-    tristate 'Cybervision3D support (accelerated)' CONFIG_FBCON_VIRGE
-    tristate 'RetinaZ3 support (accelerated)' CONFIG_FBCON_RETINAZ3
-    tristate 'Mach64 support (accelerated)' CONFIG_FBCON_MACH64
-#   tristate 'S3Trio support (accelerated)' CONFIG_FBCON_TRIO
+    bool 'Monochrome support' CONFIG_FBCON_MFB
+    bool '2 bpp packed pixels support' CONFIG_FBCON_CFB2
+    bool '4 bpp packed pixels support' CONFIG_FBCON_CFB4
+    bool '8 bpp packed pixels support' CONFIG_FBCON_CFB8
+    bool '16 bpp packed pixels support' CONFIG_FBCON_CFB16
+#   bool '24 bpp packed pixels support' CONFIG_FBCON_CFB24
+    bool '32 bpp packed pixels support' CONFIG_FBCON_CFB32
+    bool 'Amiga bitplanes support' CONFIG_FBCON_AFB
+    bool 'Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
+    bool 'Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
+    bool 'Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
+    bool 'Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
+    bool 'Mac variable bpp packed pixels support' CONFIG_FBCON_MAC
   else
     if [ "$CONFIG_FB_AMIGA" != "n" -o "$CONFIG_FB_ATARI" != "n" -o \
 	 "$CONFIG_FB_CYBER" != "n" -o "$CONFIG_FB_RETINAZ3" != "n" -o \
@@ -89,37 +88,19 @@
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
 	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
 	 "$CONFIG_FB_TGA" = "y" -o \
-	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" -o ]; then
+	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
       define_bool CONFIG_FBCON_CFB8 y
     fi
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
-	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
+	 "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
 	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
       define_bool CONFIG_FBCON_CFB16 y
     fi
     if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATARI" = "m" -o \
-	 "$CONFIG_FB_OPEN_FIRMWARE" = "y" -o \
+	 "$CONFIG_FB_ATY" = "y" -o \
 	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
       define_bool CONFIG_FBCON_CFB32 y
     fi
-    if [ "$CONFIG_FB_CYBER" = "y" -o "$CONFIG_FB_CYBER" = "m" ]; then
-      define_bool CONFIG_FBCON_CYBER y
-    fi
-    if [ "$CONFIG_FB_CV3D" = "y" ]; then
-      define_bool CONFIG_FBCON_VIRGE y
-    fi
-    if [ "$CONFIG_FB_RETINAZ3" = "y" -o "$CONFIG_FB_RETINAZ3" = "m" ]; then
-      define_bool CONFIG_FBCON_RETINAZ3 y
-    fi
-    if [ "$CONFIG_FB_MACH64" = "y" -o "$CONFIG_FB_MACH64" = "m" ]; then
-      define_bool CONFIG_FBCON_MACH64 y
-    fi
-    if [ "$CONFIG_FB_ATY" = "y" ]; then
-      define_bool CONFIG_FBCON_ATY y
-    fi
-#   if [ "$CONFIG_FB_S3TRIO" = "y" -o "$CONFIG_FB_S3TRIO" = "m" ]; then
-#     define_bool CONFIG_FBCON_TRIO y
-#   fi
   fi
 
   endmenu
--- m68k-2.1.77/drivers/video/Makefile.orig	Fri Jan  9 01:19:33 1998
+++ m68k-2.1.77/drivers/video/Makefile	Sun Jan 11 23:58:00 1998
@@ -26,11 +26,7 @@
   LX_OBJS += fbcon.o fbcmap.o fbgen.o
 endif
 
-# Frame buffer devices
-
-ifeq ($(CONFIG_APOLLO),y)
-L_OBJS += dnfb.o
-endif
+# Frame Buffer Devices
 
 ifeq ($(CONFIG_FB_AMIGA),y)
 L_OBJS += amifb.o
@@ -40,6 +36,10 @@
   endif
 endif
 
+ifeq ($(CONFIG_FB_APOLLO),y)
+L_OBJS += dnfb.o
+endif
+
 ifeq ($(CONFIG_FB_ATARI),y)
 L_OBJS += atafb.o
 else
@@ -48,39 +48,27 @@
   endif
 endif
 
-ifeq ($(CONFIG_MAC),y)
-L_OBJS += macfb.o
+ifeq ($(CONFIG_FB_ATY),y)
+L_OBJS += atyfb.o
 endif
 
 ifeq ($(CONFIG_FB_CYBER),y)
-LX_OBJS += cyberfb.o
+L_OBJS += cyberfb.o
 else
   ifeq ($(CONFIG_FB_CYBER),m)
-  MX_OBJS += cyberfb.o
-  else
-    ifeq ($(CONFIG_FB_CV3D),y)
-    LX_OBJS += cyberfb.o
-    else
-      ifeq ($(CONFIG_FB_CV3D),m)
-      MX_OBJS += cyberfb.o
-      endif
-    endif
+  M_OBJS += cyberfb.o
   endif
 endif
 
-ifeq ($(CONFIG_FB_RETINAZ3),y)
-LX_OBJS += retz3fb.o
-else
-  ifeq ($(CONFIG_FB_RETINAZ3),m)
-  MX_OBJS += retz3fb.o
-  endif
+ifeq ($(CONFIG_FB_MAC),y)
+L_OBJS += macfb.o
 endif
 
-ifeq ($(CONFIG_FB_VIRTUAL),y)
-L_OBJS += vfb.o
+ifeq ($(CONFIG_FB_MACH64),y)
+L_OBJS += mach64fb.o
 else
-  ifeq ($(CONFIG_FB_VIRTUAL),m)
-  M_OBJS += vfb.o
+  ifeq ($(CONFIG_FB_MACH64),m)
+  M_OBJS += mach64fb.o
   endif
 endif
 
@@ -88,22 +76,14 @@
 L_OBJS += offb.o
 endif
 
-ifeq ($(CONFIG_FB_ATY),y)
-L_OBJS += atyfb.o
-endif
-
-ifeq ($(CONFIG_FB_MACH64),y)
-L_OBJS += mach64fb.o
+ifeq ($(CONFIG_FB_RETINAZ3),y)
+L_OBJS += retz3fb.o
 else
-  ifeq ($(CONFIG_FB_MACH64),m)
-  M_OBJS += mach64fb.o
+  ifeq ($(CONFIG_FB_RETINAZ3),m)
+  M_OBJS += retz3fb.o
   endif
 endif
 
-ifeq ($(CONFIG_FB_TGA),y)
-L_OBJS += tgafb.o
-endif
-
 ifeq ($(CONFIG_FB_S3TRIO),y)
 L_OBJS += S3triofb.o
 else
@@ -112,158 +92,78 @@
   endif
 endif
 
-# Low level drivers
-
-ifeq ($(CONFIG_FBCON_AFB),y)
-L_OBJS += fbcon-afb.o
-else
-  ifeq ($(CONFIG_FBCON_AFB),m)
-  M_OBJS += fbcon-afb.o
-  endif
-endif
-
-ifeq ($(CONFIG_FBCON_CFB2),y)
-L_OBJS += fbcon-cfb2.o
-else
-  ifeq ($(CONFIG_FBCON_CFB2),m)
-  M_OBJS += fbcon-cfb2.o
-  endif
-endif
-
-ifeq ($(CONFIG_FBCON_CFB4),y)
-L_OBJS += fbcon-cfb4.o
-else
-  ifeq ($(CONFIG_FBCON_CFB4),m)
-  M_OBJS += fbcon-cfb4.o
-  endif
+ifeq ($(CONFIG_FB_TGA),y)
+L_OBJS += tgafb.o
 endif
 
-ifeq ($(CONFIG_FBCON_CFB8),y)
-L_OBJS += fbcon-cfb8.o
+ifeq ($(CONFIG_FB_VIRGE),y)
+L_OBJS += virgefb.o
 else
-  ifeq ($(CONFIG_FBCON_CFB8),m)
-  M_OBJS += fbcon-cfb8.o
+  ifeq ($(CONFIG_FB_VIRGE),m)
+  M_OBJS += virgefb.o
   endif
 endif
 
-ifeq ($(CONFIG_FBCON_CFB16),y)
-LX_OBJS += fbcon-cfb16.o
+ifeq ($(CONFIG_FB_VIRTUAL),y)
+L_OBJS += vfb.o
 else
-  ifeq ($(CONFIG_FBCON_CFB16),m)
-  MX_OBJS += fbcon-cfb16.o
+  ifeq ($(CONFIG_FB_VIRTUAL),m)
+  M_OBJS += vfb.o
   endif
 endif
 
-ifeq ($(CONFIG_FBCON_CFB24),y)
-LX_OBJS += fbcon-cfb24.o
-else
-  ifeq ($(CONFIG_FBCON_CFB24),m)
-  MX_OBJS += fbcon-cfb24.o
-  endif
-endif
+# Generic Low Level Drivers
 
-ifeq ($(CONFIG_FBCON_CFB32),y)
-LX_OBJS += fbcon-cfb32.o
-else
-  ifeq ($(CONFIG_FBCON_CFB32),m)
-  MX_OBJS += fbcon-cfb32.o
-  endif
+ifdef CONFIG_FBCON_AFB
+LX_OBJS += fbcon-afb.o
 endif
 
-ifeq ($(CONFIG_FBCON_ILBM),y)
-L_OBJS += fbcon-ilbm.o
-else
-  ifeq ($(CONFIG_FBCON_ILBM),m)
-  M_OBJS += fbcon-ilbm.o
-  endif
+ifdef CONFIG_FBCON_CFB2
+LX_OBJS += fbcon-cfb2.o
 endif
 
-ifeq ($(CONFIG_FBCON_IPLAN2P2),y)
-L_OBJS += fbcon-iplan2p2.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P2),m)
-  M_OBJS += fbcon-iplan2p2.o
-  endif
+ifdef CONFIG_FBCON_CFB4
+LX_OBJS += fbcon-cfb4.o
 endif
 
-ifeq ($(CONFIG_FBCON_IPLAN2P4),y)
-L_OBJS += fbcon-iplan2p4.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P4),m)
-  M_OBJS += fbcon-iplan2p4.o
-  endif
+ifdef CONFIG_FBCON_CFB8
+LX_OBJS += fbcon-cfb8.o
 endif
 
-ifeq ($(CONFIG_FBCON_IPLAN2P8),y)
-L_OBJS += fbcon-iplan2p8.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P8),m)
-  M_OBJS += fbcon-iplan2p8.o
-  endif
+ifdef CONFIG_FBCON_CFB16
+LX_OBJS += fbcon-cfb16.o
 endif
 
-ifeq ($(CONFIG_FBCON_MFB),y)
-L_OBJS += fbcon-mfb.o
-else
-  ifeq ($(CONFIG_FBCON_MFB),m)
-  M_OBJS += fbcon-mfb.o
-  endif
+ifdef CONFIG_FBCON_CFB24
+LX_OBJS += fbcon-cfb24.o
 endif
 
-ifeq ($(CONFIG_FBCON_CYBER),y)
-L_OBJS += fbcon-cyber.o
-else
-  ifeq ($(CONFIG_FBCON_CYBER),m)
-  M_OBJS += fbcon-cyber.o
-  endif
+ifdef CONFIG_FBCON_CFB32
+LX_OBJS += fbcon-cfb32.o
 endif
 
-ifeq ($(CONFIG_FBCON_VIRGE),y)
-L_OBJS += fbcon-virge.o
-else
-  ifeq ($(CONFIG_FBCON_VIRGE),m)
-  M_OBJS += fbcon-virge.o
-  endif
+ifdef CONFIG_FBCON_ILBM
+LX_OBJS += fbcon-ilbm.o
 endif
 
-ifeq ($(CONFIG_FBCON_RETINAZ3),y)
-L_OBJS += fbcon-retz3.o
-else
-  ifeq ($(CONFIG_FBCON_RETINAZ3),m)
-  M_OBJS += fbcon-retz3.o
-  endif
+ifdef CONFIG_FBCON_IPLAN2P2
+LX_OBJS += fbcon-iplan2p2.o
 endif
 
-ifeq ($(CONFIG_FBCON_MACH64),y)
-L_OBJS += fbcon-mach64.o
-else
-  ifeq ($(CONFIG_FBCON_MACH64),m)
-  M_OBJS += fbcon-mach64.o
-  endif
+ifdef CONFIG_FBCON_IPLAN2P4
+LX_OBJS += fbcon-iplan2p4.o
 endif
 
-ifeq ($(CONFIG_FBCON_MAC),y)
-L_OBJS += fbcon-mac.o
-else
-  ifeq ($(CONFIG_FBCON_MAC),m)
-  M_OBJS += fbcon-mac.o
-  endif
+ifdef CONFIG_FBCON_IPLAN2P8
+LX_OBJS += fbcon-iplan2p8.o
 endif
 
-ifeq ($(CONFIG_FBCON_ATY),y)
-L_OBJS += fbcon-aty.o
-else
-  ifeq ($(CONFIG_FBCON_ATY),m)
-  M_OBJS += fbcon-aty.o
-  endif
+ifdef CONFIG_FBCON_MAC
+LX_OBJS += fbcon-mac.o
 endif
 
-ifeq ($(CONFIG_FBCON_TRIO),y)
-L_OBJS += fbcon-trio.o
-else
-  ifeq ($(CONFIG_FBCON_TRIO),m)
-  M_OBJS += fbcon-trio.o
-  endif 
+ifdef CONFIG_FBCON_MFB
+LX_OBJS += fbcon-mfb.o
 endif
 
 # GSP Console
@@ -272,7 +172,7 @@
 L_OBJS := $(L_OBJS) gspcon.o gspcore.o
 endif
 
-# VGA Console
+# VGA Text Console
 
 ifdef CONFIG_ABSTRACT_CONSOLE
 ifdef CONFIG_VGA_CONSOLE
--- m68k-2.1.77/drivers/video/atyfb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/atyfb.c	Tue Jan 13 00:49:05 1998
@@ -43,16 +43,16 @@
 #include <asm/pci-bridge.h>
 #include "aty.h"
 
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb16.h"
+#include "fbcon-cfb32.h"
+
 
 static int currcon = 0;
 static struct display fb_disp;
 static struct fb_info fb_info;
 static struct { u_char red, green, blue, pad; } palette[256];
 
-/* hack to tell fbcon-cfb{16,32} the colormap */
-extern u16 cfb16_cmap[16];
-extern u32 cfb32_cmap[16];
-
 static char atyfb_name[16] = "ATY Mach64";
 
 struct atyfb_par {
@@ -307,12 +307,6 @@
 static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 		       u_long arg, int con, struct fb_info *info);
 
-#ifdef CONFIG_FB_COMPAT_XPMAC
-extern struct vc_mode display_info;
-extern int (*console_setmode_ptr)(struct vc_mode *, int);
-static int atyfb_console_setmode(struct vc_mode *, int);
-#endif
-
 
     /*
      *  Interface to the low level console driver
@@ -324,6 +318,20 @@
 
 
     /*
+     *  Text console acceleration
+     */
+
+static struct display_switch fbcon_aty8;
+
+
+#ifdef CONFIG_FB_COMPAT_XPMAC
+extern struct vc_mode display_info;
+extern int (*console_setmode_ptr)(struct vc_mode *, int);
+static int atyfb_console_setmode(struct vc_mode *, int);
+#endif
+
+
+    /*
      *  Internal routines
      */
 
@@ -985,6 +993,24 @@
 	    display->line_length = fix.line_length;
 	    display->can_soft_blank = 1;
 	    display->inverse = 0;
+	    switch (par.color_mode) {
+		case CMODE_8:
+#if 1
+		    display->dispsw = &fbcon_cfb8;
+#else
+		    display->dispsw = &fbcon_aty8;
+#endif
+		    break;
+		case CMODE_16:
+		    display->dispsw = &fbcon_cfb16;
+		    break;
+		case CMODE_32:
+		    display->dispsw = &fbcon_cfb32;
+		    break;
+		default:
+		    display->dispsw = NULL;
+		    break;
+	    }
 	    if (fb_info.changevar)
 		(*fb_info.changevar)(con);
 	}
@@ -1255,12 +1281,6 @@
 	palette[i].red = default_red[j];
 	palette[i].green = default_grn[j];
 	palette[i].blue = default_blu[j];
-#ifdef CONFIG_FBCON_CFB16
-	cfb16_cmap[i] = ((i << 10) & 0x7c00) | ((i << 5) & 0x03e0) | (i & 0x1f);
-#endif
-#ifdef CONFIG_FBCON_CFB32
-	cfb32_cmap[i] = (i << 24) | (i << 16) | (i << 8) | i;
-#endif
     }
     atyfb_set_par(&default_par);
     encode_var(&var, &default_par);
@@ -1410,6 +1430,15 @@
     eieio();
     aty_cmap_regs->lut = blue << scale;
     eieio();
+    if (regno < 16) {
+#ifdef CONFIG_FBCON_CFB16
+	fbcon_cfb16_cmap[regno] = (regno << 10) | (regno << 5) | regno;
+#endif
+#ifdef CONFIG_FBCON_CFB32
+	fbcon_cfb32_cmap[regno] = (regno << 24) | (regno << 16) |
+				  (regno << 8) | regno;
+#endif
+    }
     return 0;
 }
 
@@ -1482,8 +1511,8 @@
 	return;
 
     aty_WaitQueue(5);
-    aty_st_le32(DP_FRGD_CLR, color              /* pGC->fgPixel */ );
-    aty_st_le32(DP_WRITE_MSK, 0x000000FF       /* pGC->planemask */ );
+    aty_st_le32(DP_FRGD_CLR, color /* pGC->fgPixel */ );
+    aty_st_le32(DP_WRITE_MSK, 0x000000FF /* pGC->planemask */ );
     aty_st_le32(DP_MIX, (MIX_SRC << 16) | MIX_DST);
     aty_st_le32(DP_SRC, FRGD_SRC_FRGD_CLR);
 
@@ -1497,6 +1526,58 @@
 }
 
 
+    /*
+     *  Text console acceleration
+     */
+
+static void fbcon_aty8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			     int height, int width)
+{
+    sx *= p->fontwidth;
+    sy *= p->fontheight;
+    dx *= p->fontwidth;
+    dy *= p->fontheight;
+    width *= p->fontwidth;
+    height *= p->fontheight;
+
+    aty_rectcopy(sx, sy, dx, dy, width, height);
+}
+
+static void fbcon_aty8_clear(struct vc_data *conp, struct display *p, int sy,
+			     int sx, int height, int width)
+{
+    u32 bgx = attr_bgcol_ec(p, conp);
+    bgx |= (bgx << 8);
+    bgx |= (bgx << 16);
+
+    sx *= p->fontwidth;
+    sy *= p->fontheight;
+    width *= p->fontwidth;
+    height *= p->fontheight;
+
+    aty_rectfill(sx, sy, width, height, bgx);
+}
+
+static void fbcon_aty8_putc(struct vc_data *conp, struct display *p, int c,
+			    int yy, int xx)
+{
+    aty_waitblit();
+    fbcon_cfb8_putc(conp, p, c, yy, xx);
+}
+
+static void fbcon_aty8_putcs(struct vc_data *conp, struct display *p,
+			     const char *s, int count, int yy, int xx)
+{
+    aty_waitblit();
+    fbcon_cfb8_putcs(conp, p, s, count, yy, xx);
+}
+
+static struct display_switch fbcon_aty8 = {
+    fbcon_cfb8_setup, fbcon_aty8_bmove, fbcon_aty8_clear, fbcon_aty8_putc,
+    fbcon_aty8_putcs, fbcon_cfb8_revc
+};
+
+
 #ifdef CONFIG_FB_COMPAT_XPMAC
 
     /*
@@ -1514,18 +1595,18 @@
     par.video_mode = mode->mode;
 
     switch (mode->depth) {
-        case 24:
-        case 32:
+	case 24:
+	case 32:
 	    par.color_mode = CMODE_32;
 	    break;
-        case 16:
+	case 16:
 	    par.color_mode = CMODE_16;
 	    break;
-        case 8:
-        case 0:			/* (default) */
+	case 8:
+	case 0:			/* (default) */
 	    par.color_mode = CMODE_8;
 	    break;
-        default:
+	default:
 	    return -EINVAL;
     }
     encode_var(&var, &par);
--- m68k-2.1.77/drivers/video/cyberfb.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/cyberfb.c	Mon Jan 12 22:59:32 1998
@@ -39,7 +39,11 @@
 #include <asm/irq.h>
 #include <asm/pgtable.h>
 #include <asm/amigahw.h>
+
 #include "s3blit.h"
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb16.h"
+
 
 #ifdef CYBERFBDEBUG
 #define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
@@ -49,39 +53,6 @@
 
 #define arraysize(x)    (sizeof(x)/sizeof(*(x)))
 
-#if 1
-#define vgawb_3d(reg,dat) \
-                (*((unsigned char *)(CyberVGARegs + (reg ^ 3))) = dat)
-#define vgaww_3d(reg,dat) \
-                (*((unsigned word *)(CyberVGARegs + (reg ^ 2))) = swab16(dat))
-#define vgawl_3d(reg,dat) \
-                (*((unsigned long *)(CyberVGARegs + reg)) = swab32(dat))
-#else
-     /*
-      * Dunno why this doesn't work at the moment - we'll have to look at
-      * it later.
-      */
-#define vgawb_3d(reg,dat) \
-                (*((unsigned char *)(CyberRegs + 0x8000 + reg)) = dat)
-#define vgaww_3d(reg,dat) \
-                (*((unsigned word *)(CyberRegs + 0x8000 + reg)) = dat)
-#define vgawl_3d(reg,dat) \
-                (*((unsigned long *)(CyberRegs + 0x8000 + reg)) = dat)
-#endif
-
-     /*
-      * We asume P5 mapped the big-endian version of these registers.
-      */
-#define wb_3d(reg,dat) \
-                (*((unsigned char volatile *)(CyberRegs + reg)) = dat)
-#define ww_3d(reg,dat) \
-                (*((unsigned word volatile *)(CyberRegs + reg)) = dat)
-#define wl_3d(reg,dat) \
-                (*((unsigned long volatile *)(CyberRegs + reg)) = dat)
-
-#define rl_3d(reg) \
-                (*((unsigned long volatile *)(CyberRegs + reg)))
-
 
 #define wb_64(reg,dat) (*((unsigned char volatile *)CyberRegs + reg) = dat)
 
@@ -152,7 +123,6 @@
 static unsigned long CyberMem;
 static unsigned long CyberSize;
 static volatile char *CyberRegs;
-static volatile unsigned long CyberVGARegs; /* ++Andre: for CV64/3D, see macros at the beginning */
  
 
 /*
@@ -222,8 +192,6 @@
 static int Cyberfb_Cyber16 = 0;       /* Use Cybervision board */
 #endif
 
-static int CV3D = 0;
-
 /*
  *    Some default modes
  */
@@ -269,16 +237,24 @@
 
 
 /*
+ *    Text console acceleration
+ */
+
+static struct display_switch fbcon_cyber8;
+
+
+/*
  *    Accelerated Functions used by the low level console driver
  */
 
-void Cyber_WaitQueue(u_short fifo);
-void Cyber_WaitBlit(void);
-void Cyber_BitBLT(u_short curx, u_short cury, u_short destx, u_short desty,
-                  u_short width, u_short height, u_short mode);
-void Cyber_RectFill(u_short x, u_short y, u_short width, u_short height,
-                    u_short mode, u_short color);
-void Cyber_MoveCursor(u_short x, u_short y);
+static void Cyber_WaitQueue(u_short fifo);
+static void Cyber_WaitBlit(void);
+static void Cyber_BitBLT(u_short curx, u_short cury, u_short destx,
+			 u_short desty, u_short width, u_short height,
+			 u_short mode);
+static void Cyber_RectFill(u_short x, u_short y, u_short width, u_short height,
+			   u_short mode, u_short color);
+static void Cyber_MoveCursor(u_short x, u_short y);
 
 
 /*
@@ -303,7 +279,6 @@
  *    Internal routines
  */
 
-static int Cyber_probe(void);	/* looks whether a CV64 or a CV64/3D is plugged in */
 static void cyberfb_get_par(struct cyberfb_par *par);
 static void cyberfb_set_par(struct cyberfb_par *par);
 static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive);
@@ -346,43 +321,14 @@
 	memset ((char*)CyberMem, 0, 1600 * 1200);
 
 	/* Disable hardware cursor */
-	if (CV3D)
-	{
-		CyberSize = 0x00400000; /* 4 MB */
-
-		vgawb_3d(0x3c8, 255);
-		vgawb_3d(0x3c9, 56);
-		vgawb_3d(0x3c9, 100);
-		vgawb_3d(0x3c9, 160);
-
-		vgawb_3d(0x3c8, 254);
-		vgawb_3d(0x3c9, 0);
-		vgawb_3d(0x3c9, 0);
-		vgawb_3d(0x3c9, 0);
-
-		/* Disable hardware cursor */
-		vgawb_3d(S3_CRTC_ADR, S3_REG_LOCK2);
-		vgawb_3d(S3_CRTC_DATA, 0xa0);
-		vgawb_3d(S3_CRTC_ADR, S3_HGC_MODE);
-		vgawb_3d(S3_CRTC_DATA, 0x00);
-		vgawb_3d(S3_CRTC_ADR, S3_HWGC_DX);
-		vgawb_3d(S3_CRTC_DATA, 0x00);
-		vgawb_3d(S3_CRTC_ADR, S3_HWGC_DY);
-		vgawb_3d(S3_CRTC_DATA, 0x00);
-
-		return 0; /* TODO: hardware cursor for CV64/3D */
-	}
-	else
-	{
-		wb_64(S3_CRTC_ADR, S3_REG_LOCK2);
-		wb_64(S3_CRTC_DATA, 0xa0);
-		wb_64(S3_CRTC_ADR, S3_HGC_MODE);
-		wb_64(S3_CRTC_DATA, 0x00);
-		wb_64(S3_CRTC_ADR, S3_HWGC_DX);
-		wb_64(S3_CRTC_DATA, 0x00);
-		wb_64(S3_CRTC_ADR, S3_HWGC_DY);
-		wb_64(S3_CRTC_DATA, 0x00);
-	}
+	wb_64(S3_CRTC_ADR, S3_REG_LOCK2);
+	wb_64(S3_CRTC_DATA, 0xa0);
+	wb_64(S3_CRTC_ADR, S3_HGC_MODE);
+	wb_64(S3_CRTC_DATA, 0x00);
+	wb_64(S3_CRTC_ADR, S3_HWGC_DX);
+	wb_64(S3_CRTC_DATA, 0x00);
+	wb_64(S3_CRTC_ADR, S3_HWGC_DY);
+	wb_64(S3_CRTC_DATA, 0x00);
 
 	/* Get memory size (if not 2MB it is 4MB) */
 	*(CyberRegs + S3_CRTC_ADR) = S3_LAW_CTL;
@@ -430,7 +376,7 @@
 	fix->smem_start = (caddr_t)CyberMem;
 	fix->smem_len = CyberSize;
 	fix->mmio_start = (unsigned char *)CyberRegs;
-	fix->mmio_len = 0x10000; /* TODO: verify this for the CV64/3D */
+	fix->mmio_len = 0x10000;
 
 	fix->type = FB_TYPE_PACKED_PIXELS;
 	fix->type_aux = 0;
@@ -524,16 +470,8 @@
 	var->height = -1;
 	var->width = -1;
 
-	if (CV3D)
-	{
-		var->accel = FB_ACCEL_CYBERVISION3D;
-		DPRINTK("accel CV64/3D\n");
-	}
-	else
-	{
-		var->accel = FB_ACCEL_CYBERVISION;
-		DPRINTK("accel CV64\n");
-	}
+	var->accel = FB_ACCEL_CYBERVISION;
+	DPRINTK("accel CV64\n");
 
 	var->vmode = FB_VMODE_NONINTERLACED;
 
@@ -572,34 +510,15 @@
 		return (1);
 	}
 
-	/*
-	 * No colors on the CV3D yet.
-	 */
-
-	if (CV3D)
-	{
-		vgawb_3d(0x3c8, (unsigned char) regno);
-		Cyber_colour_table [regno][0] = red & 0xff;
-		Cyber_colour_table [regno][1] = green & 0xff;
-		Cyber_colour_table [regno][2] = blue & 0xff;
-		Cyber_colour_table [regno][3] = transp;
-
-		vgawb_3d(0x3c9, ((red & 0xff) >> 2));
-		vgawb_3d(0x3c9, ((green & 0xff) >> 2));
-		vgawb_3d(0x3c9, ((blue & 0xff) >> 2));
-	}
-	else
-	{
-		wb_64(0x3c8, (unsigned char) regno);
-		Cyber_colour_table [regno][0] = red & 0xff;
-		Cyber_colour_table [regno][1] = green & 0xff;
-		Cyber_colour_table [regno][2] = blue & 0xff;
-		Cyber_colour_table [regno][3] = transp;
-
-		wb_64(0x3c9, (red & 0xff) >> 2);
-		wb_64(0x3c9, (green & 0xff) >> 2);
-		wb_64(0x3c9, (blue & 0xff) >> 2);
-	}
+	wb_64(0x3c8, (unsigned char) regno);
+	Cyber_colour_table [regno][0] = red & 0xff;
+	Cyber_colour_table [regno][1] = green & 0xff;
+	Cyber_colour_table [regno][2] = blue & 0xff;
+	Cyber_colour_table [regno][3] = transp;
+
+	wb_64(0x3c9, (red & 0xff) >> 2);
+	wb_64(0x3c9, (green & 0xff) >> 2);
+	wb_64(0x3c9, (blue & 0xff) >> 2);
 
 	return (0);
 }
@@ -631,161 +550,33 @@
 {
 	int i;
 
-	if (CV3D)
+	if (blank)
 	{
-		if (blank)
+		for (i = 0; i < 256; i++)
 		{
-			for (i = 0; i < 256; i++)
-			{
-				vgawb_3d(0x3c8, (unsigned char) i);
-				vgawb_3d(0x3c9, 0);
-				vgawb_3d(0x3c9, 0);
-				vgawb_3d(0x3c9, 0);
-			}
-		}
-		else
-		{
-			for (i = 0; i < 256; i++)
-			{
-				vgawb_3d(0x3c8, (unsigned char) i);
-				vgawb_3d(0x3c9, Cyber_colour_table[i][0] >> 2);
-				vgawb_3d(0x3c9, Cyber_colour_table[i][1] >> 2);
-				vgawb_3d(0x3c9, Cyber_colour_table[i][2] >> 2);
-			}
+			wb_64(0x3c8, (unsigned char) i);
+			wb_64(0x3c9, 0);
+			wb_64(0x3c9, 0);
+			wb_64(0x3c9, 0);
 		}
 	}
 	else
 	{
-		if (blank)
+		for (i = 0; i < 256; i++)
 		{
-			for (i = 0; i < 256; i++)
-			{
-				wb_64(0x3c8, (unsigned char) i);
-				wb_64(0x3c9, 0);
-				wb_64(0x3c9, 0);
-				wb_64(0x3c9, 0);
-			}
-		}
-		else
-		{
-			for (i = 0; i < 256; i++)
-			{
-				wb_64(0x3c8, (unsigned char) i);
-				wb_64(0x3c9, Cyber_colour_table[i][0] >> 2);
-				wb_64(0x3c9, Cyber_colour_table[i][1] >> 2);
-				wb_64(0x3c9, Cyber_colour_table[i][2] >> 2);
-			}
+			wb_64(0x3c8, (unsigned char) i);
+			wb_64(0x3c9, Cyber_colour_table[i][0] >> 2);
+			wb_64(0x3c9, Cyber_colour_table[i][1] >> 2);
+			wb_64(0x3c9, Cyber_colour_table[i][2] >> 2);
 		}
 	}
 }
 
-#ifdef CONFIG_FB_CV3D
-
-/*
- * CV3D low-level support
- */
-
-#define Cyber3D_WaitQueue(v)	 { do { while ((rl_3d(0x8504) & 0x1f00) < (((v)+2) << 8)); } while (0); }
-
-static inline void Cyber3D_WaitBusy(void)
-{
-unsigned long status;
-
-	do {
-		status = rl_3d(0x8504);
-	} while (!(status & (1 << 13)));
-}
-
-#define S3V_BITBLT	(0x0 << 27)
-#define S3V_RECTFILL	(0x2 << 27)
-#define S3V_AUTOEXE	0x01
-#define S3V_HWCLIP	0x02
-#define S3V_DRAW	0x20
-#define S3V_DST_8BPP	0x00
-#define S3V_DST_16BPP	0x04
-#define S3V_DST_24BPP	0x08
-#define S3V_MONO_PAT	0x100
-
-#define S3V_BLT_COPY	(0xcc<<17)
-#define S3V_BLT_CLEAR	(0x00<<17)
-#define S3V_BLT_SET	(0xff<<17)
-
- /*
-  * BitBLT - Through the Plane
-  */
-
-void Cyber3D_BitBLT (u_short curx, u_short cury, u_short destx, u_short desty,
-		     u_short width, u_short height)
-{
-	unsigned int blitcmd = S3V_BITBLT | S3V_DRAW | S3V_DST_8BPP;
-
-	blitcmd |= S3V_BLT_COPY;
-
-	/* Set drawing direction */
-	/* -Y, X maj, -X (default) */
-	if (curx > destx)
-	{
-		blitcmd |= (1 << 25);  /* Drawing direction +X */
-	}
-	else
-	{
-		curx  += (width - 1);
-		destx += (width - 1);
-	}
-
-	if (cury > desty)
-	{
-		blitcmd |= (1 << 26);  /* Drawing direction +Y */
-	}
-	else
-	{
-		cury  += (height - 1);
-		desty += (height - 1);
-	}
-
-	wl_3d(0xa4f4, 1); /* pattern fb color */
-
-	wl_3d(0xa4e8, ~0); /* mono pat 0 */
-	wl_3d(0xa4ec, ~0); /* mono pat 1 */
-
-	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
-	wl_3d(0xa508, ((curx << 16)  | cury));		/* rsrc_xy */
-	wl_3d(0xa50c, ((destx << 16) | desty));		/* rdest_xy */
-
-	wl_3d(0xa500, blitcmd);				/* GO! */
-
-	Cyber3D_WaitBusy();
-}
-
-/*
- * Rectangle Fill Solid
- */
-
-void Cyber3D_RectFill (u_short x, u_short y, u_short width, u_short height,
-		       u_short color)
-{
-	unsigned int tmp;
-	unsigned int blitcmd = S3V_RECTFILL | S3V_DRAW | S3V_DST_8BPP |
-		S3V_BLT_CLEAR | S3V_MONO_PAT | (1 << 26) | (1 << 25);
-
-	tmp = color & 0xff;
-	wl_3d(0xa4f4, tmp);
-
-	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
-	wl_3d(0xa50c, ((x << 16) | y));			/* rdest_xy */
-
-	wl_3d(0xa500, blitcmd);				/* GO! */
-	Cyber3D_WaitBusy();
-}
-
-#endif
-
-#ifdef CONFIG_FB_CYBER
 
 /**************************************************************
  * We are waiting for "fifo" FIFO-slots empty
  */
-void Cyber_WaitQueue (u_short fifo)
+static void Cyber_WaitQueue (u_short fifo)
 {
 	u_short status;
 
@@ -799,7 +590,7 @@
 /**************************************************************
  * We are waiting for Hardware (Graphics Engine) not busy
  */
-void Cyber_WaitBlit (void)
+static void Cyber_WaitBlit (void)
 {
 	u_short status;
 
@@ -813,8 +604,9 @@
 /**************************************************************
  * BitBLT - Through the Plane
  */
-void Cyber_BitBLT (u_short curx, u_short cury, u_short destx, u_short desty,
-		   u_short width, u_short height, u_short mode)
+static void Cyber_BitBLT (u_short curx, u_short cury, u_short destx,
+			  u_short desty, u_short width, u_short height,
+			  u_short mode)
 {
 	u_short blitcmd = S3_BITBLT;
 
@@ -856,19 +648,11 @@
 /**************************************************************
  * Rectangle Fill Solid
  */
-void Cyber_RectFill (u_short x, u_short y, u_short width, u_short height,
-		     u_short mode, u_short color)
+static void Cyber_RectFill (u_short x, u_short y, u_short width,
+			    u_short height, u_short mode, u_short color)
 {
 	u_short blitcmd = S3_FILLEDRECT;
 
-#if 0
-	if (CV3D)
-	{
-		printk("Belly up .... RectFill on a 3D\n");
-		return;
-	}
-#endif
-
 	Cyber_WaitQueue (0x8000);
 
 	*((u_short volatile *)(CyberRegs + S3_PIXEL_CNTL)) = 0xa000;
@@ -885,20 +669,12 @@
 
 	*((u_short volatile *)(CyberRegs + S3_CMD)) = blitcmd;
 }
-#endif
 
 /**************************************************************
  * Move cursor to x, y
  */
-void Cyber_MoveCursor (u_short x, u_short y)
+static void Cyber_MoveCursor (u_short x, u_short y)
 {
-
-	if (CV3D)
-	{
-		printk("Yuck .... MoveCursor on a 3D\n");
-		return;
-	}
-
 	*(CyberRegs + S3_CRTC_ADR)  = 0x39;
 	*(CyberRegs + S3_CRTC_DATA) = 0xa0;
 
@@ -954,23 +730,11 @@
 {
 	/* Set clipping rectangle to current screen size */
  
-	if (CV3D)
-	{
-		unsigned int clip;
+	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x1000;
+	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x2000;
 
-		clip = ((0 << 16) | (var->xres - 1));
-		wl_3d(0xa4dc, clip);
-		clip = ((0 << 16) | (var->yres - 1));
-		wl_3d(0xa4e0, clip);
-	}
-	else
-	{
-		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x1000;
-		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x2000;
-
-		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x3000 | (var->yres - 1);
-		*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x4000 | (var->xres - 1);
-	}
+	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x3000 | (var->yres - 1);
+	*((u_short volatile *)(CyberRegs + 0xbee8)) = 0x4000 | (var->xres - 1);
 }
 
 
@@ -1090,6 +854,17 @@
 	display->ywrapstep = fix.ywrapstep;
 	display->can_soft_blank = 1;
 	display->inverse = Cyberfb_inverse;
+	switch (current_par.bpp) { /* ++Geert: FIXME par */
+	    case 8:
+		display->dispsw = &fbcon_cyber8;
+		break;
+	    case 16:
+		display->dispsw = &fbcon_cfb16;
+		break;
+	    default:
+		display->dispsw = NULL;
+		break;
+	}
 }
 
 
@@ -1199,21 +974,6 @@
 };
 
 
-static int Cyber_probe(void)
-{
-#ifdef CONFIG_FB_CYBER
-	if ((CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64, 0, 0)))
-		CV3D = 0;
-	else
-#endif
-#ifdef CONFIG_FB_CV3D
-	if ((CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64_3D, 0, 0)))
-		CV3D = 1;
-#endif
-	return CyberKey;
-}
-
-
 __initfunc(void cyberfb_setup(char *options, int *ints))
 {
 	char *this_opt;
@@ -1255,7 +1015,7 @@
 	unsigned long board_addr;
 	const struct ConfigDev *cd;
 
-	if (!(CyberKey = Cyber_probe()))
+	if (!(CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64, 0, 0)))
 		return mem_start;
 
 	cd = zorro_get_board (CyberKey);
@@ -1263,41 +1023,9 @@
 	board_addr = (unsigned long)cd->cd_BoardAddr;
 
 	/* This includes the video memory as well as the S3 register set */
-        if (!CV3D)
-	{
-		CyberMem = kernel_map (board_addr + 0x01400000, 0x01000000,
-				       KERNELMAP_NOCACHE_SER, &mem_start);
-		CyberRegs = (char*) (CyberMem + 0x00c00000);
-	}
-	else
-	{
-        	if ((unsigned long)cd->cd_BoardAddr < 0x01000000)
-		{
-                        /*
-                         * Ok we got the board running in Z2 space.
-                         */
- 
-			CyberMem = ZTWO_VADDR(board_addr);
-                        printk("CV3D detected running in Z2 mode ... not yet supported!\n");
-                        return -ENODEV;
-                }
-		else
-		{
-                        CyberVGARegs = kernel_map(board_addr +0x0c000000,
-                                                       0x00010000,
-                                                       KERNELMAP_NOCACHE_SER,
-                                                       &mem_start);
-                        CyberRegs = (char *)kernel_map(board_addr +0x05000000,
-                                                       0x00010000,
-                                                       KERNELMAP_NOCACHE_SER,
-                                                       &mem_start);
-                        CyberMem = kernel_map(board_addr + 0x04800000,
-                                              0x00400000,
-                                              KERNELMAP_NOCACHE_SER,
-                                              &mem_start);
-                        printk("CV3D detected running in Z3 mode\n");
-                }
-	}
+	CyberMem = kernel_map (board_addr + 0x01400000, 0x01000000,
+			       KERNELMAP_NOCACHE_SER, &mem_start);
+	CyberRegs = (char*) (CyberMem + 0x00c00000);
 
 	fbhw = &Cyber_switch;
 
@@ -1391,6 +1119,61 @@
 }
 
 
+/*
+ *    Text console acceleration
+ */
+
+static void fbcon_cyber8_bmove(struct display *p, int sy, int sx, int dy,
+			       int dx, int height, int width)
+{
+    sx *= 8; dx *= 8; width *= 8;
+    Cyber_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
+		 (u_short)(dy*p->fontheight), (u_short)width,
+		 (u_short)(height*p->fontheight), (u_short)S3_NEW);
+}
+
+static void fbcon_cyber8_clear(struct vc_data *conp, struct display *p, int sy,
+			       int sx, int height, int width)
+{
+    unsigned char bg;
+
+    sx *= 8; width *= 8;
+    bg = attr_bgcol_ec(p,conp);
+    Cyber_RectFill((u_short)sx,
+		   (u_short)(sy*p->fontheight),
+		   (u_short)width,
+		   (u_short)(height*p->fontheight),
+		   (u_short)S3_NEW,
+		   (u_short)bg);
+}
+
+static void fbcon_cyber8_putc(struct vc_data *conp, struct display *p, int c,
+			      int yy, int xx)
+{
+    Cyber_WaitBlit();
+    fbcon_cfb8_putc(conp, p, c, yy, xx);
+}
+
+static void fbcon_cyber8_putcs(struct vc_data *conp, struct display *p,
+			       const char *s, int count, int yy, int xx)
+{
+    Cyber_WaitBlit();
+    fbcon_cfb8_putcs(conp, p, s, count, yy, xx);
+}
+
+static void fbcon_cyber8_revc(struct display *p, int xx, int yy)
+{
+    Cyber_WaitBlit();
+    fbcon_cfb8_revc(p, xx, yy);
+}
+
+static struct display_switch fbcon_cyber8 = {
+   fbcon_cfb8_setup, fbcon_cyber8_bmove, fbcon_cyber8_clear, fbcon_cyber8_putc,
+   fbcon_cyber8_putcs, fbcon_cyber8_revc
+};
+
+
+
 #ifdef MODULE
 int init_module(void)
 {
@@ -1405,12 +1188,3 @@
 	/* TODO: clean up ... */
 }
 #endif /* MODULE */
-
-
-/*
- *  Visible symbols for modules
- */
-
-EXPORT_SYMBOL(Cyber_BitBLT);
-EXPORT_SYMBOL(Cyber_RectFill);
-EXPORT_SYMBOL(Cyber_WaitBlit);
--- m68k-2.1.77/drivers/video/fbcmap.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcmap.c	Sun Jan 11 17:15:59 1998
@@ -35,45 +35,45 @@
 #define CNVT_FROMHW(val,width)	(((width) ? ((((val)<<16)-(val)) / \
 					((1<<(width))-1)) : 0))
 
-static u_short red2[] = {
+static u16 red2[] = {
     0x0000, 0xaaaa
 };
-static u_short green2[] = {
+static u16 green2[] = {
     0x0000, 0xaaaa
 };
-static u_short blue2[] = {
+static u16 blue2[] = {
     0x0000, 0xaaaa
 };
 
-static u_short red4[] = {
+static u16 red4[] = {
     0x0000, 0xaaaa, 0x5555, 0xffff
 };
-static u_short green4[] = {
+static u16 green4[] = {
     0x0000, 0xaaaa, 0x5555, 0xffff
 };
-static u_short blue4[] = {
+static u16 blue4[] = {
     0x0000, 0xaaaa, 0x5555, 0xffff
 };
 
-static u_short red8[] = {
+static u16 red8[] = {
     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa
 };
-static u_short green8[] = {
+static u16 green8[] = {
     0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0xaaaa, 0xaaaa
 };
-static u_short blue8[] = {
+static u16 blue8[] = {
     0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa
 };
 
-static u_short red16[] = {
+static u16 red16[] = {
     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
     0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
 };
-static u_short green16[] = {
+static u16 green16[] = {
     0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0xaaaa, 0xaaaa,
     0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
 };
-static u_short blue16[] = {
+static u16 blue16[] = {
     0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
     0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
 };
@@ -98,7 +98,7 @@
 
 int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp)
 {
-    int size = len*sizeof(u_short);
+    int size = len*sizeof(u16);
 
     if (cmap->len != len) {
 	if (cmap->red)
@@ -150,7 +150,7 @@
 	size = from->len-fromoff;
     if (size < 0)
 	return;
-    size *= sizeof(u_short);
+    size *= sizeof(u16);
     memcpy_fs(fsfromto, to->red+tooff, from->red+fromoff, size);
     memcpy_fs(fsfromto, to->green+tooff, from->green+fromoff, size);
     memcpy_fs(fsfromto, to->blue+tooff, from->blue+fromoff, size);
@@ -168,7 +168,7 @@
 				 struct fb_info *), struct fb_info *info)
 {
     int i, start;
-    u_short *red, *green, *blue, *transp;
+    u16 *red, *green, *blue, *transp;
     u_int hred, hgreen, hblue, htransp;
 
     red = cmap->red;
@@ -217,7 +217,7 @@
 				 struct fb_info *), struct fb_info *info)
 {
     int i, start;
-    u_short *red, *green, *blue, *transp;
+    u16 *red, *green, *blue, *transp;
     u_int hred, hgreen, hblue, htransp;
 
     red = cmap->red;
--- m68k-2.1.77/drivers/video/fbcon-cfb16.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb16.c	Sun Jan 11 17:32:01 1998
@@ -16,41 +16,14 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_cfb16(struct display *p);
-static void release_cfb16(void);
-static void bmove_cfb16(struct display *p, int sy, int sx, int dy, int dx,
-			int height, int width);
-static void clear_cfb16(struct vc_data *conp, struct display *p, int sy,
-			int sx, int height, int width);
-static void putc_cfb16(struct vc_data *conp, struct display *p, int c,
-		       int yy, int xx);
-static void putcs_cfb16(struct vc_data *conp, struct display *p,
-			const char *s, int count, int yy, int xx);
-static void rev_char_cfb16(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_cfb16 = {
-    open_cfb16, release_cfb16, bmove_cfb16, clear_cfb16, putc_cfb16,
-    putcs_cfb16, rev_char_cfb16
-};
+#include "fbcon-cfb16.h"
 
 
     /*
      *  16 bpp packed pixels
      */
 
-u16 cfb16_cmap[16];
+u16 fbcon_cfb16_cmap[16];
 
 static u32 tab_cfb16[] = {
 #if defined(__BIG_ENDIAN)
@@ -62,26 +35,14 @@
 #endif
 };
 
-static int open_cfb16(struct display *p)
+void fbcon_cfb16_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 16 ||
-	(p->visual != FB_VISUAL_TRUECOLOR &&
-	 p->visual != FB_VISUAL_DIRECTCOLOR))
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual<<1;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
 }
 
-static void release_cfb16(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_cfb16(struct display *p, int sy, int sx, int dy, int dx,
-			int height, int width)
+void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		       int height, int width)
 {
     int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
     u_char *src, *dst;
@@ -109,8 +70,8 @@
     }
 }
 
-static void clear_cfb16(struct vc_data *conp, struct display *p, int sy,
-			int sx, int height, int width)
+void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		       int height, int width)
 {
     u_char *dest0, *dest;
     int bytes = p->next_line, lines = height * p->fontheight, rows, i;
@@ -118,7 +79,7 @@
 
     dest = p->screen_base + sy * p->fontheight * bytes + sx * 16;
 
-    bgx = cfb16_cmap[attr_bgcol_ec(p, conp)];
+    bgx = fbcon_cfb16_cmap[attr_bgcol_ec(p, conp)];
     bgx |= (bgx << 16);
 
     if (sx == 0 && width * 16 == bytes)
@@ -144,8 +105,8 @@
     }
 }
 
-static void putc_cfb16(struct vc_data *conp, struct display *p, int c, int yy,
-		       int xx)
+void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx)
 {
     u_char *dest, *cdat;
     int bytes = p->next_line, rows;
@@ -156,8 +117,8 @@
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 16;
     cdat = p->fontdata + c * p->fontheight;
 
-    fgx = cfb16_cmap[attr_fgcol(p, conp)];
-    bgx = cfb16_cmap[attr_bgcol(p, conp)];
+    fgx = fbcon_cfb16_cmap[attr_fgcol(p, conp)];
+    bgx = fbcon_cfb16_cmap[attr_bgcol(p, conp)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
@@ -171,16 +132,16 @@
     }
 }
 
-static void putcs_cfb16(struct vc_data *conp, struct display *p, const char *s,
-			int count, int yy, int xx)
+void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p, const char *s,
+		       int count, int yy, int xx)
 {
     u_char *cdat, c, *dest, *dest0;
     int rows, bytes = p->next_line;
     u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 16;
-    fgx = cfb16_cmap[attr_fgcol(p, conp)];
-    bgx = cfb16_cmap[attr_bgcol(p, conp)];
+    fgx = fbcon_cfb16_cmap[attr_fgcol(p, conp)];
+    bgx = fbcon_cfb16_cmap[attr_bgcol(p, conp)];
     fgx |= (fgx << 16);
     bgx |= (bgx << 16);
     eorx = fgx ^ bgx;
@@ -199,7 +160,7 @@
     }
 }
 
-static void rev_char_cfb16(struct display *p, int xx, int yy)
+void fbcon_cfb16_revc(struct display *p, int xx, int yy)
 {
     u_char *dest;
     int bytes = p->next_line, rows;
@@ -214,25 +175,25 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cfb16(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cfb16, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cfb16);
-}
-#endif /* MODULE */
+struct display_switch fbcon_cfb16 = {
+    fbcon_cfb16_setup, fbcon_cfb16_bmove, fbcon_cfb16_clear, fbcon_cfb16_putc,
+    fbcon_cfb16_putcs, fbcon_cfb16_revc
+};
 
 
     /*
      *  Visible symbols for modules
      */
 
-EXPORT_SYMBOL(cfb16_cmap);
+EXPORT_SYMBOL(fbcon_cfb16);
+EXPORT_SYMBOL(fbcon_cfb16_setup);
+EXPORT_SYMBOL(fbcon_cfb16_bmove);
+EXPORT_SYMBOL(fbcon_cfb16_clear);
+EXPORT_SYMBOL(fbcon_cfb16_putc);
+EXPORT_SYMBOL(fbcon_cfb16_putcs);
+EXPORT_SYMBOL(fbcon_cfb16_revc);
+EXPORT_SYMBOL(fbcon_cfb16_cmap);
--- m68k-2.1.77/drivers/video/fbcon-cfb32.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb32.c	Mon Jan 12 22:55:57 1998
@@ -16,62 +16,23 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_cfb32(struct display *p);
-static void release_cfb32(void);
-static void bmove_cfb32(struct display *p, int sy, int sx, int dy, int dx,
-			int height, int width);
-static void clear_cfb32(struct vc_data *conp, struct display *p, int sy,
-			int sx, int height, int width);
-static void putc_cfb32(struct vc_data *conp, struct display *p, int c,
-		       int yy, int xx);
-static void putcs_cfb32(struct vc_data *conp, struct display *p,
-			const char *s, int count, int yy, int xx);
-static void rev_char_cfb32(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_cfb32 = {
-    open_cfb32, release_cfb32, bmove_cfb32, clear_cfb32, putc_cfb32,
-    putcs_cfb32, rev_char_cfb32
-};
+#include "fbcon-cfb32.h"
 
 
     /*
      *  32 bpp packed pixels
      */
 
-u32 cfb32_cmap[16];
+u32 fbcon_cfb32_cmap[16];
 
-static int open_cfb32(struct display *p)
+void fbcon_cfb32_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 32 ||
-	(p->visual != FB_VISUAL_TRUECOLOR &&
-	 p->visual != FB_VISUAL_DIRECTCOLOR))
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual<<2;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cfb32(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_cfb32(struct display *p, int sy, int sx, int dy, int dx,
-			int height, int width)
+void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		       int height, int width)
 {
     int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
     u_char *src, *dst;
@@ -99,8 +60,8 @@
     }
 }
 
-static void clear_cfb32(struct vc_data *conp, struct display *p, int sy,
-			int sx, int height, int width)
+void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		       int height, int width)
 {
     u_char *dest0, *dest;
     int bytes = p->next_line, lines = height * p->fontheight, rows, i;
@@ -108,7 +69,7 @@
 
     dest = p->screen_base + sy * p->fontheight * bytes + sx * 32;
 
-    bgx = cfb32_cmap[attr_bgcol_ec(p, conp)];
+    bgx = fbcon_cfb32_cmap[attr_bgcol_ec(p, conp)];
 
     if (sx == 0 && width * 32 == bytes)
 	for (i = 0 ; i < lines * width ; i++) {
@@ -141,8 +102,8 @@
     }
 }
 
-static void putc_cfb32(struct vc_data *conp, struct display *p, int c, int yy,
-		       int xx)
+void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		      int xx)
 {
     u_char *dest, *cdat;
     int bytes = p->next_line, rows;
@@ -153,8 +114,8 @@
     dest = p->screen_base + yy * p->fontheight * bytes + xx * 32;
     cdat = p->fontdata + c * p->fontheight;
 
-    fgx = cfb32_cmap[attr_fgcol(p, conp)];
-    bgx = cfb32_cmap[attr_bgcol(p, conp)];
+    fgx = fbcon_cfb32_cmap[attr_fgcol(p, conp)];
+    bgx = fbcon_cfb32_cmap[attr_bgcol(p, conp)];
     eorx = fgx ^ bgx;
 
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
@@ -170,16 +131,16 @@
     }
 }
 
-static void putcs_cfb32(struct vc_data *conp, struct display *p, const char *s,
-			int count, int yy, int xx)
+void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p, const char *s,
+		       int count, int yy, int xx)
 {
     u_char *cdat, c, *dest, *dest0;
     int rows, bytes = p->next_line;
     u32 eorx, fgx, bgx;
 
     dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 32;
-    fgx = cfb32_cmap[attr_fgcol(p, conp)];
-    bgx = cfb32_cmap[attr_bgcol(p, conp)];
+    fgx = fbcon_cfb32_cmap[attr_fgcol(p, conp)];
+    bgx = fbcon_cfb32_cmap[attr_bgcol(p, conp)];
     eorx = fgx ^ bgx;
     while (count--) {
 	c = *s++;
@@ -200,7 +161,7 @@
     }
 }
 
-static void rev_char_cfb32(struct display *p, int xx, int yy)
+void fbcon_cfb32_revc(struct display *p, int xx, int yy)
 {
     u_char *dest;
     int bytes = p->next_line, rows;
@@ -219,25 +180,25 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cfb32(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cfb32, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cfb32);
-}
-#endif /* MODULE */
+struct display_switch fbcon_cfb32 = {
+    fbcon_cfb32_setup, fbcon_cfb32_bmove, fbcon_cfb32_clear, fbcon_cfb32_putc,
+    fbcon_cfb32_putcs, fbcon_cfb32_revc
+};
 
 
     /*
      *  Visible symbols for modules
      */
 
-EXPORT_SYMBOL(cfb32_cmap);
+EXPORT_SYMBOL(fbcon_cfb32);
+EXPORT_SYMBOL(fbcon_cfb32_setup);
+EXPORT_SYMBOL(fbcon_cfb32_bmove);
+EXPORT_SYMBOL(fbcon_cfb32_clear);
+EXPORT_SYMBOL(fbcon_cfb32_putc);
+EXPORT_SYMBOL(fbcon_cfb32_putcs);
+EXPORT_SYMBOL(fbcon_cfb32_revc);
+EXPORT_SYMBOL(fbcon_cfb32_cmap);
--- m68k-2.1.77/drivers/video/fbcon-cfb4.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb4.c	Sun Jan 11 17:32:01 1998
@@ -17,74 +17,38 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
+#include "fbcon-cfb4.h"
 
 
     /*
-     *  Prototypes
+     *  4 bpp packed pixels
      */
 
-static int open_cfb4(struct display *p);
-static void release_cfb4(void);
-static void bmove_cfb4(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_cfb4(struct vc_data *conp, struct display *p, int sy,
-		       int sx, int height, int width);
-static void putc_cfb4(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_cfb4(struct vc_data *conp, struct display *p,
-		       const char *s, int count, int yy, int xx);
-static void rev_char_cfb4(struct display *p, int xx, int yy);
-
-
     /*
-     *  `switch' for the low level operations
+     *  IFF the font is even pixel aligned (that is to say each
+     *  character start is a byte start in the pixel pairs). That
+     *  avoids us having to mask bytes and means we won't be here
+     *  all week. On a MacII that matters _lots_
      */
 
-static struct display_switch dispsw_cfb4 = {
-    open_cfb4, release_cfb4, bmove_cfb4, clear_cfb4, putc_cfb4, putcs_cfb4,
-    rev_char_cfb4
+static u16 nibbletab_cfb4[] = {
+    0x0000,0x000f,0x00f0,0x00ff,
+    0x0f00,0x0f0f,0x0ff0,0x0fff,
+    0xf000,0xf00f,0xf0f0,0xf0ff,
+    0xff00,0xff0f,0xfff0,0xffff
 };
 
-
-    /*
-     *  4 bpp packed pixels
-     */
-
-   /*
-    *		IFF the font is even pixel aligned (that is to say each
-    *		character start is a byte start in the pixel pairs). That
-    *		avoids us having to mask bytes and means we won't be here
-    *		all week. On a MacII that matters _lots_
-    */
-
-static u_short nibbletab_cfb4[]={
-0x0000,0x000f,0x00f0,0x00ff,
-0x0f00,0x0f0f,0x0ff0,0x0fff,
-0xf000,0xf00f,0xf0f0,0xf0ff,
-0xff00,0xff0f,0xfff0,0xffff};
-
-static int open_cfb4(struct display *p)
+void fbcon_cfb4_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 4)
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual>>1;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cfb4(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_cfb4(struct display *p, int sy, int sx, int dy, int dx,
-                       int height, int width)
+void fbcon_cfb4_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width)
 {
 	int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
-	u_char *src,*dst;
+	u8 *src,*dst;
 
 	if (sx == 0 && dx == 0 && width * 4 == bytes) {
 		mymemmove(p->screen_base + dy * linesize,
@@ -115,12 +79,12 @@
 	}
 }
 
-static void clear_cfb4(struct vc_data *conp, struct display *p, int sy,
-                       int sx, int height, int width)
+void fbcon_cfb4_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width)
 {
-	u_char *dest0,*dest;
+	u8 *dest0,*dest;
 	int bytes=p->next_line,lines=height * p->fontheight, rows, i;
-	u_long bgx;
+	u32 bgx;
 
 /*	if(p->screen_base!=0xFDD00020)
 		mac_boom(1);*/
@@ -133,7 +97,7 @@
 
 	if (sx == 0 && width * 4 == bytes) {
 		for (i = 0 ; i < lines * width ; i++) {
-			((u_long *)dest)[0]=bgx;
+			((u32 *)dest)[0]=bgx;
 			dest+=4;
 		}
 	} else {
@@ -142,19 +106,19 @@
 			dest=dest0;
 			for (i = 0 ; i < width ; i++) {
 				/* memset ?? */
-				((u_long *)dest)[0]=bgx;
+				((u32 *)dest)[0]=bgx;
 				dest+=4;
 			}
 		}
 	}
 }
 
-static void putc_cfb4(struct vc_data *conp, struct display *p, int c, int yy,
-                      int xx)
+void fbcon_cfb4_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		     int xx)
 {
-	u_char *dest,*cdat;
+	u8 *dest,*cdat;
 	int bytes=p->next_line,rows;
-	ulong eorx,fgx,bgx;
+	u32 eorx,fgx,bgx;
 
 	c &= 0xff;
 
@@ -170,19 +134,19 @@
 	eorx = fgx ^ bgx;
 
 	for (rows = p->fontheight ; rows-- ; dest += bytes) {
-		((u_short *)dest)[0]=
+		((u16 *)dest)[0]=
 			(nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx;
-		((u_short *)dest)[1]=
+		((u16 *)dest)[1]=
 			(nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx;
 	}
 }
 
-static void putcs_cfb4(struct vc_data *conp, struct display *p,
-                       const char *s, int count, int yy, int xx)
+void fbcon_cfb4_putcs(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx)
 {
-	u_char *cdat, c, *dest, *dest0;
+	u8 *cdat, c, *dest, *dest0;
 	int rows,bytes=p->next_line;
-	u_long eorx, fgx, bgx;
+	u32 eorx, fgx, bgx;
 
 	dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 4;
 	fgx=15/*attr_fgcol(p,conp)*/;
@@ -199,39 +163,45 @@
 		cdat = p->fontdata + c * p->fontheight;
 
 		for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-			((u_short *)dest)[0]=
+			((u16 *)dest)[0]=
 			(nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx;
-			((u_short *)dest)[1]=
+			((u16 *)dest)[1]=
 			(nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx;
 		}
 		dest0+=4;
 	}
 }
 
-static void rev_char_cfb4(struct display *p, int xx, int yy)
+void fbcon_cfb4_revc(struct display *p, int xx, int yy)
 {
-	u_char *dest;
+	u8 *dest;
 	int bytes=p->next_line, rows;
 
 	dest = p->screen_base + yy * p->fontheight * bytes + xx * 4;
 	for (rows = p->fontheight ; rows-- ; dest += bytes) {
-		((u_long *)dest)[0] ^= 0x0f0f0f0f;
+		((u32 *)dest)[0] ^= 0x0f0f0f0f;
 	}
 }
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cfb4(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cfb4, 0));
-}
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cfb4);
-}
-#endif /* MODULE */
+    /*
+     *  `switch' for the low level operations
+     */
+
+struct display_switch fbcon_cfb4 = {
+    fbcon_cfb4_setup, fbcon_cfb4_bmove, fbcon_cfb4_clear, fbcon_cfb4_putc,
+    fbcon_cfb4_putcs, fbcon_cfb4_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
 
+EXPORT_SYMBOL(fbcon_cfb4);
+EXPORT_SYMBOL(fbcon_cfb4_setup);
+EXPORT_SYMBOL(fbcon_cfb4_bmove);
+EXPORT_SYMBOL(fbcon_cfb4_clear);
+EXPORT_SYMBOL(fbcon_cfb4_putc);
+EXPORT_SYMBOL(fbcon_cfb4_putcs);
+EXPORT_SYMBOL(fbcon_cfb4_revc);
--- m68k-2.1.77/drivers/video/fbcon-cfb8.c.orig	Sun Jan 11 23:05:04 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb8.c	Sun Jan 11 17:32:02 1998
@@ -16,34 +16,7 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_cfb8(struct display *p);
-static void release_cfb8(void);
-static void bmove_cfb8(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_cfb8(struct vc_data *conp, struct display *p, int sy,
-		       int sx, int height, int width);
-static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_cfb8(struct vc_data *conp, struct display *p,
-		       const char *s, int count, int yy, int xx);
-static void rev_char_cfb8(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_cfb8 = {
-    open_cfb8, release_cfb8, bmove_cfb8, clear_cfb8, putc_cfb8, putcs_cfb8,
-    rev_char_cfb8
-};
+#include "fbcon-cfb8.h"
 
 
     /*
@@ -66,26 +39,14 @@
 #endif
 };
 
-static int open_cfb8(struct display *p)
+void fbcon_cfb8_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_PACKED_PIXELS || p->var.bits_per_pixel != 8 ||
-	(p->visual != FB_VISUAL_PSEUDOCOLOR &&
-	 p->visual != FB_VISUAL_STATIC_PSEUDOCOLOR))
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual;
     p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cfb8(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_cfb8(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width)
+void fbcon_cfb8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+		      int height, int width)
 {
     int bytes = p->next_line, linesize = bytes * p->fontheight, rows;
     u_char *src,*dst;
@@ -113,8 +74,8 @@
     }
 }
 
-static void clear_cfb8(struct vc_data *conp, struct display *p, int sy, int sx,
-		       int height, int width)
+void fbcon_cfb8_clear(struct vc_data *conp, struct display *p, int sy, int sx,
+		      int height, int width)
 {
     u_char *dest0,*dest;
     int bytes=p->next_line,lines=height * p->fontheight, rows, i;
@@ -145,8 +106,8 @@
     }
 }
 
-static void putc_cfb8(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx)
+void fbcon_cfb8_putc(struct vc_data *conp, struct display *p, int c, int yy,
+		     int xx)
 {
     u_char *dest,*cdat;
     int bytes=p->next_line,rows;
@@ -171,8 +132,8 @@
     }
 }
 
-static void putcs_cfb8(struct vc_data *conp, struct display *p, const char *s,
-		       int count, int yy, int xx)
+void fbcon_cfb8_putcs(struct vc_data *conp, struct display *p, const char *s,
+		      int count, int yy, int xx)
 {
     u_char *cdat, c, *dest, *dest0;
     int rows,bytes=p->next_line;
@@ -198,7 +159,7 @@
     }
 }
 
-static void rev_char_cfb8(struct display *p, int xx, int yy)
+void fbcon_cfb8_revc(struct display *p, int xx, int yy)
 {
     u_char *dest;
     int bytes=p->next_line, rows;
@@ -211,18 +172,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cfb8(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cfb8, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cfb8);
-}
-#endif /* MODULE */
+struct display_switch fbcon_cfb8 = {
+    fbcon_cfb8_setup, fbcon_cfb8_bmove, fbcon_cfb8_clear, fbcon_cfb8_putc,
+    fbcon_cfb8_putcs, fbcon_cfb8_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_cfb8);
+EXPORT_SYMBOL(fbcon_cfb8_setup);
+EXPORT_SYMBOL(fbcon_cfb8_bmove);
+EXPORT_SYMBOL(fbcon_cfb8_clear);
+EXPORT_SYMBOL(fbcon_cfb8_putc);
+EXPORT_SYMBOL(fbcon_cfb8_putcs);
+EXPORT_SYMBOL(fbcon_cfb8_revc);
--- m68k-2.1.77/drivers/video/fbcon-cyber.c.orig	Fri Jan  9 01:21:07 1998
+++ m68k-2.1.77/drivers/video/fbcon-cyber.c	Mon Jan 12 23:12:49 1998
@@ -1,218 +0,0 @@
-/*
- *  linux/drivers/video/cyber.c -- Low level frame buffer operations for the
- *				   CyberVision64 (accelerated)
- *
- *	Created 5 Apr 1997 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.
- */
-
-#include <linux/module.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/string.h>
-#include <linux/config.h>
-#include <linux/fb.h>
-
-#include "fbcon.h"
-#include "s3blit.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_cyber(struct display *p);
-static void release_cyber(void);
-static void bmove_cyber(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width);
-static void clear_cyber(struct vc_data *conp, struct display *p, int sy, int sx,
-	                int height, int width);
-static void putc_cyber(struct vc_data *conp, struct display *p, int c, int yy,
-	               int xx);
-static void putcs_cyber(struct vc_data *conp, struct display *p, const char *s,
-	                int count, int yy, int xx);
-static void rev_char_cyber(struct display *p, int xx, int yy);
-
-
-    /*
-     *  Acceleration functions in cyberfb.c
-     */
-
-extern void Cyber_WaitQueue(unsigned short fifo);
-extern void Cyber_WaitBlit(void);
-extern void Cyber_BitBLT(unsigned short curx, unsigned short cury,
-			 unsigned short destx, unsigned short desty,
-			 unsigned short width, unsigned short height,
-			 unsigned short mode);
-extern void Cyber_RectFill(unsigned short xx, unsigned short yy,
-			   unsigned short width, unsigned short height,
-			   unsigned short mode, unsigned short fillcolor);
-extern void Cyber_MoveCursor(unsigned short xx, unsigned short yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_cyber = {
-   open_cyber, release_cyber, bmove_cyber, clear_cyber, putc_cyber,
-   putcs_cyber, rev_char_cyber
-};
-
-
-    /*
-     *  CyberVision64 (accelerated)
-     */
-
-static u32 nibbletab_cfb8[] = {
-#if defined(__BIG_ENDIAN)
-    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
-    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
-    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
-    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
-#elif defined(__LITTLE_ENDIAN)
-    0x00000000,0xff000000,0x00ff0000,0xffff0000,
-    0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
-    0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
-    0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
-#else
-#error FIXME: No endianness??
-#endif
-};
-
-static int open_cyber(struct display *p)
-{
-    if (p->type != FB_TYPE_PACKED_PIXELS ||
-	p->var.accel != FB_ACCEL_CYBERVISION)
-	return -EINVAL;
-
-    p->next_line = p->var.xres_virtual*p->var.bits_per_pixel>>3;
-    p->next_plane = 0;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_cyber(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_cyber(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width)
-{
-    sx *= 8; dx *= 8; width *= 8;
-    Cyber_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
-		 (u_short)(dy*p->fontheight), (u_short)width,
-		 (u_short)(height*p->fontheight), (u_short)S3_NEW);
-}
-
-static void clear_cyber(struct vc_data *conp, struct display *p, int
-			sy, int sx, int height, int width)
-{
-    unsigned char bg;
-
-    sx *= 8; width *= 8;
-    bg = attr_bgcol_ec(p,conp);
-    Cyber_RectFill((u_short)sx,
-		   (u_short)(sy*p->fontheight),
-		   (u_short)width,
-		   (u_short)(height*p->fontheight),
-		   (u_short)S3_NEW,
-		   (u_short)bg);
-}
-
-static void putc_cyber(struct vc_data *conp, struct display *p, int c, int yy,
-	               int xx)
-{
-    u_char *dest,*cdat;
-    int bytes=p->next_line,rows;
-    u32 eorx,fgx,bgx;
-
-    c &= 0xff;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    cdat = p->fontdata + c * p->fontheight;
-
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
-    }
-}
-
-static void putcs_cyber(struct vc_data *conp, struct display *p, const char *s,
-	                int count, int yy, int xx)
-{
-    u_char *cdat, c, *dest, *dest0;
-    int rows,bytes=p->next_line;
-    u32 eorx, fgx, bgx;
-
-    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-    while (count--) {
-	c = *s++;
-	cdat = p->fontdata + c * p->fontheight;
-	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-	    ((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	    ((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
-	}
-	dest0+=8;
-    }
-}
-
-
-static void rev_char_cyber(struct display *p, int xx, int yy)
-{
-    unsigned char *dest;
-    unsigned int rows;
-    unsigned char fg, bg;
-
-    fg = p->fgcol;
-    bg = p->bgcol;
-
-    dest = p->screen_base+yy*p->fontheight*p->next_line+8*xx;
-    Cyber_WaitBlit();
-    for (rows = p->fontheight; rows--; dest += p->next_line) {
-	*dest = (*dest == fg) ? bg : fg;
-	*(dest+1) = (*(dest + 1) == fg) ? bg : fg;
-	*(dest+2) = (*(dest + 2) == fg) ? bg : fg;
-	*(dest+3) = (*(dest + 3) == fg) ? bg : fg;
-	*(dest+4) = (*(dest + 4) == fg) ? bg : fg;
-	*(dest+5) = (*(dest + 5) == fg) ? bg : fg;
-	*(dest+6) = (*(dest + 6) == fg) ? bg : fg;
-	*(dest+7) = (*(dest + 7) == fg) ? bg : fg;
-    }
-}
-
-
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_cyber(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_cyber, 1));
-}
-
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_cyber);
-}
-#endif /* MODULE */
--- m68k-2.1.77/drivers/video/fbcon-mach64.c.orig	Fri Jan  9 01:24:36 1998
+++ m68k-2.1.77/drivers/video/fbcon-mach64.c	Mon Jan 12 23:12:43 1998
@@ -1,529 +0,0 @@
-/*
- *  linux/drivers/video/fbcon-mach64.c -- Low level frame buffer operations for 
- *					  Ati Mach64 (accelerated)
- *
- *	Created 20 Jun 1997 by Bernd Harries
- *
- *  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/module.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/string.h>
-#include <linux/config.h>
-#include <linux/fb.h>
-
-#include "fbcon.h"
-#include "fbcon-mach64.h"
-#include "mach64fb.h"
-
-/*============================================================================*/
-/* Defines */
-
-#define  _USE_HW_ACCEL_BLT_
-#define  _USE_HW_ACCEL_FILL_
-
-
-#ifdef  BHA_DEBUG
-
-#define  FuncId       if(mach64_debug & 0x00000100) printk
-#define  FuncDone     if(mach64_debug & 0x00000200) printk
-#define  CFuncId      if(mach64_debug & 0x00000400) printk
-#define  CFuncDone    if(mach64_debug & 0x00000800) printk
-
-
-/* Busy */
-#define  Bprint       if(mach64_debug & 0x01000000) printk
-/* Debug */
-#define  Dprint       if(mach64_debug & 0x00800000) printk
-
-/* Message */
-#define  Mprint       if(mach64_debug & 0x00004000) printk
-/* Info */
-#define  Iprint       if(mach64_debug & 0x00008000) printk
-/* Warn */
-#define  Wprint       if(mach64_debug & 0x00010000) printk
-/* Error */
-#define  Eprint       if(mach64_debug & 0x00020000) printk
-/* Fatal */
-#define  Fprint       if(mach64_debug & 0x00040000) printk
-/* Panic */
-#define  Pprint       if(mach64_debug & 0x00040000) printk
-
-#else
-
-#define  FuncId
-#define  FuncDone
-#define  CFuncId
-#define  CFuncDone
-
-#endif  /* BHA_DEBUG*/
-
-/*============================================================================*/
-/* Types */
-
-/*============================================================================*/
-/* Extern Functions*/
-
-
-
-/*============================================================================*/
-/* Intern Functions*/
-
-    /*
-     *  Prototypes
-     */
-
-int fbcon_init_mach64(void);
-
-static int open_mach64(struct display *p);
-static void release_mach64(void);
-static void bmove_mach64(struct display *p, int sy, int sx, int dy, int dx,
-		       int height, int width);
-static void clear_mach64(struct vc_data *conp, struct display *p, int sy,
-		       int sx, int height, int width);
-static void putc_mach64(struct vc_data *conp, struct display *p, int c, int yy,
-		      int xx);
-static void putcs_mach64(struct vc_data *conp, struct display *p,
-		       const char *s, int count, int yy, int xx);
-static void rev_char_mach64(struct display *p, int xx, int yy);
-
-
-/*============================================================================*/
-/*============================================================================*/
-/* Intern Variables */
-
-/*--------------------------------------------------------------------------*/
-/* BSS */
-
-/*--------------------------------------------------------------------------*/
-/* Data */
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch    dispsw_mach64 = 
-{
-  open_mach64,
-  release_mach64,
-  bmove_mach64,
-  clear_mach64,
-  putc_mach64,
-  putcs_mach64,
-  rev_char_mach64
-};
-
-
-    /*
-     *  8 bpp packed pixels => 4 pixel / 32 Bit => 1/2 FontByte 
-     */
-
-static u_int nibbletab_mach64[16] = 
-{
-#if defined(__BIG_ENDIAN)
-  0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
-  0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
-  0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
-  0xffff0000,0xffff00ff,0xffffff00,0xffffffff
-#elif defined(__LITTLE_ENDIAN)
-  0x00000000,0xff000000,0x00ff0000,0xffff0000,
-  0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
-  0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
-  0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
-#else
-#error FIXME: No endianness??
-#endif
-};
-
-static  unsigned int    mach64_debug = 0x018FCF00;
-
-/*============================================================================*/
-/*============================================================================*/
-/* Functions */
-
-/*============================================================================*/
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static int 
-open_mach64(struct display * p)
-
-/*--------------------------------------------------------------------------*/
-{
-  /*--------------------------------------------------------------------------*/
-  FuncId("open_mach64($%08lX) : ", p);
-  if(p->type != FB_TYPE_PACKED_PIXELS || p->var.accel != FB_ACCEL_MACH64)
-  {
-    FuncDone(" Fail! \n");
-    return -EINVAL;  /* This driver can only do Mach64 boards! */
-  }
-  /*endif*/
-
-  p->next_line = (p->var.xres_virtual * p->var.bits_per_pixel) >> 3;
-  p->next_plane = 0;
-  MOD_INC_USE_COUNT;
-
-  FuncDone(" Match! \n");
-  return 0;
-}
-/*endproc open_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-release_mach64(void)
-{
-  /*--------------------------------------------------------------------------*/
-  FuncId("release_mach64() \n");
-    MOD_DEC_USE_COUNT;
-}
-/*endproc release_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-bmove_mach64(struct display * p,
-  int sy,
-  int sx,
-  int dy,
-  int dx,
-  int height,
-  int width)
-
-/*--------------------------------------------------------------------------*/
-{
-  u_char * src, * dst;
-  int                           bytes = p->next_line,
-                                linesize = bytes * p->fontheight,
-                                rows;
-
-  /*--------------------------------------------------------------------------*/
-  CFuncId("bmove_mach64($%04X, $%04X, $%04X, $%04X) \n",
-    sy, sx, dy, dx, height, width);
-
-#ifdef _USE_HW_ACCEL_BLT_
-
-  Mach64_BitBLT(
-    (sx << 3),
-    (sy * p->fontheight),
-    (dx << 3),
-    (dy * p->fontheight),
-    (width << 3),
-    (height * p->fontheight),
-    3);                 /*  MIX_SRC); see XGCValues GCFunction = GXCopy */
-
-#else
-
-  if(sx == 0 && dx == 0 && width * 8 == bytes)   /* full stride */
-
-    mymemmove(p->screen_base + dy * linesize,
-      p->screen_base + sy * linesize,
-      height * linesize);
-
-  else if (dy < sy || (dy == sy && dx < sx))
-  {
-    src = p->screen_base + sy * linesize + sx * 8;
-    dst = p->screen_base + dy * linesize + dx * 8;
-    for (rows = height * p->fontheight ; rows-- ;)
-    {
-      mymemmove(dst, src, (width << 3));
-      src += bytes;
-      dst += bytes;
-    }
-    /*next rows*/
-  }
-  else
-  {
-    src = p->screen_base + (sy+height) * linesize + sx * 8 - bytes;
-    dst = p->screen_base + (dy+height) * linesize + dx * 8 - bytes;
-    for(rows = height * p->fontheight ; rows-- ;)
-    {
-      mymemmove(dst, src, (width << 3));
-      src -= bytes;
-      dst -= bytes;
-    }
-    /*next rows*/
-  }
-  /*endif*/
-
-#endif  /* _USE_HW_ACCEL_BLT_ */
-
-  return;
-}
-/*endproc bmove_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-clear_mach64(struct vc_data * conp,
-  struct display * p,
-  int sy,                       /* in Characters von oben */
-  int sx,
-  int height,                   /* in Characters */
-  int width)                    /* in Characters */
-
-/*--------------------------------------------------------------------------*/
-{
-  register u_int *              dest;
-  register u_int                bgx;
-  register int                  i;
-
-  u_char *                      dest0;
-
-  int                           bytes_p_line = p->next_line,
-                                lines_w = height * p->fontheight,
-                                rows;
-
-  /*--------------------------------------------------------------------------*/
-  CFuncId("clear_mach64($%04X, $%04X, $%04X, $%04X) \n",
-    sy, sx, height, width);
-
-  bgx = attr_bgcol_ec(p, conp);
-  bgx |= (bgx << 8);
-  bgx |= (bgx << 16);
-
-#ifdef _USE_HW_ACCEL_FILL_
-
-  Mach64_RectFill(
-    (sx << 3),
-    (sy * p->fontheight),
-    (width << 3),
-    (height * p->fontheight),
-    3,                            /* MIX_SRC, see XGCValues GCFunction  */
-    bgx);
-
-#else
-
-  dest0 = p->screen_base + sy * p->fontheight * bytes_p_line + sx * 8;
-  if(sx == 0 && (width << 3) == bytes_p_line)     /* full stride */
-  {
-    lines_w *= width;
-    dest = (u_int*)dest0;
-    for(i = 0 ; i < lines_w ; i++)
-    {
-      *dest++ = bgx;          /* clears 4 pixels == half Char */
-      *dest++ = bgx;
-    }
-  }
-  else                                     /* only part of the width */
-  {
-    for(rows = lines_w; rows-- ; dest0 += bytes_p_line)
-    {
-      dest = (u_int*)dest0;
-      for(i = 0 ; i < width ; i++)
-      {
-        *dest++ = bgx;        /* clears 4 pixels */
-        *dest++ = bgx;
-      }
-      /*next i*/
-    }
-  }
-  /*endif*/
-
-#endif  /* _USE_HW_ACCEL_FILL_ */
-
-  return;
-}
-/*endproc clear_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-putc_mach64(struct vc_data * conp,
-  struct display * p,
-  int c,                   /* ASCII */
-  int yy,                  /* Text column */
-  int xx)                  /* Text row */
-
-/*--------------------------------------------------------------------------*/
-{
-  register u_char *             dest_p;
-  register u_char *             cdat_p;
-  register u_char               cdat;
-  register u_int                eorx, fgx, bgx;
-  int                           bytes = p->next_line; /*must be multiple of 4*/
-  int                           rows;
-
-  /*--------------------------------------------------------------------------*/
-  c &= 0xFF;
-
-  dest_p = p->screen_base + yy * p->fontheight * bytes + (xx << 3);
-  cdat_p = p->fontdata + c * p->fontheight;
-
-  fgx=attr_fgcol(p, conp);
-  bgx=attr_bgcol(p,conp);
-
-  fgx |= (fgx << 8);
-  fgx |= (fgx << 16);
-  bgx |= (bgx << 8);
-  bgx |= (bgx << 16);
-  eorx = fgx ^ bgx;
-
-  /* Mach64_WaitBlit(); */    /* We will have to sync with HW Blit */
-  for(rows = p->fontheight ; rows-- ; dest_p += bytes) /* byte* add = natural */
-  {
-    cdat = *cdat_p++;
-    *((u32 *)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
-    ((u32 *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
-  }
-  /*next row*/
-
-  return;
-}
-/*endproc putc_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-putcs_mach64(struct vc_data * conp,
-  struct display * p,
-  const char * s,
-  int count,
-  int yy,
-  int xx)
-
-/*--------------------------------------------------------------------------*/
-{
-  register u_char *             dest_p;
-  register u_char *             cdat_p;
-  register u_char               cdat;
-  register u_int                eorx, fgx, bgx;
-  u_char *                      dest0;
-  int                           bytes = p->next_line; /*must be multiple of 4*/
-  int                           rows;
-  u_char                        c;
-
-  /*--------------------------------------------------------------------------*/
-
-  dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-  fgx=attr_fgcol(p,conp);
-  bgx=attr_bgcol(p,conp);
-
-  fgx |= (fgx << 8);
-  fgx |= (fgx << 16);
-  bgx |= (bgx << 8);
-  bgx |= (bgx << 16);
-  eorx = fgx ^ bgx;
-
-  /* Mach64_WaitBlit(); */    /* We will have to sync with HW Blit */
-  while(count--)        /* character count 8 x h */
-  {
-    c = *s++;
-    cdat_p = p->fontdata + c * p->fontheight;
-
-    for(rows = p->fontheight, dest_p = dest0; rows-- ; dest_p += bytes)
-    {
-      cdat = *cdat_p++;
-      *((u32 *)dest_p) = (nibbletab_mach64[cdat >> 4] & eorx) ^ bgx;
-      ((u32 *)dest_p)[1] = (nibbletab_mach64[cdat & 0xF] & eorx) ^ bgx;
-    }
-    /*next rows*/
-    dest0 += 8;
-  }
-  /*endwhile*/
-
-  return;
-}
-/*endproc putcs_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-static void 
-rev_char_mach64(struct display *p, int xx, int yy)
-
-/*--------------------------------------------------------------------------*/
-{
-    u_char *dest;
-    int bytes=p->next_line, rows;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u32 *)dest)[0] ^= 0x0f0f0f0f;
-	((u32 *)dest)[1] ^= 0x0f0f0f0f;
-    }
-}
-/*endproc rev_char_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef MODULE
-int 
-init_module(void)
-#else
-int 
-fbcon_init_mach64(void)
-#endif
-
-/*--------------------------------------------------------------------------*/
-{
-
-  /*--------------------------------------------------------------------------*/
-  FuncId("fbcon_init_mach64() \n");
-  /* We want to be added to the list of accelerated drivers */
-  return(fbcon_register_driver(&dispsw_mach64, 1));
-}
-/*endproc fbcon_init_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef MODULE
-void 
-cleanup_module(void)
-
-/*--------------------------------------------------------------------------*/
-{
-  /*--------------------------------------------------------------------------*/
-  FuncId("cleanup_module() \n");
-    fbcon_unregister_driver(&dispsw_mach64);
-}
-/*endproc cleanup_mach64() */
-
-/*============================================================================*/
-
-
-/*--------------------------------------------------------------------------*/
-#endif /* MODULE */
-/*============================================================================*/
-
-
-/*============================================================================*/
-/* RCS-ID */
-
-  static char
-  rcs_id_c[] =
-    "@(#) Linux-m68k: 1997 10 05 14:53:32 BHA: fbcon-mach64.c ";
-
-  static char
-  rcs_id_h[] = FBCON_MACH64_H_ID;
-
-/*============================================================================*/
--- m68k-2.1.77/drivers/video/fbcon-mach64.h.orig	Fri Jan  9 01:24:41 1998
+++ m68k-2.1.77/drivers/video/fbcon-mach64.h	Mon Jan 12 23:12:43 1998
@@ -1,31 +0,0 @@
-
-
-#ifndef _FBCON_MACH64_H_LOADED_
-#define _FBCON_MACH64_H_LOADED_
-
-
-
-
-
-
-
-/*============================================================================*/
-	/*
-	 * Support for Graphics Boards
-	 */
-
-#ifdef CONFIG_FBCON_MACH64			/* ATI Mach 64 */
-
-int fbcon_init_mach64(void);
-
-#endif /* CONFIG_FBCON_MACH64 */	
-
-/*============================================================================*/
-/* RCS-ID */
-
-#define FBCON_MACH64_H_ID \
-  "@(#) Linux-m68k: 1997 06 25 17:34:18 BHA: fbcon-mach64.h "
-
-/*============================================================================*/
-
-#endif /* _FBCON_MACH64_H_LOADED_ */
--- m68k-2.1.77/drivers/video/fbcon-retz3.c.orig	Fri Jan  9 01:22:03 1998
+++ m68k-2.1.77/drivers/video/fbcon-retz3.c	Mon Jan 12 23:12:43 1998
@@ -1,223 +0,0 @@
-/*
- *  linux/drivers/video/retz3.c -- Low level frame buffer operations for the
- *				   RetinaZ3 (accelerated)
- *
- *	Created 5 Apr 1997 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.
- */
-
-#include <linux/module.h>
-#include <linux/tty.h>
-#include <linux/console.h>
-#include <linux/string.h>
-#include <linux/config.h>
-#include <linux/fb.h>
-
-#include "fbcon.h"
-
-
-/*
- *  Prototypes
- */
-
-static int open_retz3(struct display *p);
-static void release_retz3(void);
-static void bmove_retz3(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width);
-static void clear_retz3(struct vc_data *conp, struct display *p, int
-			sy, int sx, int height, int width);
-static void putc_retz3(struct vc_data *conp, struct display *p, int c,
-		       int ypos, int xpos);
-static void putcs_retz3(struct vc_data *conp, struct display *p, const
-			char *s, int count, int ypos, int xpos);
-static void rev_char_retz3(struct display *p, int xpos, int ypos);
-
-
-    /*
-     *  Acceleration functions in retz3fb.c
-     */
-
-extern void retz3_bitblt(struct fb_var_screeninfo *scr,
-			 unsigned short srcx, unsigned short srcy, unsigned
-			 short destx, unsigned short desty, unsigned short
-			 width, unsigned short height, unsigned short cmd,
-			 unsigned short mask);
-
-#define Z3BLTcopy		0xc0
-#define Z3BLTset		0xf0
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_retz3 = {
-	open_retz3, release_retz3, bmove_retz3, clear_retz3, putc_retz3,
-	putcs_retz3, rev_char_retz3
-};
-
-
-    /*
-     *  RetinaZ3 (accelerated)
-     */
-
-static u32 nibbletab_cfb8[] = {
-#if defined(__BIG_ENDIAN)
-    0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
-    0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
-    0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
-    0xffff0000,0xffff00ff,0xffffff00,0xffffffff
-#elif defined(__LITTLE_ENDIAN)
-    0x00000000,0xff000000,0x00ff0000,0xffff0000,
-    0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
-    0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
-    0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
-#else
-#error FIXME: No endianness??
-#endif
-};
-
-static int open_retz3(struct display *p)
-{
-	if (p->type != FB_TYPE_PACKED_PIXELS ||
-	    p->var.accel != FB_ACCEL_RETINAZ3)
-		return -EINVAL;
-
-	p->next_line = p->var.xres_virtual*p->var.bits_per_pixel>>3;
-	p->next_plane = 0;
-	MOD_INC_USE_COUNT;
-	return 0;
-}
-
-static void release_retz3(void)
-{
-	MOD_DEC_USE_COUNT;
-}
-
-static void bmove_retz3(struct display *p, int sy, int sx, int dy, int dx,
-	                int height, int width)
-{
-	int fontwidth = p->fontwidth;
-
-	sx *= fontwidth;
-	dx *= fontwidth;
-	width *= fontwidth;
-
-	retz3_bitblt(&p->var,
-		     (unsigned short)sx,
-		     (unsigned short)(sy*p->fontheight),
-		     (unsigned short)dx,
-		     (unsigned short)(dy*p->fontheight),
-		     (unsigned short)width,
-		     (unsigned short)(height*p->fontheight),
-		     Z3BLTcopy,
-		     0xffff);
-}
-
-static void clear_retz3(struct vc_data *conp, struct display *p, int
-			sy, int sx, int height, int width)
-{
-	unsigned short col;
-	int fontwidth = p->fontwidth;
-
-	sx *= fontwidth;
-	width *= fontwidth;
-
-	col = attr_bgcol_ec(p, conp);
-	col &= 0xff;
-	col |= (col << 8);
-
-	retz3_bitblt(&p->var,
-		     (unsigned short)sx,
-		     (unsigned short)(sy*p->fontheight),
-		     (unsigned short)sx,
-		     (unsigned short)(sy*p->fontheight),
-		     (unsigned short)width,
-		     (unsigned short)(height*p->fontheight),
-		     Z3BLTset,
-		     col);
-}
-
-static void putc_retz3(struct vc_data *conp, struct display *p, int c, int yy,
-		       int xx)
-{
-    u_char *dest,*cdat;
-    int bytes=p->next_line,rows;
-    u32 eorx,fgx,bgx;
-
-    c &= 0xff;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    cdat = p->fontdata + c * p->fontheight;
-
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-	((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
-    }
-}
-
-static void putcs_retz3(struct vc_data *conp, struct display *p, const char *s,
-			int count, int yy, int xx)
-{
-    u_char *cdat, c, *dest, *dest0;
-    int rows,bytes=p->next_line;
-    u32 eorx, fgx, bgx;
-
-    dest0 = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    fgx=attr_fgcol(p,conp);
-    bgx=attr_bgcol(p,conp);
-    fgx |= (fgx << 8);
-    fgx |= (fgx << 16);
-    bgx |= (bgx << 8);
-    bgx |= (bgx << 16);
-    eorx = fgx ^ bgx;
-    while (count--) {
-	c = *s++;
-	cdat = p->fontdata + c * p->fontheight;
-	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
-	    ((u32 *)dest)[0]= (nibbletab_cfb8[*cdat >> 4] & eorx) ^ bgx;
-	    ((u32 *)dest)[1]= (nibbletab_cfb8[*cdat++ & 0xf] & eorx) ^ bgx;
-	}
-	dest0+=8;
-    }
-}
-
-static void rev_char_retz3(struct display *p, int xx, int yy)
-{
-    u_char *dest;
-    int bytes=p->next_line, rows;
-
-    dest = p->screen_base + yy * p->fontheight * bytes + xx * 8;
-    for (rows = p->fontheight ; rows-- ; dest += bytes) {
-        ((u32 *)dest)[0] ^= 0x0f0f0f0f;
-        ((u32 *)dest)[1] ^= 0x0f0f0f0f;
-    }
-}
-
-
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_retz3(void)
-#endif
-{
-	return(fbcon_register_driver(&dispsw_retz3, 1));
-}
-
-#ifdef MODULE
-void cleanup_module(void)
-{
-	fbcon_unregister_driver(&dispsw_retz3);
-}
-#endif /* MODULE */
--- m68k-2.1.77/drivers/video/mach64fb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/mach64fb.c	Mon Jan 12 23:07:04 1998
@@ -46,8 +46,9 @@
 #include <asm/pgtable.h>
 
 #include "mach64regs.h"
-
 #include "mach64fb.h"
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb16.h"
 
 
 unsigned long mach64fb_init(unsigned long mem_start);
@@ -133,6 +134,10 @@
 /* Panic */
 #define  Pprint       if(mach64fb_debug & 0x00080000) printk
 
+/*--------------------------------------------------------------------------*/
+
+#define  _USE_HW_ACCEL_BLT_
+#define  _USE_HW_ACCEL_FILL_
 
 /*--------------------------------------------------------------------------*/
 
@@ -281,6 +286,13 @@
   int con,
   struct fb_info *info);
 
+
+    /*
+     *  Text console acceleration
+     */
+
+static struct display_switch fbcon_mach64_8;
+
 /*--------------------------------------------------------------------------*/
    /*
     *   Internal Routines
@@ -1797,6 +1809,17 @@
   disp_p->can_soft_blank = 1;                       /* aus Cyber_ */
   disp_p->inverse = mach64_inverse __MN__  ;
 
+  switch (current_par __MN__ .bpp) {	/* ++Geert: FIXME par */
+    case 8:
+      disp_p->dispsw = mach64_use_accel __MN__ ? &fbcon_mach64_8 : &fbcon_cfb8;
+      break;
+    case 16:
+      disp_p->dispsw = &fbcon_cfb16;
+      break;
+    default:
+      disp_p->dispsw = NULL;
+      break;
+  }
   return;
 }
 /*endproc mach64fb_set_disp() */
@@ -2499,6 +2522,108 @@
 
 /*============================================================================*/
 
+
+    /*
+     *  Text console acceleration
+     */
+
+/*--------------------------------------------------------------------------*/
+
+static void 
+fbcon_mach64_8_bmove(struct display * p,
+  int sy,
+  int sx,
+  int dy,
+  int dx,
+  int height,
+  int width)
+
+/*--------------------------------------------------------------------------*/
+{
+  u_char * src, * dst;
+  int                           bytes = p->next_line,
+                                linesize = bytes * p->fontheight,
+                                rows;
+
+  /*--------------------------------------------------------------------------*/
+  CFuncId("fbcon_mach64_8_bmove($%04X, $%04X, $%04X, $%04X) \n",
+    sy, sx, dy, dx, height, width);
+
+  Mach64_BitBLT(
+    (sx << 3),
+    (sy * p->fontheight),
+    (dx << 3),
+    (dy * p->fontheight),
+    (width << 3),
+    (height * p->fontheight),
+    3);                 /*  MIX_SRC); see XGCValues GCFunction = GXCopy */
+
+  return;
+}
+/*endproc fbcon_mach64_8_bmove() */
+
+/*============================================================================*/
+
+
+static void 
+fbcon_mach64_8_clear(struct vc_data * conp,
+  struct display * p,
+  int sy,                       /* in Characters von oben */
+  int sx,
+  int height,                   /* in Characters */
+  int width)                    /* in Characters */
+
+/*--------------------------------------------------------------------------*/
+{
+  register u_int *              dest;
+  register u_int                bgx;
+  register int                  i;
+
+  u_char *                      dest0;
+
+  int                           bytes_p_line = p->next_line,
+                                lines_w = height * p->fontheight,
+                                rows;
+
+  /*--------------------------------------------------------------------------*/
+  CFuncId("fbcon_mach64_8_clear($%04X, $%04X, $%04X, $%04X) \n",
+    sy, sx, height, width);
+
+  bgx = attr_bgcol_ec(p, conp);
+  bgx |= (bgx << 8);
+  bgx |= (bgx << 16);
+
+  Mach64_RectFill(
+    (sx << 3),
+    (sy * p->fontheight),
+    (width << 3),
+    (height * p->fontheight),
+    3,                            /* MIX_SRC, see XGCValues GCFunction  */
+    bgx);
+
+  return;
+}
+/*endproc fbcon_mach64_8_clear() */
+
+/*============================================================================*/
+
+static struct display_switch fbcon_mach64_8 = {
+    fbcon_cfb8_setup,
+#ifdef _USE_HW_ACCEL_BLT_
+    fbcon_mach64_8_bmove,
+#else
+    fbcon_cfb8_bmove,
+#endif
+#ifdef _USE_HW_ACCEL_FILL_
+    fbcon_mach64_8_clear,
+#else
+    fbcon_cfb8_clear,
+#endif
+    fbcon_cfb8_putc, fbcon_cfb8_putcs, fbcon_cfb8_revc
+};
+
+
+/*--------------------------------------------------------------------------*/
 
 /*============================================================================*/
 /* RCS-ID */
--- m68k-2.1.77/drivers/video/offb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/offb.c	Sun Jan 11 01:11:00 1998
@@ -32,6 +32,8 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 
+#include "fbcon-cfb8.h"
+
 
 static int currcon = 0;
 
@@ -415,6 +417,7 @@
 	disp->line_length = fix->line_length;
 	disp->can_soft_blank = info->cmap_adr ? 1 : 0;
 	disp->inverse = 0;
+	disp->dispsw = &fbcon_cfb8;
 
 	strcpy(info->info.modename, "OFfb ");
 	strncat(info->info.modename, dp->full_name,
--- m68k-2.1.77/drivers/video/retz3fb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/retz3fb.c	Mon Jan 12 23:04:55 1998
@@ -39,6 +39,9 @@
 #include <asm/pgtable.h>
 
 #include "retz3fb.h"
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb16.h"
+
 
 /* #define DEBUG if(1) */
 #define DEBUG if(0)
@@ -228,7 +231,7 @@
     }, {
 	"640x480-24", {		/* 640x480, 24 bpp */
 	    640, 480, 640, 480, 0, 0, 24, 0,
-	    {8, 8, 8}, {8, 8, 8}, {8, 8, 8}, {0, 0, 0}, 
+	    {8, 8, 8}, {8, 8, 8}, {8, 8, 8}, {0, 0, 0},
 	    0, 0, -1, -1, FB_ACCEL_RETINAZ3, 38461/3, 28, 32, 12, 10, 96, 2,
 	    FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}
@@ -280,17 +283,24 @@
 
 
 /*
+ *    Text console acceleration
+ */
+
+static struct display_switch fbcon_retz3_8;
+
+
+/*
  *    Accelerated Functions used by the low level console driver
  */
 
-void retz3_bitblt(struct fb_var_screeninfo *scr,
-		  unsigned short curx, unsigned short cury, unsigned
-		  short destx, unsigned short desty, unsigned short
-		  width, unsigned short height, unsigned short cmd,
-		  unsigned short mask);
-void retz3_fill(unsigned short x, unsigned short y, unsigned short
-		width, unsigned short height, unsigned short mode,
-		unsigned short color);
+static void retz3_bitblt(struct fb_var_screeninfo *scr,
+			 unsigned short curx, unsigned short cury, unsigned
+			 short destx, unsigned short desty, unsigned short
+			 width, unsigned short height, unsigned short cmd,
+			 unsigned short mask);
+static void retz3_fill(unsigned short x, unsigned short y,
+		       unsigned short width, unsigned short height,
+		       unsigned short mode, unsigned short color);
 
 /*
  *   Hardware Specific Routines
@@ -427,7 +437,7 @@
 		vback  = var->upper_margin;
 	}
 
-	data.h_total	= (hback / 8) + (xres / 8) 
+	data.h_total	= (hback / 8) + (xres / 8)
 			+ (hfront / 8) + (hsync / 8) - 1 /* + 1 */;
 	data.h_dispend	= ((xres + bpp - 1)/ 8) - 1;
 	data.h_bstart	= xres / 8 /* + 1 */;
@@ -740,7 +750,7 @@
 	 */
 	switch (bpp){
 	case 8:
-		reg_w(0x83c6, 0x00); 
+		reg_w(0x83c6, 0x00);
 		break;
 	case 16:
 		reg_w(0x83c6, 0x60);
@@ -754,7 +764,7 @@
 
 	reg_w(VDAC_ADDRESS, 0x00);
 
-	seq_w(SEQ_MAP_MASK, 0x0f );  
+	seq_w(SEQ_MAP_MASK, 0x0f );
 
 	return 0;
 }
@@ -1001,11 +1011,11 @@
 }
 
 
-void retz3_bitblt (struct fb_var_screeninfo *var,
-		   unsigned short srcx, unsigned short srcy, unsigned
-		   short destx, unsigned short desty, unsigned short
-		   width, unsigned short height, unsigned short cmd,
-		   unsigned short mask)
+static void retz3_bitblt (struct fb_var_screeninfo *var,
+			  unsigned short srcx, unsigned short srcy,
+			  unsigned short destx, unsigned short desty,
+			  unsigned short width, unsigned short height,
+			  unsigned short cmd, unsigned short mask)
 {
 
 	volatile unsigned long *acm = (unsigned long *) (z3_mem + ACM_OFFSET);
@@ -1078,7 +1088,7 @@
 	*(acm + ACM_CONTROL/4) = tmp;
 
 	tmp  = width | (height << 16);
-	
+
 	*(acm + ACM_BITMAP_DIMENSION/4) = cpu_to_le32(tmp);
 
 	*(((volatile unsigned char *)acm) + ACM_START_STATUS) = 0x00;
@@ -1103,9 +1113,9 @@
 }
 
 #if 0
-void retz3_fill (unsigned short x, unsigned short y, unsigned
-		 short width, unsigned short height,
-		 unsigned short mode, unsigned short color)
+static void retz3_fill (unsigned short x, unsigned short y,
+			unsigned short width, unsigned short height,
+			unsigned short mode, unsigned short color)
 {
 
 }
@@ -1116,7 +1126,7 @@
 /*
  * Move cursor to x, y
  */
-void retz3_MoveCursor (unsigned short x, unsigned short y)
+static void retz3_MoveCursor (unsigned short x, unsigned short y)
 {
 	/* Guess we gotta deal with the cursor at some point */
 }
@@ -1272,6 +1282,17 @@
 	display->ywrapstep = fix.ywrapstep;
 	display->can_soft_blank = 1;
 	display->inverse = z3fb_inverse;
+	switch (current_par.bpp) { /* ++Geert: FIXME par */
+	    case 8:
+		display->dispsw = &fbcon_retz3_8;
+		break;
+	    case 16:
+		display->dispsw = &fbcon_cfb16;
+		break;
+	    default:
+		display->dispsw = NULL;
+		break;
+	}
 }
 #endif
 
@@ -1322,6 +1343,17 @@
 			display->line_length = fix.line_length;
 			display->can_soft_blank = 1;
 			display->inverse = z3fb_inverse;
+			switch (current_par.bpp) { /* ++Geert: FIXME par */
+			    case 8:
+				display->dispsw = &fbcon_retz3_8;
+				break;
+			    case 16:
+				display->dispsw = &fbcon_cfb16;
+				break;
+			    default:
+				display->dispsw = NULL;
+				break;
+			}
 /*
 	retz3fb_set_disp(con, info);
 */
@@ -1423,7 +1455,7 @@
 	if (!options || !*options)
 		return;
 
-	for (this_opt = strtok(options, ","); this_opt; 
+	for (this_opt = strtok(options, ","); this_opt;
 	     this_opt = strtok(NULL, ",")){
 		if (!strcmp(this_opt, "inverse")) {
 			z3fb_inverse = 1;
@@ -1584,7 +1616,54 @@
 
 
 /*
- *  Visible symbols for modules
+ *  Text console acceleration
  */
 
-EXPORT_SYMBOL(retz3_bitblt);
+static void fbcon_retz3_8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+	                int height, int width)
+{
+	int fontwidth = p->fontwidth;
+
+	sx *= fontwidth;
+	dx *= fontwidth;
+	width *= fontwidth;
+
+	retz3_bitblt(&p->var,
+		     (unsigned short)sx,
+		     (unsigned short)(sy*p->fontheight),
+		     (unsigned short)dx,
+		     (unsigned short)(dy*p->fontheight),
+		     (unsigned short)width,
+		     (unsigned short)(height*p->fontheight),
+		     Z3BLTcopy,
+		     0xffff);
+}
+
+static void fbcon_retz3_8_clear(struct vc_data *conp, struct display *p, int
+			sy, int sx, int height, int width)
+{
+	unsigned short col;
+	int fontwidth = p->fontwidth;
+
+	sx *= fontwidth;
+	width *= fontwidth;
+
+	col = attr_bgcol_ec(p, conp);
+	col &= 0xff;
+	col |= (col << 8);
+
+	retz3_bitblt(&p->var,
+		     (unsigned short)sx,
+		     (unsigned short)(sy*p->fontheight),
+		     (unsigned short)sx,
+		     (unsigned short)(sy*p->fontheight),
+		     (unsigned short)width,
+		     (unsigned short)(height*p->fontheight),
+		     Z3BLTset,
+		     col);
+}
+
+static struct display_switch fbcon_retz3_8 = {
+    fbcon_cfb8_setup, fbcon_retz3_8_bmove, fbcon_retz3_8_clear,
+    fbcon_cfb8_putc, fbcon_cfb8_putcs, fbcon_cfb8_revc
+};
--- m68k-2.1.77/drivers/video/tgafb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/tgafb.c	Sun Jan 11 16:11:15 1998
@@ -41,6 +41,9 @@
 #include <linux/selection.h>
 #include <asm/io.h>
 
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb32.h"
+
 
 /* TGA hardware description (minimal) */
 /*
@@ -242,9 +245,6 @@
 static struct fb_info fb_info;
 static struct { u_char red, green, blue, pad; } palette[256];
 
-/* hack to tell fbcon-cfb32 the colormap */
-extern u32 cfb32_cmap[16];
-
 static struct fb_fix_screeninfo fb_fix = { { "DEC TGA ", } };
 static struct fb_var_screeninfo fb_var = { 0, };
 
@@ -747,6 +747,10 @@
     disp.line_length = fb_fix.line_length;
     disp.can_soft_blank = 1;
     disp.inverse = 0;
+    if (tga_type == 0)	/* 8-plane */
+	disp.dispsw = &fbcon_cfb8;
+    else		/* 24-plane or 24plusZ */
+	disp.dispsw = &fbcon_cfb32;
 
     strcpy(fb_info.modename, fb_fix.id);
     fb_info.node = -1;
--- m68k-2.1.77/drivers/video/txtcon.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/txtcon.c	Mon Jan 12 23:16:56 1998
@@ -14,26 +14,30 @@
  */
 
 
+#include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/kdev_t.h>
 #include <linux/console.h>
 
 
-   /*
-    *    Interface used by the world
-    */
+    /*
+     *  Interface used by the world
+     */
 
-static int txtcon_startup(u_long *kmem_start, const char **display_desc);
+static unsigned long txtcon_startup(unsigned long kmem_start,
+				    const char **display_desc);
 static void txtcon_init(struct vc_data *conp);
-static int txtcon_deinit(struct vc_data *conp);
-static int txtcon_clear(struct vc_data *conp, int sy, int sx, int height,
-                        int width);
-static int txtcon_putc(struct vc_data *conp, int c, int y, int x);
-static int txtcon_putcs(struct vc_data *conp, const char *s, int count, int y,
-                        int x);
-static int txtcon_cursor(struct vc_data *conp, int mode);
-static int txtcon_scroll(struct vc_data *conp, int t, int b, int dir, int count);
-static int txtcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
-                        int height, int width);
+static void txtcon_deinit(struct vc_data *conp);
+static void txtcon_clear(struct vc_data *conp, int sy, int sx, int height,
+			 int width);
+static void txtcon_putc(struct vc_data *conp, int c, int y, int x);
+static void txtcon_putcs(struct vc_data *conp, const char *s, int count, int y,
+			 int x);
+static void txtcon_cursor(struct vc_data *conp, int mode);
+static void txtcon_scroll(struct vc_data *conp, int t, int b, int dir,
+			  int count);
+static void txtcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+			 int height, int width);
 static int txtcon_switch(struct vc_data *conp);
 static int txtcon_blank(int blank);
 static int txtcon_get_font(struct vc_data *conp, int *w, int *h, char *data);
@@ -42,20 +46,22 @@
 static int txtcon_scrolldelta(int lines);
 
 
-static int txtcon_startup(u_long *kmem_start, const char **display_desc)
+static unsigned long txtcon_startup(unsigned long kmem_start,
+				    const char **display_desc)
 {
-   return -ENODEV;
+    return kmem_start;
 }
 
 
 static void txtcon_init(struct vc_data *conp)
 {
+    /* ... */
 }
 
 
-static int txtcon_deinit(struct vc_data *conp)
+static void txtcon_deinit(struct vc_data *conp)
 {
-   return 0;
+    /* ... */
 }
 
 
@@ -64,90 +70,102 @@
 /* txtcon_XXX routines - interface used by the world */
 
 
-static int txtcon_clear(struct vc_data *conp, int sy, int sx, int height,
-                        int width)
+static void txtcon_clear(struct vc_data *conp, int sy, int sx, int height,
+			 int width)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
-static int txtcon_putc(struct vc_data *conp, int c, int y, int x)
+static void txtcon_putc(struct vc_data *conp, int c, int y, int x)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
-static int txtcon_putcs(struct vc_data *conp, const char *s, int count, int y,
-                        int x)
+static void txtcon_putcs(struct vc_data *conp, const char *s, int count, int y,
+			 int x)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
-static int txtcon_cursor(struct vc_data *conp, int mode)
+static void txtcon_cursor(struct vc_data *conp, int mode)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
-static int txtcon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
+static void txtcon_scroll(struct vc_data *conp, int t, int b, int dir,
+			  int count)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
-static int txtcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
-                        int height, int width)
+static void txtcon_bmove(struct vc_data *conp, int sy, int sx, int dy, int dx,
+			 int height, int width)
 {
-   return -ENOSYS;
+    /* ... */
 }
 
 
 static int txtcon_switch(struct vc_data *conp)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 static int txtcon_blank(int blank)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 static int txtcon_get_font(struct vc_data *conp, int *w, int *h, char *data)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 static int txtcon_set_font(struct vc_data *conp, int w, int h, char *data)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 static int txtcon_set_palette(struct vc_data *conp, unsigned char *table)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 static int txtcon_scrolldelta(int lines)
 {
-   return -ENOSYS;
+    return -ENOSYS;
 }
 
 
 /* ====================================================================== */
 
-   /*
-    *    The console `switch' structure for the text mode based console
-    */
+    /*
+     *  The console `switch' structure for the text mode based console
+     */
 
 struct consw txt_con = {
-   txtcon_startup, txtcon_init, txtcon_deinit, txtcon_clear, txtcon_putc,
-   txtcon_putcs, txtcon_cursor, txtcon_scroll, txtcon_bmove, txtcon_switch,
-   txtcon_blank, txtcon_get_font, txtcon_set_font, txtcon_set_palette,
-   txtcon_scrolldelta
+    txtcon_startup,
+    txtcon_init,
+    txtcon_deinit,
+    txtcon_clear,
+    txtcon_putc,
+    txtcon_putcs,
+    txtcon_cursor,
+    txtcon_scroll,
+    txtcon_bmove,
+    txtcon_switch,
+    txtcon_blank,
+    txtcon_get_font,
+    txtcon_set_font,
+    txtcon_set_palette,
+    txtcon_scrolldelta
 };
--- m68k-2.1.77/drivers/video/virgefb.c.orig	Sun Jan 11 23:05:05 1998
+++ m68k-2.1.77/drivers/video/virgefb.c	Mon Jan 12 23:10:02 1998
@@ -0,0 +1,1181 @@
+/*
+ * linux/drivers/video/virgefb.c -- CyberVision64/3D frame buffer device
+ *
+ *    Copyright (C) 1997 André Heynatz
+ *
+ *
+ * This file is based on the CyberVision frame buffer device (cyberfb.c):
+ *
+ *    Copyright (C) 1996 Martin Apel
+ *                       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.
+ */
+
+#define VIRGEFBDEBUG
+
+#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/delay.h>
+#include <linux/zorro.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/irq.h>
+#include <asm/pgtable.h>
+#include <asm/amigahw.h>
+
+#include "s3blit.h"
+#include "fbcon-cfb8.h"
+#include "fbcon-cfb16.h"
+
+
+#ifdef VIRGEFBDEBUG
+#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#else
+#define DPRINTK(fmt, args...)
+#endif
+
+#define arraysize(x)    (sizeof(x)/sizeof(*(x)))
+
+#if 1
+#define vgawb_3d(reg,dat) \
+                (*((unsigned char *)(CyberVGARegs + (reg ^ 3))) = dat)
+#define vgaww_3d(reg,dat) \
+                (*((unsigned word *)(CyberVGARegs + (reg ^ 2))) = swab16(dat))
+#define vgawl_3d(reg,dat) \
+                (*((unsigned long *)(CyberVGARegs + reg)) = swab32(dat))
+#else
+     /*
+      * Dunno why this doesn't work at the moment - we'll have to look at
+      * it later.
+      */
+#define vgawb_3d(reg,dat) \
+                (*((unsigned char *)(CyberRegs + 0x8000 + reg)) = dat)
+#define vgaww_3d(reg,dat) \
+                (*((unsigned word *)(CyberRegs + 0x8000 + reg)) = dat)
+#define vgawl_3d(reg,dat) \
+                (*((unsigned long *)(CyberRegs + 0x8000 + reg)) = dat)
+#endif
+
+     /*
+      * We asume P5 mapped the big-endian version of these registers.
+      */
+#define wb_3d(reg,dat) \
+                (*((unsigned char volatile *)(CyberRegs + reg)) = dat)
+#define ww_3d(reg,dat) \
+                (*((unsigned word volatile *)(CyberRegs + reg)) = dat)
+#define wl_3d(reg,dat) \
+                (*((unsigned long volatile *)(CyberRegs + reg)) = dat)
+
+#define rl_3d(reg) \
+                (*((unsigned long volatile *)(CyberRegs + reg)))
+
+
+#define wb_64(reg,dat) (*((unsigned char volatile *)CyberRegs + reg) = dat)
+
+
+
+struct virgefb_par {
+   int xres;
+   int yres;
+   int bpp;
+};
+
+static struct virgefb_par current_par;
+
+static int current_par_valid = 0;
+static int currcon = 0;
+
+static struct display disp;
+static struct fb_info fb_info;
+
+
+/*
+ *    Switch for Chipset Independency
+ */
+
+static struct fb_hwswitch {
+
+   /* Initialisation */
+
+   int (*init)(void);
+
+   /* Display Control */
+
+   int (*encode_fix)(struct fb_fix_screeninfo *fix, struct virgefb_par *par);
+   int (*decode_var)(struct fb_var_screeninfo *var, struct virgefb_par *par);
+   int (*encode_var)(struct fb_var_screeninfo *var, struct virgefb_par *par);
+   int (*getcolreg)(u_int regno, u_int *red, u_int *green, u_int *blue,
+                    u_int *transp, struct fb_info *info);
+   int (*setcolreg)(u_int regno, u_int red, u_int green, u_int blue,
+                    u_int transp, struct fb_info *info);
+   void (*blank)(int blank);
+} *fbhw;
+
+
+/*
+ *    Frame Buffer Name
+ */
+
+static char virgefb_name[16] = "Cybervision/3D";
+
+
+/*
+ *    Cybervision Graphics Board
+ */
+
+#define VIRGE8_WIDTH 1152
+#define VIRGE8_HEIGHT 886
+#define VIRGE8_PIXCLOCK 12500    /* ++Geert: Just a guess */
+
+#if 0
+#define VIRGE16_WIDTH 800
+#define VIRGE16_HEIGHT 600
+#endif
+#define VIRGE16_PIXCLOCK 25000   /* ++Geert: Just a guess */
+
+
+static unsigned int CyberKey = 0;
+static unsigned char Cyber_colour_table [256][4];
+static unsigned long CyberMem;
+static unsigned long CyberSize;
+static volatile char *CyberRegs;
+static volatile unsigned long CyberVGARegs; /* ++Andre: for CV64/3D, see macros at the beginning */
+ 
+
+/*
+ *    Predefined Video Modes
+ */
+
+static struct fb_videomode virgefb_predefined[] __initdata = {
+    {
+	"640x480-8", {		/* Cybervision 8 bpp */
+	    640, 480, 640, 480, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"800x600-8", {		/* Cybervision 8 bpp */
+	    800, 600, 800, 600, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1024x768-8", {		/* Cybervision 8 bpp */
+	    1024, 768, 1024, 768, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1152x886-8", {		/* Cybervision 8 bpp */
+	    1152, 886, 1152, 886, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1280x1024-8", {	/* Cybervision 8 bpp */
+	    1280, 1024, 1280, 1024, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"1600x1200-8", {	/* Cybervision 8 bpp */
+	    1600, 1200, 1600, 1200, 0, 0, 8, 0,
+	    {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE8_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }, {
+	"800x600-16", {		/* Cybervision 16 bpp */
+	    800, 600, 800, 600, 0, 0, 16, 0,
+	    {11, 5, 0}, {5, 6, 0}, {0, 5, 0}, {0, 0, 0},
+	    0, 0, -1, -1, FB_ACCEL_NONE, VIRGE16_PIXCLOCK, 64, 96, 35, 12, 112, 2,
+	    FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}
+    }
+};
+
+
+#define NUM_TOTAL_MODES    arraysize(virgefb_predefined)
+
+
+static int Cyberfb_inverse = 0;
+#if 0
+static int Cyberfb_Cyber8 = 0;        /* Use Cybervision board */
+static int Cyberfb_Cyber16 = 0;       /* Use Cybervision board */
+#endif
+
+/*
+ *    Some default modes
+ */
+
+#define VIRGE8_DEFMODE     (0)
+#define VIRGE16_DEFMODE    (6)
+
+static struct fb_var_screeninfo virgefb_default;
+
+
+/*
+ *    Interface used by the world
+ */
+
+void virgefb_setup(char *options, int *ints);
+
+static int virgefb_open(struct fb_info *info);
+static int virgefb_release(struct fb_info *info);
+static int virgefb_get_fix(struct fb_fix_screeninfo *fix, int con, struct
+fb_info *info);
+static int virgefb_get_var(struct fb_var_screeninfo *var, int con, struct
+fb_info *info);
+static int virgefb_set_var(struct fb_var_screeninfo *var, int con, struct
+fb_info *info);
+static int virgefb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
+			    struct fb_info *info);
+static int virgefb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+			    struct fb_info *info);
+static int virgefb_pan_display(struct fb_var_screeninfo *var, int con,
+			       struct fb_info *info);
+static int virgefb_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
+ */
+
+unsigned long virgefb_init(unsigned long mem_start);
+static int Cyberfb_switch(int con, struct fb_info *info);
+static int Cyberfb_updatevar(int con, struct fb_info *info);
+static void Cyberfb_blank(int blank, struct fb_info *info);
+
+
+/*
+ *    Text console acceleration
+ */
+
+static struct display_switch fbcon_virge8;
+
+
+/*
+ *   Hardware Specific Routines
+ */
+
+static int Cyber_init(void);
+static int Cyber_encode_fix(struct fb_fix_screeninfo *fix,
+                          struct virgefb_par *par);
+static int Cyber_decode_var(struct fb_var_screeninfo *var,
+                          struct virgefb_par *par);
+static int Cyber_encode_var(struct fb_var_screeninfo *var,
+                          struct virgefb_par *par);
+static int Cyber_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+                         u_int *transp, struct fb_info *info);
+static int Cyber_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+                         u_int transp, struct fb_info *info);
+static void Cyber_blank(int blank);
+
+
+/*
+ *    Internal routines
+ */
+
+static void virgefb_get_par(struct virgefb_par *par);
+static void virgefb_set_par(struct virgefb_par *par);
+static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive);
+static void do_install_cmap(int con, struct fb_info *info);
+static void virgefb_set_disp(int con, struct fb_info *info);
+static int get_video_mode(const char *name);
+
+
+/* -------------------- Hardware specific routines ------------------------- */
+
+
+/*
+ *    Initialization
+ *
+ *    Set the default video mode for this chipset. If a video mode was
+ *    specified on the command line, it will override the default mode.
+ */
+
+static int Cyber_init(void)
+{
+	int i;
+
+	for (i = 0; i < 256; i++)
+	{
+		Cyber_colour_table [i][0] = i;
+		Cyber_colour_table [i][1] = i;
+		Cyber_colour_table [i][2] = i;
+		Cyber_colour_table [i][3] = 0;
+	}
+
+	/*
+	 * Just clear the thing for the biggest mode.
+	 *
+	 * ++Andre, TODO: determine size first, then clear all memory
+	 *                (the 3D penguin might need texture memory :-) )
+	 */
+
+	memset ((char*)CyberMem, 0, 1600 * 1200);
+
+	/* Disable hardware cursor */
+	CyberSize = 0x00400000; /* 4 MB */
+
+	vgawb_3d(0x3c8, 255);
+	vgawb_3d(0x3c9, 56);
+	vgawb_3d(0x3c9, 100);
+	vgawb_3d(0x3c9, 160);
+
+	vgawb_3d(0x3c8, 254);
+	vgawb_3d(0x3c9, 0);
+	vgawb_3d(0x3c9, 0);
+	vgawb_3d(0x3c9, 0);
+
+	/* Disable hardware cursor */
+	vgawb_3d(S3_CRTC_ADR, S3_REG_LOCK2);
+	vgawb_3d(S3_CRTC_DATA, 0xa0);
+	vgawb_3d(S3_CRTC_ADR, S3_HGC_MODE);
+	vgawb_3d(S3_CRTC_DATA, 0x00);
+	vgawb_3d(S3_CRTC_ADR, S3_HWGC_DX);
+	vgawb_3d(S3_CRTC_DATA, 0x00);
+	vgawb_3d(S3_CRTC_ADR, S3_HWGC_DY);
+	vgawb_3d(S3_CRTC_DATA, 0x00);
+
+	return 0; /* TODO: hardware cursor for CV64/3D */
+}
+
+
+/*
+ *    This function should fill in the `fix' structure based on the
+ *    values in the `par' structure.
+ */
+
+static int Cyber_encode_fix(struct fb_fix_screeninfo *fix,
+			    struct virgefb_par *par)
+{
+	int i;
+
+	strcpy(fix->id, virgefb_name);
+	fix->smem_start = (caddr_t)CyberMem;
+	fix->smem_len = CyberSize;
+	fix->mmio_start = (unsigned char *)CyberRegs;
+	fix->mmio_len = 0x10000; /* TODO: verify this for the CV64/3D */
+
+	fix->type = FB_TYPE_PACKED_PIXELS;
+	fix->type_aux = 0;
+	if (par->bpp == 8)
+		fix->visual = FB_VISUAL_PSEUDOCOLOR;
+	else
+		fix->visual = FB_VISUAL_DIRECTCOLOR;
+
+	fix->xpanstep = 0;
+	fix->ypanstep = 0;
+	fix->ywrapstep = 0;
+	fix->line_length = 0;
+
+	for (i = 0; i < arraysize(fix->reserved); i++)
+		fix->reserved[i] = 0;
+
+	return(0);
+}
+
+
+/*
+ *    Get the video params out of `var'. If a value doesn't fit, round
+ *    it up, if it's too big, return -EINVAL.
+ */
+
+static int Cyber_decode_var(struct fb_var_screeninfo *var,
+			    struct virgefb_par *par)
+{
+#if 1
+	par->xres = var->xres;
+	par->yres = var->yres;
+	par->bpp = var->bits_per_pixel;
+#else
+	if (Cyberfb_Cyber8) {
+		par->xres = VIRGE8_WIDTH;
+		par->yres = VIRGE8_HEIGHT;
+		par->bpp = 8;
+	} else {
+		par->xres = VIRGE16_WIDTH;
+		par->yres = VIRGE16_HEIGHT;
+		par->bpp = 16;
+	}
+#endif
+	return(0);
+}
+
+
+/*
+ *    Fill the `var' structure based on the values in `par' and maybe
+ *    other values read out of the hardware.
+ */
+
+static int Cyber_encode_var(struct fb_var_screeninfo *var,
+			    struct virgefb_par *par)
+{
+	int i;
+
+	var->xres = par->xres;
+	var->yres = par->yres;
+	var->xres_virtual = par->xres;
+	var->yres_virtual = par->yres;
+	var->xoffset = 0;
+	var->yoffset = 0;
+
+	var->bits_per_pixel = par->bpp;
+	var->grayscale = 0;
+
+	if (par->bpp == 8) {
+		var->red.offset = 0;
+		var->red.length = 8;
+		var->red.msb_right = 0;
+		var->blue = var->green = var->red;
+	} else {
+		var->red.offset = 11;
+		var->red.length = 5;
+		var->red.msb_right = 0;
+		var->green.offset = 5;
+		var->green.length = 6;
+		var->green.msb_right = 0;
+		var->blue.offset = 0;
+		var->blue.length = 5;
+		var->blue.msb_right = 0;
+	}
+	var->transp.offset = 0;
+	var->transp.length = 0;
+	var->transp.msb_right = 0;
+
+	var->nonstd = 0;
+	var->activate = 0;
+
+	var->height = -1;
+	var->width = -1;
+
+	var->accel = FB_ACCEL_CYBERVISION3D;
+	DPRINTK("accel CV64/3D\n");
+
+	var->vmode = FB_VMODE_NONINTERLACED;
+
+	/* Dummy values */
+
+	if (par->bpp == 8)
+		var->pixclock = VIRGE8_PIXCLOCK;
+	else
+		var->pixclock = VIRGE16_PIXCLOCK;
+	var->sync = 0;
+	var->left_margin = 64;
+	var->right_margin = 96;
+	var->upper_margin = 35;
+	var->lower_margin = 12;
+	var->hsync_len = 112;
+	var->vsync_len = 2;
+
+	for (i = 0; i < arraysize(var->reserved); i++)
+		var->reserved[i] = 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 Cyber_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			   u_int transp, struct fb_info *info)
+{
+	if (regno > 255)
+	{
+		return (1);
+	}
+
+	/*
+	 * No colors on the CV3D yet.
+	 */
+
+	vgawb_3d(0x3c8, (unsigned char) regno);
+	Cyber_colour_table [regno][0] = red & 0xff;
+	Cyber_colour_table [regno][1] = green & 0xff;
+	Cyber_colour_table [regno][2] = blue & 0xff;
+	Cyber_colour_table [regno][3] = transp;
+
+	vgawb_3d(0x3c9, ((red & 0xff) >> 2));
+	vgawb_3d(0x3c9, ((green & 0xff) >> 2));
+	vgawb_3d(0x3c9, ((blue & 0xff) >> 2));
+
+	return (0);
+}
+
+
+/*
+ *    Read a single color register and split it into
+ *    colors/transparent. Return != 0 for invalid regno.
+ */
+
+static int Cyber_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
+			   u_int *transp, struct fb_info *info)
+{
+	if (regno >= 256)
+		return (1);
+	*red	= Cyber_colour_table [regno][0];
+	*green	= Cyber_colour_table [regno][1];
+	*blue	= Cyber_colour_table [regno][2];
+	*transp = Cyber_colour_table [regno][3];
+	return (0);
+}
+
+
+/*
+ *    (Un)Blank the screen
+ */
+
+void Cyber_blank(int blank)
+{
+	int i;
+
+	if (blank)
+	{
+		for (i = 0; i < 256; i++)
+		{
+			vgawb_3d(0x3c8, (unsigned char) i);
+			vgawb_3d(0x3c9, 0);
+			vgawb_3d(0x3c9, 0);
+			vgawb_3d(0x3c9, 0);
+		}
+	}
+	else
+	{
+		for (i = 0; i < 256; i++)
+		{
+			vgawb_3d(0x3c8, (unsigned char) i);
+			vgawb_3d(0x3c9, Cyber_colour_table[i][0] >> 2);
+			vgawb_3d(0x3c9, Cyber_colour_table[i][1] >> 2);
+			vgawb_3d(0x3c9, Cyber_colour_table[i][2] >> 2);
+		}
+	}
+}
+
+/*
+ * CV3D low-level support
+ */
+
+#define Cyber3D_WaitQueue(v)	 { do { while ((rl_3d(0x8504) & 0x1f00) < (((v)+2) << 8)); } while (0); }
+
+static inline void Cyber3D_WaitBusy(void)
+{
+unsigned long status;
+
+	do {
+		status = rl_3d(0x8504);
+	} while (!(status & (1 << 13)));
+}
+
+#define S3V_BITBLT	(0x0 << 27)
+#define S3V_RECTFILL	(0x2 << 27)
+#define S3V_AUTOEXE	0x01
+#define S3V_HWCLIP	0x02
+#define S3V_DRAW	0x20
+#define S3V_DST_8BPP	0x00
+#define S3V_DST_16BPP	0x04
+#define S3V_DST_24BPP	0x08
+#define S3V_MONO_PAT	0x100
+
+#define S3V_BLT_COPY	(0xcc<<17)
+#define S3V_BLT_CLEAR	(0x00<<17)
+#define S3V_BLT_SET	(0xff<<17)
+
+ /*
+  * BitBLT - Through the Plane
+  */
+
+static void Cyber3D_BitBLT(u_short curx, u_short cury, u_short destx,
+			   u_short desty, u_short width, u_short height)
+{
+	unsigned int blitcmd = S3V_BITBLT | S3V_DRAW | S3V_DST_8BPP;
+
+	blitcmd |= S3V_BLT_COPY;
+
+	/* Set drawing direction */
+	/* -Y, X maj, -X (default) */
+	if (curx > destx)
+	{
+		blitcmd |= (1 << 25);  /* Drawing direction +X */
+	}
+	else
+	{
+		curx  += (width - 1);
+		destx += (width - 1);
+	}
+
+	if (cury > desty)
+	{
+		blitcmd |= (1 << 26);  /* Drawing direction +Y */
+	}
+	else
+	{
+		cury  += (height - 1);
+		desty += (height - 1);
+	}
+
+	wl_3d(0xa4f4, 1); /* pattern fb color */
+
+	wl_3d(0xa4e8, ~0); /* mono pat 0 */
+	wl_3d(0xa4ec, ~0); /* mono pat 1 */
+
+	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
+	wl_3d(0xa508, ((curx << 16)  | cury));		/* rsrc_xy */
+	wl_3d(0xa50c, ((destx << 16) | desty));		/* rdest_xy */
+
+	wl_3d(0xa500, blitcmd);				/* GO! */
+
+	Cyber3D_WaitBusy();
+}
+
+/*
+ * Rectangle Fill Solid
+ */
+
+static void Cyber3D_RectFill(u_short x, u_short y, u_short width,
+			     u_short height, u_short color)
+{
+	unsigned int tmp;
+	unsigned int blitcmd = S3V_RECTFILL | S3V_DRAW | S3V_DST_8BPP |
+		S3V_BLT_CLEAR | S3V_MONO_PAT | (1 << 26) | (1 << 25);
+
+	tmp = color & 0xff;
+	wl_3d(0xa4f4, tmp);
+
+	wl_3d(0xa504, ((width << 16) | height));	/* rwidth_height */
+	wl_3d(0xa50c, ((x << 16) | y));			/* rdest_xy */
+
+	wl_3d(0xa500, blitcmd);				/* GO! */
+	Cyber3D_WaitBusy();
+}
+
+
+/**************************************************************
+ * Move cursor to x, y
+ */
+static void Cyber_MoveCursor (u_short x, u_short y)
+{
+	printk("Yuck .... MoveCursor on a 3D\n");
+	return;
+}
+
+
+/* -------------------- Interfaces to hardware functions -------------------- */
+
+
+static struct fb_hwswitch Cyber_switch = {
+	Cyber_init, Cyber_encode_fix, Cyber_decode_var, Cyber_encode_var,
+	Cyber_getcolreg, Cyber_setcolreg, Cyber_blank
+};
+
+
+/* -------------------- Generic routines ------------------------------------ */
+
+
+/*
+ *    Fill the hardware's `par' structure.
+ */
+
+static void virgefb_get_par(struct virgefb_par *par)
+{
+	if (current_par_valid)
+	{
+		*par = current_par;
+	}
+	else
+	{
+		fbhw->decode_var(&virgefb_default, par);
+	}
+}
+
+
+static void virgefb_set_par(struct virgefb_par *par)
+{
+	current_par = *par;
+	current_par_valid = 1;
+}
+
+
+static void virge_set_video(struct fb_var_screeninfo *var)
+{
+	/* Set clipping rectangle to current screen size */
+ 
+	unsigned int clip;
+
+	clip = ((0 << 16) | (var->xres - 1));
+	wl_3d(0xa4dc, clip);
+	clip = ((0 << 16) | (var->yres - 1));
+	wl_3d(0xa4e0, clip);
+}
+
+
+static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
+{
+	int err, activate;
+	struct virgefb_par par;
+
+	if ((err = fbhw->decode_var(var, &par)))
+		return(err);
+	activate = var->activate;
+	if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW && isactive)
+		virgefb_set_par(&par);
+	fbhw->encode_var(var, &par);
+	var->activate = activate;
+
+	virge_set_video(var);
+	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,
+			    fbhw->setcolreg, info);
+	else
+		fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel),
+			    &fb_display[con].var, 1, fbhw->setcolreg, info);
+}
+
+
+/*
+ *  Open/Release the frame buffer device
+ */
+
+static int virgefb_open(struct fb_info *info)
+{
+	/*
+	 * Nothing, only a usage count for the moment
+	 */
+
+	MOD_INC_USE_COUNT;
+	return(0);
+}
+
+static int virgefb_release(struct fb_info *info)
+{
+	MOD_DEC_USE_COUNT;
+	return(0);
+}
+
+
+/*
+ *    Get the Fixed Part of the Display
+ */
+
+static int virgefb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			   struct fb_info *info)
+{
+	struct virgefb_par par;
+	int error = 0;
+
+	if (con == -1)
+		virgefb_get_par(&par);
+	else
+		error = fbhw->decode_var(&fb_display[con].var, &par);
+	return(error ? error : fbhw->encode_fix(fix, &par));
+}
+
+
+/*
+ *    Get the User Defined Part of the Display
+ */
+
+static int virgefb_get_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
+{
+	struct virgefb_par par;
+	int error = 0;
+
+	if (con == -1)
+	{
+		virgefb_get_par(&par);
+		error = fbhw->encode_var(var, &par);
+		disp.var = *var;   /* ++Andre: don't know if this is the right place */
+	}
+	else
+	{
+		*var = fb_display[con].var;
+	}
+
+	return(error);
+}
+
+
+static void virgefb_set_disp(int con, struct fb_info *info)
+{
+	struct fb_fix_screeninfo fix;
+	struct display *display;
+
+	if (con >= 0)
+		display = &fb_display[con];
+	else
+		display = &disp;	/* used during initialization */
+
+	virgefb_get_fix(&fix, con, info);
+	if (con == -1)
+		con = 0;
+	display->screen_base = (u_char *)fix.smem_start;
+	display->visual = fix.visual;
+	display->type = fix.type;
+	display->type_aux = fix.type_aux;
+	display->ypanstep = fix.ypanstep;
+	display->ywrapstep = fix.ywrapstep;
+	display->can_soft_blank = 1;
+	display->inverse = Cyberfb_inverse;
+	switch (current_par.bpp) { /* ++Geert: FIXME par */
+	    case 8:
+		display->dispsw = &fbcon_virge8;
+		break;
+	    case 16:
+		display->dispsw = &fbcon_cfb16;
+		break;
+	    default:
+		display->dispsw = NULL;
+		break;
+	}
+}
+
+
+/*
+ *    Set the User Defined Part of the Display
+ */
+
+static int virgefb_set_var(struct fb_var_screeninfo *var, int con,
+			   struct fb_info *info)
+{
+	int err, oldxres, oldyres, oldvxres, oldvyres, oldbpp;
+
+	if ((err = do_fb_set_var(var, con == currcon)))
+		return(err);
+	if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
+		oldxres = fb_display[con].var.xres;
+		oldyres = fb_display[con].var.yres;
+		oldvxres = fb_display[con].var.xres_virtual;
+		oldvyres = fb_display[con].var.yres_virtual;
+		oldbpp = fb_display[con].var.bits_per_pixel;
+		fb_display[con].var = *var;
+		if (oldxres != var->xres || oldyres != var->yres ||
+		    oldvxres != var->xres_virtual ||
+		    oldvyres != var->yres_virtual ||
+		    oldbpp != var->bits_per_pixel) {
+			virgefb_set_disp(con, info);
+			(*fb_info.changevar)(con);
+			fb_alloc_cmap(&fb_display[con].cmap, 0, 0);
+			do_install_cmap(con, info);
+		}
+	}
+	var->activate = 0;
+	return(0);
+}
+
+
+/*
+ *    Get the Colormap
+ */
+
+static int virgefb_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, fbhw->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 virgefb_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? */
+		return(fb_set_cmap(cmap, &fb_display[con].var,
+				   kspc, fbhw->setcolreg, info));
+	else
+		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+	return(0);
+}
+
+
+/*
+ *    Pan or Wrap the Display
+ *
+ *    This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
+ */
+
+static int virgefb_pan_display(struct fb_var_screeninfo *var, int con,
+			       struct fb_info *info)
+{
+	return(-EINVAL);
+}
+
+
+/*
+    *	 Cybervision Frame Buffer Specific ioctls
+    */
+
+static int virgefb_ioctl(struct inode *inode, struct file *file,
+			 u_int cmd, u_long arg, int con, struct fb_info *info)
+{
+	return(-EINVAL);
+}
+
+
+static struct fb_ops virgefb_ops = {
+	virgefb_open, virgefb_release, virgefb_get_fix, virgefb_get_var,
+	virgefb_set_var, virgefb_get_cmap, virgefb_set_cmap,
+	virgefb_pan_display, virgefb_ioctl
+};
+
+
+__initfunc(void virgefb_setup(char *options, int *ints))
+{
+	char *this_opt;
+
+	fb_info.fontname[0] = '\0';
+
+	if (!options || !*options)
+		return;
+
+	for (this_opt = strtok(options, ","); this_opt; this_opt = strtok(NULL, ","))
+		if (!strcmp(this_opt, "inverse")) {
+			Cyberfb_inverse = 1;
+			fb_invert_cmaps();
+		} else if (!strncmp(this_opt, "font:", 5))
+			strcpy(fb_info.fontname, this_opt+5);
+		else if (!strcmp (this_opt, "virge8")){
+			virgefb_default = virgefb_predefined[VIRGE8_DEFMODE].var;
+		}
+		else if (!strcmp (this_opt, "virge16")){
+			virgefb_default = virgefb_predefined[VIRGE16_DEFMODE].var;
+		}
+		else
+			get_video_mode(this_opt);
+
+	DPRINTK("default mode: xres=%d, yres=%d, bpp=%d\n",virgefb_default.xres,
+                                                           virgefb_default.yres,
+		                                           virgefb_default.bits_per_pixel);
+}
+
+
+/*
+ *    Initialization
+ */
+
+__initfunc(unsigned long virgefb_init(unsigned long mem_start))
+{
+	int err;
+	struct virgefb_par par;
+	unsigned long board_addr;
+	const struct ConfigDev *cd;
+
+	if (!(CyberKey = zorro_find(ZORRO_PROD_PHASE5_CYBERVISION64_3D, 0, 0)))
+		return mem_start;
+
+	cd = zorro_get_board (CyberKey);
+	zorro_config_board (CyberKey, 0);
+	board_addr = (unsigned long)cd->cd_BoardAddr;
+
+	/* This includes the video memory as well as the S3 register set */
+	if ((unsigned long)cd->cd_BoardAddr < 0x01000000)
+	{
+		/*
+		 * Ok we got the board running in Z2 space.
+		 */
+
+		CyberMem = ZTWO_VADDR(board_addr);
+		printk("CV3D detected running in Z2 mode ... not yet supported!\n");
+		return -ENODEV;
+	}
+	else
+	{
+		CyberVGARegs = kernel_map(board_addr +0x0c000000,
+					       0x00010000,
+					       KERNELMAP_NOCACHE_SER,
+					       &mem_start);
+		CyberRegs = (char *)kernel_map(board_addr +0x05000000,
+					       0x00010000,
+					       KERNELMAP_NOCACHE_SER,
+					       &mem_start);
+		CyberMem = kernel_map(board_addr + 0x04800000,
+				      0x00400000,
+				      KERNELMAP_NOCACHE_SER,
+				      &mem_start);
+		printk("CV3D detected running in Z3 mode\n");
+	}
+
+	fbhw = &Cyber_switch;
+
+	strcpy(fb_info.modename, virgefb_name);
+	fb_info.changevar = NULL;
+	fb_info.node = -1;
+	fb_info.fbops = &virgefb_ops;
+	fb_info.disp = &disp;
+	fb_info.switch_con = &Cyberfb_switch;
+	fb_info.updatevar = &Cyberfb_updatevar;
+	fb_info.blank = &Cyberfb_blank;
+
+	err = register_framebuffer(&fb_info);
+	if (err < 0)
+		return mem_start;
+
+	fbhw->init();
+	fbhw->decode_var(&virgefb_default, &par);
+	fbhw->encode_var(&virgefb_default, &par);
+
+	do_fb_set_var(&virgefb_default, 1);
+	virgefb_get_var(&fb_display[0].var, -1, &fb_info);
+	virgefb_set_disp(-1, &fb_info);
+	do_install_cmap(0, &fb_info);
+
+	printk("%s frame buffer device, using %ldK of video memory\n",
+	       fb_info.modename, CyberSize>>10);
+
+	/* TODO: This driver cannot be unloaded yet */
+	MOD_INC_USE_COUNT;
+
+	return mem_start;
+}
+
+
+static int Cyberfb_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,
+			    fbhw->getcolreg, info);
+
+	do_fb_set_var(&fb_display[con].var, 1);
+	currcon = con;
+	/* Install new colormap */
+	do_install_cmap(con, info);
+	return(0);
+}
+
+
+/*
+ *    Update the `var' structure (called by fbcon.c)
+ *
+ *    This call looks only at yoffset and the FB_VMODE_YWRAP flag in `var'.
+ *    Since it's called by a kernel driver, no range checking is done.
+ */
+
+static int Cyberfb_updatevar(int con, struct fb_info *info)
+{
+	return(0);
+}
+
+
+/*
+    *    Blank the display.
+    */
+
+static void Cyberfb_blank(int blank, struct fb_info *info)
+{
+	fbhw->blank(blank);
+}
+
+
+/*
+ *    Get a Video Mode
+ */
+
+__initfunc(static int get_video_mode(const char *name))
+{
+	int i;
+
+	for (i = 0; i < NUM_TOTAL_MODES; i++) {
+		if (!strcmp(name, virgefb_predefined[i].name)) {
+			virgefb_default = virgefb_predefined[i].var;
+			return(i);
+		}
+	}
+	/* ++Andre: set virgefb default mode */
+	virgefb_default = virgefb_predefined[VIRGE8_DEFMODE].var;
+	return(0);
+}
+
+
+/*
+ *    Text console acceleration
+ */
+
+static void fbcon_virge8_bmove(struct display *p, int sy, int sx, int dy,
+			       int dx, int height, int width)
+{
+        sx *= 8; dx *= 8; width *= 8;
+        Cyber3D_BitBLT((u_short)sx, (u_short)(sy*p->fontheight), (u_short)dx,
+                       (u_short)(dy*p->fontheight), (u_short)width,
+                       (u_short)(height*p->fontheight));
+}
+
+static void fbcon_virge8_clear(struct vc_data *conp, struct display *p, int sy,
+			       int sx, int height, int width)
+{
+        unsigned char bg;
+
+        sx *= 8; width *= 8;
+        bg = attr_bgcol_ec(p,conp);
+        Cyber3D_RectFill((u_short)sx, (u_short)(sy*p->fontheight),
+                         (u_short)width, (u_short)(height*p->fontheight),
+                         (u_short)bg);
+}
+
+static struct display_switch fbcon_virge8 = {
+   fbcon_cfb8_setup, fbcon_virge8_bmove, fbcon_virge8_clear, fbcon_cfb8_putc,
+   fbcon_cfb8_putcs, fbcon_cfb8_revc
+};
+
+
+#ifdef MODULE
+int init_module(void)
+{
+	return(virgefb_init(NULL));
+}
+
+void cleanup_module(void)
+{
+	/* Not reached because the usecount will never be
+	   decremented to zero */
+	unregister_framebuffer(&fb_info);
+	/* TODO: clean up ... */
+}
+#endif /* MODULE */
--- m68k-2.1.77/drivers/video/fbcon-afb.h.orig	Sun Jan 11 23:05:07 1998
+++ m68k-2.1.77/drivers/video/fbcon-afb.h	Sun Jan 11 23:52:32 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Amiga bitplanes (afb)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_afb_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-cfb16.h.orig	Sun Jan 11 23:05:07 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb16.h	Tue Jan 13 00:10:56 1998
@@ -0,0 +1,18 @@
+    /*
+     *  16 bpp packed pixel (cfb16)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_cfb16_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-cfb2.h.orig	Sun Jan 11 23:05:07 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb2.h	Sun Jan 11 17:32:01 1998
@@ -0,0 +1,17 @@
+    /*
+     *  2 bpp packed pixel (cfb2)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_cfb2_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-cfb32.h.orig	Sun Jan 11 23:05:07 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb32.h	Tue Jan 13 00:10:29 1998
@@ -0,0 +1,18 @@
+    /*
+     *  32 bpp packed pixel (cfb32)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_cfb32_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-cfb4.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb4.h	Sun Jan 11 17:32:01 1998
@@ -0,0 +1,17 @@
+    /*
+     *  4 bpp packed pixel (cfb4)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_cfb4_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-cfb8.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-cfb8.h	Sun Jan 11 17:32:02 1998
@@ -0,0 +1,17 @@
+    /*
+     *  8 bpp packed pixel (cfb8)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_cfb8_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-ilbm.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-ilbm.h	Sun Jan 11 23:52:32 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Amiga interleaved bitplanes (ilbm)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_ilbm_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p2.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p2.h	Sun Jan 11 17:32:02 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Atari interleaved bitplanes (2 planes) (iplan2p2)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_iplan2p2_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p4.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p4.h	Sun Jan 11 17:32:02 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Atari interleaved bitplanes (4 planes) (iplan2p4)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_iplan2p4_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p8.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p8.h	Sun Jan 11 17:32:02 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Atari interleaved bitplanes (8 planes) (iplan2p8)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_iplan2p8_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-mac.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-mac.h	Sun Jan 11 23:52:19 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Mac variable bpp packed pixels (mac)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_mac_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-mfb.h.orig	Sun Jan 11 23:05:08 1998
+++ m68k-2.1.77/drivers/video/fbcon-mfb.h	Mon Jan 12 00:00:14 1998
@@ -0,0 +1,17 @@
+    /*
+     *  Monochrome (mfb)
+     */
+
+#include "fbcon.h"
+
+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 char *s, int count, int yy, int xx);
+extern void fbcon_mfb_revc(struct display *p, int xx, int yy);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p4.c.orig	Mon Jan 12 21:30:58 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p4.c	Mon Jan 12 21:52:15 1998
@@ -19,34 +19,7 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_iplan2p4(struct display *p);
-static void release_iplan2p4(void);
-static void bmove_iplan2p4(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width);
-static void clear_iplan2p4(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width);
-static void putc_iplan2p4(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx);
-static void putcs_iplan2p4(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx);
-static void rev_char_iplan2p4(struct display *p, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_iplan2p4 = {
-    open_iplan2p4, release_iplan2p4, bmove_iplan2p4, clear_iplan2p4,
-    putc_iplan2p4, putcs_iplan2p4, rev_char_iplan2p4
-};
+#include "fbcon-iplan2p4.h"
 
 
     /*
@@ -133,8 +106,7 @@
 
 /* This expands a 4 bit color into a long for movepl (4 plane) operations. */
 
-static const u32 four2byte[] =
-{
+static const u32 four2byte[] = {
     0x00000000, 0xff000000, 0x00ff0000, 0xffff0000,
     0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00,
     0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff,
@@ -146,12 +118,12 @@
     return four2byte[c];
 }
 
+
 /* This expands a 4 bit color into two longs for two movel operations
  * (4 planes).
  */
 
-static const u32 two2word[] =
-{
+static const u32 two2word[] = {
 #ifndef __LITTLE_ENDIAN
     0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff,
 #else
@@ -179,25 +151,14 @@
 }
 
 
-static int open_iplan2p4(struct display *p)
+void fbcon_iplan2p4_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_INTERLEAVED_PLANES || p->type_aux != 2 ||
-	p->var.bits_per_pixel != 4)
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual>>1;
     p->next_plane = 2;
-    MOD_INC_USE_COUNT;
-    return 0;
-}
-
-static void release_iplan2p4(void)
-{
-    MOD_DEC_USE_COUNT;
 }
 
-static void bmove_iplan2p4(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width)
+void fbcon_iplan2p4_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			  int height, int width)
 {
     /*  bmove() has to distinguish two major cases: If both, source and
      *  destination, start at even addresses or both are at odd
@@ -300,8 +261,8 @@
     }
 }
 
-static void clear_iplan2p4(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width)
+void fbcon_iplan2p4_clear(struct vc_data *conp, struct display *p, int sy,
+			  int sx, int height, int width)
 {
     u32 offset;
     u8 *start;
@@ -345,8 +306,8 @@
     }
 }
 
-static void putc_iplan2p4(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx)
+void fbcon_iplan2p4_putc(struct vc_data *conp, struct display *p, int c,
+			 int yy, int xx)
 {
     u8 *dest;
     u8 *cdat;
@@ -369,8 +330,8 @@
     }
 }
 
-static void putcs_iplan2p4(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx)
+void fbcon_iplan2p4_putcs(struct vc_data *conp, struct display *p,
+			  const char *s, int count, int yy, int xx)
 {
     u8 *dest, *dest0;
     u8 *cdat, c;
@@ -403,7 +364,7 @@
     }
 }
 
-static void rev_char_iplan2p4(struct display *p, int xx, int yy)
+void fbcon_iplan2p4_revc(struct display *p, int xx, int yy)
 {
     u8 *dest;
     int j;
@@ -428,18 +389,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_iplan2p4(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_iplan2p4, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_iplan2p4);
-}
-#endif /* MODULE */
+struct display_switch fbcon_iplan2p4 = {
+    fbcon_iplan2p4_setup, fbcon_iplan2p4_bmove, fbcon_iplan2p4_clear,
+    fbcon_iplan2p4_putc, fbcon_iplan2p4_putcs, fbcon_iplan2p4_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_iplan2p4);
+EXPORT_SYMBOL(fbcon_iplan2p4_setup);
+EXPORT_SYMBOL(fbcon_iplan2p4_bmove);
+EXPORT_SYMBOL(fbcon_iplan2p4_clear);
+EXPORT_SYMBOL(fbcon_iplan2p4_putc);
+EXPORT_SYMBOL(fbcon_iplan2p4_putcs);
+EXPORT_SYMBOL(fbcon_iplan2p4_revc);
--- m68k-2.1.77/drivers/video/fbcon-iplan2p8.c.orig	Mon Jan 12 21:30:58 1998
+++ m68k-2.1.77/drivers/video/fbcon-iplan2p8.c	Mon Jan 12 21:54:22 1998
@@ -19,34 +19,7 @@
 
 #include <asm/byteorder.h>
 
-#include "fbcon.h"
-
-
-    /*
-     *  Prototypes
-     */
-
-static int open_iplan2p8(struct display *p);
-static void release_iplan2p8(void);
-static void bmove_iplan2p8(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width);
-static void clear_iplan2p8(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width);
-static void putc_iplan2p8(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx);
-static void putcs_iplan2p8(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx);
-static void rev_char_iplan2p8(struct display *display, int xx, int yy);
-
-
-    /*
-     *  `switch' for the low level operations
-     */
-
-static struct display_switch dispsw_iplan2p8 = {
-    open_iplan2p8, release_iplan2p8, bmove_iplan2p8, clear_iplan2p8,
-    putc_iplan2p8, putcs_iplan2p8, rev_char_iplan2p8
-};
+#include "fbcon-iplan2p8.h"
 
 
     /*
@@ -174,6 +147,7 @@
     *ret2 = four2long[c >> 4];
 }
 
+
 /* This expands a 8 bit color into four longs for four movel operations
  * (8 planes).
  */
@@ -195,6 +169,7 @@
     *rv4 = two2word[c >> 6];
 }
 
+
 /* This duplicates a byte 4 times into a long. */
 
 static __inline__ u32 dup4l(u8 c)
@@ -208,25 +183,14 @@
 }
 
 
-static int open_iplan2p8(struct display *p)
+void fbcon_iplan2p8_setup(struct display *p)
 {
-    if (p->type != FB_TYPE_INTERLEAVED_PLANES || p->type_aux != 2 ||
-	p->var.bits_per_pixel != 8)
-	return -EINVAL;
-
     p->next_line = p->var.xres_virtual;
     p->next_plane = 2;
-    MOD_INC_USE_COUNT;
-    return 0;
 }
 
-static void release_iplan2p8(void)
-{
-    MOD_DEC_USE_COUNT;
-}
-
-static void bmove_iplan2p8(struct display *p, int sy, int sx, int dy, int dx,
-			   int height, int width)
+void fbcon_iplan2p8_bmove(struct display *p, int sy, int sx, int dy, int dx,
+			  int height, int width)
 {
     /*  bmove() has to distinguish two major cases: If both, source and
      *  destination, start at even addresses or both are at odd
@@ -329,8 +293,8 @@
     }
 }
 
-static void clear_iplan2p8(struct vc_data *conp, struct display *p, int sy,
-			   int sx, int height, int width)
+void fbcon_iplan2p8_clear(struct vc_data *conp, struct display *p, int sy,
+			  int sx, int height, int width)
 {
     u32 offset;
     u8 *start;
@@ -374,8 +338,8 @@
 	}
 }
 
-static void putc_iplan2p8(struct vc_data *conp, struct display *p, int c,
-			  int yy, int xx)
+void fbcon_iplan2p8_putc(struct vc_data *conp, struct display *p, int c,
+			 int yy, int xx)
 {
     u8 *dest;
     u8 *cdat;
@@ -398,8 +362,8 @@
     }
 }
 
-static void putcs_iplan2p8(struct vc_data *conp, struct display *p,
-			   const char *s, int count, int yy, int xx)
+void fbcon_iplan2p8_putcs(struct vc_data *conp, struct display *p,
+			  const char *s, int count, int yy, int xx)
 {
     u8 *dest, *dest0;
     u8 *cdat, c;
@@ -435,7 +399,7 @@
     }
 }
 
-static void rev_char_iplan2p8(struct display *p, int xx, int yy)
+void fbcon_iplan2p8_revc(struct display *p, int xx, int yy)
 {
     u8 *dest;
     int j;
@@ -462,18 +426,24 @@
 }
 
 
-#ifdef MODULE
-int init_module(void)
-#else
-int fbcon_init_iplan2p8(void)
-#endif
-{
-    return(fbcon_register_driver(&dispsw_iplan2p8, 0));
-}
+    /*
+     *  `switch' for the low level operations
+     */
 
-#ifdef MODULE
-void cleanup_module(void)
-{
-    fbcon_unregister_driver(&dispsw_iplan2p8);
-}
-#endif /* MODULE */
+struct display_switch fbcon_iplan2p8 = {
+    fbcon_iplan2p8_setup, fbcon_iplan2p8_bmove, fbcon_iplan2p8_clear,
+    fbcon_iplan2p8_putc, fbcon_iplan2p8_putcs, fbcon_iplan2p8_revc
+};
+
+
+    /*
+     *  Visible symbols for modules
+     */
+
+EXPORT_SYMBOL(fbcon_iplan2p8);
+EXPORT_SYMBOL(fbcon_iplan2p8_setup);
+EXPORT_SYMBOL(fbcon_iplan2p8_bmove);
+EXPORT_SYMBOL(fbcon_iplan2p8_clear);
+EXPORT_SYMBOL(fbcon_iplan2p8_putc);
+EXPORT_SYMBOL(fbcon_iplan2p8_putcs);
+EXPORT_SYMBOL(fbcon_iplan2p8_revc);

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

