Date: Tue, 19 Aug 1997 08:24:24 +0200 (CEST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: linux-m68k@phil.uni-sb.de
Subject: Re: L68K: mach64fb for 2.1.47
In-Reply-To: <Pine.LNX.3.95.970817193715.345A-100000@localhost>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>

On Sun, 17 Aug 1997, Bernd Harries wrote:
> If you have Geerts FB patches applied, you might like this if you have a
> Mach64.
> 
> It's a .tgz and a .diff, all collected in a big .tgz file. Extract
> mach64.tgz in /usr/src/linux-2.1.47/ and then apply the .diff.

Could you please clean up atafb.c and send me a diff for that? I tried it
myself, but I saw some changes in atafb.c I'm afraid of some people won't
like...

I removed fbcon-mach64.h and brew the included patch to ensure correct
prototypes, without creating extra header files.

> In the future I would like to have another strategy in fbmem.c which sorts
> the register_framebuffer() calls in the same order as the bootargs occur.
> Geert has already prepared that. :-) And I have written the mach64fb.c to
> be easily switched to an array of mach64 cards, lets say 8.   ;-)

I don't think this is a good idea. On Amiga, most frame buffers devices (read:
all frame buffer devices are supposed to) support full autoprobing, which means
that you don't need a video= option at all to enable them.

Maybe we should split the frame buffer devices into autoprobe and
non-autoprobe. The non-autoprobe ones are only initialized if a corresponding
video= option is found. Or does someone have a better idea?

Bernd, does your Medusa also have Atari graphics? If not, is there a way to
detect it doesn't have them?

FYI, a diff of my current kernel source tree (relative to m68k-2.1.47) can be
found at the usual place:

    http://www.cs.kuleuven.ac.be/~geert/bin/linux-m68k-2.1.47-19970818.diff.gz

--- linux-2.1.47/drivers/char/fbmem.c.orig	Mon Aug 11 20:42:18 1997
+++ linux-2.1.47/drivers/char/fbmem.c	Mon Aug 18 21:06:28 1997
@@ -38,26 +38,26 @@
      *  Frame buffer device initialization and setup routines
      */
 
-extern int amiga_fb_init(u_long *mem_start);
-extern void amiga_video_setup(char *options, int *ints);
-extern int atari_fb_init(u_long *mem_start);
-extern void atari_video_setup(char *options, int *ints);
-extern int Cyber_fb_init(u_long *mem_start);
-extern void Cyber_video_setup(char *options, int *ints);
-extern int retz3_fb_init(u_long *mem_start);
-extern void retz3_video_setup(char *options, int *ints);
-extern int clgen_fb_init(u_long *mem_start);
-extern void clgen_video_setup(char *options, int *ints);
-extern int virtual_fb_init(u_long *mem_start);
-extern void vfb_video_setup(char *options, int *ints);
-extern int Mach64_fb_init(u_long *mem_start);
-extern void Mach64_video_setup(char *options, int *ints);
-extern void resolver_video_setup(char *options, int *ints);
+extern fb_init_func amiga_fb_init;
+extern video_setup_func amiga_video_setup;
+extern fb_init_func atari_fb_init;
+extern video_setup_func atari_video_setup;
+extern fb_init_func Cyber_fb_init;
+extern video_setup_func Cyber_video_setup;
+extern fb_init_func retz3_fb_init;
+extern video_setup_func retz3_video_setup;
+extern fb_init_func clgen_fb_init;
+extern video_setup_func clgen_video_setup;
+extern fb_init_func virtual_fb_init;
+extern video_setup_func vfb_video_setup;
+extern fb_init_func Mach64_fb_init;
+extern video_setup_func Mach64_video_setup;
+extern video_setup_func resolver_video_setup;
 
 static struct {
     const char *name;
-    int (*init)(u_long *mem_start);
-    void (*setup)(char *options, int *ints);
+    fb_init_func *init;
+    video_setup_func *setup;
 } builtin_frame_buffers[] __initdata = {
 #ifdef CONFIG_FB_AMIGA
     { "amifb", amiga_fb_init, amiga_video_setup },
--- linux-2.1.47/drivers/video/atafb.c.orig	Mon Aug 18 21:10:01 1997
+++ linux-2.1.47/drivers/video/atafb.c	Mon Aug 18 21:13:39 1997
@@ -71,6 +71,10 @@
 #define up(x, r) (((x) + (r) - 1) & ~((r)-1))
 
 
+video_setup_func atari_video_setup;
+fb_init_func atari_fb_init;
+
+
 static int default_par=0;	/* default resolution (0=none) */
 
 static unsigned long default_mem_req=0;
--- linux-2.1.47/drivers/video/fbcon.c.orig	Mon Aug  4 20:54:42 1997
+++ linux-2.1.47/drivers/video/fbcon.c	Mon Aug 18 21:15:06 1997
@@ -187,38 +188,38 @@
 static struct display_switch dispsw_dummy;
 
 #ifdef CONFIG_FBCON_MFB
-extern int fbcon_init_mfb(void);
+extern fbcon_init_func fbcon_init_mfb;
 #endif /* CONFIG_FBCON_MFB */
 #ifdef CONFIG_FBCON_ILBM
-extern int fbcon_init_ilbm(void);
+extern fbcon_init_func fbcon_init_ilbm;
 #endif /* CONFIG_FBCON_ILBM */
 #ifdef CONFIG_FBCON_AFB
-extern int fbcon_init_afb(void);
+extern fbcon_init_func fbcon_init_afb;
 #endif /* CONFIG_FBCON_AFB */
 #ifdef CONFIG_FBCON_IPLAN2P2
-extern int fbcon_init_iplan2p2(void);
+extern fbcon_init_func fbcon_init_iplan2p2;
 #endif /* CONFIG_FBCON_IPLAN2P2 */
 #ifdef CONFIG_FBCON_IPLAN2P4
-extern int fbcon_init_iplan2p4(void);
+extern fbcon_init_func fbcon_init_iplan2p4;
 #endif /* CONFIG_FBCON_IPLAN2P4 */
 #ifdef CONFIG_FBCON_IPLAN2P8
-extern int fbcon_init_iplan2p8(void);
+extern fbcon_init_func fbcon_init_iplan2p8;
 #endif /* CONFIG_FBCON_IPLAN2P8 */
 #ifdef CONFIG_FBCON_CFB8
-extern int fbcon_init_cfb8(void);
+extern fbcon_init_func fbcon_init_cfb8;
 #endif /* CONFIG_FBCON_CFB8 */
 #ifdef CONFIG_FBCON_CFB16
-extern int fbcon_init_cfb16(void);
+extern fbcon_init_func fbcon_init_cfb16;
 #endif /* CONFIG_FBCON_CFB16 */
 #ifdef CONFIG_FBCON_CYBER
-extern int fbcon_init_cyber(void);
+extern fbcon_init_func fbcon_init_cyber;
 #endif /* CONFIG_FBCON_CYBER */
 #ifdef CONFIG_FBCON_RETINAZ3
-extern int fbcon_init_retz3(void);
-#endif
+extern fbcon_init_func fbcon_init_retz3;
+#endif /* CONFIG_FBCON_RETINAZ3 */
 #ifdef CONFIG_FBCON_MACH64
-extern int fbcon_init_mach64(void);
-#endif
+extern fbcon_init_func fbcon_init_mach64;
+#endif /* CONFIG_FBCON_MACH64 */
 
 
 static int fbcon_startup(u_long *kmem_start, const char **display_desc)
--- linux-2.1.47/drivers/video/amifb.c.orig	Mon Aug 11 22:20:28 1997
+++ linux-2.1.47/drivers/video/amifb.c	Mon Aug 18 21:12:11 1997
@@ -1175,7 +1175,7 @@
 	 * Interface used by the world
 	 */
 
-void amiga_video_setup(char *options, int *ints);
+video_setup_func amiga_video_setup;
 
 static int amiga_fb_open(int fbidx);
 static int amiga_fb_release(int fbidx);
@@ -1198,7 +1198,7 @@
 	 * Interface to the low level console driver
 	 */
 
-int amiga_fb_init(u_long *mem_start);
+fb_init_func amiga_fb_init;
 static int amifbcon_switch(int con);
 static int amifbcon_updatevar(int con);
 static void amifbcon_blank(int blank);
--- linux-2.1.47/drivers/video/cyberfb.c.orig	Mon Aug 11 22:20:38 1997
+++ linux-2.1.47/drivers/video/cyberfb.c	Mon Aug 18 23:21:21 1997
@@ -213,7 +213,7 @@
     *    Interface used by the world
     */
 
-void Cyber_video_setup(char *options, int *ints);
+video_setup_func Cyber_video_setup;
 
 static int Cyber_fb_open(int fbidx);
 static int Cyber_fb_release(int fbidx);
@@ -231,7 +231,7 @@
     *    Interface to the low level console driver
     */
 
-int Cyber_fb_init(u_long *mem_start);
+fb_init_func Cyber_fb_init;
 static int Cyberfb_switch(int con);
 static int Cyberfb_updatevar(int con);
 static void Cyberfb_blank(int blank);
--- linux-2.1.47/drivers/video/mach64fb.c.orig	Sat Aug 16 20:53:06 1997
+++ linux-2.1.47/drivers/video/mach64fb.c	Mon Aug 18 21:13:04 1997
@@ -44,6 +44,10 @@
 #include "mach64fb.h"
 
 
+video_setup_func Mach64_video_setup;
+fb_init_func Mach64_fb_init;
+
+
 /*============================================================================*/
 /* Defines */
 
--- linux-2.1.47/drivers/video/retz3fb.c.orig	Mon Aug 11 22:20:42 1997
+++ linux-2.1.47/drivers/video/retz3fb.c	Mon Aug 18 21:13:20 1997
@@ -308,7 +308,7 @@
  *    Interface used by the world
  */
 
-void retz3_video_setup(char *options, int *ints);
+video_setup_func retz3_video_setup;
 
 static int retz3_fb_open(int fbidx);
 static int retz3_fb_release(int fbidx);
@@ -326,7 +326,7 @@
  *    Interface to the low level console driver
  */
 
-int retz3_fb_init(u_long *mem_start);
+fb_init_func retz3_fb_init;
 static int z3fb_switch(int con);
 static int z3fb_updatevar(int con);
 static void z3fb_blank(int blank);
--- linux-2.1.47/drivers/video/vfb.c.orig	Mon Aug 11 20:31:15 1997
+++ linux-2.1.47/drivers/video/vfb.c	Mon Aug 18 21:13:28 1997
@@ -73,7 +73,7 @@
      *  Interface used by the world
      */
 
-void vfb_video_setup(char *options, int *ints);
+video_setup_func vfb_video_setup;
 
 static int virtual_fb_open(int fbidx);
 static int virtual_fb_release(int fbidx);
@@ -91,7 +91,7 @@
      *  Interface to the low level console driver
      */
 
-int virtual_fb_init(u_long *mem_start);
+fb_init_func virtual_fb_init;
 static int vfbcon_switch(int con);
 static int vfbcon_updatevar(int con);
 static void vfbcon_blank(int blank);
--- linux-2.1.47/drivers/video/fbcon-afb.c.orig	Mon Aug 18 21:15:39 1997
+++ linux-2.1.47/drivers/video/fbcon-afb.c	Mon Aug 18 21:17:46 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_afb;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-cfb16.c.orig	Mon Aug 18 21:15:39 1997
+++ linux-2.1.47/drivers/video/fbcon-cfb16.c	Mon Aug 18 21:17:52 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_cfb16;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-cfb8.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-cfb8.c	Mon Aug 18 21:17:58 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_cfb8;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-cyber.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-cyber.c	Mon Aug 18 21:18:03 1997
@@ -24,6 +24,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_cyber;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-ilbm.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-ilbm.c	Mon Aug 18 21:18:09 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_ilbm;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-iplan2p2.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-iplan2p2.c	Mon Aug 18 21:18:17 1997
@@ -29,6 +29,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_iplan2p2;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-iplan2p4.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-iplan2p4.c	Mon Aug 18 21:18:26 1997
@@ -29,6 +29,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_iplan2p4;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-iplan2p8.c.orig	Mon Aug 18 21:15:40 1997
+++ linux-2.1.47/drivers/video/fbcon-iplan2p8.c	Mon Aug 18 21:18:32 1997
@@ -29,6 +29,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_iplan2p8;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-mach64.c.orig	Mon Aug 18 21:15:41 1997
+++ linux-2.1.47/drivers/video/fbcon-mach64.c	Mon Aug 18 21:18:42 1997
@@ -75,6 +75,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_mach64;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-mfb.c.orig	Mon Aug 18 21:15:41 1997
+++ linux-2.1.47/drivers/video/fbcon-mfb.c	Mon Aug 18 21:18:48 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_mfb;
+
 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,
--- linux-2.1.47/drivers/video/fbcon-retz3.c.orig	Mon Aug 18 21:15:41 1997
+++ linux-2.1.47/drivers/video/fbcon-retz3.c	Mon Aug 18 21:18:53 1997
@@ -23,6 +23,8 @@
      *  Prototypes
      */
 
+fbcon_init_func fbcon_init_retz3;
+
 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,
--- linux-2.1.47/include/linux/fb.h.orig	Mon Aug 18 20:53:40 1997
+++ linux-2.1.47/include/linux/fb.h	Mon Aug 18 21:14:20 1997
@@ -235,6 +235,11 @@
 };
 
 
+/* prototypes */
+typedef void video_setup_func(char *, int *);
+typedef int fb_init_func(u_long *);
+typedef int fbcon_init_func(void);
+
 /* drivers/char/fbmem.c */
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(const struct fb_info *fb_info);

Greetings,

						Geert

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

