Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

fb.h

Go to the documentation of this file.
00001 /***********************************/
00002 /* copied from linux kernel 2.6.28 */
00003 /*  - kernel specific code removed */
00004 /*  - types changed                */
00005 /***********************************/
00006 
00007 #ifndef _LINUX_FB_H
00008 #define _LINUX_FB_H
00009 
00010 //#include <asm/types.h>
00011 //#include <linux/i2c.h>
00012 
00013 //struct dentry;
00014 
00015 /* Definitions of frame buffers                     */
00016 
00017 #define FB_MAX          32  /* sufficient for now */
00018 
00019 /* ioctls
00020    0x46 is 'F'                              */
00021 #define FBIOGET_VSCREENINFO 0x4600
00022 #define FBIOPUT_VSCREENINFO 0x4601
00023 #define FBIOGET_FSCREENINFO 0x4602
00024 #define FBIOGETCMAP     0x4604
00025 #define FBIOPUTCMAP     0x4605
00026 #define FBIOPAN_DISPLAY     0x4606
00027 #define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
00028 /* 0x4607-0x460B are defined below */
00029 /* #define FBIOGET_MONITORSPEC  0x460C */
00030 /* #define FBIOPUT_MONITORSPEC  0x460D */
00031 /* #define FBIOSWITCH_MONIBIT   0x460E */
00032 #define FBIOGET_CON2FBMAP   0x460F
00033 #define FBIOPUT_CON2FBMAP   0x4610
00034 #define FBIOBLANK       0x4611      /* arg: 0 or vesa level + 1 */
00035 #define FBIOGET_VBLANK      _IOR('F', 0x12, struct fb_vblank)
00036 #define FBIO_ALLOC              0x4613
00037 #define FBIO_FREE               0x4614
00038 #define FBIOGET_GLYPH           0x4615
00039 #define FBIOGET_HWCINFO         0x4616
00040 #define FBIOPUT_MODEINFO        0x4617
00041 #define FBIOGET_DISPINFO        0x4618
00042 
00043 
00044 #define FB_TYPE_PACKED_PIXELS       0   /* Packed Pixels    */
00045 #define FB_TYPE_PLANES          1   /* Non interleaved planes */
00046 #define FB_TYPE_INTERLEAVED_PLANES  2   /* Interleaved planes   */
00047 #define FB_TYPE_TEXT            3   /* Text/attributes  */
00048 #define FB_TYPE_VGA_PLANES      4   /* EGA/VGA planes   */
00049 
00050 #define FB_AUX_TEXT_MDA     0   /* Monochrome text */
00051 #define FB_AUX_TEXT_CGA     1   /* CGA/EGA/VGA Color text */
00052 #define FB_AUX_TEXT_S3_MMIO 2   /* S3 MMIO fasttext */
00053 #define FB_AUX_TEXT_MGA_STEP16  3   /* MGA Millenium I: text, attr, 14 reserved bytes */
00054 #define FB_AUX_TEXT_MGA_STEP8   4   /* other MGAs:      text, attr,  6 reserved bytes */
00055 #define FB_AUX_TEXT_SVGA_GROUP  8   /* 8-15: SVGA tileblit compatible modes */
00056 #define FB_AUX_TEXT_SVGA_MASK   7   /* lower three bits says step */
00057 #define FB_AUX_TEXT_SVGA_STEP2  8   /* SVGA text mode:  text, attr */
00058 #define FB_AUX_TEXT_SVGA_STEP4  9   /* SVGA text mode:  text, attr,  2 reserved bytes */
00059 #define FB_AUX_TEXT_SVGA_STEP8  10  /* SVGA text mode:  text, attr,  6 reserved bytes */
00060 #define FB_AUX_TEXT_SVGA_STEP16 11  /* SVGA text mode:  text, attr, 14 reserved bytes */
00061 #define FB_AUX_TEXT_SVGA_LAST   15  /* reserved up to 15 */
00062 
00063 #define FB_AUX_VGA_PLANES_VGA4      0   /* 16 color planes (EGA/VGA) */
00064 #define FB_AUX_VGA_PLANES_CFB4      1   /* CFB4 in planes (VGA) */
00065 #define FB_AUX_VGA_PLANES_CFB8      2   /* CFB8 in planes (VGA) */
00066 
00067 #define FB_VISUAL_MONO01        0   /* Monochr. 1=Black 0=White */
00068 #define FB_VISUAL_MONO10        1   /* Monochr. 1=White 0=Black */
00069 #define FB_VISUAL_TRUECOLOR     2   /* True color   */
00070 #define FB_VISUAL_PSEUDOCOLOR       3   /* Pseudo color (like atari) */
00071 #define FB_VISUAL_DIRECTCOLOR       4   /* Direct color */
00072 #define FB_VISUAL_STATIC_PSEUDOCOLOR    5   /* Pseudo color readonly */
00073 
00074 #define FB_ACCEL_NONE       0   /* no hardware accelerator  */
00075 #define FB_ACCEL_ATARIBLITT 1   /* Atari Blitter        */
00076 #define FB_ACCEL_AMIGABLITT 2   /* Amiga Blitter                */
00077 #define FB_ACCEL_S3_TRIO64  3   /* Cybervision64 (S3 Trio64)    */
00078 #define FB_ACCEL_NCR_77C32BLT   4   /* RetinaZ3 (NCR 77C32BLT)      */
00079 #define FB_ACCEL_S3_VIRGE   5   /* Cybervision64/3D (S3 ViRGE)  */
00080 #define FB_ACCEL_ATI_MACH64GX   6   /* ATI Mach 64GX family     */
00081 #define FB_ACCEL_DEC_TGA    7   /* DEC 21030 TGA        */
00082 #define FB_ACCEL_ATI_MACH64CT   8   /* ATI Mach 64CT family     */
00083 #define FB_ACCEL_ATI_MACH64VT   9   /* ATI Mach 64CT family VT class */
00084 #define FB_ACCEL_ATI_MACH64GT   10  /* ATI Mach 64CT family GT class */
00085 #define FB_ACCEL_SUN_CREATOR    11  /* Sun Creator/Creator3D    */
00086 #define FB_ACCEL_SUN_CGSIX  12  /* Sun cg6          */
00087 #define FB_ACCEL_SUN_LEO    13  /* Sun leo/zx           */
00088 #define FB_ACCEL_IMS_TWINTURBO  14  /* IMS Twin Turbo       */
00089 #define FB_ACCEL_3DLABS_PERMEDIA2 15    /* 3Dlabs Permedia 2        */
00090 #define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium)  */
00091 #define FB_ACCEL_MATROX_MGA1064SG 17    /* Matrox MGA1064SG (Mystique)  */
00092 #define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
00093 #define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
00094 #define FB_ACCEL_MATROX_MGAG100 20  /* Matrox G100 (Productiva G100) */
00095 #define FB_ACCEL_MATROX_MGAG200 21  /* Matrox G200 (Myst, Mill, ...) */
00096 #define FB_ACCEL_SUN_CG14   22  /* Sun cgfourteen        */
00097 #define FB_ACCEL_SUN_BWTWO  23  /* Sun bwtwo            */
00098 #define FB_ACCEL_SUN_CGTHREE    24  /* Sun cgthree          */
00099 #define FB_ACCEL_SUN_TCX    25  /* Sun tcx          */
00100 #define FB_ACCEL_MATROX_MGAG400 26  /* Matrox G400          */
00101 #define FB_ACCEL_NV3        27  /* nVidia RIVA 128              */
00102 #define FB_ACCEL_NV4        28  /* nVidia RIVA TNT      */
00103 #define FB_ACCEL_NV5        29  /* nVidia RIVA TNT2     */
00104 #define FB_ACCEL_CT_6555x   30  /* C&T 6555x            */
00105 #define FB_ACCEL_3DFX_BANSHEE   31  /* 3Dfx Banshee         */
00106 #define FB_ACCEL_ATI_RAGE128    32  /* ATI Rage128 family       */
00107 #define FB_ACCEL_IGS_CYBER2000  33  /* CyberPro 2000        */
00108 #define FB_ACCEL_IGS_CYBER2010  34  /* CyberPro 2010        */
00109 #define FB_ACCEL_IGS_CYBER5000  35  /* CyberPro 5000        */
00110 #define FB_ACCEL_SIS_GLAMOUR    36  /* SiS 300/630/540              */
00111 #define FB_ACCEL_3DLABS_PERMEDIA3 37    /* 3Dlabs Permedia 3        */
00112 #define FB_ACCEL_ATI_RADEON 38  /* ATI Radeon family        */
00113 #define FB_ACCEL_I810           39      /* Intel 810/815                */
00114 #define FB_ACCEL_SIS_GLAMOUR_2  40  /* SiS 315, 650, 740        */
00115 #define FB_ACCEL_SIS_XABRE      41  /* SiS 330 ("Xabre")        */
00116 #define FB_ACCEL_I830           42      /* Intel 830M/845G/85x/865G     */
00117 #define FB_ACCEL_NV_10          43      /* nVidia Arch 10               */
00118 #define FB_ACCEL_NV_20          44      /* nVidia Arch 20               */
00119 #define FB_ACCEL_NV_30          45      /* nVidia Arch 30               */
00120 #define FB_ACCEL_NV_40          46      /* nVidia Arch 40               */
00121 #define FB_ACCEL_XGI_VOLARI_V   47  /* XGI Volari V3XT, V5, V8      */
00122 #define FB_ACCEL_XGI_VOLARI_Z   48  /* XGI Volari Z7                */
00123 #define FB_ACCEL_OMAP1610   49  /* TI OMAP16xx                  */
00124 #define FB_ACCEL_TRIDENT_TGUI   50  /* Trident TGUI         */
00125 #define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage      */
00126 #define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D      */
00127 #define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP      */
00128 #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070              */
00129 #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090              */
00130 #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093              */
00131 #define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097              */
00132 #define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160              */
00133 #define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200              */
00134 #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230              */
00135 #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360              */
00136 #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380              */
00137 
00138 #define FB_ACCEL_SAVAGE4        0x80    /* S3 Savage4                   */
00139 #define FB_ACCEL_SAVAGE3D       0x81    /* S3 Savage3D                  */
00140 #define FB_ACCEL_SAVAGE3D_MV    0x82    /* S3 Savage3D-MV               */
00141 #define FB_ACCEL_SAVAGE2000     0x83    /* S3 Savage2000                */
00142 #define FB_ACCEL_SAVAGE_MX_MV   0x84    /* S3 Savage/MX-MV              */
00143 #define FB_ACCEL_SAVAGE_MX      0x85    /* S3 Savage/MX                 */
00144 #define FB_ACCEL_SAVAGE_IX_MV   0x86    /* S3 Savage/IX-MV              */
00145 #define FB_ACCEL_SAVAGE_IX      0x87    /* S3 Savage/IX                 */
00146 #define FB_ACCEL_PROSAVAGE_PM   0x88    /* S3 ProSavage PM133           */
00147 #define FB_ACCEL_PROSAVAGE_KM   0x89    /* S3 ProSavage KM133           */
00148 #define FB_ACCEL_S3TWISTER_P    0x8a    /* S3 Twister                   */
00149 #define FB_ACCEL_S3TWISTER_K    0x8b    /* S3 TwisterK                  */
00150 #define FB_ACCEL_SUPERSAVAGE    0x8c    /* S3 Supersavage               */
00151 #define FB_ACCEL_PROSAVAGE_DDR  0x8d    /* S3 ProSavage DDR             */
00152 #define FB_ACCEL_PROSAVAGE_DDRK 0x8e    /* S3 ProSavage DDR-K           */
00153 
00154 struct fb_fix_screeninfo {
00155     char id[16];            /* identification string eg "TT Builtin" */
00156     unsigned long smem_start;   /* Start of frame buffer mem */
00157                     /* (physical address) */
00158     unsigned int smem_len;          /* Length of frame buffer mem */
00159     unsigned int type;          /* see FB_TYPE_*        */
00160     unsigned int type_aux;          /* Interleave for interleaved Planes */
00161     unsigned int visual;            /* see FB_VISUAL_*      */
00162     unsigned short int xpanstep;            /* zero if no hardware panning  */
00163     unsigned short int ypanstep;            /* zero if no hardware panning  */
00164     unsigned short int ywrapstep;       /* zero if no hardware ywrap    */
00165     unsigned int line_length;       /* length of a line in bytes    */
00166     unsigned long mmio_start;   /* Start of Memory Mapped I/O   */
00167                     /* (physical address) */
00168     unsigned int mmio_len;          /* Length of Memory Mapped I/O  */
00169     unsigned int accel;         /* Indicate to driver which */
00170                     /*  specific chip/card we have  */
00171     unsigned short int reserved[3];     /* Reserved for future compatibility */
00172 };
00173 
00174 /* Interpretation of offset for color fields: All offsets are from the right,
00175  * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
00176  * can use the offset as right argument to <<). A pixel afterwards is a bit
00177  * stream and is written to video memory as that unmodified. This implies
00178  * big-endian byte order if bits_per_pixel is greater than 8.
00179  */
00180 struct fb_bitfield {
00181     unsigned int offset;            /* beginning of bitfield    */
00182     unsigned int length;            /* length of bitfield       */
00183     unsigned int msb_right;     /* != 0 : Most significant bit is */
00184                     /* right */
00185 };
00186 
00187 #define FB_NONSTD_HAM       1   /* Hold-And-Modify (HAM)        */
00188 #define FB_NONSTD_REV_PIX_IN_B  2   /* order of pixels in each byte is reversed */
00189 
00190 #define FB_ACTIVATE_NOW     0   /* set values immediately (or vbl)*/
00191 #define FB_ACTIVATE_NXTOPEN 1   /* activate on next open    */
00192 #define FB_ACTIVATE_TEST    2   /* don't set, round up impossible */
00193 #define FB_ACTIVATE_MASK       15
00194                     /* values           */
00195 #define FB_ACTIVATE_VBL        16   /* activate values on next vbl  */
00196 #define FB_CHANGE_CMAP_VBL     32   /* change colormap on vbl   */
00197 #define FB_ACTIVATE_ALL        64   /* change all VCs on this fb    */
00198 #define FB_ACTIVATE_FORCE     128   /* force apply even when no change*/
00199 #define FB_ACTIVATE_INV_MODE  256       /* invalidate videomode */
00200 
00201 #define FB_ACCELF_TEXT      1   /* (OBSOLETE) see fb_info.flags and vc_mode */
00202 
00203 #define FB_SYNC_HOR_HIGH_ACT    1   /* horizontal sync high active  */
00204 #define FB_SYNC_VERT_HIGH_ACT   2   /* vertical sync high active    */
00205 #define FB_SYNC_EXT     4   /* external sync        */
00206 #define FB_SYNC_COMP_HIGH_ACT   8   /* composite sync high active   */
00207 #define FB_SYNC_BROADCAST   16  /* broadcast video timings      */
00208                     /* vtotal = 144d/288n/576i => PAL  */
00209                     /* vtotal = 121d/242n/484i => NTSC */
00210 #define FB_SYNC_ON_GREEN    32  /* sync on green */
00211 
00212 #define FB_VMODE_NONINTERLACED  0   /* non interlaced */
00213 #define FB_VMODE_INTERLACED 1   /* interlaced   */
00214 #define FB_VMODE_DOUBLE     2   /* double scan */
00215 #define FB_VMODE_ODD_FLD_FIRST  4   /* interlaced: top line first */
00216 #define FB_VMODE_MASK       255
00217 
00218 #define FB_VMODE_YWRAP      256 /* ywrap instead of panning     */
00219 #define FB_VMODE_SMOOTH_XPAN    512 /* smooth xpan possible (internally used) */
00220 #define FB_VMODE_CONUPDATE  512 /* don't update x/yoffset   */
00221 
00222 /*
00223  * Display rotation support
00224  */
00225 #define FB_ROTATE_UR      0
00226 #define FB_ROTATE_CW      1
00227 #define FB_ROTATE_UD      2
00228 #define FB_ROTATE_CCW     3
00229 
00230 #define PICOS2KHZ(a) (1000000000UL/(a))
00231 #define KHZ2PICOS(a) (1000000000UL/(a))
00232 
00233 struct fb_var_screeninfo {
00234     unsigned int xres;          /* visible resolution       */
00235     unsigned int yres;
00236     unsigned int xres_virtual;      /* virtual resolution       */
00237     unsigned int yres_virtual;
00238     unsigned int xoffset;           /* offset from virtual to visible */
00239     unsigned int yoffset;           /* resolution           */
00240 
00241     unsigned int bits_per_pixel;        /* guess what           */
00242     unsigned int grayscale;     /* != 0 Graylevels instead of colors */
00243 
00244     struct fb_bitfield red;     /* bitfield in fb mem if true color, */
00245     struct fb_bitfield green;   /* else only length is significant */
00246     struct fb_bitfield blue;
00247     struct fb_bitfield transp;  /* transparency         */
00248 
00249     unsigned int nonstd;            /* != 0 Non standard pixel format */
00250 
00251     unsigned int activate;          /* see FB_ACTIVATE_*        */
00252 
00253     unsigned int height;            /* height of picture in mm    */
00254     unsigned int width;         /* width of picture in mm     */
00255 
00256     unsigned int accel_flags;       /* (OBSOLETE) see fb_info.flags */
00257 
00258     /* Timing: All values in pixclocks, except pixclock (of course) */
00259     unsigned int pixclock;          /* pixel clock in ps (pico seconds) */
00260     unsigned int left_margin;       /* time from sync to picture    */
00261     unsigned int right_margin;      /* time from picture to sync    */
00262     unsigned int upper_margin;      /* time from sync to picture    */
00263     unsigned int lower_margin;
00264     unsigned int hsync_len;     /* length of horizontal sync    */
00265     unsigned int vsync_len;     /* length of vertical sync  */
00266     unsigned int sync;          /* see FB_SYNC_*        */
00267     unsigned int vmode;         /* see FB_VMODE_*       */
00268     unsigned int rotate;            /* angle we rotate counter clockwise */
00269     unsigned int reserved[5];       /* Reserved for future compatibility */
00270 };
00271 
00272 struct fb_cmap {
00273     unsigned int start;         /* First entry  */
00274     unsigned int len;           /* Number of entries */
00275     unsigned short int *red;            /* Red values   */
00276     unsigned short int *green;
00277     unsigned short int *blue;
00278     unsigned short int *transp;         /* transparency, can be NULL */
00279 };
00280 
00281 struct fb_con2fbmap {
00282     unsigned int console;
00283     unsigned int framebuffer;
00284 };
00285 
00286 /* VESA Blanking Levels */
00287 #define VESA_NO_BLANKING        0
00288 #define VESA_VSYNC_SUSPEND      1
00289 #define VESA_HSYNC_SUSPEND      2
00290 #define VESA_POWERDOWN          3
00291 
00292 
00293 enum {
00294     /* screen: unblanked, hsync: on,  vsync: on */
00295     FB_BLANK_UNBLANK       = VESA_NO_BLANKING,
00296 
00297     /* screen: blanked,   hsync: on,  vsync: on */
00298     FB_BLANK_NORMAL        = VESA_NO_BLANKING + 1,
00299 
00300     /* screen: blanked,   hsync: on,  vsync: off */
00301     FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
00302 
00303     /* screen: blanked,   hsync: off, vsync: on */
00304     FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
00305 
00306     /* screen: blanked,   hsync: off, vsync: off */
00307     FB_BLANK_POWERDOWN     = VESA_POWERDOWN + 1
00308 };
00309 
00310 #define FB_VBLANK_VBLANKING 0x001   /* currently in a vertical blank */
00311 #define FB_VBLANK_HBLANKING 0x002   /* currently in a horizontal blank */
00312 #define FB_VBLANK_HAVE_VBLANK   0x004   /* vertical blanks can be detected */
00313 #define FB_VBLANK_HAVE_HBLANK   0x008   /* horizontal blanks can be detected */
00314 #define FB_VBLANK_HAVE_COUNT    0x010   /* global retrace counter is available */
00315 #define FB_VBLANK_HAVE_VCOUNT   0x020   /* the vcount field is valid */
00316 #define FB_VBLANK_HAVE_HCOUNT   0x040   /* the hcount field is valid */
00317 #define FB_VBLANK_VSYNCING  0x080   /* currently in a vsync */
00318 #define FB_VBLANK_HAVE_VSYNC    0x100   /* verical syncs can be detected */
00319 
00320 struct fb_vblank {
00321     unsigned int flags;         /* FB_VBLANK flags */
00322     unsigned int count;         /* counter of retraces since boot */
00323     unsigned int vcount;            /* current scanline position */
00324     unsigned int hcount;            /* current scandot position */
00325     unsigned int reserved[4];       /* reserved for future compatibility */
00326 };
00327 
00328 /* Internal HW accel */
00329 #define ROP_COPY 0
00330 #define ROP_XOR  1
00331 
00332 struct fb_copyarea {
00333     unsigned int dx;
00334     unsigned int dy;
00335     unsigned int width;
00336     unsigned int height;
00337     unsigned int sx;
00338     unsigned int sy;
00339 };
00340 
00341 struct fb_fillrect {
00342     unsigned int dx;    /* screen-relative */
00343     unsigned int dy;
00344     unsigned int width;
00345     unsigned int height;
00346     unsigned int color;
00347     unsigned int rop;
00348 };
00349 
00350 struct fb_image {
00351     unsigned int dx;        /* Where to place image */
00352     unsigned int dy;
00353     unsigned int width;     /* Size of image */
00354     unsigned int height;
00355     unsigned int fg_color;      /* Only used when a mono bitmap */
00356     unsigned int bg_color;
00357     unsigned char  depth;       /* Depth of the image */
00358     const char *data;   /* Pointer to image data */
00359     struct fb_cmap cmap;    /* color map info */
00360 };
00361 
00362 /*
00363  * hardware cursor control
00364  */
00365 
00366 #define FB_CUR_SETIMAGE 0x01
00367 #define FB_CUR_SETPOS   0x02
00368 #define FB_CUR_SETHOT   0x04
00369 #define FB_CUR_SETCMAP  0x08
00370 #define FB_CUR_SETSHAPE 0x10
00371 #define FB_CUR_SETSIZE  0x20
00372 #define FB_CUR_SETALL   0xFF
00373 
00374 struct fbcurpos {
00375     unsigned short int x, y;
00376 };
00377 
00378 struct fb_cursor {
00379     unsigned short int set;     /* what to set */
00380     unsigned short int enable;      /* cursor on/off */
00381     unsigned short int rop;     /* bitop operation */
00382     const char *mask;   /* cursor mask bits */
00383     struct fbcurpos hot;    /* cursor hot spot */
00384     struct fb_image image;  /* Cursor image */
00385 };
00386 
00387 #ifdef CONFIG_FB_BACKLIGHT
00388 /* Settings for the generic backlight code */
00389 #define FB_BACKLIGHT_LEVELS 128
00390 #define FB_BACKLIGHT_MAX    0xFF
00391 #endif
00392 
00393 #endif /* _LINUX_FB_H */

Generated by doxygen