From: James S. <jsi...@us...> - 2002-03-23 00:23:02
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv32141/drivers/video Modified Files: cfbcopyarea.c cfbfillrect.c cfbimgblt.c fbcon.c fbmem.c vesafb.c Log Message: Bug fixes for fbcon. Index: cfbcopyarea.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbcopyarea.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cfbcopyarea.c 12 Mar 2002 20:33:19 -0000 1.5 +++ cfbcopyarea.c 23 Mar 2002 00:22:58 -0000 1.6 @@ -26,7 +26,6 @@ #include <linux/slab.h> #include <asm/types.h> #include <asm/io.h> -#include <video/fbcon.h> void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) { Index: cfbfillrect.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbfillrect.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cfbfillrect.c 12 Mar 2002 20:33:19 -0000 1.8 +++ cfbfillrect.c 23 Mar 2002 00:22:58 -0000 1.9 @@ -20,7 +20,6 @@ #include <linux/string.h> #include <linux/fb.h> #include <asm/types.h> -#include <video/fbcon.h> void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) { Index: cfbimgblt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/cfbimgblt.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- cfbimgblt.c 11 Mar 2002 21:37:23 -0000 1.9 +++ cfbimgblt.c 23 Mar 2002 00:22:58 -0000 1.10 @@ -31,8 +31,6 @@ #include <linux/fb.h> #include <asm/types.h> -#include <video/fbcon.h> - #define DEBUG #ifdef DEBUG Index: fbcon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbcon.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- fbcon.c 26 Dec 2001 17:28:11 -0000 1.61 +++ fbcon.c 23 Mar 2002 00:22:58 -0000 1.62 @@ -316,25 +316,18 @@ static void fbcon_clear(struct vc_data *vc,int sx,int sy, int width,int height) { struct fb_info *info = (struct fb_info *) vc->display_fg->data_hook; - unsigned long color; + struct fb_fillrect rect; - if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR) - color = attr_bgcol_ec(vc); - else { - if (info->var.bits_per_pixel > 16) - color = ((u32*)info->pseudo_palette)[attr_bgcol_ec(vc)]; - else - color = ((u16*)info->pseudo_palette)[attr_bgcol_ec(vc)]; - } - sx *= vc->vc_font.width; - sy *= vc->vc_font.height; - width *= vc->vc_font.width; - height *= vc->vc_font.height; + rect.color = attr_bgcol_ec(vc); + rect.rop = ROP_COPY; + rect.dx *= vc->vc_font.width; + rect.dy *= vc->vc_font.height; + rect.width *= vc->vc_font.width; + rect.height *= vc->vc_font.height; DPRINTK("Calling clear screen with width %d, height %d at %d,%d\n", - width, height, sx, sy); - - info->fbops->fb_fillrect(info, sx, sy, width, height, color, ROP_COPY); + rect.width, rect.height, rect.sx, rect.sy); + info->fbops->fb_fillrect(info, &rect); } static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) @@ -357,8 +350,8 @@ } } - image.x = xpos * vc->vc_font.width; - image.y = ypos * vc->vc_font.height; + image.dx = xpos * vc->vc_font.width; + image.dy = ypos * vc->vc_font.height; image.width = vc->vc_font.width; image.height = vc->vc_font.height; image.depth = 1; @@ -391,8 +384,8 @@ image.bg_color = ((u16*)info->pseudo_palette)[attr_bgcol(vc,c)]; } } - image.x = xpos * vc->vc_font.width; - image.y = ypos * vc->vc_font.height; + image.dx = xpos * vc->vc_font.width; + image.dy = ypos * vc->vc_font.height; image.width = vc->vc_font.width; image.height = vc->vc_font.height; image.depth = 1; @@ -402,13 +395,14 @@ (scr_readw(s) & charmask)*vc->vc_font.height*width; s++; info->fbops->fb_imageblit(info, &image); - image.x += vc->vc_font.width; + image.dx += vc->vc_font.width; } } static void fbcon_cursor(struct vc_data *vc, int mode) { struct fb_info *info = (struct fb_info *) vc->display_fg->data_hook; + struct fb_fillrect rect; struct fbcursor cursor; int i; @@ -427,12 +421,13 @@ info->cursor.set = FB_CUR_SETCUR; info->fbops->fb_cursor(info, &info->cursor); } else { - unsigned int sx = vc->vc_x * vc->vc_font.width; - unsigned int sy = vc->vc_y * vc->vc_font.height; - unsigned long color = -1; - - info->fbops->fb_fillrect(info, sx, sy,vc->vc_font.width, - vc->vc_font.height, color, ROP_XOR); + rect.dx = vc->vc_x * vc->vc_font.width; + rect.dy = vc->vc_y * vc->vc_font.height; + rect.width = vc->vc_font.width; + rect.height = vc->vc_font.height; + rect.color = -1; + rect.rop = ROP_XOR; + info->fbops->fb_fillrect(info, &rect); } break; case CM_MOVE: @@ -446,12 +441,13 @@ info->cursor.hot.y = info->cursor.pos.y; info->fbops->fb_cursor(info, &info->cursor); } else { - unsigned int sx = vc->vc_x * vc->vc_font.width; - unsigned int sy = vc->vc_y * vc->vc_font.height; - unsigned long color = -1; - - info->fbops->fb_fillrect(info, sx, sy,vc->vc_font.width, - vc->vc_font.height, color, ROP_XOR); + rect.dx = vc->vc_x * vc->vc_font.width; + rect.dy = vc->vc_y * vc->vc_font.height; + rect.width = vc->vc_font.width; + rect.height = vc->vc_font.height; + rect.color = -1; + rect.rop = ROP_XOR; + info->fbops->fb_fillrect(info, &rect); } break; case CM_CHANGE: { @@ -504,12 +500,13 @@ cursor.mask = mask; info->fbops->fb_cursor(info, &cursor); } else { - unsigned int sx = vc->vc_x * vc->vc_font.width; - unsigned int sy = vc->vc_y * vc->vc_font.height; - unsigned long color = -1; - - info->fbops->fb_fillrect(info, sx, sy,vc->vc_font.width, - vc->vc_font.height, color, ROP_XOR); + rect.dx = vc->vc_x * vc->vc_font.width; + rect.dy = vc->vc_y * vc->vc_font.height; + rect.width = vc->vc_font.width; + rect.height = vc->vc_font.height; + rect.color = -1; + rect.rop = ROP_XOR; + info->fbops->fb_fillrect(info, &rect); } break; } @@ -520,21 +517,23 @@ int count) { struct fb_info *info = (struct fb_info *) vc->display_fg->data_hook; - unsigned int height = (b-t-count) * vc->vc_font.height; - unsigned int sy = 0, dy = 0; + struct fb_copyarea area; + + area.sy = area.dy = area.sx = area.dx = 0; + area.height = (b-t-count) * vc->vc_font.height; + area.width = info->var.xres; switch (dir) { case SM_UP: - sy = (t + count) * vc->vc_font.height; - dy = t * vc->vc_font.height; + area.sy = (t + count) * vc->vc_font.height; + area.dy = t * vc->vc_font.height; break; case SM_DOWN: - sy = t * vc->vc_font.height; - dy = (t + count) * vc->vc_font.height; + area.sy = t * vc->vc_font.height; + area.dy = (t + count) * vc->vc_font.height; break; } - - info->fbops->fb_copyarea(info, 0, sy, info->var.xres, height, 0, dy); + info->fbops->fb_copyarea(info, &area); return 0; } @@ -542,16 +541,17 @@ int height, int width) { struct fb_info *info = (struct fb_info *) vc->display_fg->data_hook; - - sx *= vc->vc_font.width; - sy *= vc->vc_font.height; - dx *= vc->vc_font.width; - dy *= vc->vc_font.height; - height *= vc->vc_font.height; - width *= vc->vc_font.width; + struct fb_copyarea area; + + area.sx *= vc->vc_font.width; + area.sy *= vc->vc_font.height; + area.dx *= vc->vc_font.width; + area.dy *= vc->vc_font.height; + area.height *= vc->vc_font.height; + area.width *= vc->vc_font.width; - DPRINTK("Calling bmove to move a region of width %d and height %d to go from %d,%d to %d,%d\n", width, height, sx, sy, dx, dy); - info->fbops->fb_copyarea(info, sx, sy, width, height, dx, dy); + DPRINTK("Calling bmove to move a region of width %d and height %d to go from %d,%d to %d,%d\n", area.width, area.height, area.sx, area.sy,area.dx,area.dy); + info->fbops->fb_copyarea(info, &area); } static int fbcon_blank(struct vc_data *vc, int blank) @@ -562,10 +562,16 @@ info->fbops->fb_blank(blank, info); } else { if (info->var.accel_flags != FB_ACCEL_NONE) { + struct fb_fillrect rect; unsigned long color = 0; - info->fbops->fb_fillrect(info, 0, 0, info->var.xres, - info->var.yres, color, ROP_COPY); + rect.dx = 0; + rect.dy = 0; + rect.width = info->var.xres; + rect.height = info->var.yres; + rect.color = color; + rect.rop = ROP_COPY; + info->fbops->fb_fillrect(info, &rect); } else { if ((info->fix.visual == FB_VISUAL_PSEUDOCOLOR || info->fix.visual == FB_VISUAL_DIRECTCOLOR) && blank) { @@ -673,12 +679,19 @@ /* Hardware panning support */ if (fb_pan_display(&info->var, info)) { + struct fb_copyarea area; /* * Oops it failed to work. Time to do cleanup then use * a copyarea. */ info->var.yoffset = orig_y; - info->fbops->fb_copyarea(info, 0, orig_y, info->var.xres, delta, 0, info->var.yoffset); + area.sx = 0; + area.sy = orig_y; + area.width = info->var.xres; + area.height = delta; + area.dx = 0; + area.dy = info->var.yoffset; + info->fbops->fb_copyarea(info, &area); } return 0; } Index: fbmem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbmem.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- fbmem.c 14 Mar 2002 22:32:23 -0000 1.60 +++ fbmem.c 23 Mar 2002 00:22:58 -0000 1.61 @@ -549,12 +549,11 @@ ((fbca.dx + fbca.width) > info->var.xres) || ((fbca.dy + fbca.height) > info->var.yres)) return(-EINVAL); - fb->fb_copyarea(info, - fbca.sx + info->var.xoffset, - fbca.sy + info->var.yoffset, - fbca.width, fbca.height, - fbca.dx + info->var.xoffset, - fbca.dy + info->var.yoffset); + fbca.sx += info->var.xoffset; + fbca.sy += info->var.yoffset; + fbca.dx += info->var.xoffset; + fbca.dy += info->var.yoffset; + fb->fb_copyarea(info, &fbca); return(0); } case FBIOPUT_FILLRECT: @@ -562,19 +561,16 @@ struct fb_fillrect fbfr; if (copy_from_user(&fbfr, (void *) arg, sizeof(var))) return -EFAULT; - if ((fbfr.x1 > info->var.xres) || - (fbfr.y1 > info->var.yres) || - ((fbfr.x1 + fbfr.width) > info->var.xres) || - ((fbfr.y1 + fbfr.height) > info->var.yres)) + if ((fbfr.dx > info->var.xres) || + (fbfr.dy > info->var.yres) || + ((fbfr.dx + fbfr.width) > info->var.xres) || + ((fbfr.dy + fbfr.height) > info->var.yres)) return(-EINVAL); if ((fbfr.rop != ROP_COPY) && (fbfr.rop != ROP_XOR)) return(-EINVAL); - fb->fb_fillrect(info, - fbfr.x1 + info->var.xoffset, - fbfr.y1 + info->var.yoffset, - fbfr.width, fbfr.height, - fbfr.color, - fbfr.rop); + fbfr.dx += info->var.xoffset; + fbfr.dy += info->var.yoffset; + fb->fb_fillrect(info, &fbfr); return(0); } @@ -838,8 +834,8 @@ for (x = 0; x < smp_num_cpus * (LOGO_W + 8) && x < info->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) { - image.x = x; - image.y = 0; /* For now. We should add in wrap around */ + image.dx = x; + image.dy = 0; /* For now. We should add in wrap around */ if (info->fbops->fb_imageblit) info->fbops->fb_imageblit(info, &image); Index: vesafb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/vesafb.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- vesafb.c 18 Mar 2002 19:29:11 -0000 1.20 +++ vesafb.c 23 Mar 2002 00:22:58 -0000 1.21 @@ -21,6 +21,7 @@ #include <linux/init.h> #include <asm/io.h> +#include <asm/mtrr.h> #define dac_reg (0x3c8) #define dac_val (0x3c9) @@ -28,33 +29,24 @@ /* --------------------------------------------------------------------- */ static struct fb_var_screeninfo vesafb_defined = { - 0,0,0,0, /* W,H, W, H (virtual) load xres,xres_virtual*/ - 0,0, /* virtual -> visible no offset */ - 8, /* depth -> load bits_per_pixel */ - 0, /* greyscale ? */ - {0,0,0}, /* R */ - {0,0,0}, /* G */ - {0,0,0}, /* B */ - {0,0,0}, /* transparency */ - 0, /* standard pixel format */ - FB_ACTIVATE_NOW, - -1,-1, - 0, - 0L,0L,0L,0L,0L, - 0L,0L,0, /* No sync info */ - FB_VMODE_NONINTERLACED, - {0,0,0,0,0,0} + activate: FB_ACTIVATE_NOW, + height: -1, + width: -1, + vmode: FB_VMODE_NONINTERLACED, }; -static struct fb_fix_screeninfo vesafb_fix __initdata = { - "VESA VGA", (unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS, 0, - FB_VISUAL_PSEUDOCOLOR, 0, 0, 0, 0, (unsigned long) NULL, 0, FB_ACCEL_NONE +static struct fb_fix_screeninfo vesafb_fix = { + id: "VESA VGA", + type: FB_TYPE_PACKED_PIXELS, + accel: FB_ACCEL_NONE, }; static struct fb_info fb_info; static u32 pseudo_palette[17]; static int inverse = 0; +static int mtrr = 0; + static int pmi_setpal = 0; /* pmi for palette changes ??? */ static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */ static unsigned short *pmi_base = 0; @@ -63,7 +55,7 @@ /* --------------------------------------------------------------------- */ -static int vesafb_pan_display(struct fb_var_screeninfo *var, +static int vesafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { int offset; @@ -127,49 +119,49 @@ * (according to the entries in the `var' structure). Return * != 0 for invalid regno. */ + if (regno >= info->cmap.len) return 1; switch (info->var.bits_per_pixel) { - case 8: - vesa_setpalette(regno, red, green, blue); - break; - case 15: - case 16: - if (info->var.red.offset == 10) { - /* 1:5:5:5 */ - ((u16*) (info->pseudo_palette))[regno] = + case 8: + vesa_setpalette(regno,red,green,blue); + break; + case 16: + if (info->var.red.offset == 10) { + /* 1:5:5:5 */ + ((u32*) (info->pseudo_palette))[regno] = ((red & 0xf800) >> 1) | ((green & 0xf800) >> 6) | ((blue & 0xf800) >> 11); - } else { - /* 0:5:6:5 */ - ((u16*) (info->pseudo_palette))[regno] = + } else { + /* 0:5:6:5 */ + ((u32*) (info->pseudo_palette))[regno] = ((red & 0xf800) ) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11); - } - break; - case 24: - red >>= 8; - green >>= 8; - blue >>= 8; - ((u32 *)(info->pseudo_palette))[regno] = - (red << info->var.red.offset) | - (green << info->var.green.offset) | - (blue << info->var.blue.offset); - break; - case 32: - red >>= 8; - green >>= 8; - blue >>= 8; - ((u32 *)(info->pseudo_palette))[regno] = - (red << info->var.red.offset) | - (green << info->var.green.offset) | - (blue << info->var.blue.offset); - break; - } - return 0; + } + break; + case 24: + red >>= 8; + green >>= 8; + blue >>= 8; + ((u32 *)(info->pseudo_palette))[regno] = + (red << info->var.red.offset) | + (green << info->var.green.offset) | + (blue << info->var.blue.offset); + break; + case 32: + red >>= 8; + green >>= 8; + blue >>= 8; + ((u32 *)(info->pseudo_palette))[regno] = + (red << info->var.red.offset) | + (green << info->var.green.offset) | + (blue << info->var.blue.offset); + break; + } + return 0; } static struct fb_ops vesafb_ops = { @@ -187,8 +179,8 @@ if (!options || !*options) return 0; - - while ((this_opt = strsep(&options, ",")) != NULL) { + + while ((this_opt = strsep(&options, ",")) != NULL) { if (!*this_opt) continue; if (! strcmp(this_opt, "inverse")) @@ -209,51 +201,44 @@ int __init vesafb_init(void) { - /* Mode */ - int video_width, video_height, video_height_virtual, video_bpp, i; - int video_visual, video_linelength, video_cmap_len, video_size; - unsigned long video_base; /* physical addr */ - char *video_vbase; /* mapped */ + int video_cmap_len; + int i; if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return -ENXIO; - printk("It is a linear framebuffer\n"); - - video_base = screen_info.lfb_base; - video_bpp = screen_info.lfb_depth; - if (15 == video_bpp) - video_bpp = 16; - video_width = screen_info.lfb_width; - video_height = screen_info.lfb_height; - video_linelength = screen_info.lfb_linelength; - video_size = screen_info.lfb_size * 65536; - video_visual = (video_bpp == 8) ? + vesafb_fix.smem_start = screen_info.lfb_base; + vesafb_defined.bits_per_pixel = screen_info.lfb_depth; + if (15 == vesafb_defined.bits_per_pixel) + vesafb_defined.bits_per_pixel = 16; + vesafb_defined.xres = screen_info.lfb_width; + vesafb_defined.yres = screen_info.lfb_height; + vesafb_fix.line_length = screen_info.lfb_linelength; + vesafb_fix.smem_len = screen_info.lfb_size * 65536; + vesafb_fix.visual = (vesafb_defined.bits_per_pixel == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; - if (!request_mem_region(video_base, video_size, "vesafb")) { + if (!request_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len, "vesafb")) { printk(KERN_WARNING "vesafb: abort, cannot reserve video memory at 0x%lx\n", - video_base); + vesafb_fix.smem_start); /* We cannot make this fatal. Sometimes this comes from magic - spaces our resource handlers simply don't know about */ + spaces our resource handlers simply don't know about */ } - printk("Got requested region (framebuffer)\n"); - - fb_info.screen_base = video_vbase = ioremap(video_base, video_size); - if (!video_vbase) { - release_mem_region(video_base, video_size); + fb_info.screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len); + if (!fb_info.screen_base) { + release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len); printk(KERN_ERR "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", - video_size, video_base); + vesafb_fix.smem_len, vesafb_fix.smem_start); return -EIO; } printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n", - video_base, video_vbase, video_size/1024); + vesafb_fix.smem_start, fb_info.screen_base, vesafb_fix.smem_len/1024); printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n", - video_width, video_height, video_bpp, video_linelength, screen_info.pages); + vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages); if (screen_info.vesapm_seg) { printk(KERN_INFO "vesafb: protected mode interface info at %04x:%04x\n", @@ -286,31 +271,27 @@ } } - vesafb_defined.xres=video_width; - vesafb_defined.yres=video_height; - vesafb_defined.xres_virtual=video_width; - vesafb_defined.yres_virtual=video_size / video_linelength; - vesafb_defined.bits_per_pixel=video_bpp; - - if (ypan && vesafb_defined.yres_virtual > video_height) { - printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n", (ypan > 1) ? "ywrap" : "ypan", vesafb_defined.yres_virtual); + vesafb_defined.xres_virtual = vesafb_defined.xres; + vesafb_defined.yres_virtual = vesafb_fix.smem_len / vesafb_fix.line_length; + if (ypan && vesafb_defined.yres_virtual > vesafb_defined.yres) { + printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n", + (ypan > 1) ? "ywrap" : "ypan",vesafb_defined.yres_virtual); } else { printk(KERN_INFO "vesafb: scrolling: redraw\n"); - vesafb_defined.yres_virtual = video_height; + vesafb_defined.yres_virtual = vesafb_defined.yres; ypan = 0; } - video_height_virtual = vesafb_defined.yres_virtual; - + /* some dummy values for timing to make fbset happy */ - vesafb_defined.pixclock = 10000000 / video_width * 1000 / video_height; - vesafb_defined.left_margin = (video_width / 8) & 0xf8; + vesafb_defined.pixclock = 10000000 / vesafb_defined.xres * 1000 / vesafb_defined.yres; + vesafb_defined.left_margin = (vesafb_defined.xres / 8) & 0xf8; vesafb_defined.right_margin = 32; vesafb_defined.upper_margin = 16; vesafb_defined.lower_margin = 4; - vesafb_defined.hsync_len = (video_width / 8) & 0xf8; + vesafb_defined.hsync_len = (vesafb_defined.xres / 8) & 0xf8; vesafb_defined.vsync_len = 4; - if (video_bpp > 8) { + if (vesafb_defined.bits_per_pixel > 8) { vesafb_defined.red.offset = screen_info.red_pos; vesafb_defined.red.length = screen_info.red_size; vesafb_defined.green.offset = screen_info.green_pos; @@ -337,29 +318,39 @@ video_cmap_len = 256; } - vesafb_fix.smem_start = video_base; - vesafb_fix.smem_len = video_size; - vesafb_fix.visual = video_visual; - vesafb_fix.ypanstep = ypan ? 1 : 0; - vesafb_fix.ywrapstep = (ypan>1) ? 1 : 0; - vesafb_fix.line_length = video_linelength; + vesafb_fix.ypanstep = ypan ? 1 : 0; + vesafb_fix.ywrapstep = (ypan>1) ? 1 : 0; /* request failure does not faze us, as vgacon probably has this * region already (FIXME) */ request_region(0x3c0, 32, "vesafb"); - fb_info.node = -1; + if (mtrr) { + int temp_size = vesafb_fix.smem_len; + /* Find the largest power-of-two */ + while (temp_size & (temp_size - 1)) + temp_size &= (temp_size - 1); + + /* Try and find a power of two to add */ + while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { + temp_size >>= 1; + } + } + + fb_info.node = NODEV; fb_info.fbops = &vesafb_ops; fb_info.var = vesafb_defined; fb_info.fix = vesafb_fix; - fb_info.flags=FBINFO_FLAG_DEFAULT; fb_info.pseudo_palette = pseudo_palette; + fb_info.flags = FBINFO_FLAG_DEFAULT; + + fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0); if (register_framebuffer(&fb_info)<0) return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device\n", - GET_FB_IDX(fb_info.node), fb_info.fix.id); + minor(fb_info.node), fb_info.fix.id); return 0; } |