Skip to contentSkip to conversation

fbcon/fbdev: Remove fbcon-specific fields from struct fb_info

PATCH In review Antonino A. Daplas 1 participant 1 message Nov 2, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/8 fbcon/fbdev: Remove fbcon-specific fields from struct fb_info

The following fields in struct fb_info is specific only to fbcon:
- struct timer_ cursor_timer
- int currcon

Remove them from struct fb_info and place them in fbcon_par so they become invisible from the drivers.

---

 drivers/video/acornfb.c               |    1
 drivers/video/aty/radeon_base.c       |    1
 drivers/video/bw2.c                   |    1
 drivers/video/cg14.c                  |    1
 drivers/video/cg3.c                   |    1
 drivers/video/cg6.c                   |    1
 drivers/video/cirrusfb.c              |    1
 drivers/video/console/fbcon.c         |   82 +++++++++++++++++++++-------------
 drivers/video/console/fbcon.h         |    2
 drivers/video/ffb.c                   |    1
 drivers/video/gbefb.c                 |    1
 drivers/video/intelfb/intelfbdrv.c    |    1
 drivers/video/leo.c                   |    1
 drivers/video/matrox/matroxfb_base.c  |   26 ++++++----
 drivers/video/matrox/matroxfb_crtc2.c |    5 --
 drivers/video/p9100.c                 |    1
 drivers/video/pxafb.c                 |    1
 drivers/video/radeonfb.c              |    1
 drivers/video/sa1100fb.c              |    1
 drivers/video/sis/sis_main.c          |    5 +-
 drivers/video/sstfb.c                 |    1
 drivers/video/stifb.c                 |    1
 drivers/video/tcx.c                   |    1
 drivers/video/tgafb.c                 |    1
 drivers/video/vga16fb.c               |    1
 include/linux/fb.h                    |    2
 26 files changed, 73 insertions(+), 69 deletions(-)
drivers/video/acornfb.c +0 -1
diff -Nru a/drivers/video/acornfb.c b/drivers/video/acornfb.c
@@ -1332,7 +1332,6 @@
 		}
 	}
 
-	fb_info.currcon	       = -1;
 	fb_info.screen_base    = (char *)SCREEN_BASE;
 	fb_info.fix.smem_start = SCREEN_START;
 	current_par.using_vram = 0;
drivers/video/aty/radeon_base.c +0 -1
diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
@@ -1749,7 +1749,6 @@
 {
 	struct fb_info *info = rinfo->info;
 
-	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
 	info->flags = FBINFO_DEFAULT
drivers/video/bw2.c +0 -1
diff -Nru a/drivers/video/bw2.c b/drivers/video/bw2.c
@@ -361,7 +361,6 @@
 	if (!all->info.screen_base)
 		all->info.screen_base = (char *)
 			sbus_ioremap(resp, 0, all->par.fbsize, "bw2 ram");
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	bw2_blank(0, &all->info);
drivers/video/cg14.c +0 -1
diff -Nru a/drivers/video/cg14.c b/drivers/video/cg14.c
@@ -552,7 +552,6 @@
 
 	all->info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
 	all->info.fbops = &cg14_ops;
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	__cg14_reset(&all->par);
drivers/video/cg3.c +0 -1
diff -Nru a/drivers/video/cg3.c b/drivers/video/cg3.c
@@ -408,7 +408,6 @@
 		all->info.screen_base = (char *)
 			sbus_ioremap(&sdev->resource[0], CG3_RAM_OFFSET,
 				     all->par.fbsize, "cg3 ram");
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	cg3_blank(0, &all->info);
drivers/video/cg6.c +0 -1
diff -Nru a/drivers/video/cg6.c b/drivers/video/cg6.c
@@ -723,7 +723,6 @@
 		all->info.screen_base = (char *)
 			sbus_ioremap(&sdev->resource[0], CG6_RAM_OFFSET,
 				     all->par.fbsize, "cgsix ram");
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	all->info.var.accel_flags = FB_ACCELF_TEXT;
drivers/video/cirrusfb.c +0 -1
diff -Nru a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
@@ -2246,7 +2246,6 @@
 	struct fb_info *info = cinfo->info;
 	struct fb_var_screeninfo *var = &info->var;
 
-	info->currcon = -1;
 	info->par = cinfo;
 	info->pseudo_palette = cinfo->pseudo_palette;
 	info->flags = FBINFO_DEFAULT
drivers/video/console/fbcon.c +51 -31

203 lines not on this page · raw message

drivers/video/console/fbcon.h +2 -0
diff -Nru a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
@@ -61,7 +61,9 @@
 	void (*cursor)(struct vc_data *vc, struct fb_info *info,
 		       struct display *p, int mode, int fg, int bg);
 
+	struct timer_list cursor_timer; /* Cursor timer */
 	struct fb_cursor cursor_state;
+        int    currcon;	                /* Current VC. */
 	int    cursor_flash;
 	char  *cursor_data;
 };
drivers/video/ffb.c +0 -1
diff -Nru a/drivers/video/ffb.c b/drivers/video/ffb.c
@@ -969,7 +969,6 @@
 			   FBINFO_HWACCEL_IMAGEBLIT);
 	all->info.fbops = &ffb_ops;
 	all->info.screen_base = (char *) all->par.physbase + FFB_DFB24_POFF;
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 	all->info.pseudo_palette = all->pseudo_palette;
 
drivers/video/gbefb.c +0 -1
diff -Nru a/drivers/video/gbefb.c b/drivers/video/gbefb.c
@@ -1140,7 +1140,6 @@
 	for (i = 0; i < (gbe_mem_size >> TILE_SHIFT); i++)
 		gbe_tiles.cpu[i] = (gbe_mem_phys >> TILE_SHIFT) + i;
 
-	fb_info.currcon = -1;
 	fb_info.fbops = &gbefb_ops;
 	fb_info.pseudo_palette = pseudo_palette;
 	fb_info.flags = FBINFO_DEFAULT;
drivers/video/intelfb/intelfbdrv.c +0 -1
diff -Nru a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
@@ -1108,7 +1108,6 @@
 
 	DBG_MSG("intelfb_set_fbinfo\n");
 
-	//info->currcon = -1;
 	info->flags = FBINFO_FLAG_DEFAULT;
 	info->fbops = &intel_fb_ops;
 	info->pseudo_palette = dinfo->pseudo_palette;
drivers/video/leo.c +0 -1
diff -Nru a/drivers/video/leo.c b/drivers/video/leo.c
@@ -590,7 +590,6 @@
 
 	all->info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
 	all->info.fbops = &leo_ops;
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	leo_init_wids(&all->info);
drivers/video/matrox/matroxfb_base.c +15 -11
diff -Nru a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
@@ -1712,7 +1712,6 @@
 	}
 	ACCESS_FBINFO(devflags.ydstorg) = 0;
 
-	ACCESS_FBINFO(fbcon.currcon) = -1;
 	ACCESS_FBINFO(video.base) = video_base_phys;
 	ACCESS_FBINFO(video.len_usable) = ACCESS_FBINFO(video.len);
 	if (ACCESS_FBINFO(video.len_usable) > b->base->maxdisplayable)
@@ -1877,16 +1876,21 @@
 	}
 	printk("fb%d: %s frame buffer device\n",
 	       ACCESS_FBINFO(fbcon.node), ACCESS_FBINFO(fbcon.fix.id));
-	if (ACCESS_FBINFO(fbcon.currcon) < 0) {
-		/* there is no console on this fb... but we have to initialize hardware
-		 * until someone tells me what is proper thing to do */
-		printk(KERN_INFO "fb%d: initializing hardware\n",
-			ACCESS_FBINFO(fbcon.node));
-		/* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var
-		 * already before, so register_framebuffer works correctly. */
-		vesafb_defined.activate |= FB_ACTIVATE_FORCE;
-		fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined);
-	}
+	/*
+	 * Tony: If this driver is to be mapped to the console, then
+	 *       fbcon will automatically do a set_par for us.  The code below
+	 *       may not be needed.
+	 */
+
+	/* there is no console on this fb... but we have to initialize hardware
+	 * until someone tells me what is proper thing to do */
+	printk(KERN_INFO "fb%d: initializing hardware\n",
+	       ACCESS_FBINFO(fbcon.node));
+	/* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var
+	 * already before, so register_framebuffer works correctly. */
+	vesafb_defined.activate |= FB_ACTIVATE_FORCE;
+	fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined);
+
 	return 0;
 failVideoIO:;
 	matroxfb_g450_shutdown(PMINFO2);
drivers/video/matrox/matroxfb_crtc2.c +1 -4
diff -Nru a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
@@ -605,7 +605,6 @@
 	m2info->fbcon.flags = FBINFO_FLAG_DEFAULT;
 	m2info->fbcon.flags |= FBINFO_HWACCEL_XPAN |
 			       FBINFO_HWACCEL_YPAN;
-	m2info->fbcon.currcon = -1;
 	m2info->fbcon.pseudo_palette = m2info->cmap;
 	fb_alloc_cmap(&m2info->fbcon.cmap, 256, 1);
 
@@ -634,9 +633,7 @@
 	if (register_framebuffer(&m2info->fbcon)) {
 		return -ENXIO;
 	}
-	if (m2info->fbcon.currcon < 0) {
-		fb_set_var(&m2info->fbcon, &matroxfb_dh_defined);
-	}
+	fb_set_var(&m2info->fbcon, &matroxfb_dh_defined);
 	down_write(&ACCESS_FBINFO(crtc2.lock));
 	oldcrtc2 = ACCESS_FBINFO(crtc2.info);
 	ACCESS_FBINFO(crtc2.info) = m2info;
drivers/video/p9100.c +0 -1
diff -Nru a/drivers/video/p9100.c b/drivers/video/p9100.c
@@ -307,7 +307,6 @@
 		all->info.screen_base = (char *)
 			sbus_ioremap(&sdev->resource[2], 0,
 				     all->par.fbsize, "p9100 ram");
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	p9100_blank(0, &all->info);
drivers/video/pxafb.c +0 -1
diff -Nru a/drivers/video/pxafb.c b/drivers/video/pxafb.c
@@ -1043,7 +1043,6 @@
 	fbi->fb.fbops		= &pxafb_ops;
 	fbi->fb.flags		= FBINFO_DEFAULT;
 	fbi->fb.node		= -1;
-	fbi->fb.currcon		= -1;
 
 	addr = fbi;
 	addr = addr + sizeof(struct pxafb_info);
drivers/video/radeonfb.c +0 -1
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
@@ -2247,7 +2247,6 @@
 
 	info = &rinfo->info;
 
-	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
         info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
drivers/video/sa1100fb.c +0 -1
diff -Nru a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
@@ -1673,7 +1673,6 @@
 	fbi->fb.fbops		= &sa1100fb_ops;
 	fbi->fb.flags		= FBINFO_DEFAULT;
 	fbi->fb.monspecs	= monspecs;
-	fbi->fb.currcon		= -1;
 	fbi->fb.pseudo_palette	= (fbi + 1);
 
 	fbi->rgb[RGB_8]		= &rgb_8;
drivers/video/sis/sis_main.c +4 -1
diff -Nru a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
@@ -1813,8 +1813,11 @@
 		return err;
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
 	sisfb_get_fix(&info->fix, info->currcon, info);
-
+#else
+	sisfb_get_fix(&info->fix, -1, info);
+#endif
 	return 0;
 }
 
drivers/video/sstfb.c +0 -1
diff -Nru a/drivers/video/sstfb.c b/drivers/video/sstfb.c
@@ -1471,7 +1471,6 @@
 
 	info->flags	= FBINFO_DEFAULT;
 	info->fbops	= &sstfb_ops;
-	info->currcon	= -1;
 	info->pseudo_palette = &all->pseudo_palette;
 
 	fix->type	= FB_TYPE_PACKED_PIXELS;
drivers/video/stifb.c +0 -1
diff -Nru a/drivers/video/stifb.c b/drivers/video/stifb.c
@@ -1326,7 +1326,6 @@
 	info->fbops = &stifb_ops;
 	info->screen_base = (void*) REGION_BASE(fb,1);
 	info->flags = FBINFO_DEFAULT;
-	info->currcon = -1;
 
 	/* This has to been done !!! */
 	fb_alloc_cmap(&info->cmap, 256, 0);
drivers/video/tcx.c +0 -1
diff -Nru a/drivers/video/tcx.c b/drivers/video/tcx.c
@@ -422,7 +422,6 @@
 		all->info.screen_base = (char *)
 			sbus_ioremap(&sdev->resource[0], 0,
 				     all->par.fbsize, "tcx ram");
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 
 	/* Initialize brooktree DAC. */
drivers/video/tgafb.c +0 -1
diff -Nru a/drivers/video/tgafb.c b/drivers/video/tgafb.c
@@ -1430,7 +1430,6 @@
                           FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT;
 	all->info.fbops = &tgafb_ops;
 	all->info.screen_base = (char *) all->par.tga_fb_base;
-	all->info.currcon = -1;
 	all->info.par = &all->par;
 	all->info.pseudo_palette = all->pseudo_palette;
 
drivers/video/vga16fb.c +0 -1
diff -Nru a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
@@ -859,7 +859,6 @@
 			par->vesa_blanked = 0;
 		}
 		if (par->palette_blanked) {
-			//do_install_cmap(info->currcon, info);
 			par->palette_blanked = 0;
 		}
 		break;
include/linux/fb.h +0 -2
diff -Nru a/include/linux/fb.h b/include/linux/fb.h
@@ -685,7 +685,6 @@
 	struct fb_fix_screeninfo fix;	/* Current fix */
 	struct fb_monspecs monspecs;	/* Current Monitor specs */
 	struct work_struct queue;	/* Framebuffer event queue */
-	struct timer_list cursor_timer; /* Cursor timer */
 	struct fb_pixmap pixmap;	/* Image hardware mapper */
 	struct fb_pixmap sprite;	/* Cursor hardware mapper */
 	struct fb_cmap cmap;		/* Current cmap */
@@ -697,7 +696,6 @@
 #endif
 	char __iomem *screen_base;	/* Virtual address */
 	unsigned long screen_size;	/* Amount of ioremapped VRAM or 0 */ 
-	int currcon;			/* Current VC. */
 	void *pseudo_palette;		/* Fake palette of 16 colors */ 
 #define FBINFO_STATE_RUNNING	0
 #define FBINFO_STATE_SUSPENDED	1

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click