root/include/linux/fb.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_FB_H
   2 #define _LINUX_FB_H
   3 
   4 /* Definitions of frame buffers                                         */
   5 
   6 #ifdef __KERNEL__
   7 #include <linux/config.h>
   8 #include <linux/fs.h>
   9 #endif
  10 
  11 /* ioctls
  12    0x46 is 'F'                                                          */
  13 #define FBIOGET_VSCREENINFO     0x4600
  14 #define FBIOPUT_VSCREENINFO     0x4601
  15 #define FBIOGET_FSCREENINFO     0x4602
  16 #define FBIOGETCMAP             0x4604
  17 #define FBIOPUTCMAP             0x4605
  18 #define FBIOPAN_DISPLAY         0x4606
  19 
  20 #define FB_TYPE_PACKED_PIXELS           0       /* Packed Pixels        */
  21 #define FB_TYPE_PLANES                  1       /* Non interleaved planes */
  22 #define FB_TYPE_INTERLEAVED_PLANES      2       /* Interleaved planes   */
  23 
  24 #define FB_VISUAL_MONO01                0       /* Monochr. 1=Black 0=White */
  25 #define FB_VISUAL_MONO10                1       /* Monochr. 1=White 0=Black */
  26 #define FB_VISUAL_TRUECOLOR             2       /* True color   */
  27 #define FB_VISUAL_PSEUDOCOLOR           3       /* Pseudo color (like atari) */
  28 #define FB_VISUAL_DIRECTCOLOR           4       /* Direct color */
  29 #define FB_VISUAL_STATIC_PSEUDOCOLOR    5       /* Pseudo color readonly */
  30 #define FB_VISUAL_STATIC_DIRECTCOLOR    6       /* Direct color readonly */
  31 
  32 struct fb_fix_screeninfo {
  33         char id[16];                    /* identification string eg "TT Builtin" */
  34         unsigned long smem_start;       /* Start of frame buffer mem */
  35         unsigned long smem_len;         /* Length of frame buffer mem */        
  36         int type;                       /* see FB_TYPE_*                */
  37         int type_aux;                   /* Interleave for interleaved Planes */
  38         int visual;                     /* see FB_VISUAL_*              */ 
  39         u_short xpanstep;               /* zero if no hardware panning  */
  40         u_short ypanstep;               /* zero if no hardware panning  */
  41         u_short ywrapstep;              /* zero if no hardware ywrap    */
  42         short reserved[11];             /* Reserved for future compatibility */
  43 };
  44 
  45 struct fb_bitfield {
  46         int offset;                     /* beginning of bitfield        */
  47         int length;                     /* length of bitfield           */
  48         int msb_right;                  /* != 0 : Most significant bit is */ 
  49                                         /* right */ 
  50 };
  51 
  52 #define FB_NONSTD_HAM           1       /* Hold-And-Modify (HAM)        */
  53 
  54 #define FB_ACTIVATE_NOW         0       /* set values immediately (or vbl)*/
  55 #define FB_ACTIVATE_NXTOPEN     1       /* activate on next open        */
  56 #define FB_ACTIVATE_TEST        2       /* don't set, round up impossible */
  57 #define FB_ACTIVATE_MASK       15
  58                                         /* values                       */
  59 #define FB_ACTIVATE_VBL        16       /* activate values on next vbl  */
  60 #define FB_CHANGE_CMAP_VBL     32       /* change colormap on vbl       */
  61 
  62 #define FB_ACCEL_NONE           0       /* no hardware accelerator      */
  63 #define FB_ACCEL_ATARIBLITT     1       /* Atari Blitter                */
  64 #define FB_ACCEL_AMIGABLITT     2       /* Amiga Blitter                */
  65 #define FB_ACCEL_CYBERVISION    3       /* Cybervision64 (S3 Trio64)    */
  66 
  67 #define FB_SYNC_HOR_HIGH_ACT    1       /* horizontal sync high active  */
  68 #define FB_SYNC_VERT_HIGH_ACT   2       /* vertical sync high active    */
  69 #define FB_SYNC_EXT             4       /* external sync                */
  70 #define FB_SYNC_COMP_HIGH_ACT   8       /* composite sync high active   */
  71 #define FB_SYNC_BROADCAST       16      /* broadcast video timings      */
  72                                         /* vtotal = 144d/288n/576i => PAL  */
  73                                         /* vtotal = 121d/242n/484i => NTSC */
  74 
  75 #define FB_VMODE_NONINTERLACED  0       /* non interlaced */
  76 #define FB_VMODE_INTERLACED     1       /* interlaced   */
  77 #define FB_VMODE_DOUBLE         2       /* double scan */
  78 #define FB_VMODE_MASK           255
  79 
  80 #define FB_VMODE_YWRAP          256     /* ywrap instead of panning     */
  81 
  82 struct fb_var_screeninfo {
  83         int xres;                       /* visible resolution           */
  84         int yres;
  85         int xres_virtual;               /* virtual resolution           */
  86         int yres_virtual;
  87         int xoffset;                    /* offset from virtual to visible */
  88         int yoffset;                    /* resolution                   */
  89 
  90         int bits_per_pixel;             /* guess what                   */
  91         int grayscale;                  /* != 0 Graylevels instead of colors */
  92 
  93         struct fb_bitfield red;         /* bitfield in fb mem if true color, */
  94         struct fb_bitfield green;       /* else only length is significant */
  95         struct fb_bitfield blue;
  96         struct fb_bitfield transp;      /* transparency                 */      
  97 
  98         int nonstd;                     /* != 0 Non standard pixel format */
  99 
 100         int activate;                   /* see FB_ACTIVATE_*            */
 101 
 102         int height;                     /* height of picture in mm    */
 103         int width;                      /* width of picture in mm     */
 104 
 105         int accel;                      /* see FB_ACCEL_*               */
 106 
 107         /* Timing: All values in pixclocks, except pixclock (of course) */
 108         unsigned long pixclock;         /* pixel clock in ps (pico seconds) */
 109         unsigned long left_margin;      /* time from sync to picture    */
 110         unsigned long right_margin;     /* time from picture to sync    */
 111         unsigned long upper_margin;     /* time from sync to picture    */
 112         unsigned long lower_margin;
 113         unsigned long hsync_len;        /* length of horizontal sync    */
 114         unsigned long vsync_len;        /* length of vertical sync      */
 115         int sync;                       /* see FB_SYNC_*                */
 116         int vmode;                      /* see FB_VMODE_*               */
 117         int reserved[6];                /* Reserved for future compatibility */
 118 };
 119 
 120 struct fb_cmap {
 121         int start;                      /* First entry  */
 122         int len;                        /* Number of entries */
 123         unsigned short *red;            /* Red values   */
 124         unsigned short *green;
 125         unsigned short *blue;
 126         unsigned short *transp;         /* transparency, can be NULL */
 127 };
 128 
 129 #ifdef __KERNEL__
 130 
 131 struct fb_ops {
 132         /* get non setable parameters   */
 133         int (*fb_get_fix) (struct fb_fix_screeninfo *, int); 
 134         /* get setable parameters       */
 135         int (*fb_get_var) (struct fb_var_screeninfo *, int);            
 136         /* set setable parameters       */
 137         int (*fb_set_var) (struct fb_var_screeninfo *, int);            
 138         /* get colormap                 */
 139         int (*fb_get_cmap) (struct fb_cmap *, int, int);
 140         /* set colormap                 */
 141         int (*fb_set_cmap) (struct fb_cmap *, int, int);
 142         /* pan display                   */
 143         int (*fb_pan_display) (struct fb_var_screeninfo *, int);
 144         /* perform fb specific ioctl    */
 145         int (*fb_ioctl)(struct inode *, struct file *, unsigned int,
 146                         unsigned long, int);
 147 };
 148 
 149 int register_framebuffer(char *, int *, struct fb_ops *, int, 
 150                          struct fb_var_screeninfo *);
 151 int unregister_framebuffer(int);
 152 
 153    /*
 154     *    This is the interface between the low-level console driver and the
 155     *    low-level frame buffer device
 156     */
 157 
 158 struct display {
 159 /*
 160  * As long as the old Amiga screen driver is being used, we have to
 161  * include these old parameters.
 162  */
 163 #if defined(CONFIG_AMIGA)
 164   ushort scr_max_height;        /* screen dimensions */
 165   ushort scr_max_width;
 166   ushort scr_height;
 167   ushort scr_width;
 168   ushort scr_depth;
 169   int bytes_per_row;            /* offset to one line below */
 170   
 171   ulong crsrcol;
 172 
 173   ushort scroll_latch;          /* Vblank support for hardware scroll */
 174   ushort y_wrap;
 175   ushort cursor_latch;          /* Hardware cursor */
 176   ushort *cursor, *dummy;
 177   ushort cursor_flash;
 178   ushort cursor_visible;
 179 
 180   /* Some chipreg values we need to rebuild copper lists */
 181   ushort diwstrt_v, diwstrt_h;  /* display window control */
 182   ushort diwstop_v, diwstop_h;
 183   ushort bplcon0;               /* display mode */
 184   ushort htotal;
 185 
 186   u_char *bitplane[8];          /* pointers to display bitplanes */
 187   ulong plane_size;
 188 
 189   ushort *coplist1hdr;          /* List 1 static  component */
 190   ushort *coplist1dyn;          /* List 1 dynamic component */
 191   ushort *coplist2hdr;          /* List 2 static  component */
 192   ushort *coplist2dyn;          /* List 2 dynamic component */
 193 
 194 #endif
 195 
 196    /* Filled in by the frame buffer device */
 197 
 198    struct fb_var_screeninfo var;    /* variable infos. yoffset and vmode */
 199                                     /* are updated by fbcon.c */
 200    struct fb_cmap cmap;             /* colormap */
 201    u_char *screen_base;             /* pointer to top of virtual screen */    
 202    int visual;
 203    int type;                        /* see FB_TYPE_* */
 204    int type_aux;                    /* Interleave for interleaved Planes */
 205    u_short ypanstep;                /* zero if no hardware ypan */
 206    u_short ywrapstep;               /* zero if no hardware ywrap */
 207    u_short can_soft_blank;          /* zero if no hardware blanking */
 208    u_short inverse;                 /* != 0 text black on white as default */
 209 
 210 #if 0
 211    struct fb_fix_cursorinfo fcrsr;
 212    struct fb_var_cursorinfo *vcrsr;
 213    struct fb_cursorstate crsrstate;
 214 #endif
 215 
 216    /* Filled in by the low-level console driver */
 217 
 218    struct vc_data *conp;            /* pointer to console data */
 219    int cursor_x;                    /* current cursor position */
 220    int cursor_y;
 221    int fgcol;                       /* text colors */
 222    int bgcol;
 223    u_long next_line;                /* offset to one line below */
 224    u_long next_plane;               /* offset to next plane */
 225    u_char *fontdata;                /* Font associated to this display */
 226    int fontheight;
 227    int fontwidth;
 228    struct display_switch *dispsw;   /* low level operations */
 229    u_short scrollmode;              /* Scroll Method */
 230    short yscroll;                   /* Hardware scrolling */
 231 }; 
 232 
 233 
 234 struct fb_info {
 235    char modename[40];               /* at boottime detected video mode */
 236    struct display *disp;            /* pointer to display variables */
 237    char fontname[40];               /* default font name */
 238    int (*changevar)(int);           /* tell console var has changed */
 239    int (*switch_con)(int);          /* tell fb to switch consoles */
 240    int (*updatevar)(int);           /* tell fb to update the vars */
 241    void (*blank)(int);              /* tell fb to (un)blank the screen */
 242 };
 243 
 244 #endif /* __KERNEL__ */
 245 
 246 #if 1
 247 
 248 #define FBCMD_GET_CURRENTPAR        0xDEAD0005
 249 #define FBCMD_SET_CURRENTPAR        0xDEAD8005
 250 
 251 #endif
 252 
 253 
 254 #if 1 /* Preliminary */
 255 
 256    /*
 257     *    Hardware Cursor
 258     */
 259 
 260 #define FBIOGET_FCURSORINFO     0x4607
 261 #define FBIOGET_VCURSORINFO     0x4608
 262 #define FBIOPUT_VCURSORINFO     0x4609
 263 #define FBIOGET_CURSORSTATE     0x460A
 264 #define FBIOPUT_CURSORSTATE     0x460B
 265 
 266 
 267 struct fb_fix_cursorinfo {
 268         u_short crsr_width;             /* width and height of the cursor in */
 269         u_short crsr_height;            /* pixels (zero if no cursor)   */
 270         u_short crsr_xsize;             /* cursor size in display pixels */
 271         u_short crsr_ysize;
 272         u_short crsr_color1;            /* colormap entry for cursor color1 */
 273         u_short crsr_color2;            /* colormap entry for cursor color2 */
 274 };
 275 
 276 struct fb_var_cursorinfo {
 277         u_long data[256];              /* max. 64x64 (ilbm, 2 planes)   */
 278 };
 279 
 280 struct fb_cursorstate {
 281         short xoffset;
 282         short yoffset;
 283         u_short mode;
 284 };
 285 
 286 #define FB_CURSOR_OFF           0
 287 #define FB_CURSOR_ON            1
 288 #define FB_CURSOR_FLASH         2
 289 
 290 #endif /* Preliminary */
 291 
 292 
 293 #endif /* _LINUX_FB_H */

/* [previous][next][first][last][top][bottom][index][help] */