aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonino Daplas <adaplas@hotpop.com>2005-03-30 16:47:26 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-30 16:47:26 -0800
commit92d3fa193ea4a104b5590b9687b27dbba4308c5f (patch)
treef42dd363c973fddbf28b6d682e91d6648a6ff97f
parent03fb6c4a52cb7e37bcc31b1ed032072026cf168e (diff)
downloadhistory-92d3fa193ea4a104b5590b9687b27dbba4308c5f.tar.gz
[PATCH] fbcon: Call set_par per fb_info once during init
Currently, fbcon will unconditionally do set_par's on all info's mapped to each console. This results in repetetive hardware initialization when one is enough. Fix this by skipping all fbdev's that already underwent initialization. From: Antonino Daplas <adaplas@pol.net> Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/video/console/fbcon.c16
-rw-r--r--drivers/video/console/fbcon.h3
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index a26a54ad69c892..5256d9b09e3e56 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -599,9 +599,10 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
ops->currcon = fg_console;
- if (info->fbops->fb_set_par)
+ if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT))
info->fbops->fb_set_par(info);
+ ops->flags |= FBCON_FLAGS_INIT;
ops->graphics = 0;
if (vc)
@@ -900,6 +901,7 @@ static const char *fbcon_startup(void)
static void fbcon_init(struct vc_data *vc, int init)
{
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+ struct fbcon_ops *ops;
struct vc_data **default_mode = vc->vc_display_fg;
struct vc_data *svc = *default_mode;
struct display *t, *p = &fb_display[vc->vc_num];
@@ -950,6 +952,8 @@ static void fbcon_init(struct vc_data *vc, int init)
new_cols = info->var.xres / vc->vc_font.width;
new_rows = info->var.yres / vc->vc_font.height;
vc_resize(vc, new_cols, new_rows);
+
+ ops = info->fbcon_par;
/*
* We must always set the mode. The mode of the previous console
* driver could be in the same resolution but we are using different
@@ -957,10 +961,14 @@ static void fbcon_init(struct vc_data *vc, int init)
*
* We need to do it in fbcon_init() to prevent screen corruption.
*/
- if (CON_IS_VISIBLE(vc) && info->fbops->fb_set_par)
- info->fbops->fb_set_par(info);
+ if (CON_IS_VISIBLE(vc)) {
+ if (info->fbops->fb_set_par &&
+ !(ops->flags & FBCON_FLAGS_INIT))
+ info->fbops->fb_set_par(info);
+ ops->flags |= FBCON_FLAGS_INIT;
+ }
- ((struct fbcon_ops *) info->fbcon_par)->graphics = 0;
+ ops->graphics = 0;
if ((cap & FBINFO_HWACCEL_COPYAREA) &&
!(cap & FBINFO_HWACCEL_DISABLED))
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 23422630bf5fd1..5d377860bce283 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -18,6 +18,8 @@
#include <asm/io.h>
+#define FBCON_FLAGS_INIT 1
+
/*
* This is the interface between the low-level console driver and the
* low-level frame buffer device
@@ -69,6 +71,7 @@ struct fbcon_ops {
int cursor_reset;
int blank_state;
int graphics;
+ int flags;
char *cursor_data;
};
/*