aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino Daplas <adaplas@hotpop.com>2004-08-22 22:52:19 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:52:19 -0700
commit0a857e2396576c9a8c3c5823e4846b0f0c8b04cf (patch)
tree3f309079864a819ba593b052c19279069489cdc6 /drivers
parent7fbf08c28b53a1c60905cd149e630ae64583772a (diff)
downloadhistory-0a857e2396576c9a8c3c5823e4846b0f0c8b04cf.tar.gz
[PATCH] Video Mode Handling - Reduce memory footprint of fbdev
This patch is entirely optional. Its only advantage is reduction of kernel size by ~5-6K. a. Mark modedb as __init. b. Add CONFIG_FB_MODE_HELPERS. Unselecting this will uninclude the code for Generalized Timing Formula and the EDID parser on kernel compilation. These are used only by radeonfb, rivafb and i810fb. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/Kconfig11
-rw-r--r--drivers/video/fbmon.c31
-rw-r--r--drivers/video/modedb.c8
3 files changed, 47 insertions, 3 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index c85dbda450bc3a..86b26b707806ae 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -38,6 +38,17 @@ config FB
(e.g. an accelerated X server) and that are not frame buffer
device-aware may cause unexpected results. If unsure, say N.
+config FB_MODE_HELPERS
+ bool "Enable Video Mode Handling Helpers"
+ depends on FB
+ default y
+ ---help---
+ This enables functions for handling video modes using the
+ Generalized Timing Formula and the EDID parser. A few drivers rely
+ on this feature such as the radeonfb, rivafb, and the i810fb. If
+ your driver does not take advantage of this feature, choosing Y will
+ just increase the kernel size by about 5K.
+
config FB_CIRRUS
tristate "Cirrus Logic support"
depends on FB && (ZORRO || PCI)
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index f1e2d5210f6fea..fb2f2254a90473 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -51,6 +51,7 @@
#define FBMON_FIX_HEADER 1
+#ifdef CONFIG_FB_MODE_HELPERS
struct broken_edid {
u8 manufacturer[4];
u32 model;
@@ -1156,6 +1157,36 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf
return 0;
}
+#else
+int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
+{
+ return 1;
+}
+void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
+{
+ specs = NULL;
+}
+char *get_EDID_from_firmware(struct device *dev)
+{
+ return NULL;
+}
+struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
+{
+ return NULL;
+}
+void fb_destroy_modedb(struct fb_videomode *modedb)
+{
+}
+int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs)
+{
+ return 1;
+}
+int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ return -EINVAL;
+}
+#endif /* CONFIG_FB_MODE_HELPERS */
/*
* fb_validate_mode - validates var against monitor capabilities
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 75d4931b430116..abb201db1e7fb4 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -39,7 +39,7 @@ const char *global_mode_option = NULL;
#define DEFAULT_MODEDB_INDEX 0
-static const struct fb_videomode modedb[] = {
+static const __init struct fb_videomode modedb[] = {
{
/* 640x400 @ 70 Hz, 31.5 kHz hsync */
NULL, 70, 640, 400, 39721, 40, 24, 39, 9, 96, 2,
@@ -251,6 +251,7 @@ static const struct fb_videomode modedb[] = {
},
};
+#ifdef CONFIG_FB_MODE_HELPERS
const struct fb_videomode vesa_modes[] = {
/* 0 640x350-85 VESA */
{ NULL, 85, 640, 350, 31746, 96, 32, 60, 32, 64, 3,
@@ -374,6 +375,8 @@ const struct fb_videomode vesa_modes[] = {
{ NULL, 60, 1920, 1440, 3367, 352, 144, 56, 1, 224, 3,
FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
};
+EXPORT_SYMBOL(vesa_modes);
+#endif /* CONFIG_FB_MODE_HELPERS */
static int my_atoi(const char *name)
{
@@ -404,7 +407,7 @@ static int my_atoi(const char *name)
*/
int fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
- const struct fb_videomode *mode, unsigned int bpp)
+ const struct fb_videomode *mode, unsigned int bpp)
{
int err = 0;
@@ -827,5 +830,4 @@ EXPORT_SYMBOL(fb_destroy_modelist);
EXPORT_SYMBOL(fb_match_mode);
EXPORT_SYMBOL(fb_find_best_mode);
EXPORT_SYMBOL(fb_videomode_to_modelist);
-EXPORT_SYMBOL(vesa_modes);
EXPORT_SYMBOL(fb_find_mode);