Resent-Date: Mon, 25 Jan 1999 20:57:09 +0100 (MET)
Date: Mon, 25 Jan 1999 20:56:59 +0100 (CET)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: display->screen_base (fwd)
Resent-From: linux-m68k@phil.uni-sb.de

---------- Forwarded message ----------
Date: Sun, 24 Jan 1999 21:58:31 +0100 (CET)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Linux/APUS <linux-apus@sunsite.auc.dk>
Subject: display->screen_base


Here's a patch that hopefully fixes the problems with the calling of
phys_to_virt() in fbgen.c. Now fbhw->set_disp() must initialize
display->screen_base too.

Anybody care to test?

--- native-2.2.0-pre9/drivers/video/clgenfb.c	Thu Jan 21 23:19:10 1999
+++ linux/drivers/video/clgenfb.c	Sun Jan 24 21:42:21 1999
@@ -204,8 +204,8 @@
 			      struct fb_info_gen *info);
 static int  clgen_blank(int blank_mode, struct fb_info_gen *info);
 
-static void clgen_set_dispsw(const void *par, struct display *disp,
-			     struct fb_info_gen *info);
+static void clgen_set_disp(const void *par, struct display *disp,
+			   struct fb_info_gen *info);
 
 /* function table of the above functions */
 static struct fbgen_hwswitch clgen_hwswitch = 
@@ -220,7 +220,7 @@
     clgen_setcolreg,
     clgen_pan_display,
     clgen_blank,
-    clgen_set_dispsw
+    clgen_set_disp
 };
 
 /* Text console acceleration */
@@ -1372,13 +1372,14 @@
 	}
 }
 
-static void clgen_set_dispsw(const void *par, struct display *disp,
-			     struct fb_info_gen *info)
+static void clgen_set_disp(const void *par, struct display *disp,
+			   struct fb_info_gen *info)
 {
     struct clgenfb_par *_par = (struct clgenfb_par*) par;
     struct clgenfb_info *info2 = (struct clgenfb_info *)info;
 
-    printk("clgen_get_dispsw(): ");
+    printk("clgen_set_disp(): ");
+    disp->screen_base = info2->fbmem;
     switch (_par->var.bits_per_pixel)
     {
 #ifdef FBCON_HAS_MFB
@@ -1670,7 +1671,7 @@
 int init_module(void)
 {
     printk("init_module()\n");
-    clgenfb_init(0);
+    clgenfb_init();
     return 0;
 }
 
--- native-2.2.0-pre9/drivers/video/fbgen.c	Fri Nov 20 09:58:12 1998
+++ linux/drivers/video/fbgen.c	Sun Jan 24 20:27:02 1999
@@ -244,7 +244,6 @@
     memset(&fix, 0, sizeof(struct fb_fix_screeninfo));
     fbhw->encode_fix(&fix, &par, info);
 
-    display->screen_base = phys_to_virt((unsigned long)fix.smem_start);
     display->visual = fix.visual;
     display->type = fix.type;
     display->type_aux = fix.type_aux;
@@ -256,7 +255,7 @@
 	display->can_soft_blank = 1;
     else
 	display->can_soft_blank = 0;
-    fbhw->set_dispsw(&par, display, info);
+    fbhw->set_disp(&par, display, info);
 #if 0 /* FIXME: generic inverse is not supported yet */
     display->inverse = (fix.visual == FB_VISUAL_MONO01 ? !inverse : inverse);
 #else
--- native-2.2.0-pre9/drivers/video/pm2fb.c	Thu Jan 21 23:19:10 1999
+++ linux/drivers/video/pm2fb.c	Sun Jan 24 21:41:50 1999
@@ -286,14 +286,14 @@
 static int pm2fb_blank(int blank_mode, struct fb_info_gen* info);
 static int pm2fb_pan_display(const struct fb_var_screeninfo* var,
 					struct fb_info_gen* info);
-static void pm2fb_dispsw(const void* par, struct display* disp,
+static void pm2fb_set_disp(const void* par, struct display* disp,
 						struct fb_info_gen* info);
 
 static struct fbgen_hwswitch pm2fb_hwswitch={
 	pm2fb_detect, pm2fb_encode_fix, pm2fb_decode_var,
 	pm2fb_encode_var, pm2fb_get_par, pm2fb_set_par,
 	pm2fb_getcolreg, pm2fb_setcolreg, pm2fb_pan_display,
-	pm2fb_blank, pm2fb_dispsw
+	pm2fb_blank, pm2fb_set_disp
 };
 
 static int pm2fb_open(struct fb_info* info, int user);
@@ -1338,14 +1338,15 @@
 	return regno>255;
 }
 
-static void pm2fb_dispsw(const void* par, struct display* disp,
-						struct fb_info_gen* info) {
+static void pm2fb_set_disp(const void* par, struct display* disp,
+						   struct fb_info_gen* info) {
 	struct pm2fb_info* i=(struct pm2fb_info* )info;
 	unsigned long flags;
 	unsigned long depth;
 
 	save_flags(flags);
 	cli();
+	disp->screen_base = i->regions.v_fb;
 	switch (depth=((struct pm2fb_par* )par)->depth) {
 #ifdef FBCON_HAS_CFB8
 		case 8:
--- native-2.2.0-pre9/drivers/video/skeletonfb.c	Mon Oct  5 19:25:37 1998
+++ linux/drivers/video/skeletonfb.c	Sun Jan 24 20:27:02 1999
@@ -240,12 +240,13 @@
     return 0;
 }
 
-static void xxx_set_dispsw(const void *par, struct display *disp,
-			   struct fb_info_gen *info)
+static void xxx_set_disp(const void *par, struct display *disp,
+			 struct fb_info_gen *info)
 {
     unsigned long flags;
 
     /*
+     *  Fill in a pointer with the virtual address of the mapped frame buffer.
      *  Fill in a pointer to appropriate low level text console operations (and
      *  optionally a pointer to help data) for the video mode `par' of your
      *  video hardware. These can be generic software routines, or hardware
@@ -254,6 +255,7 @@
      *  pointer to dummy operations, and there will be no text output.
      */
     save_flags(flags); cli();
+    disp->screen_base = virtual_frame_buffer_address;
 #ifdef FBCON_HAS_CFB8
     if (is_cfb8) {
 	disp->dispsw = fbcon_cfb8;
@@ -278,7 +280,6 @@
     } else
 #endif
 	disp->dispsw = &fbcon_dummy;
-    restore_flags(flags);
 }
 
 
--- native-2.2.0-pre9/include/linux/fb.h	Tue Dec 29 17:14:23 1998
+++ linux/include/linux/fb.h	Sun Jan 24 21:19:31 1999
@@ -340,8 +340,8 @@
     int (*pan_display)(const struct fb_var_screeninfo *var,
 		       struct fb_info_gen *info);
     int (*blank)(int blank_mode, struct fb_info_gen *info);
-    void (*set_dispsw)(const void *par, struct display *disp,
-		       struct fb_info_gen *info);
+    void (*set_disp)(const void *par, struct display *disp,
+		     struct fb_info_gen *info);
 };
 
 struct fb_info_gen {

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


---------------------------------------------------------------------
To unsubscribe, e-mail: linux-apus-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: linux-apus-help@sunsite.auc.dk

