fbio.h revision 270980
1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software developed by the Computer Systems 6 * Engineering group at Lawrence Berkeley Laboratory under DARPA 7 * contract BG 91-66 and contributed to Berkeley. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)fbio.h 8.2 (Berkeley) 10/30/93 34 * 35 * $FreeBSD: stable/10/sys/sys/fbio.h 270980 2014-09-02 19:56:37Z emaste $ 36 */ 37 38#ifndef _SYS_FBIO_H_ 39#define _SYS_FBIO_H_ 40 41#ifndef _KERNEL 42#include <sys/types.h> 43#else 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/eventhandler.h> 47#endif 48#include <sys/ioccom.h> 49 50/* 51 * Frame buffer ioctls (from Sprite, trimmed to essentials for X11). 52 */ 53 54/* 55 * Frame buffer type codes. 56 */ 57#define FBTYPE_SUN1BW 0 /* multibus mono */ 58#define FBTYPE_SUN1COLOR 1 /* multibus color */ 59#define FBTYPE_SUN2BW 2 /* memory mono */ 60#define FBTYPE_SUN2COLOR 3 /* color w/rasterop chips */ 61#define FBTYPE_SUN2GP 4 /* GP1/GP2 */ 62#define FBTYPE_SUN5COLOR 5 /* RoadRunner accelerator */ 63#define FBTYPE_SUN3COLOR 6 /* memory color */ 64#define FBTYPE_MEMCOLOR 7 /* memory 24-bit */ 65#define FBTYPE_SUN4COLOR 8 /* memory color w/overlay */ 66 67#define FBTYPE_NOTSUN1 9 /* reserved for customer */ 68#define FBTYPE_NOTSUN2 10 /* reserved for customer */ 69#define FBTYPE_PCIMISC 11 /* (generic) PCI misc. disp. */ 70 71#define FBTYPE_SUNFAST_COLOR 12 /* accelerated 8bit */ 72#define FBTYPE_SUNROP_COLOR 13 /* MEMCOLOR with rop h/w */ 73#define FBTYPE_SUNFB_VIDEO 14 /* Simple video mixing */ 74#define FBTYPE_RESERVED5 15 /* reserved, do not use */ 75#define FBTYPE_RESERVED4 16 /* reserved, do not use */ 76#define FBTYPE_SUNGP3 17 77#define FBTYPE_SUNGT 18 78#define FBTYPE_SUNLEO 19 /* zx Leo */ 79 80#define FBTYPE_MDA 20 81#define FBTYPE_HERCULES 21 82#define FBTYPE_CGA 22 83#define FBTYPE_EGA 23 84#define FBTYPE_VGA 24 85#define FBTYPE_PC98 25 86#define FBTYPE_TGA 26 87#define FBTYPE_TGA2 27 88 89#define FBTYPE_MDICOLOR 28 /* cg14 */ 90#define FBTYPE_TCXCOLOR 29 /* SUNW,tcx */ 91#define FBTYPE_CREATOR 30 92 93#define FBTYPE_LASTPLUSONE 31 /* max number of fbs (change as add) */ 94 95/* 96 * Frame buffer descriptor as returned by FBIOGTYPE. 97 */ 98struct fbtype { 99 int fb_type; /* as defined above */ 100 int fb_height; /* in pixels */ 101 int fb_width; /* in pixels */ 102 int fb_depth; /* bits per pixel */ 103 int fb_cmsize; /* size of color map (entries) */ 104 int fb_size; /* total size in bytes */ 105}; 106#define FBIOGTYPE _IOR('F', 0, struct fbtype) 107 108#define FBTYPE_GET_STRIDE(_fb) ((_fb)->fb_size / (_fb)->fb_height) 109#define FBTYPE_GET_BPP(_fb) ((_fb)->fb_bpp) 110#define FBTYPE_GET_BYTESPP(_fb) ((_fb)->fb_bpp / 8) 111 112#ifdef _KERNEL 113 114struct fb_info; 115 116typedef int fb_enter_t(void *priv); 117typedef int fb_leave_t(void *priv); 118typedef int fb_write_t(void *priv, int offset, void *data, int size); 119typedef int fb_read_t(void *priv, int offset, void *data, int size); 120 121/* XXX: should use priv instead of fb_info too. */ 122typedef void fb_copy_t(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, 123 uint32_t size); 124typedef void fb_wr1_t(struct fb_info *sc, uint32_t offset, uint8_t value); 125typedef void fb_wr2_t(struct fb_info *sc, uint32_t offset, uint16_t value); 126typedef void fb_wr4_t(struct fb_info *sc, uint32_t offset, uint32_t value); 127 128typedef int fb_ioctl_t(struct cdev *, u_long, caddr_t, int, struct thread *); 129typedef int fb_mmap_t(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, 130 int prot, vm_memattr_t *memattr); 131 132struct fb_info { 133 /* Raw copy of fbtype. Do not change. */ 134 int fb_type; /* as defined above */ 135 int fb_height; /* in pixels */ 136 int fb_width; /* in pixels */ 137 int fb_depth; /* bits to define color */ 138 int fb_cmsize; /* size of color map (entries) */ 139 int fb_size; /* total size in bytes */ 140 141 /* Methods. */ 142 fb_write_t *fb_write; /* if NULL, direct mem write. */ 143 fb_read_t *fb_read; /* if NULL, direct mem read. */ 144 145 struct cdev *fb_cdev; 146 147 fb_wr1_t *wr1; 148 fb_wr2_t *wr2; 149 fb_wr4_t *wr4; 150 fb_copy_t *copy; 151 fb_enter_t *enter; 152 fb_leave_t *leave; 153 154 intptr_t fb_pbase; /* For FB mmap. */ 155 intptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */ 156 void *fb_priv; /* First argument for read/write. */ 157 const char *fb_name; 158 uint32_t fb_flags; 159 int fb_stride; 160 int fb_bpp; /* bits per pixel */ 161#define FB_FLAG_NOMMAP 1 /* mmap unsupported. */ 162 uint32_t fb_cmap[16]; 163}; 164 165int fbd_list(void); 166int fbd_register(struct fb_info *); 167int fbd_unregister(struct fb_info *); 168 169static inline int 170register_framebuffer(struct fb_info *info) 171{ 172 173 EVENTHANDLER_INVOKE(register_framebuffer, info); 174 return (0); 175} 176 177static inline int 178unregister_framebuffer(struct fb_info *info) 179{ 180 181 EVENTHANDLER_INVOKE(unregister_framebuffer, info); 182 return (0); 183} 184#endif 185 186#ifdef notdef 187/* 188 * General purpose structure for passing info in and out of frame buffers 189 * (used for gp1) -- unsupported. 190 */ 191struct fbinfo { 192 int fb_physaddr; /* physical frame buffer address */ 193 int fb_hwwidth; /* fb board width */ 194 int fb_hwheight; /* fb board height */ 195 int fb_addrdelta; /* phys addr diff between boards */ 196 u_char *fb_ropaddr; /* fb virtual addr */ 197 int fb_unit; /* minor devnum of fb */ 198}; 199#define FBIOGINFO _IOR('F', 2, struct fbinfo) 200#endif 201 202/* 203 * Color map I/O. 204 */ 205struct fbcmap { 206 int index; /* first element (0 origin) */ 207 int count; /* number of elements */ 208 u_char *red; /* red color map elements */ 209 u_char *green; /* green color map elements */ 210 u_char *blue; /* blue color map elements */ 211}; 212#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap) 213#define FBIOGETCMAP _IOW('F', 4, struct fbcmap) 214 215/* 216 * Set/get attributes. 217 */ 218#define FB_ATTR_NDEVSPECIFIC 8 /* no. of device specific values */ 219#define FB_ATTR_NEMUTYPES 4 /* no. of emulation types */ 220 221struct fbsattr { 222 int flags; /* flags; see below */ 223 int emu_type; /* emulation type (-1 if unused) */ 224 int dev_specific[FB_ATTR_NDEVSPECIFIC]; /* catchall */ 225}; 226#define FB_ATTR_AUTOINIT 1 /* emulation auto init flag */ 227#define FB_ATTR_DEVSPECIFIC 2 /* dev. specific stuff valid flag */ 228 229struct fbgattr { 230 int real_type; /* real device type */ 231 int owner; /* PID of owner, 0 if myself */ 232 struct fbtype fbtype; /* fbtype info for real device */ 233 struct fbsattr sattr; /* see above */ 234 int emu_types[FB_ATTR_NEMUTYPES]; /* possible emulations */ 235 /* (-1 if unused) */ 236}; 237#define FBIOSATTR _IOW('F', 5, struct fbsattr) 238#define FBIOGATTR _IOR('F', 6, struct fbgattr) 239 240/* 241 * Video control. 242 */ 243#define FBVIDEO_OFF 0 244#define FBVIDEO_ON 1 245 246#define FBIOSVIDEO _IOW('F', 7, int) 247#define FBIOGVIDEO _IOR('F', 8, int) 248 249/* vertical retrace */ 250#define FBIOVERTICAL _IO('F', 9) 251 252/* 253 * Hardware cursor control (for, e.g., CG6). A rather complex and icky 254 * interface that smells like VMS, but there it is.... 255 */ 256struct fbcurpos { 257 short x; 258 short y; 259}; 260 261struct fbcursor { 262 short set; /* flags; see below */ 263 short enable; /* nonzero => cursor on, 0 => cursor off */ 264 struct fbcurpos pos; /* position on display */ 265 struct fbcurpos hot; /* hot-spot within cursor */ 266 struct fbcmap cmap; /* cursor color map */ 267 struct fbcurpos size; /* number of valid bits in image & mask */ 268 caddr_t image; /* cursor image bits */ 269 caddr_t mask; /* cursor mask bits */ 270}; 271#define FB_CUR_SETCUR 0x01 /* set on/off (i.e., obey fbcursor.enable) */ 272#define FB_CUR_SETPOS 0x02 /* set position */ 273#define FB_CUR_SETHOT 0x04 /* set hot-spot */ 274#define FB_CUR_SETCMAP 0x08 /* set cursor color map */ 275#define FB_CUR_SETSHAPE 0x10 /* set size & bits */ 276#define FB_CUR_SETALL (FB_CUR_SETCUR | FB_CUR_SETPOS | FB_CUR_SETHOT | \ 277 FB_CUR_SETCMAP | FB_CUR_SETSHAPE) 278 279/* controls for cursor attributes & shape (including position) */ 280#define FBIOSCURSOR _IOW('F', 24, struct fbcursor) 281#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor) 282 283/* controls for cursor position only */ 284#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos) 285#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos) 286 287/* get maximum cursor size */ 288#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos) 289 290/* 291 * Video board information 292 */ 293struct brd_info { 294 u_short accessible_width; /* accessible bytes in scanline */ 295 u_short accessible_height; /* number of accessible scanlines */ 296 u_short line_bytes; /* number of bytes/scanline */ 297 u_short hdb_capable; /* can this thing hardware db? */ 298 u_short vmsize; /* video memory size */ 299 u_char boardrev; /* board revision # */ 300 u_char pad0; 301 u_long pad1; 302}; 303#define FBIOGXINFO _IOR('F', 39, struct brd_info) 304 305/* 306 * Monitor information 307 */ 308struct mon_info { 309 u_long mon_type; /* bit array */ 310#define MON_TYPE_STEREO 0x8 /* stereo display */ 311#define MON_TYPE_0_OFFSET 0x4 /* black level 0 ire instead of 7.5 */ 312#define MON_TYPE_OVERSCAN 0x2 /* overscan */ 313#define MON_TYPE_GRAY 0x1 /* greyscale monitor */ 314 u_long pixfreq; /* pixel frequency in Hz */ 315 u_long hfreq; /* horizontal freq in Hz */ 316 u_long vfreq; /* vertical freq in Hz */ 317 u_long vsync; /* vertical sync in scanlines */ 318 u_long hsync; /* horizontal sync in pixels */ 319 /* these are in pixel units */ 320 u_short hfporch; /* horizontal front porch */ 321 u_short hbporch; /* horizontal back porch */ 322 u_short vfporch; /* vertical front porch */ 323 u_short vbporch; /* vertical back porch */ 324}; 325#define FBIOMONINFO _IOR('F', 40, struct mon_info) 326 327/* 328 * Color map I/O. 329 */ 330struct fbcmap_i { 331 unsigned int flags; 332#define FB_CMAP_BLOCK (1 << 0) /* wait for vertical refresh */ 333#define FB_CMAP_KERNEL (1 << 1) /* called within kernel */ 334 int id; /* color map id */ 335 int index; /* first element (0 origin) */ 336 int count; /* number of elements */ 337 u_char *red; /* red color map elements */ 338 u_char *green; /* green color map elements */ 339 u_char *blue; /* blue color map elements */ 340}; 341#define FBIOPUTCMAPI _IOW('F', 41, struct fbcmap_i) 342#define FBIOGETCMAPI _IOW('F', 42, struct fbcmap_i) 343 344/* The new style frame buffer ioctls. */ 345 346/* video mode information block */ 347struct video_info { 348 int vi_mode; /* mode number, see below */ 349 int vi_flags; 350#define V_INFO_COLOR (1 << 0) 351#define V_INFO_GRAPHICS (1 << 1) 352#define V_INFO_LINEAR (1 << 2) 353#define V_INFO_VESA (1 << 3) 354#define V_INFO_NONVGA (1 << 4) 355 int vi_width; 356 int vi_height; 357 int vi_cwidth; 358 int vi_cheight; 359 int vi_depth; 360 int vi_planes; 361 vm_offset_t vi_window; /* physical address */ 362 size_t vi_window_size; 363 size_t vi_window_gran; 364 vm_offset_t vi_buffer; /* physical address */ 365 size_t vi_buffer_size; 366 int vi_mem_model; 367#define V_INFO_MM_OTHER (-1) 368#define V_INFO_MM_TEXT 0 369#define V_INFO_MM_PLANAR 1 370#define V_INFO_MM_PACKED 2 371#define V_INFO_MM_DIRECT 3 372#define V_INFO_MM_CGA 100 373#define V_INFO_MM_HGC 101 374#define V_INFO_MM_VGAX 102 375 /* for MM_PACKED and MM_DIRECT only */ 376 int vi_pixel_size; /* in bytes */ 377 /* for MM_DIRECT only */ 378 int vi_pixel_fields[4]; /* RGB and reserved fields */ 379 int vi_pixel_fsizes[4]; 380 /* reserved */ 381 u_char vi_reserved[64]; 382 vm_offset_t vi_registers; /* physical address */ 383 vm_offset_t vi_registers_size; 384}; 385typedef struct video_info video_info_t; 386 387/* adapter infromation block */ 388struct video_adapter { 389 int va_index; 390 int va_type; 391#define KD_OTHER 0 /* unknown */ 392#define KD_MONO 1 /* monochrome adapter */ 393#define KD_HERCULES 2 /* hercules adapter */ 394#define KD_CGA 3 /* color graphics adapter */ 395#define KD_EGA 4 /* enhanced graphics adapter */ 396#define KD_VGA 5 /* video graphics adapter */ 397#define KD_PC98 6 /* PC-98 display */ 398#define KD_TGA 7 /* TGA */ 399#define KD_TGA2 8 /* TGA2 */ 400 char *va_name; 401 int va_unit; 402 int va_minor; 403 int va_flags; 404#define V_ADP_COLOR (1 << 0) 405#define V_ADP_MODECHANGE (1 << 1) 406#define V_ADP_STATESAVE (1 << 2) 407#define V_ADP_STATELOAD (1 << 3) 408#define V_ADP_FONT (1 << 4) 409#define V_ADP_PALETTE (1 << 5) 410#define V_ADP_BORDER (1 << 6) 411#define V_ADP_VESA (1 << 7) 412#define V_ADP_BOOTDISPLAY (1 << 8) 413#define V_ADP_PROBED (1 << 16) 414#define V_ADP_INITIALIZED (1 << 17) 415#define V_ADP_REGISTERED (1 << 18) 416#define V_ADP_ATTACHED (1 << 19) 417#define V_ADP_DAC8 (1 << 20) 418 vm_offset_t va_io_base; 419 int va_io_size; 420 vm_offset_t va_crtc_addr; 421 vm_offset_t va_mem_base; 422 int va_mem_size; 423 vm_offset_t va_window; /* virtual address */ 424 size_t va_window_size; 425 size_t va_window_gran; 426 u_int va_window_orig; 427 vm_offset_t va_buffer; /* virtual address */ 428 size_t va_buffer_size; 429 int va_initial_mode; 430 int va_initial_bios_mode; 431 int va_mode; 432 struct video_info va_info; 433 int va_line_width; 434 struct { 435 int x; 436 int y; 437 } va_disp_start; 438 void *va_token; 439 int va_model; 440 int va_little_bitian; 441 int va_little_endian; 442 int va_buffer_alias; 443 vm_offset_t va_registers; /* virtual address */ 444 vm_offset_t va_registers_size; 445}; 446typedef struct video_adapter video_adapter_t; 447 448struct video_adapter_info { 449 int va_index; 450 int va_type; 451 char va_name[16]; 452 int va_unit; 453 int va_flags; 454 vm_offset_t va_io_base; 455 int va_io_size; 456 vm_offset_t va_crtc_addr; 457 vm_offset_t va_mem_base; 458 int va_mem_size; 459 vm_offset_t va_window; /* virtual address */ 460 size_t va_window_size; 461 size_t va_window_gran; 462 vm_offset_t va_unused0; 463 size_t va_buffer_size; 464 int va_initial_mode; 465 int va_initial_bios_mode; 466 int va_mode; 467 int va_line_width; 468 struct { 469 int x; 470 int y; 471 } va_disp_start; 472 u_int va_window_orig; 473 /* reserved */ 474 u_char va_reserved[64]; 475}; 476typedef struct video_adapter_info video_adapter_info_t; 477 478/* some useful video adapter index */ 479#define V_ADP_PRIMARY 0 480#define V_ADP_SECONDARY 1 481 482/* video mode numbers */ 483 484#define M_B40x25 0 /* black & white 40 columns */ 485#define M_C40x25 1 /* color 40 columns */ 486#define M_B80x25 2 /* black & white 80 columns */ 487#define M_C80x25 3 /* color 80 columns */ 488#define M_BG320 4 /* black & white graphics 320x200 */ 489#define M_CG320 5 /* color graphics 320x200 */ 490#define M_BG640 6 /* black & white graphics 640x200 hi-res */ 491#define M_EGAMONO80x25 7 /* ega-mono 80x25 */ 492#define M_CG320_D 13 /* ega mode D */ 493#define M_CG640_E 14 /* ega mode E */ 494#define M_EGAMONOAPA 15 /* ega mode F */ 495#define M_CG640x350 16 /* ega mode 10 */ 496#define M_ENHMONOAPA2 17 /* ega mode F with extended memory */ 497#define M_ENH_CG640 18 /* ega mode 10* */ 498#define M_ENH_B40x25 19 /* ega enhanced black & white 40 columns */ 499#define M_ENH_C40x25 20 /* ega enhanced color 40 columns */ 500#define M_ENH_B80x25 21 /* ega enhanced black & white 80 columns */ 501#define M_ENH_C80x25 22 /* ega enhanced color 80 columns */ 502#define M_VGA_C40x25 23 /* vga 8x16 font on color */ 503#define M_VGA_C80x25 24 /* vga 8x16 font on color */ 504#define M_VGA_M80x25 25 /* vga 8x16 font on mono */ 505 506#define M_VGA11 26 /* vga 640x480 2 colors */ 507#define M_BG640x480 26 508#define M_VGA12 27 /* vga 640x480 16 colors */ 509#define M_CG640x480 27 510#define M_VGA13 28 /* vga 320x200 256 colors */ 511#define M_VGA_CG320 28 512 513#define M_VGA_C80x50 30 /* vga 8x8 font on color */ 514#define M_VGA_M80x50 31 /* vga 8x8 font on color */ 515#define M_VGA_C80x30 32 /* vga 8x16 font on color */ 516#define M_VGA_M80x30 33 /* vga 8x16 font on color */ 517#define M_VGA_C80x60 34 /* vga 8x8 font on color */ 518#define M_VGA_M80x60 35 /* vga 8x8 font on color */ 519#define M_VGA_CG640 36 /* vga 640x400 256 color */ 520#define M_VGA_MODEX 37 /* vga 320x240 256 color */ 521 522#define M_VGA_C90x25 40 /* vga 8x16 font on color */ 523#define M_VGA_M90x25 41 /* vga 8x16 font on mono */ 524#define M_VGA_C90x30 42 /* vga 8x16 font on color */ 525#define M_VGA_M90x30 43 /* vga 8x16 font on mono */ 526#define M_VGA_C90x43 44 /* vga 8x8 font on color */ 527#define M_VGA_M90x43 45 /* vga 8x8 font on mono */ 528#define M_VGA_C90x50 46 /* vga 8x8 font on color */ 529#define M_VGA_M90x50 47 /* vga 8x8 font on mono */ 530#define M_VGA_C90x60 48 /* vga 8x8 font on color */ 531#define M_VGA_M90x60 49 /* vga 8x8 font on mono */ 532 533#define M_ENH_B80x43 0x70 /* ega black & white 80x43 */ 534#define M_ENH_C80x43 0x71 /* ega color 80x43 */ 535 536#define M_PC98_80x25 98 /* PC98 text 80x25 */ 537#define M_PC98_80x30 99 /* PC98 text 80x30 */ 538#define M_PC98_EGC640x400 100 /* PC98 graphic 640x400 16 colors */ 539#define M_PC98_PEGC640x400 101 /* PC98 graphic 640x400 256 colors */ 540#define M_PC98_PEGC640x480 102 /* PC98 graphic 640x480 256 colors */ 541 542#define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */ 543#define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */ 544#define M_MCA_MODE 0xff /* monochrome adapter mode */ 545 546#define M_TEXT_80x25 200 /* generic text modes */ 547#define M_TEXT_80x30 201 548#define M_TEXT_80x43 202 549#define M_TEXT_80x50 203 550#define M_TEXT_80x60 204 551#define M_TEXT_132x25 205 552#define M_TEXT_132x30 206 553#define M_TEXT_132x43 207 554#define M_TEXT_132x50 208 555#define M_TEXT_132x60 209 556 557#define M_VESA_BASE 0x100 /* VESA mode number base */ 558#define M_VESA_CG640x400 0x100 /* 640x400, 256 color */ 559#define M_VESA_CG640x480 0x101 /* 640x480, 256 color */ 560#define M_VESA_800x600 0x102 /* 800x600, 16 color */ 561#define M_VESA_CG800x600 0x103 /* 800x600, 256 color */ 562#define M_VESA_1024x768 0x104 /* 1024x768, 16 color */ 563#define M_VESA_CG1024x768 0x105 /* 1024x768, 256 color */ 564#define M_VESA_1280x1024 0x106 /* 1280x1024, 16 color */ 565#define M_VESA_CG1280x1024 0x107 /* 1280x1024, 256 color */ 566#define M_VESA_C80x60 0x108 /* 8x8 font */ 567#define M_VESA_C132x25 0x109 /* 8x16 font */ 568#define M_VESA_C132x43 0x10a /* 8x14 font */ 569#define M_VESA_C132x50 0x10b /* 8x8 font */ 570#define M_VESA_C132x60 0x10c /* 8x8 font */ 571#define M_VESA_32K_320 0x10d /* 320x200, 5:5:5 */ 572#define M_VESA_64K_320 0x10e /* 320x200, 5:6:5 */ 573#define M_VESA_FULL_320 0x10f /* 320x200, 8:8:8 */ 574#define M_VESA_32K_640 0x110 /* 640x480, 5:5:5 */ 575#define M_VESA_64K_640 0x111 /* 640x480, 5:6:5 */ 576#define M_VESA_FULL_640 0x112 /* 640x480, 8:8:8 */ 577#define M_VESA_32K_800 0x113 /* 800x600, 5:5:5 */ 578#define M_VESA_64K_800 0x114 /* 800x600, 5:6:5 */ 579#define M_VESA_FULL_800 0x115 /* 800x600, 8:8:8 */ 580#define M_VESA_32K_1024 0x116 /* 1024x768, 5:5:5 */ 581#define M_VESA_64K_1024 0x117 /* 1024x768, 5:6:5 */ 582#define M_VESA_FULL_1024 0x118 /* 1024x768, 8:8:8 */ 583#define M_VESA_32K_1280 0x119 /* 1280x1024, 5:5:5 */ 584#define M_VESA_64K_1280 0x11a /* 1280x1024, 5:6:5 */ 585#define M_VESA_FULL_1280 0x11b /* 1280x1024, 8:8:8 */ 586#define M_VESA_MODE_MAX 0x1ff 587 588struct video_display_start { 589 int x; 590 int y; 591}; 592typedef struct video_display_start video_display_start_t; 593 594struct video_color_palette { 595 int index; /* first element (zero-based) */ 596 int count; /* number of elements */ 597 u_char *red; /* red */ 598 u_char *green; /* green */ 599 u_char *blue; /* blue */ 600 u_char *transparent; /* may be NULL */ 601}; 602typedef struct video_color_palette video_color_palette_t; 603 604/* adapter info. */ 605#define FBIO_ADAPTER _IOR('F', 100, int) 606#define FBIO_ADPTYPE _IOR('F', 101, int) 607#define FBIO_ADPINFO _IOR('F', 102, struct video_adapter_info) 608 609/* video mode control */ 610#define FBIO_MODEINFO _IOWR('F', 103, struct video_info) 611#define FBIO_FINDMODE _IOWR('F', 104, struct video_info) 612#define FBIO_GETMODE _IOR('F', 105, int) 613#define FBIO_SETMODE _IOW('F', 106, int) 614 615/* get/set frame buffer window origin */ 616#define FBIO_GETWINORG _IOR('F', 107, u_int) 617#define FBIO_SETWINORG _IOW('F', 108, u_int) 618 619/* get/set display start address */ 620#define FBIO_GETDISPSTART _IOR('F', 109, video_display_start_t) 621#define FBIO_SETDISPSTART _IOW('F', 110, video_display_start_t) 622 623/* get/set scan line width */ 624#define FBIO_GETLINEWIDTH _IOR('F', 111, u_int) 625#define FBIO_SETLINEWIDTH _IOW('F', 112, u_int) 626 627/* color palette control */ 628#define FBIO_GETPALETTE _IOW('F', 113, video_color_palette_t) 629#define FBIO_SETPALETTE _IOW('F', 114, video_color_palette_t) 630 631/* blank display */ 632#define V_DISPLAY_ON 0 633#define V_DISPLAY_BLANK 1 634#define V_DISPLAY_STAND_BY 2 635#define V_DISPLAY_SUSPEND 3 636 637#define FBIO_BLANK _IOW('F', 115, int) 638 639#endif /* !_SYS_FBIO_H_ */ 640