vserver 1.9.5.x5
[linux-2.6.git] / drivers / video / skeletonfb.c
1 /*
2  * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
3  *
4  *  Modified to new api Jan 2001 by James Simmons (jsimmons@transvirtual.com)
5  *
6  *  Created 28 Dec 1997 by Geert Uytterhoeven
7  *
8  *
9  *  I have started rewriting this driver as a example of the upcoming new API
10  *  The primary goal is to remove the console code from fbdev and place it
11  *  into fbcon.c. This reduces the code and makes writing a new fbdev driver
12  *  easy since the author doesn't need to worry about console internals. It
13  *  also allows the ability to run fbdev without a console/tty system on top 
14  *  of it. 
15  *
16  *  First the roles of struct fb_info and struct display have changed. Struct
17  *  display will go away. The way the the new framebuffer console code will
18  *  work is that it will act to translate data about the tty/console in 
19  *  struct vc_data to data in a device independent way in struct fb_info. Then
20  *  various functions in struct fb_ops will be called to store the device 
21  *  dependent state in the par field in struct fb_info and to change the 
22  *  hardware to that state. This allows a very clean separation of the fbdev
23  *  layer from the console layer. It also allows one to use fbdev on its own
24  *  which is a bounus for embedded devices. The reason this approach works is  
25  *  for each framebuffer device when used as a tty/console device is allocated
26  *  a set of virtual terminals to it. Only one virtual terminal can be active 
27  *  per framebuffer device. We already have all the data we need in struct 
28  *  vc_data so why store a bunch of colormaps and other fbdev specific data
29  *  per virtual terminal. 
30  *
31  *  As you can see doing this makes the con parameter pretty much useless
32  *  for struct fb_ops functions, as it should be. Also having struct  
33  *  fb_var_screeninfo and other data in fb_info pretty much eliminates the 
34  *  need for get_fix and get_var. Once all drivers use the fix, var, and cmap
35  *  fbcon can be written around these fields. This will also eliminate the
36  *  need to regenerate struct fb_var_screeninfo, struct fb_fix_screeninfo
37  *  struct fb_cmap every time get_var, get_fix, get_cmap functions are called
38  *  as many drivers do now. 
39  *
40  *  This file is subject to the terms and conditions of the GNU General Public
41  *  License. See the file COPYING in the main directory of this archive for
42  *  more details.
43  */
44
45 #include <linux/module.h>
46 #include <linux/kernel.h>
47 #include <linux/errno.h>
48 #include <linux/string.h>
49 #include <linux/mm.h>
50 #include <linux/tty.h>
51 #include <linux/slab.h>
52 #include <linux/delay.h>
53 #include <linux/fb.h>
54 #include <linux/init.h>
55
56     /*
57      *  This is just simple sample code.
58      *
59      *  No warranty that it actually compiles.
60      *  Even less warranty that it actually works :-)
61      */
62
63 /*
64  *  If your driver supports multiple boards, you should make the  
65  *  below data types arrays, or allocate them dynamically (using kmalloc()). 
66  */ 
67
68 /* 
69  * This structure defines the hardware state of the graphics card. Normally
70  * you place this in a header file in linux/include/video. This file usually
71  * also includes register information. That allows other driver subsystems
72  * and userland applications the ability to use the same header file to 
73  * avoid duplicate work and easy porting of software. 
74  */
75 struct xxx_par;
76
77 /*
78  * Here we define the default structs fb_fix_screeninfo and fb_var_screeninfo
79  * if we don't use modedb. If we do use modedb see xxxfb_init how to use it
80  * to get a fb_var_screeninfo. Otherwise define a default var as well. 
81  */
82 static struct fb_fix_screeninfo xxxfb_fix __initdata = {
83         .id =           "FB's name", 
84         .type =         FB_TYPE_PACKED_PIXELS,
85         .visual =       FB_VISUAL_PSEUDOCOLOR,
86         .xpanstep =     1,
87         .ypanstep =     1,
88         .ywrapstep =    1, 
89         .accel =        FB_ACCEL_NONE,
90 };
91
92     /*
93      *  Modern graphical hardware not only supports pipelines but some 
94      *  also support multiple monitors where each display can have its  
95      *  its own unique data. In this case each display could be  
96      *  represented by a separate framebuffer device thus a separate 
97      *  struct fb_info. Now the struct xxx_par represents the graphics
98      *  hardware state thus only one exist per card. In this case the 
99      *  struct xxx_par for each graphics card would be shared between 
100      *  every struct fb_info that represents a framebuffer on that card. 
101      *  This allows when one display changes it video resolution (info->var) 
102      *  the other displays know instantly. Each display can always be
103      *  aware of the entire hardware state that affects it because they share
104      *  the same xxx_par struct. The other side of the coin is multiple
105      *  graphics cards that pass data around until it is finally displayed
106      *  on one monitor. Such examples are the voodoo 1 cards and high end
107      *  NUMA graphics servers. For this case we have a bunch of pars, each
108      *  one that represents a graphics state, that belong to one struct 
109      *  fb_info. Their you would want to have *par point to a array of device
110      *  states and have each struct fb_ops function deal with all those 
111      *  states. I hope this covers every possible hardware design. If not
112      *  feel free to send your ideas at jsimmons@users.sf.net 
113      */
114
115     /*
116      *  If your driver supports multiple boards or it supports multiple 
117      *  framebuffers, you should make these arrays, or allocate them 
118      *  dynamically (using kmalloc()). 
119      */ 
120 static struct fb_info info;
121
122     /* 
123      * Each one represents the a state of the hardware. Most hardware have 
124      * just one hardware state. These here represent the default state(s). 
125      */
126 static struct xxx_par __initdata current_par;
127
128 int xxxfb_init(void);
129 int xxxfb_setup(char*);
130
131 /**
132  *      xxxfb_open - Optional function. Called when the framebuffer is
133  *                   first accessed.
134  *      @info: frame buffer structure that represents a single frame buffer
135  *      @user: tell us if the userland (value=1) or the console is accessing
136  *             the framebuffer. 
137  *
138  *      This function is the first function called in the framebuffer api.
139  *      Usually you don't need to provide this function. The case where it 
140  *      is used is to change from a text mode hardware state to a graphics
141  *      mode state. 
142  */
143 static int xxxfb_open(const struct fb_info *info, int user)
144 {
145     return 0;
146 }
147
148 /**
149  *      xxxfb_release - Optional function. Called when the framebuffer 
150  *                      device is closed. 
151  *      @info: frame buffer structure that represents a single frame buffer
152  *      @user: tell us if the userland (value=1) or the console is accessing
153  *             the framebuffer. 
154  *      
155  *      Thus function is called when we close /dev/fb or the framebuffer 
156  *      console system is released. Usually you don't need this function.
157  *      The case where it is usually used is to go from a graphics state
158  *      to a text mode state.
159  */
160 static int xxxfb_release(const struct fb_info *info, int user)
161 {
162     return 0;
163 }
164
165 /**
166  *      xxxfb_check_var - Optional function. Validates a var passed in. 
167  *      @var: frame buffer variable screen structure
168  *      @info: frame buffer structure that represents a single frame buffer 
169  *
170  *      Checks to see if the hardware supports the state requested by
171  *      var passed in. This function does not alter the hardware state!!! 
172  *      This means the data stored in struct fb_info and struct xxx_par do 
173  *      not change. This includes the var inside of struct fb_info. 
174  *      Do NOT change these. This function can be called on its own if we
175  *      intent to only test a mode and not actually set it. The stuff in 
176  *      modedb.c is a example of this. If the var passed in is slightly 
177  *      off by what the hardware can support then we alter the var PASSED in
178  *      to what we can do. If the hardware doesn't support mode change 
179  *      a -EINVAL will be returned by the upper layers. You don't need to 
180  *      implement this function then. If you hardware doesn't support 
181  *      changing the resolution then this function is not needed. In this
182  *      case the driver woudl just provide a var that represents the static
183  *      state the screen is in.
184  *
185  *      Returns negative errno on error, or zero on success.
186  */
187 static int xxxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
188 {
189     const struct xxx_par *par = (const struct xxx_par *) info->par;
190     /* ... */
191     return 0;           
192 }
193
194 /**
195  *      xxxfb_set_par - Optional function. Alters the hardware state.
196  *      @info: frame buffer structure that represents a single frame buffer
197  *
198  *      Using the fb_var_screeninfo in fb_info we set the resolution of the
199  *      this particular framebuffer. This function alters the par AND the
200  *      fb_fix_screeninfo stored in fb_info. It doesn't not alter var in 
201  *      fb_info since we are using that data. This means we depend on the
202  *      data in var inside fb_info to be supported by the hardware. 
203  *      xxxfb_check_var is always called before xxxfb_set_par to ensure this.
204  *      Again if you can't can't the resolution you don't need this function.
205  *
206  */
207 static int xxxfb_set_par(struct fb_info *info)
208 {
209     struct xxx_par *par = (struct xxx_par *) info->par;
210     /* ... */
211     return 0;   
212 }
213
214 /**
215  *      xxxfb_setcolreg - Optional function. Sets a color register.
216  *      @regno: Which register in the CLUT we are programming 
217  *      @red: The red value which can be up to 16 bits wide 
218  *      @green: The green value which can be up to 16 bits wide 
219  *      @blue:  The blue value which can be up to 16 bits wide.
220  *      @transp: If supported the alpha value which can be up to 16 bits wide.  
221  *      @info: frame buffer info structure
222  * 
223  *      Set a single color register. The values supplied have a 16 bit
224  *      magnitude which needs to be scaled in this function for the hardware. 
225  *      Things to take into consideration are how many color registers, if
226  *      any, are supported with the current color visual. With truecolor mode
227  *      no color palettes are supported. Here a psuedo palette is created 
228  *      which we store the value in pseudo_palette in struct fb_info. For
229  *      pseudocolor mode we have a limited color palette. To deal with this
230  *      we can program what color is displayed for a particular pixel value.
231  *      DirectColor is similar in that we can program each color field. If
232  *      we have a static colormap we don't need to implement this function. 
233  * 
234  *      Returns negative errno on error, or zero on success.
235  */
236 static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
237                            unsigned blue, unsigned transp,
238                            const struct fb_info *info)
239 {
240     if (regno >= 256)  /* no. of hw registers */
241        return 1;
242     /*
243      * Program hardware... do anything you want with transp
244      */
245
246     /* grayscale works only partially under directcolor */
247     if (info->var.grayscale) {
248        /* grayscale = 0.30*R + 0.59*G + 0.11*B */
249        red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
250     }
251
252     /* Directcolor:
253      *   var->{color}.offset contains start of bitfield
254      *   var->{color}.length contains length of bitfield
255      *   {hardwarespecific} contains width of DAC
256      *   cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
257      *   RAMDAC[X] is programmed to (red, green, blue)
258      *
259      * Pseudocolor:
260      *    uses offset = 0 && length = DAC register width.
261      *    var->{color}.offset is 0
262      *    var->{color}.length contains widht of DAC
263      *    cmap is not used
264      *    DAC[X] is programmed to (red, green, blue)
265      * Truecolor:
266      *    does not use RAMDAC (usually has 3 of them).
267      *    var->{color}.offset contains start of bitfield
268      *    var->{color}.length contains length of bitfield
269      *    cmap is programmed to (red << red.offset) | (green << green.offset) |
270      *                      (blue << blue.offset) | (transp << transp.offset)
271      *    RAMDAC does not exist
272      */
273 #define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16)
274     switch (info->fix.visual) {
275        case FB_VISUAL_TRUECOLOR:
276        case FB_VISUAL_PSEUDOCOLOR:
277                red = CNVT_TOHW(red, info->var.red.length);
278                green = CNVT_TOHW(green, info->var.green.length);
279                blue = CNVT_TOHW(blue, info->var.blue.length);
280                transp = CNVT_TOHW(transp, info->var.transp.length);
281                break;
282        case FB_VISUAL_DIRECTCOLOR:
283                /* example here assumes 8 bit DAC. Might be different 
284                 * for your hardware */  
285                red = CNVT_TOHW(red, 8);       
286                green = CNVT_TOHW(green, 8);
287                blue = CNVT_TOHW(blue, 8);
288                /* hey, there is bug in transp handling... */
289                transp = CNVT_TOHW(transp, 8);
290                break;
291     }
292 #undef CNVT_TOHW
293     /* Truecolor has hardware independent palette */
294     if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
295        u32 v;
296
297        if (regno >= 16)
298            return 1;
299
300        v = (red << info->var.red.offset) |
301            (green << info->var.green.offset) |
302            (blue << info->var.blue.offset) |
303            (transp << info->var.transp.offset);
304
305        switch (info->var.bits_per_pixel) {
306                 case 8:
307                         /* Yes some hand held devices have this. */ 
308                         ((u8*)(info->pseudo_palette))[regno] = v;
309                         break;  
310                 case 16:
311                         ((u16*)(info->pseudo_palette))[regno] = v;
312                         break;
313                 case 24:
314                 case 32:        
315                         ((u32*)(info->pseudo_palette))[regno] = v;
316                         break;
317        }
318        return 0;
319     }
320     /* ... */
321     return 0;
322 }
323
324 /**
325  *      xxxfb_pan_display - NOT a required function. Pans the display.
326  *      @var: frame buffer variable screen structure
327  *      @info: frame buffer structure that represents a single frame buffer
328  *
329  *      Pan (or wrap, depending on the `vmode' field) the display using the
330  *      `xoffset' and `yoffset' fields of the `var' structure.
331  *      If the values don't fit, return -EINVAL.
332  *
333  *      Returns negative errno on error, or zero on success.
334  */
335 static int xxxfb_pan_display(struct fb_var_screeninfo *var,
336                              const struct fb_info *info)
337 {
338     /* ... */
339     return 0;
340 }
341
342 /**
343  *      xxxfb_blank - NOT a required function. Blanks the display.
344  *      @blank_mode: the blank mode we want. 
345  *      @info: frame buffer structure that represents a single frame buffer
346  *
347  *      Blank the screen if blank_mode != 0, else unblank. Return 0 if
348  *      blanking succeeded, != 0 if un-/blanking failed due to e.g. a 
349  *      video mode which doesn't support it. Implements VESA suspend
350  *      and powerdown modes on hardware that supports disabling hsync/vsync:
351  *      blank_mode == 2: suspend vsync
352  *      blank_mode == 3: suspend hsync
353  *      blank_mode == 4: powerdown
354  *
355  *      Returns negative errno on error, or zero on success.
356  *
357  */
358 static int xxxfb_blank(int blank_mode, const struct fb_info *info)
359 {
360     /* ... */
361     return 0;
362 }
363
364 /* ------------ Accelerated Functions --------------------- */
365
366 /*
367  * We provide our own functions if we have hardware acceleration
368  * or non packed pixel format layouts. If we have no hardware 
369  * acceleration, we can use a generic unaccelerated function. If using
370  * a pack pixel format just use the functions in cfb_*.c. Each file 
371  * has one of the three different accel functions we support.
372  */
373
374 /**
375  *      xxxfb_fillrect - REQUIRED function. Can use generic routines if 
376  *                       non acclerated hardware and packed pixel based.
377  *                       Draws a rectangle on the screen.               
378  *
379  *      @info: frame buffer structure that represents a single frame buffer
380  *      @region: The structure representing the rectangular region we 
381  *               wish to draw to.
382  *
383  *      This drawing operation places/removes a retangle on the screen 
384  *      depending on the rastering operation with the value of color which
385  *      is in the current color depth format.
386  */
387 void xxfb_fillrect(struct fb_info *p, const struct fb_fillrect *region)
388 {
389 /*      Meaning of struct fb_fillrect
390  *
391  *      @dx: The x and y corrdinates of the upper left hand corner of the 
392  *      @dy: area we want to draw to. 
393  *      @width: How wide the rectangle is we want to draw.
394  *      @height: How tall the rectangle is we want to draw.
395  *      @color: The color to fill in the rectangle with. 
396  *      @rop: The raster operation. We can draw the rectangle with a COPY
397  *            of XOR which provides erasing effect. 
398  */
399 }
400
401 /**
402  *      xxxfb_copyarea - REQUIRED function. Can use generic routines if
403  *                       non acclerated hardware and packed pixel based.
404  *                       Copies one area of the screen to another area.
405  *
406  *      @info: frame buffer structure that represents a single frame buffer
407  *      @area: Structure providing the data to copy the framebuffer contents
408  *             from one region to another.
409  *
410  *      This drawing operation copies a rectangular area from one area of the
411  *      screen to another area.
412  */
413 void xxxfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) 
414 {
415 /*
416  *      @dx: The x and y coordinates of the upper left hand corner of the
417  *      @dy: destination area on the screen.
418  *      @width: How wide the rectangle is we want to copy.
419  *      @height: How tall the rectangle is we want to copy.
420  *      @sx: The x and y coordinates of the upper left hand corner of the
421  *      @sy: source area on the screen.
422  */
423 }
424
425
426 /**
427  *      xxxfb_imageblit - REQUIRED function. Can use generic routines if
428  *                        non acclerated hardware and packed pixel based.
429  *                        Copies a image from system memory to the screen. 
430  *
431  *      @info: frame buffer structure that represents a single frame buffer
432  *      @image: structure defining the image.
433  *
434  *      This drawing operation draws a image on the screen. It can be a 
435  *      mono image (needed for font handling) or a color image (needed for
436  *      tux). 
437  */
438 void xxxfb_imageblit(struct fb_info *p, const struct fb_image *image) 
439 {
440 /*
441  *      @dx: The x and y coordinates of the upper left hand corner of the
442  *      @dy: destination area to place the image on the screen.
443  *      @width: How wide the image is we want to copy.
444  *      @height: How tall the image is we want to copy.
445  *      @fg_color: For mono bitmap images this is color data for     
446  *      @bg_color: the foreground and background of the image to
447  *                 write directly to the frmaebuffer.
448  *      @depth: How many bits represent a single pixel for this image.
449  *      @data: The actual data used to construct the image on the display.
450  *      @cmap: The colormap used for color images.   
451  */
452 }
453
454 /**
455  *      xxxfb_cursor -  REQUIRED function. If your hardware lacks support
456  *                      for a cursor you can use the default cursor whose
457  *                      function is called soft_cursor. It will always 
458  *                      work since it uses xxxfb_imageblit function which 
459  *                      is required.             
460  *
461  *      @info: frame buffer structure that represents a single frame buffer
462  *      @cursor: structure defining the cursor to draw.
463  *
464  *      This operation is used to set or alter the properities of the
465  *      cursor.
466  *
467  *      Returns negative errno on error, or zero on success.
468  */
469 int xxxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
470 {
471 /*
472  *      @set:   Which fields we are altering in struct fb_cursor 
473  *      @enable: Disable or enable the cursor 
474  *      @rop:   The bit operation we want to do. 
475  *      @mask:  This is the cursor mask bitmap. 
476  *      @dest:  A image of the area we are going to display the cursor.
477  *              Used internally by the driver.   
478  *      @hot:   The hot spot. 
479  *      @image: The actual data for the cursor image.
480  *
481  *      NOTES ON FLAGS (cursor->set):
482  *
483  *      FB_CUR_SETIMAGE - the cursor image has changed (cursor->image.data)
484  *      FB_CUR_SETPOS   - the cursor position has changed (cursor->image.dx|dy)
485  *      FB_CUR_SETHOT   - the cursor hot spot has changed (cursor->hot.dx|dy)
486  *      FB_CUR_SETCMAP  - the cursor colors has changed (cursor->fg_color|bg_color)
487  *      FB_CUR_SETSHAPE - the cursor bitmask has changed (cursor->mask)
488  *      FB_CUR_SETSIZE  - the cursor size has changed (cursor->width|height)
489  *      FB_CUR_SETALL   - everything has changed
490  *
491  *      NOTES ON ROPs (cursor->rop, Raster Operation)
492  *
493  *      ROP_XOR         - cursor->image.data XOR cursor->mask
494  *      ROP_COPY        - curosr->image.data AND cursor->mask
495  *
496  *      OTHER NOTES:
497  *
498  *      - fbcon only supports a 2-color cursor (cursor->image.depth = 1)
499  *      - The fb_cursor structure, @cursor, _will_ always contain valid
500  *        fields, whether any particular bitfields in cursor->set is set
501  *        or not.
502  */
503 }
504
505 /**
506  *      xxxfb_rotate -  NOT a required function. If your hardware
507  *                      supports rotation the whole screen then 
508  *                      you would provide a hook for this. 
509  *
510  *      @info: frame buffer structure that represents a single frame buffer
511  *      @angle: The angle we rotate the screen.   
512  *
513  *      This operation is used to set or alter the properities of the
514  *      cursor.
515  */
516 void xxxfb_rotate(struct fb_info *info, int angle)
517 {
518 }
519
520 /**
521  *      xxxfb_poll - NOT a required function. The purpose of this
522  *                   function is to provide a way for some process
523  *                   to wait until a specific hardware event occurs
524  *                   for the framebuffer device.
525  *                               
526  *      @info: frame buffer structure that represents a single frame buffer
527  *      @wait: poll table where we store process that await a event.     
528  */
529 void xxxfb_poll(struct fb_info *info, poll_table *wait)
530 {
531 }
532
533 /**
534  *      xxxfb_sync - NOT a required function. Normally the accel engine 
535  *                   for a graphics card take a specific amount of time.
536  *                   Often we have to wait for the accelerator to finish
537  *                   its operation before we can write to the framebuffer
538  *                   so we can have consistent display output. 
539  *
540  *      @info: frame buffer structure that represents a single frame buffer
541  */
542 void xxxfb_sync(struct fb_info *info)
543 {
544 }
545
546     /*
547      *  Initialization
548      */
549
550 int __init xxxfb_init(void)
551 {
552     int cmap_len, retval;       
553    
554     /*
555      *  For kernel boot options (in 'video=xxxfb:<options>' format)
556      */
557 #ifndef MODULE
558     char *option = NULL;
559
560     if (fb_get_options("xxxfb", &option))
561             return -ENODEV;
562     xxxfb_setup(option);
563 #endif
564
565     /* 
566      * Here we set the screen_base to the vitrual memory address
567      * for the framebuffer. Usually we obtain the resource address
568      * from the bus layer and then translate it to virtual memory
569      * space via ioremap. Consult ioport.h. 
570      */
571     info.screen_base = framebuffer_virtual_memory;      
572     info.fbops = &xxxfb_ops;
573     info.fix = xxxfb_fix;
574     info.pseudo_palette = pseudo_palette;
575
576     /*
577      * Set up flags to indicate what sort of acceleration your
578      * driver can provide (pan/wrap/copyarea/etc.) and whether it
579      * is a module -- see FBINFO_* in include/linux/fb.h
580      */
581     info.flags = FBINFO_DEFAULT;
582     info.par = current_par;
583
584     /*
585      * This should give a reasonable default video mode. The following is
586      * done when we can set a video mode. 
587      */
588     if (!mode_option)
589         mode_option = "640x480@60";             
590
591     retval = fb_find_mode(&info.var, &info, mode_option, NULL, 0, NULL, 8);
592   
593     if (!retval || retval == 4)
594         return -EINVAL;                 
595
596     /* This has to been done !!! */     
597     fb_alloc_cmap(&info.cmap, cmap_len, 0);
598         
599     /* 
600      * The following is done in the case of having hardware with a static 
601      * mode. If we are setting the mode ourselves we don't call this. 
602      */ 
603     info.var = xxxfb_var;
604         
605     if (register_framebuffer(&info) < 0)
606         return -EINVAL;
607     printk(KERN_INFO "fb%d: %s frame buffer device\n", info.node,
608            info.fix.id);
609     return 0;
610 }
611
612     /*
613      *  Cleanup
614      */
615
616 static void __exit xxxfb_cleanup(void)
617 {
618     /*
619      *  If your driver supports multiple boards, you should unregister and
620      *  clean up all instances.
621      */
622
623     unregister_framebuffer(info);
624     /* ... */
625 }
626
627     /*
628      *  Setup
629      */
630
631 /* 
632  * Only necessary if your driver takes special options,
633  * otherwise we fall back on the generic fb_setup().
634  */
635 int __init xxxfb_setup(char *options)
636 {
637     /* Parse user speficied options (`video=xxxfb:') */
638 }
639
640 /* ------------------------------------------------------------------------- */
641
642     /*
643      *  Frame buffer operations
644      */
645
646 static struct fb_ops xxxfb_ops = {
647         .owner          = THIS_MODULE,
648         .fb_open        = xxxfb_open,
649         .fb_read        = xxxfb_read,
650         .fb_write       = xxxfb_write,
651         .fb_release     = xxxfb_release,
652         .fb_check_var   = xxxfb_check_var,
653         .fb_set_par     = xxxfb_set_par,        
654         .fb_setcolreg   = xxxfb_setcolreg,
655         .fb_blank       = xxxfb_blank,
656         .fb_pan_display = xxxfb_pan_display,    
657         .fb_fillrect    = xxxfb_fillrect,       /* Needed !!! */ 
658         .fb_copyarea    = xxxfb_copyarea,       /* Needed !!! */ 
659         .fb_imageblit   = xxxfb_imageblit,      /* Needed !!! */
660         .fb_cursor      = xxxfb_cursor,         /* Needed !!! */
661         .fb_rotate      = xxxfb_rotate,
662         .fb_poll        = xxxfb_poll,
663         .fb_sync        = xxxfb_sync,
664         .fb_ioctl       = xxxfb_ioctl,
665         .fb_mmap        = xxxfb_mmap,   
666 };
667
668 /* ------------------------------------------------------------------------- */
669
670
671     /*
672      *  Modularization
673      */
674
675 module_init(xxxfb_init);
676 module_exit(xxxfb_cleanup);
677
678 MODULE_LICENSE("GPL");