summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbcon.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-19 01:28:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-19 01:28:40 +0000
commit8abb719409c9060a7c0676f76e9182c1e0b8ca46 (patch)
treeb88cc5a6cd513a04a512b7e6215c873c90a1c5dd /drivers/video/fbcon.c
parentf01bd7aeafd95a08aafc9e3636bb26974df69d82 (diff)
Merge with 2.3.99-pre1.
Diffstat (limited to 'drivers/video/fbcon.c')
-rw-r--r--drivers/video/fbcon.c101
1 files changed, 13 insertions, 88 deletions
diff --git a/drivers/video/fbcon.c b/drivers/video/fbcon.c
index 8da8117c9..aedbc8b17 100644
--- a/drivers/video/fbcon.c
+++ b/drivers/video/fbcon.c
@@ -111,10 +111,6 @@
#define LOGO_W 80
#define LOGO_LINE (LOGO_W/8)
-static int first_fb_vc = 0;
-static int last_fb_vc = MAX_NR_CONSOLES-1;
-static int fbcon_is_default = 1;
-
struct display fb_display[MAX_NR_CONSOLES];
char con2fb_map[MAX_NR_CONSOLES];
static int logo_lines;
@@ -132,8 +128,6 @@ static int softback_lines;
#define FNTSUM(fd) (((int *)(fd))[-4])
#define FONT_EXTRA_WORDS 4
-static char fontname[40] __initdata = { 0 }; /* default font name */
-
#define CM_SOFTBACK (8)
#define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * conp->vc_size_row)
@@ -203,8 +197,7 @@ static int fbcon_scrolldelta(struct vc_data *conp, int lines);
* Internal routines
*/
-static int __init fbcon_setup(char *options);
-static void fbcon_set_disp(int con, int init, int logo);
+static void fbcon_setup(int con, int init, int logo);
static __inline__ int real_y(struct display *p, int ypos);
static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp);
static __inline__ void updatescrollmode(struct display *p);
@@ -300,8 +293,6 @@ void set_con2fb_map(int unit, int newidx)
newfb = registered_fb[newidx];
if (newfb->fbops->fb_open(newfb,0))
return;
- newfb->count++;
- oldfb->count--;
oldfb->fbops->fb_release(oldfb,0);
conp = fb_display[unit].conp;
fontdata = fb_display[unit].fontdata;
@@ -332,57 +323,6 @@ void set_con2fb_map(int unit, int newidx)
}
}
-static int __init fbcon_setup(char *options)
-{
- int i, j;
-
- if (!options || !*options)
- return 0;
-
- if (!strncmp(options, "font:", 5))
- strcpy(fontname, options+5);
-
- if (!strncmp(options, "scrollback:", 11)) {
- options += 11;
- if (*options) {
- fbcon_softback_size = simple_strtoul(options, &options, 0);
- if (*options == 'k' || *options == 'K') {
- fbcon_softback_size *= 1024;
- options++;
- }
- if (*options != ',')
- return 0;
- options++;
- } else
- return 0;
- }
-
- if (!strncmp(options, "map:", 4)) {
- options += 4;
- if (*options)
- for (i = 0, j = 0; i < MAX_NR_CONSOLES; i++) {
- if (!options[j])
- j = 0;
- con2fb_map[i] = (options[j++]-'0') % FB_MAX;
- }
- return 0;
- }
-
- if (!strncmp(options, "vc:", 3)) {
- options += 3;
- if (*options)
- first_fb_vc = simple_strtoul(options, &options, 10) - 1;
- if (first_fb_vc < 0)
- first_fb_vc = 0;
- if (*options++ == '-')
- last_fb_vc = simple_strtoul(options, &options, 10) - 1;
- fbcon_is_default = 0;
- }
- return 0;
-}
-
-__setup("fbcon=", fbcon_setup);
-
/*
* Low Level Operations
*/
@@ -479,23 +419,15 @@ static const char *fbcon_startup(void)
return display_desc;
}
+
static void fbcon_init(struct vc_data *conp, int init)
{
- int j, unit = conp->vc_num;
+ int unit = conp->vc_num;
struct fb_info *info;
-
+
/* on which frame buffer will we open this console? */
info = registered_fb[(int)con2fb_map[unit]];
- /*
- * We assume initial frame buffer devices can be opened this
- * many times
- */
- for (j = 0; j < (last_fb_vc - first_fb_vc + 1); j++) {
- info->fbops->fb_open(info,0);
- info->count++;
- }
-
info->changevar = &fbcon_changevar;
fb_display[unit] = *(info->disp); /* copy from default */
DPRINTK("mode: %s\n",info->modename);
@@ -511,8 +443,8 @@ static void fbcon_init(struct vc_data *conp, int init)
fb_display[unit].cmap.green = 0;
fb_display[unit].cmap.blue = 0;
fb_display[unit].cmap.transp = 0;
- fbcon_set_disp(unit, init, !init);
- /* Must be done after fbcon_set_disp to prevent excess updates */
+ fbcon_setup(unit, init, !init);
+ /* Must be done after fbcon_setup to prevent excess updates */
conp->vc_display_fg = &info->display_fg;
if (!info->display_fg)
info->display_fg = conp;
@@ -526,7 +458,6 @@ static void fbcon_deinit(struct vc_data *conp)
fbcon_free_font(p);
p->dispsw = &fbcon_dummy;
- p->fb_info->count = 0;
p->conp = 0;
}
@@ -534,7 +465,7 @@ static void fbcon_deinit(struct vc_data *conp)
static int fbcon_changevar(int con)
{
if (fb_display[con].conp)
- fbcon_set_disp(con, 0, 0);
+ fbcon_setup(con, 0, 0);
return 0;
}
@@ -573,7 +504,7 @@ static void fbcon_font_widths(struct display *p)
#define fontwidthvalid(p,w) ((p)->dispsw->fontwidthmask & FONTWIDTH(w))
-static void fbcon_set_disp(int con, int init, int logo)
+static void fbcon_setup(int con, int init, int logo)
{
struct display *p = &fb_display[con];
struct vc_data *conp = p->conp;
@@ -637,8 +568,9 @@ static void fbcon_set_disp(int con, int init, int logo)
}
if (!p->fontdata) {
- if (!fontname[0] || !(font = fbcon_find_font(fontname)))
- font = fbcon_get_default_font(p->var.xres, p->var.yres);
+ if (!p->fb_info->fontname[0] ||
+ !(font = fbcon_find_font(p->fb_info->fontname)))
+ font = fbcon_get_default_font(p->var.xres, p->var.yres);
p->_fontwidth = font->width;
p->_fontheight = font->height;
p->fontdata = font->data;
@@ -654,7 +586,7 @@ static void fbcon_set_disp(int con, int init, int logo)
#endif
{
/* ++Geert: changed from panic() to `correct and continue' */
- printk(KERN_ERR "fbcon_set_disp: No support for fontwidth %d\n", fontwidth(p));
+ printk(KERN_ERR "fbcon_setup: No support for fontwidth %d\n", fontwidth(p));
p->dispsw = &fbcon_dummy;
}
}
@@ -737,7 +669,7 @@ static void fbcon_set_disp(int con, int init, int logo)
}
if (p->dispsw == &fbcon_dummy)
- printk(KERN_WARNING "fbcon_set_disp: type %d (aux %d, depth %d) not "
+ printk(KERN_WARNING "fbcon_setup: type %d (aux %d, depth %d) not "
"supported\n", p->type, p->type_aux, p->var.bits_per_pixel);
p->dispsw->setup(p);
@@ -2462,13 +2394,6 @@ struct consw fb_con = {
con_getxy: fbcon_getxy,
};
-void __init fbconsole_init(void)
-{
- if (!num_registered_fb || (first_fb_vc > last_fb_vc))
- return;
-
- take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default);
-}
/*
* Dummy Low Level Operations