Commit 07cf5ddf authored by James Simmons's avatar James Simmons

Made fbcon modular.

parent 3b6dbf19
......@@ -33,12 +33,6 @@ extern int i2c_init_all(void);
#ifdef CONFIG_FB
extern void fbmem_init(void);
#endif
#ifdef CONFIG_PROM_CONSOLE
extern void prom_con_init(void);
#endif
#ifdef CONFIG_MDA_CONSOLE
extern void mda_console_init(void);
#endif
#if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR)
extern void tapechar_init(void);
#endif
......@@ -685,12 +679,6 @@ int __init chr_dev_init(void)
#endif
#if defined (CONFIG_FB)
fbmem_init();
#endif
#if defined (CONFIG_PROM_CONSOLE)
prom_con_init();
#endif
#if defined (CONFIG_MDA_CONSOLE)
mda_console_init();
#endif
tty_init();
#ifdef CONFIG_M68K_PRINTER
......
......@@ -126,6 +126,15 @@ const struct consw *conswitchp;
extern void vcs_make_devfs (unsigned int index, int unregister);
extern void console_map_init(void);
#ifdef CONFIG_PROM_CONSOLE
extern void prom_con_init(void);
#endif
#ifdef CONFIG_MDA_CONSOLE
extern void mda_console_init(void);
#endif
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
extern int fb_console_init(void);
#endif
static struct tty_struct *console_table[MAX_NR_CONSOLES];
static struct termios *console_termios[MAX_NR_CONSOLES];
......@@ -2524,6 +2533,15 @@ int __init vty_init(void)
kbd_init();
console_map_init();
#ifdef CONFIG_PROM_CONSOLE
prom_con_init();
#endif
#ifdef CONFIG_MDA_CONSOLE
mda_console_init();
#endif
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
fb_console_init();
#endif
con_init_devfs();
vcs_init();
return 0;
......
......@@ -400,8 +400,10 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
}
}
#ifdef MODULE
int init_module(void) { return 0; };
void cleanup_module(void) {};
#endif
EXPORT_SYMBOL(cfb_copyarea);
......
......@@ -443,8 +443,10 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
}
}
#ifdef MODULE
int init_module(void) { return 0; };
void cleanup_module(void) {};
#endif
EXPORT_SYMBOL(cfb_fillrect);
......
......@@ -342,8 +342,10 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
color_imageblit(image, p, dst1, start_index, pitch_index);
}
#ifdef MODULE
int init_module(void) { return 0; };
void cleanup_module(void) {};
#endif
EXPORT_SYMBOL(cfb_imageblit);
......
......@@ -125,7 +125,7 @@ config FBCON_STI
depends on !FBCON_ADVANCED && FRAMEBUFFER_CONSOLE && FB_STI
default y
config FBCON_FONTWIDTH8_ONLY
config FONTWIDTH8_ONLY
bool "Support only 8 pixels wide fonts"
depends on FRAMEBUFFER_CONSOLE
help
......@@ -136,19 +136,19 @@ config FBCON_FONTWIDTH8_ONLY
config FONT_SUN8x16
bool "Sparc console 8x16 font"
depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FBCON_FONTS || SPARC32 || SPARC64)
depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64)
help
This is the high resolution console font for Sun machines. Say Y.
config FONT_SUN12x22
bool "Sparc console 12x22 font (not supported by all drivers)"
depends on FRAMEBUFFER_CONSOLE && !FBCON_FONTWIDTH8_ONLY && (!SPARC32 && !SPARC64 && FBCON_FONTS || SPARC32 || SPARC64)
depends on FRAMEBUFFER_CONSOLE && !FONTWIDTH8_ONLY && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64)
help
This is the high resolution console font for Sun machines with very
big letters (like the letters used in the SPARC PROM). If the
standard font is unreadable for you, say Y, otherwise say N.
config FBCON_FONTS
config FONTS
bool "Select other fonts" if SPARC32 || SPARC64
depends on FRAMEBUFFER_CONSOLE
help
......@@ -161,14 +161,14 @@ config FBCON_FONTS
If unsure, say N (the default choices are safe).
config FBCON_FONTS
config FONTS
prompt "Select compiled-in fonts"
depends on FRAMEBUFFER_CONSOLE && !SPARC32 && !SPARC64
config FONT_8x8
bool "VGA 8x8 font" if FBCON_FONTS
bool "VGA 8x8 font" if FONTS
depends on FRAMEBUFFER_CONSOLE
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS
default y if !SPARC32 && !SPARC64 && !FONTS
help
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x50 (and higher) modes).
......@@ -180,9 +180,9 @@ config FONT_8x8
here is safe.
config FONT_8x16
bool "VGA 8x16 font" if FBCON_FONTS
bool "VGA 8x16 font" if FONTS
depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS
default y if !SPARC32 && !SPARC64 && !FONTS
help
This is the "high resolution" font for the VGA frame buffer (the one
provided by the VGA text console 80x25 mode.
......@@ -190,32 +190,32 @@ config FONT_8x16
If unsure, say Y.
config FONT_6x11
bool "Mac console 6x11 font (not supported by all drivers)" if FBCON_FONTS
depends on FRAMEBUFFER_CONSOLE && !FBCON_FONTWIDTH8_ONLY
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && MAC
bool "Mac console 6x11 font (not supported by all drivers)" if FONTS
depends on FRAMEBUFFER_CONSOLE && !FONTWIDTH8_ONLY
default y if !SPARC32 && !SPARC64 && !FONTS && MAC
help
Small console font with Macintosh-style high-half glyphs. Some Mac
framebuffer drivers don't support this one at all.
config FONT_PEARL_8x8
bool "Pearl (old m68k) console 8x8 font" if FBCON_FONTS
bool "Pearl (old m68k) console 8x8 font" if FONTS
depends on FRAMEBUFFER_CONSOLE
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && AMIGA
default y if !SPARC32 && !SPARC64 && !FONTS && AMIGA
help
Small console font with PC-style control-character and high-half
glyphs.
config FONT_ACORN_8x8
bool "Acorn console 8x8 font" if FBCON_FONTS
bool "Acorn console 8x8 font" if FONTS
depends on FRAMEBUFFER_CONSOLE
default y if !SPARC32 && !SPARC64 && !FBCON_FONTS && ARM && ARCH_ACORN
default y if !SPARC32 && !SPARC64 && !FONTS && ARM && ARCH_ACORN
help
Small console font with PC-style control characters and high-half
glyphs.
config FONT_MINI_4x6
bool "Mini 4x6 font"
depends on !SPARC32 && !SPARC64 && FBCON_FONTS
depends on !SPARC32 && !SPARC64 && FONTS
endmenu
......@@ -7,6 +7,34 @@
export-objs := fbcon.o fonts.o
# Font handling
font-objs := fonts.o
ifeq ($(CONFIG_FONT_SUN8x16),y)
font-objs += font_sun8x16.o
endif
ifeq ($(CONFIG_FONT_SUN12x22),y)
font-objs += font_sun12x22.o
endif
ifeq ($(CONFIG_FONT_8x8),y)
font-objs += font_8x8.o
endif
ifeq ($(CONFIG_FONT_8x16),y)
font-objs += font_8x16.o
endif
ifeq ($(CONFIG_FONT_6x11),y)
font-objs += font_6x11.o
endif
ifeq ($(CONFIG_FONT_PEARL_8x8),y)
font-objs += font_pearl_8x8.o
endif
ifeq ($(CONFIG_FONT_ACORN_8x8),y)
font-objs += font_acorn_8x8.o
endif
ifeq ($(CONFIG_FONT_MINI_4x6),y)
font-objs += font_mini_4x6.o
endif
# Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
......@@ -17,18 +45,6 @@ obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o font.o
obj-$(CONFIG_FONT_SUN8x16) += font_sun8x16.o
obj-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
obj-$(CONFIG_FONT_8x8) += font_8x8.o
obj-$(CONFIG_FONT_8x16) += font_8x16.o
obj-$(CONFIG_FONT_6x11) += font_6x11.o
obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
font-objs := fonts.o font_sun8x16.o font_sun12x22.o font_8x8.o font_8x16.o \
font_6x11.o font_pearl_8x8.o font_acorn_8x8.o font_mini_4x6.o
# Generic Low Level Drivers
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
......
......@@ -234,7 +234,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
add_timer(&cursor_timer);
}
static int __init fbconsole_setup(char *this_opt)
int __init fb_console_setup(char *this_opt)
{
int unit, i, j;
char *options;
......@@ -289,7 +289,7 @@ static int __init fbconsole_setup(char *this_opt)
return 0;
}
__setup("fbcon=", fbconsole_setup);
__setup("fbcon=", fb_console_setup);
void gen_set_disp(int con, struct fb_info *info)
{
......@@ -551,6 +551,7 @@ static const char *fbcon_startup(void)
{
const char *display_desc = "frame buffer device";
struct font_desc *font = NULL;
struct module *owner;
struct fb_info *info;
struct vc_data *vc;
static int done = 0;
......@@ -566,7 +567,14 @@ static const char *fbcon_startup(void)
info = registered_fb[num_registered_fb-1];
if (!info) return NULL;
info->currcon = -1;
owner = info->fbops->owner;
if (owner)
__MOD_INC_USE_COUNT(owner);
if (info->fbops->fb_open && info->fbops->fb_open(info, 0) && owner)
__MOD_DEC_USE_COUNT(owner);
if (info->fix.type != FB_TYPE_TEXT) {
if (fbcon_softback_size) {
if (!softback_buf) {
......@@ -768,7 +776,7 @@ static int fbcon_changevar(int con)
p->fontdata = font->data;
}
#ifdef FBCON_FONTWIDTH8_ONLY
#ifdef FONTWIDTH8_ONLY
if (!fontwidthvalid(p, vc->vc_font.width)) {
/* ++Geert: changed from panic() to `correct and continue' */
printk(KERN_ERR
......@@ -912,7 +920,7 @@ static void fbcon_set_display(int con, int init, int logo)
p->fontdata = font->data;
}
#ifdef FBCON_FONTWIDTH8_ONLY
#ifdef FONTWIDTH8_ONLY
if (!fontwidthvalid(p, vc->vc_font.width)) {
/* ++Geert: changed from panic() to `correct and continue' */
printk(KERN_ERR
......@@ -1976,7 +1984,7 @@ static inline int fbcon_get_font(struct vc_data *vc, struct console_font_op *op)
u8 *fontdata = p->fontdata;
int i, j;
#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
#ifdef CONFIG_FONTWIDTH8_ONLY
if (fontwidth(p) != 8)
return -EINVAL;
#endif
......@@ -1995,7 +2003,7 @@ static inline int fbcon_get_font(struct vc_data *vc, struct console_font_op *op)
fontdata += j;
}
}
#ifndef CONFIG_FBCON_FONTWIDTH8_ONLY
#ifndef CONFIG_FONTWIDTH8_ONLY
else if (op->width <= 16) {
j = vc->vc_font.height * 2;
for (i = 0; i < op->charcount; i++) {
......@@ -2177,7 +2185,7 @@ static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
int i, k;
u8 *new_data, *data = op->data, *p;
#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
#ifdef CONFIG_FONTWIDTH8_ONLY
if (w != 8)
return -EINVAL;
#endif
......@@ -2209,7 +2217,7 @@ static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
p += h;
}
}
#ifndef CONFIG_FBCON_FONTWIDTH8_ONLY
#ifndef CONFIG_FONTWIDTH8_ONLY
else if (w <= 16) {
h *= 2;
for (i = 0; i < op->charcount; i++) {
......@@ -2665,18 +2673,19 @@ const struct consw fb_con = {
.con_getxy = fbcon_getxy,
};
static int __init fbconsole_init(void)
int __init fb_console_init(void)
{
take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default);
return 0;
}
static void __exit fbconsole_exit(void)
void __exit fb_console_exit(void)
{
give_up_console(&fb_con);
}
module_init(fbconsole_init);
module_exit(fbconsole_exit);
module_init(fb_console_init);
module_exit(fb_console_exit);
/*
* Visible symbols for modules
......
......@@ -53,7 +53,7 @@ extern void set_con2fb_map(int unit, int newidx);
#define fontheight(p) ((p)->_fontheight)
#ifdef CONFIG_FBCON_FONTWIDTH8_ONLY
#ifdef CONFIG_FONTWIDTH8_ONLY
/* fontwidth w is supported by dispsw */
#define FONTWIDTH(w) (1 << ((8) - 1))
......
......@@ -41,7 +41,9 @@
#include <asm/pgtable.h>
#include <linux/fb.h>
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
#include "console/fbcon.h"
#endif
/*
* Frame buffer device initialization and setup routines
*/
......@@ -783,10 +785,6 @@ static devfs_handle_t devfs_handle;
int
register_framebuffer(struct fb_info *fb_info)
{
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
static int fb_ever_opened[FB_MAX];
int j;
#endif
char name_buf[8];
int i;
......@@ -797,29 +795,7 @@ register_framebuffer(struct fb_info *fb_info)
if (!registered_fb[i])
break;
fb_info->node = mk_kdev(FB_MAJOR, i);
fb_info->currcon = -1;
registered_fb[i] = fb_info;
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
if (!fb_ever_opened[i]) {
struct module *owner = fb_info->fbops->owner;
/*
* We assume initial frame buffer devices can be opened this
* many times
*/
for (j = 0; j < MAX_NR_CONSOLES; j++)
if (con2fb_map[j] == i) {
if (owner)
__MOD_INC_USE_COUNT(owner);
if (!fb_info->fbops->fb_open)
continue;
if (!fb_info->fbops->fb_open(fb_info,0))
continue;
if (owner)
__MOD_DEC_USE_COUNT(owner);
}
fb_ever_opened[i] = 1;
}
#endif
sprintf (name_buf, "%d", i);
fb_info->devfs_handle =
devfs_register (devfs_handle, name_buf, DEVFS_FL_DEFAULT,
......@@ -842,14 +818,9 @@ register_framebuffer(struct fb_info *fb_info)
int
unregister_framebuffer(struct fb_info *fb_info)
{
int i, j;
int i;
i = minor(fb_info->node);
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
for (j = 0; j < MAX_NR_CONSOLES; j++)
if (con2fb_map[j] == i)
return -EBUSY;
#endif
if (!registered_fb[i])
return -EINVAL;
devfs_unregister (fb_info->devfs_handle);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment