setup enviroment for compilation
[linux-2.4.21-pre4.git] / drivers / video / vesafb.c
1 /*
2  * framebuffer driver for VBE 2.0 compliant graphic boards
3  *
4  * switching to graphics mode happens at boot time (while
5  * running in real mode, see arch/i386/boot/video.S).
6  *
7  * (c) 1998 Gerd Knorr <kraxel@goldbach.in-berlin.de>
8  *
9  */
10
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/string.h>
15 #include <linux/mm.h>
16 #include <linux/tty.h>
17 #include <linux/slab.h>
18 #include <linux/delay.h>
19 #include <linux/fb.h>
20 #include <linux/console.h>
21 #include <linux/selection.h>
22 #include <linux/ioport.h>
23 #include <linux/init.h>
24
25 #include <asm/io.h>
26 #ifdef CONFIG_MTRR
27 #include <asm/mtrr.h>
28 #endif /* CONFIG_MTRR */
29
30 #include <video/fbcon.h>
31 #include <video/fbcon-cfb8.h>
32 #include <video/fbcon-cfb16.h>
33 #include <video/fbcon-cfb24.h>
34 #include <video/fbcon-cfb32.h>
35 #include <video/fbcon-mac.h>
36
37 #define dac_reg (0x3c8)
38 #define dac_val (0x3c9)
39
40 /* --------------------------------------------------------------------- */
41
42 /*
43  * card parameters
44  */
45
46 /* card */
47 unsigned long video_base; /* physical addr */
48 int   video_size;
49 char *video_vbase;        /* mapped */
50
51 /* mode */
52 static int  video_bpp;
53 static int  video_width;
54 static int  video_height;
55 static int  video_height_virtual;
56 static int  video_type = FB_TYPE_PACKED_PIXELS;
57 static int  video_visual;
58 static int  video_linelength;
59 static int  video_cmap_len;
60
61 /* --------------------------------------------------------------------- */
62
63 static struct fb_var_screeninfo vesafb_defined = {
64         0,0,0,0,        /* W,H, W, H (virtual) load xres,xres_virtual*/
65         0,0,            /* virtual -> visible no offset */
66         8,              /* depth -> load bits_per_pixel */
67         0,              /* greyscale ? */
68         {0,0,0},        /* R */
69         {0,0,0},        /* G */
70         {0,0,0},        /* B */
71         {0,0,0},        /* transparency */
72         0,              /* standard pixel format */
73         FB_ACTIVATE_NOW,
74         -1,-1,
75         0,
76         0L,0L,0L,0L,0L,
77         0L,0L,0,        /* No sync info */
78         FB_VMODE_NONINTERLACED,
79         {0,0,0,0,0,0}
80 };
81
82 static struct display disp;
83 static struct fb_info fb_info;
84 static struct { u_short blue, green, red, pad; } palette[256];
85 static union {
86 #ifdef FBCON_HAS_CFB16
87     u16 cfb16[16];
88 #endif
89 #ifdef FBCON_HAS_CFB24
90     u32 cfb24[16];
91 #endif
92 #ifdef FBCON_HAS_CFB32
93     u32 cfb32[16];
94 #endif
95 } fbcon_cmap;
96
97 static int             inverse   = 0;
98 static int             mtrr      = 0;
99 static int             currcon   = 0;
100
101 static int             pmi_setpal = 0;  /* pmi for palette changes ??? */
102 static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */
103 static unsigned short  *pmi_base  = 0;
104 static void            (*pmi_start)(void);
105 static void            (*pmi_pal)(void);
106
107 static struct display_switch vesafb_sw;
108
109 /* --------------------------------------------------------------------- */
110
111 static int vesafb_pan_display(struct fb_var_screeninfo *var, int con,
112                               struct fb_info *info)
113 {
114 #if defined(__i386__) || defined(__x86_64__)
115         int offset;
116
117         if (!ypan)
118                 return -EINVAL;
119         if (var->xoffset)
120                 return -EINVAL;
121         if (var->yoffset > var->yres_virtual)
122                 return -EINVAL;
123         if ((ypan==1) && var->yoffset+var->yres > var->yres_virtual)
124                 return -EINVAL;
125
126         offset = (var->yoffset * video_linelength + var->xoffset) / 4;
127
128         __asm__ __volatile__(
129                 "call *(%%edi)"
130                 : /* no return value */
131                 : "a" (0x4f07),         /* EAX */
132                   "b" (0),              /* EBX */
133                   "c" (offset),         /* ECX */
134                   "d" (offset >> 16),   /* EDX */
135                   "D" (&pmi_start));    /* EDI */
136 #endif
137         return 0;
138 }
139
140 static int vesafb_update_var(int con, struct fb_info *info)
141 {
142         if (con == currcon && ypan) {
143                 struct fb_var_screeninfo *var = &fb_display[currcon].var;
144                 return vesafb_pan_display(var,con,info);
145         }
146         return 0;
147 }
148
149 static int vesafb_get_fix(struct fb_fix_screeninfo *fix, int con,
150                          struct fb_info *info)
151 {
152         memset(fix, 0, sizeof(struct fb_fix_screeninfo));
153         strcpy(fix->id,"VESA VGA");
154
155         fix->smem_start=video_base;
156         fix->smem_len=video_size;
157         fix->type = video_type;
158         fix->visual = video_visual;
159         fix->xpanstep  = 0;
160         fix->ypanstep  = ypan     ? 1 : 0;
161         fix->ywrapstep = (ypan>1) ? 1 : 0;
162         fix->line_length=video_linelength;
163         return 0;
164 }
165
166 static int vesafb_get_var(struct fb_var_screeninfo *var, int con,
167                          struct fb_info *info)
168 {
169         if(con==-1)
170                 memcpy(var, &vesafb_defined, sizeof(struct fb_var_screeninfo));
171         else
172                 *var=fb_display[con].var;
173         return 0;
174 }
175
176 static void vesafb_set_disp(int con)
177 {
178         struct fb_fix_screeninfo fix;
179         struct display *display;
180         struct display_switch *sw;
181         
182         if (con >= 0)
183                 display = &fb_display[con];
184         else
185                 display = &disp;        /* used during initialization */
186
187         vesafb_get_fix(&fix, con, 0);
188
189         memset(display, 0, sizeof(struct display));
190         display->screen_base = video_vbase;
191         display->visual = fix.visual;
192         display->type = fix.type;
193         display->type_aux = fix.type_aux;
194         display->ypanstep = fix.ypanstep;
195         display->ywrapstep = fix.ywrapstep;
196         display->line_length = fix.line_length;
197         display->next_line = fix.line_length;
198         display->can_soft_blank = 0;
199         display->inverse = inverse;
200         vesafb_get_var(&display->var, -1, &fb_info);
201
202         switch (video_bpp) {
203 #ifdef FBCON_HAS_CFB8
204         case 8:
205                 sw = &fbcon_cfb8;
206                 break;
207 #endif
208 #ifdef FBCON_HAS_CFB16
209         case 15:
210         case 16:
211                 sw = &fbcon_cfb16;
212                 display->dispsw_data = fbcon_cmap.cfb16;
213                 break;
214 #endif
215 #ifdef FBCON_HAS_CFB24
216         case 24:
217                 sw = &fbcon_cfb24;
218                 display->dispsw_data = fbcon_cmap.cfb24;
219                 break;
220 #endif
221 #ifdef FBCON_HAS_CFB32
222         case 32:
223                 sw = &fbcon_cfb32;
224                 display->dispsw_data = fbcon_cmap.cfb32;
225                 break;
226 #endif
227         default:
228 #ifdef FBCON_HAS_MAC
229                 sw = &fbcon_mac;
230                 break;
231 #else
232                 sw = &fbcon_dummy;
233                 return;
234 #endif
235         }
236         memcpy(&vesafb_sw, sw, sizeof(*sw));
237         display->dispsw = &vesafb_sw;
238         if (!ypan) {
239                 display->scrollmode = SCROLL_YREDRAW;
240                 vesafb_sw.bmove = fbcon_redraw_bmove;
241         }
242 }
243
244 static int vesafb_set_var(struct fb_var_screeninfo *var, int con,
245                           struct fb_info *info)
246 {
247         static int first = 1;
248
249         if (var->xres           != vesafb_defined.xres           ||
250             var->yres           != vesafb_defined.yres           ||
251             var->xres_virtual   != vesafb_defined.xres_virtual   ||
252             var->yres_virtual   >  video_height_virtual          ||
253             var->yres_virtual   <  video_height                  ||
254             var->xoffset                                         ||
255             var->bits_per_pixel != vesafb_defined.bits_per_pixel ||
256             var->nonstd) {
257                 if (first) {
258                         printk(KERN_ERR "Vesafb does not support changing the video mode\n");
259                         first = 0;
260                 }
261                 return -EINVAL;
262         }
263
264         if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_TEST)
265                 return 0;
266
267         if (ypan) {
268                 if (vesafb_defined.yres_virtual != var->yres_virtual) {
269                         vesafb_defined.yres_virtual = var->yres_virtual;
270                         if (con != -1) {
271                                 fb_display[con].var = vesafb_defined;
272                                 info->changevar(con);
273                         }
274                 }
275
276                 if (var->yoffset != vesafb_defined.yoffset)
277                         return vesafb_pan_display(var,con,info);
278                 return 0;
279         }
280
281         if (var->yoffset)
282                 return -EINVAL;
283         return 0;
284 }
285
286 static int vesa_getcolreg(unsigned regno, unsigned *red, unsigned *green,
287                           unsigned *blue, unsigned *transp,
288                           struct fb_info *fb_info)
289 {
290         /*
291          *  Read a single color register and split it into colors/transparent.
292          *  Return != 0 for invalid regno.
293          */
294
295         if (regno >= video_cmap_len)
296                 return 1;
297
298         *red   = palette[regno].red;
299         *green = palette[regno].green;
300         *blue  = palette[regno].blue;
301         *transp = 0;
302         return 0;
303 }
304
305 #ifdef FBCON_HAS_CFB8
306
307 static void vesa_setpalette(int regno, unsigned red, unsigned green, unsigned blue)
308 {
309 #ifdef i386
310         struct { u_char blue, green, red, pad; } entry;
311
312 #if defined(__i386__) || defined(__x86_64__)
313         if (pmi_setpal) {
314                 entry.red   = red   >> 10;
315                 entry.green = green >> 10;
316                 entry.blue  = blue  >> 10;
317                 entry.pad   = 0;
318
319                 __asm__ __volatile__(
320                 "call *(%%esi)"
321                 : /* no return value */
322                 : "a" (0x4f09),         /* EAX */
323                   "b" (0),              /* EBX */
324                   "c" (1),              /* ECX */
325                   "d" (regno),          /* EDX */
326                   "D" (&entry),         /* EDI */
327                   "S" (&pmi_pal));      /* ESI */
328         } else
329 #endif /* __i386__ || __x86_64__ */
330         {
331                 /* without protected mode interface, try VGA registers... */
332                 outb_p(regno,       dac_reg);
333                 outb_p(red   >> 10, dac_val);
334                 outb_p(green >> 10, dac_val);
335                 outb_p(blue  >> 10, dac_val);
336         }
337 #endif
338
339 }
340
341 #endif
342
343 static int vesa_setcolreg(unsigned regno, unsigned red, unsigned green,
344                           unsigned blue, unsigned transp,
345                           struct fb_info *fb_info)
346 {
347         /*
348          *  Set a single color register. The values supplied are
349          *  already rounded down to the hardware's capabilities
350          *  (according to the entries in the `var' structure). Return
351          *  != 0 for invalid regno.
352          */
353         
354         if (regno >= video_cmap_len)
355                 return 1;
356
357         palette[regno].red   = red;
358         palette[regno].green = green;
359         palette[regno].blue  = blue;
360         
361         switch (video_bpp) {
362 #ifdef FBCON_HAS_CFB8
363         case 8:
364                 vesa_setpalette(regno,red,green,blue);
365                 break;
366 #endif
367 #ifdef FBCON_HAS_CFB16
368         case 15:
369         case 16:
370                 if (vesafb_defined.red.offset == 10) {
371                         /* 1:5:5:5 */
372                         fbcon_cmap.cfb16[regno] =
373                                 ((red   & 0xf800) >>  1) |
374                                 ((green & 0xf800) >>  6) |
375                                 ((blue  & 0xf800) >> 11);
376                 } else {
377                         /* 0:5:6:5 */
378                         fbcon_cmap.cfb16[regno] =
379                                 ((red   & 0xf800)      ) |
380                                 ((green & 0xfc00) >>  5) |
381                                 ((blue  & 0xf800) >> 11);
382                 }
383                 break;
384 #endif
385 #ifdef FBCON_HAS_CFB24
386         case 24:
387                 red   >>= 8;
388                 green >>= 8;
389                 blue  >>= 8;
390                 fbcon_cmap.cfb24[regno] =
391                         (red   << vesafb_defined.red.offset)   |
392                         (green << vesafb_defined.green.offset) |
393                         (blue  << vesafb_defined.blue.offset);
394                 break;
395 #endif
396 #ifdef FBCON_HAS_CFB32
397         case 32:
398                 red   >>= 8;
399                 green >>= 8;
400                 blue  >>= 8;
401                 fbcon_cmap.cfb32[regno] =
402                         (red   << vesafb_defined.red.offset)   |
403                         (green << vesafb_defined.green.offset) |
404                         (blue  << vesafb_defined.blue.offset);
405                 break;
406 #endif
407     }
408     return 0;
409 }
410
411 static void do_install_cmap(int con, struct fb_info *info)
412 {
413         if (con != currcon)
414                 return;
415         if (fb_display[con].cmap.len)
416                 fb_set_cmap(&fb_display[con].cmap, 1, vesa_setcolreg, info);
417         else
418                 fb_set_cmap(fb_default_cmap(video_cmap_len), 1, vesa_setcolreg,
419                             info);
420 }
421
422 static int vesafb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
423                            struct fb_info *info)
424 {
425         if (con == currcon) /* current console? */
426                 return fb_get_cmap(cmap, kspc, vesa_getcolreg, info);
427         else if (fb_display[con].cmap.len) /* non default colormap? */
428                 fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
429         else
430                 fb_copy_cmap(fb_default_cmap(video_cmap_len),
431                      cmap, kspc ? 0 : 2);
432         return 0;
433 }
434
435 static int vesafb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
436                            struct fb_info *info)
437 {
438         int err;
439
440         if (!fb_display[con].cmap.len) {        /* no colormap allocated? */
441                 err = fb_alloc_cmap(&fb_display[con].cmap,video_cmap_len,0);
442                 if (err)
443                         return err;
444         }
445         if (con == currcon)                     /* current console? */
446                 return fb_set_cmap(cmap, kspc, vesa_setcolreg, info);
447         else
448                 fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
449         return 0;
450 }
451
452 static struct fb_ops vesafb_ops = {
453         owner:          THIS_MODULE,
454         fb_get_fix:     vesafb_get_fix,
455         fb_get_var:     vesafb_get_var,
456         fb_set_var:     vesafb_set_var,
457         fb_get_cmap:    vesafb_get_cmap,
458         fb_set_cmap:    vesafb_set_cmap,
459         fb_pan_display: vesafb_pan_display,
460 };
461
462 int __init vesafb_setup(char *options)
463 {
464         char *this_opt;
465         
466         fb_info.fontname[0] = '\0';
467         
468         if (!options || !*options)
469                 return 0;
470         
471         while ((this_opt = strsep(&options, ",")) != NULL) {
472                 if (!*this_opt) continue;
473                 
474                 if (! strcmp(this_opt, "inverse"))
475                         inverse=1;
476                 else if (! strcmp(this_opt, "redraw"))
477                         ypan=0;
478 #if defined(__i386__) || defined(__x86_64__)
479                 else if (! strcmp(this_opt, "ypan"))
480                         ypan=1;
481                 else if (! strcmp(this_opt, "ywrap"))
482                         ypan=2;
483                 else if (! strcmp(this_opt, "vgapal"))
484                         pmi_setpal=0;
485                 else if (! strcmp(this_opt, "pmipal"))
486                         pmi_setpal=1;
487 #endif /* __i386__ || __x64-64__ */
488 #ifdef CONFIG_MTRR
489                 else if (! strcmp(this_opt, "mtrr"))
490                         mtrr=1;
491 #endif
492                 else if (!strncmp(this_opt, "font:", 5))
493                         strcpy(fb_info.fontname, this_opt+5);
494         }
495         return 0;
496 }
497
498 static int vesafb_switch(int con, struct fb_info *info)
499 {
500         /* Do we have to save the colormap? */
501         if (fb_display[currcon].cmap.len)
502                 fb_get_cmap(&fb_display[currcon].cmap, 1, vesa_getcolreg,
503                             info);
504         
505         currcon = con;
506         /* Install new colormap */
507         do_install_cmap(con, info);
508         vesafb_update_var(con,info);
509         return 1;
510 }
511
512 /* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
513
514 static void vesafb_blank(int blank, struct fb_info *info)
515 {
516         /* Not supported */
517 }
518
519 int __init vesafb_init(void)
520 {
521         int i,j;
522
523         if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
524                 return -ENXIO;
525
526         video_base          = screen_info.lfb_base;
527         video_bpp           = screen_info.lfb_depth;
528         if (15 == video_bpp)
529                 video_bpp = 16;
530         video_width         = screen_info.lfb_width;
531         video_height        = screen_info.lfb_height;
532         video_linelength    = screen_info.lfb_linelength;
533         video_size          = screen_info.lfb_size * 65536;
534         video_visual = (video_bpp == 8) ?
535                 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
536
537 #ifndef __i386__
538         screen_info.vesapm_seg = 0;
539 #endif
540
541         if (!request_mem_region(video_base, video_size, "vesafb")) {
542                 printk(KERN_WARNING
543                        "vesafb: abort, cannot reserve video memory at 0x%lx\n",
544                         video_base);
545                 /* We cannot make this fatal. Sometimes this comes from magic
546                    spaces our resource handlers simply don't know about */
547         }
548
549         video_vbase = ioremap(video_base, video_size);
550         if (!video_vbase) {
551                 release_mem_region(video_base, video_size);
552                 printk(KERN_ERR
553                        "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
554                         video_size, video_base);
555                 return -EIO;
556         }
557
558         printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
559                video_base, video_vbase, video_size/1024);
560         printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
561                video_width, video_height, video_bpp, video_linelength, screen_info.pages);
562
563         vesafb_defined.xres=video_width;
564         vesafb_defined.yres=video_height;
565         vesafb_defined.xres_virtual=video_width;
566         vesafb_defined.yres_virtual=video_size / video_linelength;
567         vesafb_defined.bits_per_pixel=video_bpp;
568
569 #if defined(__i386__) || defined(__x86_64__)
570         if (screen_info.vesapm_seg) {
571                 printk(KERN_INFO "vesafb: protected mode interface info at %04x:%04x\n",
572                        screen_info.vesapm_seg,screen_info.vesapm_off);
573         }
574
575         if (screen_info.vesapm_seg < 0xc000)
576                 ypan = pmi_setpal = 0; /* not available or some DOS TSR ... */
577
578         if (ypan || pmi_setpal) {
579                 pmi_base  = (unsigned short*)bus_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
580                 pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
581                 pmi_pal   = (void*)((char*)pmi_base + pmi_base[2]);
582                 printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
583                 if (pmi_base[3]) {
584                         printk(KERN_INFO "vesafb: pmi: ports = ");
585                                 for (i = pmi_base[3]/2; pmi_base[i] != 0xffff; i++)
586                                         printk("%x ",pmi_base[i]);
587                         printk("\n");
588                         if (pmi_base[i] != 0xffff) {
589                                 /*
590                                  * memory areas not supported (yet?)
591                                  *
592                                  * Rules are: we have to set up a descriptor for the requested
593                                  * memory area and pass it in the ES register to the BIOS function.
594                                  */
595                                 printk(KERN_INFO "vesafb: can't handle memory requests, pmi disabled\n");
596                                 ypan = pmi_setpal = 0;
597                         }
598                 }
599         }
600
601         if (ypan && vesafb_defined.yres_virtual > video_height) {
602                 printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n",
603                        (ypan > 1) ? "ywrap" : "ypan",vesafb_defined.yres_virtual);
604         } else
605 #endif /* __i386__ || __x86-64__ */
606         {
607                 printk(KERN_INFO "vesafb: scrolling: redraw\n");
608                 vesafb_defined.yres_virtual = video_height;
609                 ypan = 0;
610         }
611         video_height_virtual = vesafb_defined.yres_virtual;
612
613         /* some dummy values for timing to make fbset happy */
614         vesafb_defined.pixclock     = 10000000 / video_width * 1000 / video_height;
615         vesafb_defined.left_margin  = (video_width / 8) & 0xf8;
616         vesafb_defined.right_margin = 32;
617         vesafb_defined.upper_margin = 16;
618         vesafb_defined.lower_margin = 4;
619         vesafb_defined.hsync_len    = (video_width / 8) & 0xf8;
620         vesafb_defined.vsync_len    = 4;
621
622         if (video_bpp > 8) {
623                 vesafb_defined.red.offset    = screen_info.red_pos;
624                 vesafb_defined.red.length    = screen_info.red_size;
625                 vesafb_defined.green.offset  = screen_info.green_pos;
626                 vesafb_defined.green.length  = screen_info.green_size;
627                 vesafb_defined.blue.offset   = screen_info.blue_pos;
628                 vesafb_defined.blue.length   = screen_info.blue_size;
629                 vesafb_defined.transp.offset = screen_info.rsvd_pos;
630                 vesafb_defined.transp.length = screen_info.rsvd_size;
631                 printk(KERN_INFO "vesafb: directcolor: "
632                        "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n",
633                        screen_info.rsvd_size,
634                        screen_info.red_size,
635                        screen_info.green_size,
636                        screen_info.blue_size,
637                        screen_info.rsvd_pos,
638                        screen_info.red_pos,
639                        screen_info.green_pos,
640                        screen_info.blue_pos);
641                 video_cmap_len = 16;
642         } else {
643                 vesafb_defined.red.length   = 6;
644                 vesafb_defined.green.length = 6;
645                 vesafb_defined.blue.length  = 6;
646                 for(i = 0; i < 16; i++) {
647                         j = color_table[i];
648                         palette[i].red   = default_red[j];
649                         palette[i].green = default_grn[j];
650                         palette[i].blue  = default_blu[j];
651                 }
652                 video_cmap_len = 256;
653         }
654
655         /* request failure does not faze us, as vgacon probably has this
656          * region already (FIXME) */
657         request_region(0x3c0, 32, "vesafb");
658
659 #ifdef CONFIG_MTRR
660         if (mtrr) {
661                 int temp_size = video_size;
662                 /* Find the largest power-of-two */
663                 while (temp_size & (temp_size - 1))
664                         temp_size &= (temp_size - 1);
665                         
666                 /* Try and find a power of two to add */
667                 while (temp_size && mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
668                         temp_size >>= 1;
669                 }
670         }
671 #endif /* CONFIG_MTRR */
672         
673         strcpy(fb_info.modename, "VESA VGA");
674         fb_info.changevar = NULL;
675         fb_info.node = -1;
676         fb_info.fbops = &vesafb_ops;
677         fb_info.disp=&disp;
678         fb_info.switch_con=&vesafb_switch;
679         fb_info.updatevar=&vesafb_update_var;
680         fb_info.blank=&vesafb_blank;
681         fb_info.flags=FBINFO_FLAG_DEFAULT;
682         vesafb_set_disp(-1);
683
684         if (register_framebuffer(&fb_info)<0)
685                 return -EINVAL;
686
687         printk(KERN_INFO "fb%d: %s frame buffer device\n",
688                GET_FB_IDX(fb_info.node), fb_info.modename);
689         return 0;
690 }
691
692 /*
693  * Overrides for Emacs so that we follow Linus's tabbing style.
694  * ---------------------------------------------------------------------------
695  * Local variables:
696  * c-basic-offset: 8
697  * End:
698  */
699
700 MODULE_LICENSE("GPL");