00001 #ifndef _LINUX_FB_H
00002 #define _LINUX_FB_H
00003
00004 #include <asm/types.h>
00005
00006
00007
00008 #define FB_MAJOR 29
00009
00010 #define FB_MODES_SHIFT 5
00011 #define FB_NUM_MINORS 256
00012 #define FB_MAX (FB_NUM_MINORS / (1 << FB_MODES_SHIFT))
00013 #define GET_FB_IDX(node) (MINOR(node) >> FB_MODES_SHIFT)
00014
00015
00016
00017 #define FBIOGET_VSCREENINFO 0x4600
00018 #define FBIOPUT_VSCREENINFO 0x4601
00019 #define FBIOGET_FSCREENINFO 0x4602
00020 #define FBIOGETCMAP 0x4604
00021 #define FBIOPUTCMAP 0x4605
00022 #define FBIOPAN_DISPLAY 0x4606
00023
00024
00025
00026
00027 #define FBIOGET_CON2FBMAP 0x460F
00028 #define FBIOPUT_CON2FBMAP 0x4610
00029 #define FBIOBLANK 0x4611
00030
00031 #define FB_TYPE_PACKED_PIXELS 0
00032 #define FB_TYPE_PLANES 1
00033 #define FB_TYPE_INTERLEAVED_PLANES 2
00034 #define FB_TYPE_TEXT 3
00035 #define FB_TYPE_VGA_PLANES 4
00036
00037 #define FB_AUX_TEXT_MDA 0
00038 #define FB_AUX_TEXT_CGA 1
00039 #define FB_AUX_TEXT_S3_MMIO 2
00040 #define FB_AUX_TEXT_MGA_STEP16 3
00041 #define FB_AUX_TEXT_MGA_STEP8 4
00042
00043 #define FB_VISUAL_MONO01 0
00044 #define FB_VISUAL_MONO10 1
00045 #define FB_VISUAL_TRUECOLOR 2
00046 #define FB_VISUAL_PSEUDOCOLOR 3
00047 #define FB_VISUAL_DIRECTCOLOR 4
00048 #define FB_VISUAL_STATIC_PSEUDOCOLOR 5
00049
00050 #define FB_ACCEL_NONE 0
00051 #define FB_ACCEL_ATARIBLITT 1
00052 #define FB_ACCEL_AMIGABLITT 2
00053 #define FB_ACCEL_S3_TRIO64 3
00054 #define FB_ACCEL_NCR_77C32BLT 4
00055 #define FB_ACCEL_S3_VIRGE 5
00056 #define FB_ACCEL_ATI_MACH64GX 6
00057 #define FB_ACCEL_DEC_TGA 7
00058 #define FB_ACCEL_ATI_MACH64CT 8
00059 #define FB_ACCEL_ATI_MACH64VT 9
00060 #define FB_ACCEL_ATI_MACH64GT 10
00061 #define FB_ACCEL_SUN_CREATOR 11
00062 #define FB_ACCEL_SUN_CGSIX 12
00063 #define FB_ACCEL_SUN_LEO 13
00064 #define FB_ACCEL_IMS_TWINTURBO 14
00065 #define FB_ACCEL_3DLABS_PERMEDIA2 15
00066 #define FB_ACCEL_MATROX_MGA2064W 16
00067 #define FB_ACCEL_MATROX_MGA1064SG 17
00068 #define FB_ACCEL_MATROX_MGA2164W 18
00069 #define FB_ACCEL_MATROX_MGA2164W_AGP 19
00070 #define FB_ACCEL_MATROX_MGAG100 20
00071 #define FB_ACCEL_MATROX_MGAG200 21
00072 #define FB_ACCEL_SUN_CG14 22
00073 #define FB_ACCEL_SUN_BWTWO 23
00074 #define FB_ACCEL_SUN_CGTHREE 24
00075 #define FB_ACCEL_SUN_TCX 25
00076 #define FB_ACCEL_MATROX_MGAG400 26
00077 #define FB_ACCEL_ATI_RAGE128 32
00078
00079 struct fb_fix_screeninfo {
00080 char id[16];
00081 char *smem_start;
00082
00083 __u32 smem_len;
00084 __u32 type;
00085 __u32 type_aux;
00086 __u32 visual;
00087 __u16 xpanstep;
00088 __u16 ypanstep;
00089 __u16 ywrapstep;
00090 __u32 line_length;
00091 char *mmio_start;
00092
00093 __u32 mmio_len;
00094 __u32 accel;
00095 __u16 reserved[3];
00096 };
00097
00098
00099
00100
00101
00102
00103
00104 struct fb_bitfield {
00105 __u32 offset;
00106 __u32 length;
00107 __u32 msb_right;
00108
00109 };
00110
00111 #define FB_NONSTD_HAM 1
00112
00113 #define FB_ACTIVATE_NOW 0
00114 #define FB_ACTIVATE_NXTOPEN 1
00115 #define FB_ACTIVATE_TEST 2
00116 #define FB_ACTIVATE_MASK 15
00117
00118 #define FB_ACTIVATE_VBL 16
00119 #define FB_CHANGE_CMAP_VBL 32
00120 #define FB_ACTIVATE_ALL 64
00121
00122 #define FB_ACCELF_TEXT 1
00123
00124 #define FB_SYNC_HOR_HIGH_ACT 1
00125 #define FB_SYNC_VERT_HIGH_ACT 2
00126 #define FB_SYNC_EXT 4
00127 #define FB_SYNC_COMP_HIGH_ACT 8
00128 #define FB_SYNC_BROADCAST 16
00129
00130
00131 #define FB_SYNC_ON_GREEN 32
00132
00133 #define FB_VMODE_NONINTERLACED 0
00134 #define FB_VMODE_INTERLACED 1
00135 #define FB_VMODE_DOUBLE 2
00136 #define FB_VMODE_MASK 255
00137
00138 #define FB_VMODE_YWRAP 256
00139 #define FB_VMODE_SMOOTH_XPAN 512
00140 #define FB_VMODE_CONUPDATE 512
00141
00142 struct fb_var_screeninfo {
00143 __u32 xres;
00144 __u32 yres;
00145 __u32 xres_virtual;
00146 __u32 yres_virtual;
00147 __u32 xoffset;
00148 __u32 yoffset;
00149
00150 __u32 bits_per_pixel;
00151 __u32 grayscale;
00152
00153 struct fb_bitfield red;
00154 struct fb_bitfield green;
00155 struct fb_bitfield blue;
00156 struct fb_bitfield transp;
00157
00158 __u32 nonstd;
00159
00160 __u32 activate;
00161
00162 __u32 height;
00163 __u32 width;
00164
00165 __u32 accel_flags;
00166
00167
00168 __u32 pixclock;
00169 __u32 left_margin;
00170 __u32 right_margin;
00171 __u32 upper_margin;
00172 __u32 lower_margin;
00173 __u32 hsync_len;
00174 __u32 vsync_len;
00175 __u32 sync;
00176 __u32 vmode;
00177 __u32 reserved[6];
00178 };
00179
00180 struct fb_cmap {
00181 __u32 start;
00182 __u32 len;
00183 __u16 *red;
00184 __u16 *green;
00185 __u16 *blue;
00186 __u16 *transp;
00187 };
00188
00189 struct fb_con2fbmap {
00190 __u32 console;
00191 __u32 framebuffer;
00192 };
00193
00194 struct fb_monspecs {
00195 __u32 hfmin;
00196 __u32 hfmax;
00197 __u16 vfmin;
00198 __u16 vfmax;
00199 unsigned dpms : 1;
00200 };
00201
00202 #ifdef __KERNEL__
00203
00204 #include <linux/fs.h>
00205
00206
00207 struct fb_info;
00208 struct fb_info_gen;
00209 struct vm_area_struct;
00210 struct file;
00211
00212
00213
00214
00215
00216 struct fb_ops {
00217
00218 int (*fb_open)(struct fb_info *info, int user);
00219 int (*fb_release)(struct fb_info *info, int user);
00220
00221 int (*fb_get_fix)(struct fb_fix_screeninfo *fix, int con,
00222 struct fb_info *info);
00223
00224 int (*fb_get_var)(struct fb_var_screeninfo *var, int con,
00225 struct fb_info *info);
00226
00227 int (*fb_set_var)(struct fb_var_screeninfo *var, int con,
00228 struct fb_info *info);
00229
00230 int (*fb_get_cmap)(struct fb_cmap *cmap, int kspc, int con,
00231 struct fb_info *info);
00232
00233 int (*fb_set_cmap)(struct fb_cmap *cmap, int kspc, int con,
00234 struct fb_info *info);
00235
00236 int (*fb_pan_display)(struct fb_var_screeninfo *var, int con,
00237 struct fb_info *info);
00238
00239 int (*fb_ioctl)(struct inode *inode, struct file *file, unsigned int cmd,
00240 unsigned long arg, int con, struct fb_info *info);
00241
00242 int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
00243
00244 int (*fb_rasterimg)(struct fb_info *info, int start);
00245 };
00246
00247
00248
00249
00250
00251
00252
00253 struct display {
00254
00255
00256 struct fb_var_screeninfo var;
00257
00258 struct fb_cmap cmap;
00259 char *screen_base;
00260
00261 int visual;
00262 int type;
00263 int type_aux;
00264 u_short ypanstep;
00265 u_short ywrapstep;
00266 u_long line_length;
00267 u_short can_soft_blank;
00268 u_short inverse;
00269 struct display_switch *dispsw;
00270 void *dispsw_data;
00271
00272 #if 0
00273 struct fb_fix_cursorinfo fcrsr;
00274 struct fb_var_cursorinfo *vcrsr;
00275 struct fb_cursorstate crsrstate;
00276 #endif
00277
00278
00279
00280 struct vc_data *conp;
00281 struct fb_info *fb_info;
00282 int vrows;
00283 unsigned short cursor_x;
00284 unsigned short cursor_y;
00285 int fgcol;
00286 int bgcol;
00287 u_long next_line;
00288 u_long next_plane;
00289 u_char *fontdata;
00290 unsigned short _fontheightlog;
00291 unsigned short _fontwidthlog;
00292 unsigned short _fontheight;
00293 unsigned short _fontwidth;
00294 int userfont;
00295 u_short scrollmode;
00296 short yscroll;
00297 unsigned char fgshift, bgshift;
00298 unsigned short charmask;
00299 };
00300
00301
00302 struct fb_info {
00303 char modename[40];
00304 kdev_t node;
00305 int flags;
00306 #define FBINFO_FLAG_MODULE 1
00307 struct fb_ops *fbops;
00308 struct fb_monspecs monspecs;
00309 struct display *disp;
00310 struct vc_data *display_fg;
00311 char fontname[40];
00312 int (*changevar)(int);
00313 int (*switch_con)(int, struct fb_info*);
00314
00315 int (*updatevar)(int, struct fb_info*);
00316
00317 void (*blank)(int, struct fb_info*);
00318
00319
00320
00321
00322 };
00323
00324 #ifdef MODULE
00325 #define FBINFO_FLAG_DEFAULT FBINFO_FLAG_MODULE
00326 #else
00327 #define FBINFO_FLAG_DEFAULT 0
00328 #endif
00329
00330
00331
00332
00333
00334
00335
00336 struct fbgen_hwswitch {
00337 void (*detect)(void);
00338 int (*encode_fix)(struct fb_fix_screeninfo *fix, const void *par,
00339 struct fb_info_gen *info);
00340 int (*decode_var)(const struct fb_var_screeninfo *var, void *par,
00341 struct fb_info_gen *info);
00342 int (*encode_var)(struct fb_var_screeninfo *var, const void *par,
00343 struct fb_info_gen *info);
00344 void (*get_par)(void *par, struct fb_info_gen *info);
00345 void (*set_par)(const void *par, struct fb_info_gen *info);
00346 int (*getcolreg)(unsigned regno, unsigned *red, unsigned *green,
00347 unsigned *blue, unsigned *transp, struct fb_info *info);
00348 int (*setcolreg)(unsigned regno, unsigned red, unsigned green,
00349 unsigned blue, unsigned transp, struct fb_info *info);
00350 int (*pan_display)(const struct fb_var_screeninfo *var,
00351 struct fb_info_gen *info);
00352 int (*blank)(int blank_mode, struct fb_info_gen *info);
00353 void (*set_disp)(const void *par, struct display *disp,
00354 struct fb_info_gen *info);
00355 };
00356
00357 struct fb_info_gen {
00358 struct fb_info info;
00359
00360
00361
00362 u_int parsize;
00363 struct fbgen_hwswitch *fbhw;
00364
00365
00366 };
00367
00368
00369
00370
00371
00372 extern int fbgen_get_fix(struct fb_fix_screeninfo *fix, int con,
00373 struct fb_info *info);
00374 extern int fbgen_get_var(struct fb_var_screeninfo *var, int con,
00375 struct fb_info *info);
00376 extern int fbgen_set_var(struct fb_var_screeninfo *var, int con,
00377 struct fb_info *info);
00378 extern int fbgen_get_cmap(struct fb_cmap *cmap, int kspc, int con,
00379 struct fb_info *info);
00380 extern int fbgen_set_cmap(struct fb_cmap *cmap, int kspc, int con,
00381 struct fb_info *info);
00382 extern int fbgen_pan_display(struct fb_var_screeninfo *var, int con,
00383 struct fb_info *info);
00384 extern int fbgen_ioctl(struct inode *inode, struct file *file,
00385 unsigned int cmd, unsigned long arg, int con,
00386 struct fb_info *info);
00387
00388
00389
00390
00391
00392 extern int fbgen_do_set_var(struct fb_var_screeninfo *var, int isactive,
00393 struct fb_info_gen *info);
00394 extern void fbgen_set_disp(int con, struct fb_info_gen *info);
00395 extern void fbgen_install_cmap(int con, struct fb_info_gen *info);
00396 extern int fbgen_update_var(int con, struct fb_info *info);
00397 extern int fbgen_switch(int con, struct fb_info *info);
00398 extern void fbgen_blank(int blank, struct fb_info *info);
00399
00400
00401 struct fb_videomode {
00402 const char *name;
00403 struct fb_var_screeninfo var;
00404 };
00405
00406
00407
00408 extern int register_framebuffer(struct fb_info *fb_info);
00409 extern int unregister_framebuffer(const struct fb_info *fb_info);
00410 extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
00411 const struct fb_info *fb_info);
00412 extern int fbmon_dpms(const struct fb_info *fb_info);
00413
00414
00415 extern int num_registered_fb;
00416 extern struct fb_info *registered_fb[FB_MAX];
00417 extern char con2fb_map[MAX_NR_CONSOLES];
00418
00419
00420 extern struct display fb_display[MAX_NR_CONSOLES];
00421
00422
00423 extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
00424 extern void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to,
00425 int fsfromto);
00426 extern int fb_get_cmap(struct fb_cmap *cmap, int kspc,
00427 int (*getcolreg)(u_int, u_int *, u_int *, u_int *,
00428 u_int *, struct fb_info *),
00429 struct fb_info *fb_info);
00430 extern int fb_set_cmap(struct fb_cmap *cmap, int kspc,
00431 int (*setcolreg)(u_int, u_int, u_int, u_int, u_int,
00432 struct fb_info *),
00433 struct fb_info *fb_info);
00434 extern struct fb_cmap *fb_default_cmap(int len);
00435 extern void fb_invert_cmaps(void);
00436
00437
00438 #define VESA_NO_BLANKING 0
00439 #define VESA_VSYNC_SUSPEND 1
00440 #define VESA_HSYNC_SUSPEND 2
00441 #define VESA_POWERDOWN 3
00442
00443 #endif
00444
00445 #if 1
00446
00447 #define FBCMD_GET_CURRENTPAR 0xDEAD0005
00448 #define FBCMD_SET_CURRENTPAR 0xDEAD8005
00449
00450 #endif
00451
00452
00453 #if 1
00454
00455
00456
00457
00458
00459 #define FBIOGET_FCURSORINFO 0x4607
00460 #define FBIOGET_VCURSORINFO 0x4608
00461 #define FBIOPUT_VCURSORINFO 0x4609
00462 #define FBIOGET_CURSORSTATE 0x460A
00463 #define FBIOPUT_CURSORSTATE 0x460B
00464
00465
00466 struct fb_fix_cursorinfo {
00467 __u16 crsr_width;
00468 __u16 crsr_height;
00469 __u16 crsr_xsize;
00470 __u16 crsr_ysize;
00471 __u16 crsr_color1;
00472 __u16 crsr_color2;
00473 };
00474
00475 struct fb_var_cursorinfo {
00476 __u16 width;
00477 __u16 height;
00478 __u16 xspot;
00479 __u16 yspot;
00480 __u8 data[1];
00481 };
00482
00483 struct fb_cursorstate {
00484 __s16 xoffset;
00485 __s16 yoffset;
00486 __u16 mode;
00487 };
00488
00489 #define FB_CURSOR_OFF 0
00490 #define FB_CURSOR_ON 1
00491 #define FB_CURSOR_FLASH 2
00492
00493 #endif
00494
00495 #endif