patch-2.3.38 linux/drivers/video/fbmem.c

Next file: linux/drivers/video/matroxfb.c
Previous file: linux/drivers/video/fbcon.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.37/linux/drivers/video/fbmem.c linux/drivers/video/fbmem.c
@@ -110,6 +110,13 @@
 	int (*init)(void);
 	int (*setup)(char*);
 } fb_drivers[] __initdata = {
+#ifdef CONFIG_FB_SBUS
+	/*
+	 * Sbusfb must be initialized _before_ other frame buffer devices that
+	 * use PCI probing
+	 */
+	{ "sbus", sbusfb_init, sbusfb_setup },
+#endif
 #ifdef CONFIG_FB_3DFX
 	{ "tdfx", tdfxfb_init, tdfxfb_setup },
 #endif
@@ -153,9 +160,6 @@
 	 */
 	{ "offb", offb_init, offb_setup },
 #endif
-#ifdef CONFIG_FB_SBUS
-	{ "sbus", sbusfb_init, sbusfb_setup },
-#endif
 #ifdef CONFIG_FB_ATY128
 	{ "aty128fb", aty128fb_init, aty128fb_setup },
 #endif
@@ -225,9 +229,6 @@
 static int num_pref_init_funcs __initdata = 0;
 
 
-#define GET_INODE(i) MKDEV(FB_MAJOR, (i) << FB_MODES_SHIFT)
-#define GET_FB_VAR_IDX(node) (MINOR(node) & ((1 << FB_MODES_SHIFT)-1)) 
-
 struct fb_info *registered_fb[FB_MAX];
 int num_registered_fb = 0;
 extern int fbcon_softback_size; 
@@ -507,6 +508,24 @@
 #endif /* !sparc32 */
 }
 
+#if 1 /* to go away in 2.4.0 */
+int GET_FB_IDX(kdev_t rdev)
+{
+    int fbidx = MINOR(rdev);
+    if (fbidx >= 32) {
+	int newfbidx = fbidx >> 5;
+	static int warned = 0;
+	if (!(warned & (1<<newfbidx))) {
+	    warned |= 1<<newfbidx;
+	    printk("Warning: Remapping obsolete /dev/fb* minor %d to %d\n",
+		   fbidx, newfbidx);
+	}
+	fbidx = newfbidx;
+    }
+    return fbidx;
+}
+#endif
+
 static int
 fb_open(struct inode *inode, struct file *file)
 {
@@ -559,7 +578,7 @@
 	for (i = 0 ; i < FB_MAX; i++)
 		if (!registered_fb[i])
 			break;
-	fb_info->node=GET_INODE(i);
+	fb_info->node = MKDEV(FB_MAJOR, i);
 	registered_fb[i] = fb_info;
 	if (!fb_ever_opened[i]) {
 		/*
@@ -703,3 +722,6 @@
 
 EXPORT_SYMBOL(register_framebuffer);
 EXPORT_SYMBOL(unregister_framebuffer);
+#if 1 /* to go away in 2.4.0 */
+EXPORT_SYMBOL(GET_FB_IDX);
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)