Commit e55355ea authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: Reduce pixmap memory allocation size

- Reduce pixmap size allocated by fbmem, i810fb and rivafb from 16-64K to
  8K.  This size is sufficient that a single putcs call can be accomodated by
  a single imageblit

- Replace NR_FB_DRIVERS with FB_MAX

- Trivial code, Kconfig and Documentation cleanup
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5f4420ff
......@@ -41,7 +41,7 @@ config FB
config FB_MODE_HELPERS
bool "Enable Video Mode Handling Helpers"
depends on FB
default y
default n
---help---
This enables functions for handling video modes using the
Generalized Timing Formula and the EDID parser. A few drivers rely
......@@ -61,10 +61,10 @@ config FB_TILEBLITTING
parameters in terms of number of tiles instead of number of pixels.
For example, to draw a single character, instead of using bitmaps,
an index to an array of bitmaps will be used. To clear or move a
rectangular section of a screen, the rectangle willbe described in
rectangular section of a screen, the rectangle will be described in
terms of number of tiles in the x- and y-axis.
This is particularly important to one driver, the matroxfb. If
This is particularly important to one driver, matroxfb. If
unsure, say N.
config FB_CIRRUS
......
......@@ -337,24 +337,24 @@ __setup("fbcon=", fb_console_setup);
static int search_fb_in_map(int idx)
{
int i;
int i, retval = 0;
for (i = 0; i < MAX_NR_CONSOLES; i++) {
if (con2fb_map[i] == idx)
return 1;
retval = 1;
}
return 0;
return retval;
}
static int search_for_mapped_con(void)
{
int i;
int i, retval = 0;
for (i = 0; i < MAX_NR_CONSOLES; i++) {
if (con2fb_map[i] != -1)
return 1;
retval = 1;
}
return 0;
return retval;
}
static int fbcon_takeover(int show_logo)
......
......@@ -51,7 +51,7 @@
* Frame buffer device initialization and setup routines
*/
#define FBPIXMAPSIZE 16384
#define FBPIXMAPSIZE (1024 * 8)
static struct notifier_block *fb_notifier_list;
struct fb_info *registered_fb[FB_MAX];
......@@ -1309,8 +1309,7 @@ fbmem_init(void)
}
module_init(fbmem_init);
#define NR_FB_DRIVERS 64
static char *video_options[NR_FB_DRIVERS];
static char *video_options[FB_MAX];
static int ofonly;
/**
......@@ -1331,7 +1330,7 @@ int fb_get_options(char *name, char **option)
retval = 1;
if (name_len && !retval) {
for (i = 0; i < NR_FB_DRIVERS; i++) {
for (i = 0; i < FB_MAX; i++) {
if (video_options[i] == NULL)
continue;
opt_len = strlen(video_options[i]);
......@@ -1373,7 +1372,7 @@ int __init video_setup(char *options)
if (!options || !*options)
return 0;
for (i = 0; i < NR_FB_DRIVERS; i++) {
for (i = 0; i < FB_MAX; i++) {
if (!strncmp(options, "ofonly", 6))
ofonly = 1;
if (video_options[i] == NULL) {
......
......@@ -1874,12 +1874,12 @@ static int __devinit i810fb_init_pci (struct pci_dev *dev,
par = (struct i810fb_par *) info->par;
par->dev = dev;
if (!(info->pixmap.addr = kmalloc(64*1024, GFP_KERNEL))) {
if (!(info->pixmap.addr = kmalloc(8*1024, GFP_KERNEL))) {
i810fb_release_resource(info, par);
return -ENOMEM;
}
memset(info->pixmap.addr, 0, 64*1024);
info->pixmap.size = 64*1024;
memset(info->pixmap.addr, 0, 8*1024);
info->pixmap.size = 8*1024;
info->pixmap.buf_align = 8;
info->pixmap.flags = FB_PIXMAP_SYSTEM;
......
......@@ -1679,7 +1679,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
cmap_len = riva_get_cmap_len(&info->var);
fb_alloc_cmap(&info->cmap, cmap_len, 0);
info->pixmap.size = 64 * 1024;
info->pixmap.size = 8 * 1024;
info->pixmap.buf_align = 4;
info->pixmap.scan_align = 4;
info->pixmap.flags = FB_PIXMAP_SYSTEM;
......@@ -1866,10 +1866,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
default_par = (struct riva_par *) info->par;
default_par->pdev = pd;
info->pixmap.addr = kmalloc(64 * 1024, GFP_KERNEL);
info->pixmap.addr = kmalloc(8 * 1024, GFP_KERNEL);
if (info->pixmap.addr == NULL)
goto err_out_kfree;
memset(info->pixmap.addr, 0, 64 * 1024);
memset(info->pixmap.addr, 0, 8 * 1024);
if (pci_enable_device(pd)) {
printk(KERN_ERR PFX "cannot enable PCI device\n");
......
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