| 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 | * 3. All advertising materials mentioning features or use of this software |
| 18 | * must display the following acknowledgement: |
| 19 | * This product includes software developed by the University of |
| 20 | * California, Berkeley and its contributors. |
| 21 | * 4. Neither the name of the University nor the names of its contributors |
| 22 | * may be used to endorse or promote products derived from this software |
| 23 | * without specific prior written permission. |
| 24 | * |
| 25 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 35 | * SUCH DAMAGE. |
| 36 | * |
| 37 | * @(#)fbio.h 8.2 (Berkeley) 10/30/93 |
| 38 | * |
| 39 | * $FreeBSD: src/sys/sys/fbio.h,v 1.9.2.1 2000/05/05 09:16:16 nyan Exp $ |
| 40 | * $DragonFly: src/sys/sys/fbio.h,v 1.4 2005/03/13 01:53:56 swildner Exp $ |
| 41 | */ |
| 42 | |
| 43 | #ifndef _SYS_FBIO_H_ |
| 44 | #define _SYS_FBIO_H_ |
| 45 | |
| 46 | #ifndef _KERNEL |
| 47 | #include <sys/types.h> |
| 48 | #endif |
| 49 | #include <sys/ioccom.h> |
| 50 | |
| 51 | /* |
| 52 | * Frame buffer ioctls (from Sprite, trimmed to essentials for X11). |
| 53 | */ |
| 54 | |
| 55 | /* |
| 56 | * Frame buffer type codes. |
| 57 | */ |
| 58 | #define FBTYPE_SUN1BW 0 /* multibus mono */ |
| 59 | #define FBTYPE_SUN1COLOR 1 /* multibus color */ |
| 60 | #define FBTYPE_SUN2BW 2 /* memory mono */ |
| 61 | #define FBTYPE_SUN2COLOR 3 /* color w/rasterop chips */ |
| 62 | #define FBTYPE_SUN2GP 4 /* GP1/GP2 */ |
| 63 | #define FBTYPE_SUN5COLOR 5 /* RoadRunner accelerator */ |
| 64 | #define FBTYPE_SUN3COLOR 6 /* memory color */ |
| 65 | #define FBTYPE_MEMCOLOR 7 /* memory 24-bit */ |
| 66 | #define FBTYPE_SUN4COLOR 8 /* memory color w/overlay */ |
| 67 | |
| 68 | #define FBTYPE_NOTSUN1 9 /* reserved for customer */ |
| 69 | #define FBTYPE_NOTSUN2 10 /* reserved for customer */ |
| 70 | #define FBTYPE_NOTSUN3 11 /* reserved for customer */ |
| 71 | |
| 72 | #define FBTYPE_SUNFAST_COLOR 12 /* accelerated 8bit */ |
| 73 | #define FBTYPE_SUNROP_COLOR 13 /* MEMCOLOR with rop h/w */ |
| 74 | #define FBTYPE_SUNFB_VIDEO 14 /* Simple video mixing */ |
| 75 | #define FBTYPE_RESERVED5 15 /* reserved, do not use */ |
| 76 | #define FBTYPE_RESERVED4 16 /* reserved, do not use */ |
| 77 | #define FBTYPE_RESERVED3 17 /* reserved, do not use */ |
| 78 | #define FBTYPE_RESERVED2 18 /* reserved, do not use */ |
| 79 | #define FBTYPE_RESERVED1 19 /* reserved, do not use */ |
| 80 | |
| 81 | #define FBTYPE_MDA 20 |
| 82 | #define FBTYPE_HERCULES 21 |
| 83 | #define FBTYPE_CGA 22 |
| 84 | #define FBTYPE_EGA 23 |
| 85 | #define FBTYPE_VGA 24 |
| 86 | #define FBTYPE_TGA 26 |
| 87 | |
| 88 | #define FBTYPE_LASTPLUSONE 27 /* max number of fbs (change as add) */ |
| 89 | |
| 90 | /* |
| 91 | * Frame buffer descriptor as returned by FBIOGTYPE. |
| 92 | */ |
| 93 | struct fbtype { |
| 94 | int fb_type; /* as defined above */ |
| 95 | int fb_height; /* in pixels */ |
| 96 | int fb_width; /* in pixels */ |
| 97 | int fb_depth; /* bits per pixel */ |
| 98 | int fb_cmsize; /* size of color map (entries) */ |
| 99 | int fb_size; /* total size in bytes */ |
| 100 | }; |
| 101 | #define FBIOGTYPE _IOR('F', 0, struct fbtype) |
| 102 | |
| 103 | #ifdef notdef |
| 104 | /* |
| 105 | * General purpose structure for passing info in and out of frame buffers |
| 106 | * (used for gp1) -- unsupported. |
| 107 | */ |
| 108 | struct fbinfo { |
| 109 | int fb_physaddr; /* physical frame buffer address */ |
| 110 | int fb_hwwidth; /* fb board width */ |
| 111 | int fb_hwheight; /* fb board height */ |
| 112 | int fb_addrdelta; /* phys addr diff between boards */ |
| 113 | u_char *fb_ropaddr; /* fb virtual addr */ |
| 114 | int fb_unit; /* minor devnum of fb */ |
| 115 | }; |
| 116 | #define FBIOGINFO _IOR('F', 2, struct fbinfo) |
| 117 | #endif |
| 118 | |
| 119 | /* |
| 120 | * Color map I/O. |
| 121 | */ |
| 122 | struct fbcmap { |
| 123 | int index; /* first element (0 origin) */ |
| 124 | int count; /* number of elements */ |
| 125 | u_char *red; /* red color map elements */ |
| 126 | u_char *green; /* green color map elements */ |
| 127 | u_char *blue; /* blue color map elements */ |
| 128 | }; |
| 129 | #define FBIOPUTCMAP _IOW('F', 3, struct fbcmap) |
| 130 | #define FBIOGETCMAP _IOW('F', 4, struct fbcmap) |
| 131 | |
| 132 | /* |
| 133 | * Set/get attributes. |
| 134 | */ |
| 135 | #define FB_ATTR_NDEVSPECIFIC 8 /* no. of device specific values */ |
| 136 | #define FB_ATTR_NEMUTYPES 4 /* no. of emulation types */ |
| 137 | |
| 138 | struct fbsattr { |
| 139 | int flags; /* flags; see below */ |
| 140 | int emu_type; /* emulation type (-1 if unused) */ |
| 141 | int dev_specific[FB_ATTR_NDEVSPECIFIC]; /* catchall */ |
| 142 | }; |
| 143 | #define FB_ATTR_AUTOINIT 1 /* emulation auto init flag */ |
| 144 | #define FB_ATTR_DEVSPECIFIC 2 /* dev. specific stuff valid flag */ |
| 145 | |
| 146 | struct fbgattr { |
| 147 | int real_type; /* real device type */ |
| 148 | int owner; /* PID of owner, 0 if myself */ |
| 149 | struct fbtype fbtype; /* fbtype info for real device */ |
| 150 | struct fbsattr sattr; /* see above */ |
| 151 | int emu_types[FB_ATTR_NEMUTYPES]; /* possible emulations */ |
| 152 | /* (-1 if unused) */ |
| 153 | }; |
| 154 | /* FBIOSATTR _IOW('F', 5, struct fbsattr) -- unsupported */ |
| 155 | #define FBIOGATTR _IOR('F', 6, struct fbgattr) |
| 156 | |
| 157 | /* |
| 158 | * Video control. |
| 159 | */ |
| 160 | #define FBVIDEO_OFF 0 |
| 161 | #define FBVIDEO_ON 1 |
| 162 | |
| 163 | #define FBIOSVIDEO _IOW('F', 7, int) |
| 164 | #define FBIOGVIDEO _IOR('F', 8, int) |
| 165 | |
| 166 | /* |
| 167 | * Hardware cursor control (for, e.g., CG6). A rather complex and icky |
| 168 | * interface that smells like VMS, but there it is.... |
| 169 | */ |
| 170 | struct fbcurpos { |
| 171 | short x; |
| 172 | short y; |
| 173 | }; |
| 174 | |
| 175 | struct fbcursor { |
| 176 | short set; /* flags; see below */ |
| 177 | short enable; /* nonzero => cursor on, 0 => cursor off */ |
| 178 | struct fbcurpos pos; /* position on display */ |
| 179 | struct fbcurpos hot; /* hot-spot within cursor */ |
| 180 | struct fbcmap cmap; /* cursor color map */ |
| 181 | struct fbcurpos size; /* number of valid bits in image & mask */ |
| 182 | caddr_t image; /* cursor image bits */ |
| 183 | caddr_t mask; /* cursor mask bits */ |
| 184 | }; |
| 185 | #define FB_CUR_SETCUR 0x01 /* set on/off (i.e., obey fbcursor.enable) */ |
| 186 | #define FB_CUR_SETPOS 0x02 /* set position */ |
| 187 | #define FB_CUR_SETHOT 0x04 /* set hot-spot */ |
| 188 | #define FB_CUR_SETCMAP 0x08 /* set cursor color map */ |
| 189 | #define FB_CUR_SETSHAPE 0x10 /* set size & bits */ |
| 190 | #define FB_CUR_SETALL (FB_CUR_SETCUR | FB_CUR_SETPOS | FB_CUR_SETHOT | \ |
| 191 | FB_CUR_SETCMAP | FB_CUR_SETSHAPE) |
| 192 | |
| 193 | /* controls for cursor attributes & shape (including position) */ |
| 194 | #define FBIOSCURSOR _IOW('F', 24, struct fbcursor) |
| 195 | #define FBIOGCURSOR _IOWR('F', 25, struct fbcursor) |
| 196 | |
| 197 | /* controls for cursor position only */ |
| 198 | #define FBIOSCURPOS _IOW('F', 26, struct fbcurpos) |
| 199 | #define FBIOGCURPOS _IOW('F', 27, struct fbcurpos) |
| 200 | |
| 201 | /* get maximum cursor size */ |
| 202 | #define FBIOGCURMAX _IOR('F', 28, struct fbcurpos) |
| 203 | |
| 204 | /* The new style frame buffer ioctls. */ |
| 205 | |
| 206 | /* video mode information block */ |
| 207 | struct video_info { |
| 208 | int vi_mode; /* mode number, see below */ |
| 209 | int vi_flags; |
| 210 | #define V_INFO_COLOR (1 << 0) |
| 211 | #define V_INFO_GRAPHICS (1 << 1) |
| 212 | #define V_INFO_LINEAR (1 << 2) |
| 213 | #define V_INFO_VESA (1 << 3) |
| 214 | int vi_width; |
| 215 | int vi_height; |
| 216 | int vi_cwidth; |
| 217 | int vi_cheight; |
| 218 | int vi_depth; |
| 219 | int vi_planes; |
| 220 | u_int vi_window; /* physical address */ |
| 221 | size_t vi_window_size; |
| 222 | size_t vi_window_gran; |
| 223 | u_int vi_buffer; /* physical address */ |
| 224 | size_t vi_buffer_size; |
| 225 | int vi_mem_model; |
| 226 | #define V_INFO_MM_OTHER (-1) |
| 227 | #define V_INFO_MM_TEXT 0 |
| 228 | #define V_INFO_MM_PLANAR 1 |
| 229 | #define V_INFO_MM_PACKED 2 |
| 230 | #define V_INFO_MM_DIRECT 3 |
| 231 | #define V_INFO_MM_CGA 100 |
| 232 | #define V_INFO_MM_HGC 101 |
| 233 | #define V_INFO_MM_VGAX 102 |
| 234 | /* for MM_PACKED and MM_DIRECT only */ |
| 235 | int vi_pixel_size; /* in bytes */ |
| 236 | /* for MM_DIRECT only */ |
| 237 | int vi_pixel_fields[4]; /* RGB and reserved fields */ |
| 238 | int vi_pixel_fsizes[4]; |
| 239 | /* reserved */ |
| 240 | u_char vi_reserved[64]; |
| 241 | }; |
| 242 | typedef struct video_info video_info_t; |
| 243 | |
| 244 | /* adapter infromation block */ |
| 245 | struct video_adapter { |
| 246 | int va_index; |
| 247 | int va_type; |
| 248 | #define KD_OTHER 0 /* unknown */ |
| 249 | #define KD_MONO 1 /* monochrome adapter */ |
| 250 | #define KD_HERCULES 2 /* hercules adapter */ |
| 251 | #define KD_CGA 3 /* color graphics adapter */ |
| 252 | #define KD_EGA 4 /* enhanced graphics adapter */ |
| 253 | #define KD_VGA 5 /* video graphics adapter */ |
| 254 | #define KD_TGA 7 /* TGA */ |
| 255 | char *va_name; |
| 256 | int va_unit; |
| 257 | int va_minor; |
| 258 | int va_flags; |
| 259 | #define V_ADP_COLOR (1 << 0) |
| 260 | #define V_ADP_MODECHANGE (1 << 1) |
| 261 | #define V_ADP_STATESAVE (1 << 2) |
| 262 | #define V_ADP_STATELOAD (1 << 3) |
| 263 | #define V_ADP_FONT (1 << 4) |
| 264 | #define V_ADP_PALETTE (1 << 5) |
| 265 | #define V_ADP_BORDER (1 << 6) |
| 266 | #define V_ADP_VESA (1 << 7) |
| 267 | #define V_ADP_PROBED (1 << 16) |
| 268 | #define V_ADP_INITIALIZED (1 << 17) |
| 269 | #define V_ADP_REGISTERED (1 << 18) |
| 270 | int va_io_base; |
| 271 | int va_io_size; |
| 272 | int va_crtc_addr; |
| 273 | int va_mem_base; |
| 274 | int va_mem_size; |
| 275 | vm_offset_t va_window; /* virtual address */ |
| 276 | size_t va_window_size; |
| 277 | size_t va_window_gran; |
| 278 | u_int va_window_orig; |
| 279 | vm_offset_t va_buffer; /* virtual address */ |
| 280 | size_t va_buffer_size; |
| 281 | int va_initial_mode; |
| 282 | int va_initial_bios_mode; |
| 283 | int va_mode; |
| 284 | u_char va_palette_regs[16]; |
| 285 | struct video_info va_info; |
| 286 | int va_line_width; |
| 287 | struct { |
| 288 | int x; |
| 289 | int y; |
| 290 | } va_disp_start; |
| 291 | void *va_token; |
| 292 | }; |
| 293 | typedef struct video_adapter video_adapter_t; |
| 294 | |
| 295 | struct video_adapter_info { |
| 296 | int va_index; |
| 297 | int va_type; |
| 298 | char va_name[16]; |
| 299 | int va_unit; |
| 300 | int va_flags; |
| 301 | int va_io_base; |
| 302 | int va_io_size; |
| 303 | int va_crtc_addr; |
| 304 | int va_mem_base; |
| 305 | int va_mem_size; |
| 306 | u_int va_window; /* virtual address */ |
| 307 | size_t va_window_size; |
| 308 | size_t va_window_gran; |
| 309 | u_int va_unused0; |
| 310 | size_t va_buffer_size; |
| 311 | int va_initial_mode; |
| 312 | int va_initial_bios_mode; |
| 313 | int va_mode; |
| 314 | int va_line_width; |
| 315 | struct { |
| 316 | int x; |
| 317 | int y; |
| 318 | } va_disp_start; |
| 319 | u_int va_window_orig; |
| 320 | /* reserved */ |
| 321 | u_char va_reserved[64]; |
| 322 | }; |
| 323 | typedef struct video_adapter_info video_adapter_info_t; |
| 324 | |
| 325 | /* some useful video adapter index */ |
| 326 | #define V_ADP_PRIMARY 0 |
| 327 | #define V_ADP_SECONDARY 1 |
| 328 | |
| 329 | /* video mode numbers */ |
| 330 | |
| 331 | #define M_B40x25 0 /* black & white 40 columns */ |
| 332 | #define M_C40x25 1 /* color 40 columns */ |
| 333 | #define M_B80x25 2 /* black & white 80 columns */ |
| 334 | #define M_C80x25 3 /* color 80 columns */ |
| 335 | #define M_BG320 4 /* black & white graphics 320x200 */ |
| 336 | #define M_CG320 5 /* color graphics 320x200 */ |
| 337 | #define M_BG640 6 /* black & white graphics 640x200 hi-res */ |
| 338 | #define M_EGAMONO80x25 7 /* ega-mono 80x25 */ |
| 339 | #define M_CG320_D 13 /* ega mode D */ |
| 340 | #define M_CG640_E 14 /* ega mode E */ |
| 341 | #define M_EGAMONOAPA 15 /* ega mode F */ |
| 342 | #define M_CG640x350 16 /* ega mode 10 */ |
| 343 | #define M_ENHMONOAPA2 17 /* ega mode F with extended memory */ |
| 344 | #define M_ENH_CG640 18 /* ega mode 10* */ |
| 345 | #define M_ENH_B40x25 19 /* ega enhanced black & white 40 columns */ |
| 346 | #define M_ENH_C40x25 20 /* ega enhanced color 40 columns */ |
| 347 | #define M_ENH_B80x25 21 /* ega enhanced black & white 80 columns */ |
| 348 | #define M_ENH_C80x25 22 /* ega enhanced color 80 columns */ |
| 349 | #define M_VGA_C40x25 23 /* vga 8x16 font on color */ |
| 350 | #define M_VGA_C80x25 24 /* vga 8x16 font on color */ |
| 351 | #define M_VGA_M80x25 25 /* vga 8x16 font on mono */ |
| 352 | |
| 353 | #define M_VGA11 26 /* vga 640x480 2 colors */ |
| 354 | #define M_BG640x480 26 |
| 355 | #define M_VGA12 27 /* vga 640x480 16 colors */ |
| 356 | #define M_CG640x480 27 |
| 357 | #define M_VGA13 28 /* vga 320x200 256 colors */ |
| 358 | #define M_VGA_CG320 28 |
| 359 | |
| 360 | #define M_VGA_C80x50 30 /* vga 8x8 font on color */ |
| 361 | #define M_VGA_M80x50 31 /* vga 8x8 font on color */ |
| 362 | #define M_VGA_C80x30 32 /* vga 8x16 font on color */ |
| 363 | #define M_VGA_M80x30 33 /* vga 8x16 font on color */ |
| 364 | #define M_VGA_C80x60 34 /* vga 8x8 font on color */ |
| 365 | #define M_VGA_M80x60 35 /* vga 8x8 font on color */ |
| 366 | #define M_VGA_CG640 36 /* vga 640x400 256 color */ |
| 367 | #define M_VGA_MODEX 37 /* vga 320x240 256 color */ |
| 368 | |
| 369 | #define M_VGA_C90x25 40 /* vga 8x16 font on color */ |
| 370 | #define M_VGA_M90x25 41 /* vga 8x16 font on mono */ |
| 371 | #define M_VGA_C90x30 42 /* vga 8x16 font on color */ |
| 372 | #define M_VGA_M90x30 43 /* vga 8x16 font on mono */ |
| 373 | #define M_VGA_C90x43 44 /* vga 8x8 font on color */ |
| 374 | #define M_VGA_M90x43 45 /* vga 8x8 font on mono */ |
| 375 | #define M_VGA_C90x50 46 /* vga 8x8 font on color */ |
| 376 | #define M_VGA_M90x50 47 /* vga 8x8 font on mono */ |
| 377 | #define M_VGA_C90x60 48 /* vga 8x8 font on color */ |
| 378 | #define M_VGA_M90x60 49 /* vga 8x8 font on mono */ |
| 379 | |
| 380 | #define M_ENH_B80x43 0x70 /* ega black & white 80x43 */ |
| 381 | #define M_ENH_C80x43 0x71 /* ega color 80x43 */ |
| 382 | |
| 383 | #define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */ |
| 384 | #define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */ |
| 385 | #define M_MCA_MODE 0xff /* monochrome adapter mode */ |
| 386 | |
| 387 | #define M_TEXT_80x25 200 /* generic text modes */ |
| 388 | #define M_TEXT_80x30 201 |
| 389 | #define M_TEXT_80x43 202 |
| 390 | #define M_TEXT_80x50 203 |
| 391 | #define M_TEXT_80x60 204 |
| 392 | #define M_TEXT_132x25 205 |
| 393 | #define M_TEXT_132x30 206 |
| 394 | #define M_TEXT_132x43 207 |
| 395 | #define M_TEXT_132x50 208 |
| 396 | #define M_TEXT_132x60 209 |
| 397 | |
| 398 | #define M_VESA_BASE 0x100 /* VESA mode number base */ |
| 399 | #define M_VESA_CG640x400 0x100 /* 640x400, 256 color */ |
| 400 | #define M_VESA_CG640x480 0x101 /* 640x480, 256 color */ |
| 401 | #define M_VESA_800x600 0x102 /* 800x600, 16 color */ |
| 402 | #define M_VESA_CG800x600 0x103 /* 800x600, 256 color */ |
| 403 | #define M_VESA_1024x768 0x104 /* 1024x768, 16 color */ |
| 404 | #define M_VESA_CG1024x768 0x105 /* 1024x768, 256 color */ |
| 405 | #define M_VESA_1280x1024 0x106 /* 1280x1024, 16 color */ |
| 406 | #define M_VESA_CG1280x1024 0x107 /* 1280x1024, 256 color */ |
| 407 | #define M_VESA_C80x60 0x108 /* 8x8 font */ |
| 408 | #define M_VESA_C132x25 0x109 /* 8x16 font */ |
| 409 | #define M_VESA_C132x43 0x10a /* 8x14 font */ |
| 410 | #define M_VESA_C132x50 0x10b /* 8x8 font */ |
| 411 | #define M_VESA_C132x60 0x10c /* 8x8 font */ |
| 412 | #define M_VESA_32K_320 0x10d /* 320x200, 5:5:5 */ |
| 413 | #define M_VESA_64K_320 0x10e /* 320x200, 5:6:5 */ |
| 414 | #define M_VESA_FULL_320 0x10f /* 320x200, 8:8:8 */ |
| 415 | #define M_VESA_32K_640 0x110 /* 640x480, 5:5:5 */ |
| 416 | #define M_VESA_64K_640 0x111 /* 640x480, 5:6:5 */ |
| 417 | #define M_VESA_FULL_640 0x112 /* 640x480, 8:8:8 */ |
| 418 | #define M_VESA_32K_800 0x113 /* 800x600, 5:5:5 */ |
| 419 | #define M_VESA_64K_800 0x114 /* 800x600, 5:6:5 */ |
| 420 | #define M_VESA_FULL_800 0x115 /* 800x600, 8:8:8 */ |
| 421 | #define M_VESA_32K_1024 0x116 /* 1024x768, 5:5:5 */ |
| 422 | #define M_VESA_64K_1024 0x117 /* 1024x768, 5:6:5 */ |
| 423 | #define M_VESA_FULL_1024 0x118 /* 1024x768, 8:8:8 */ |
| 424 | #define M_VESA_32K_1280 0x119 /* 1280x1024, 5:5:5 */ |
| 425 | #define M_VESA_64K_1280 0x11a /* 1280x1024, 5:6:5 */ |
| 426 | #define M_VESA_FULL_1280 0x11b /* 1280x1024, 8:8:8 */ |
| 427 | #define M_VESA_MODE_MAX 0x1ff |
| 428 | |
| 429 | struct video_display_start { |
| 430 | int x; |
| 431 | int y; |
| 432 | }; |
| 433 | typedef struct video_display_start video_display_start_t; |
| 434 | |
| 435 | struct video_color_palette { |
| 436 | int index; /* first element (zero-based) */ |
| 437 | int count; /* number of elements */ |
| 438 | u_char *red; /* red */ |
| 439 | u_char *green; /* green */ |
| 440 | u_char *blue; /* blue */ |
| 441 | u_char *transparent; /* may be NULL */ |
| 442 | }; |
| 443 | typedef struct video_color_palette video_color_palette_t; |
| 444 | |
| 445 | /* adapter info. */ |
| 446 | #define FBIO_ADAPTER _IOR('F', 100, int) |
| 447 | #define FBIO_ADPTYPE _IOR('F', 101, int) |
| 448 | #define FBIO_ADPINFO _IOR('F', 102, struct video_adapter_info) |
| 449 | |
| 450 | /* video mode control */ |
| 451 | #define FBIO_MODEINFO _IOWR('F', 103, struct video_info) |
| 452 | #define FBIO_FINDMODE _IOWR('F', 104, struct video_info) |
| 453 | #define FBIO_GETMODE _IOR('F', 105, int) |
| 454 | #define FBIO_SETMODE _IOW('F', 106, int) |
| 455 | |
| 456 | /* get/set frame buffer window origin */ |
| 457 | #define FBIO_GETWINORG _IOR('F', 107, u_int) |
| 458 | #define FBIO_SETWINORG _IOW('F', 108, u_int) |
| 459 | |
| 460 | /* get/set display start address */ |
| 461 | #define FBIO_GETDISPSTART _IOR('F', 109, video_display_start_t) |
| 462 | #define FBIO_SETDISPSTART _IOW('F', 110, video_display_start_t) |
| 463 | |
| 464 | /* get/set scan line width */ |
| 465 | #define FBIO_GETLINEWIDTH _IOR('F', 111, u_int) |
| 466 | #define FBIO_SETLINEWIDTH _IOW('F', 112, u_int) |
| 467 | |
| 468 | /* color palette control */ |
| 469 | #define FBIO_GETPALETTE _IOW('F', 113, video_color_palette_t) |
| 470 | #define FBIO_SETPALETTE _IOW('F', 114, video_color_palette_t) |
| 471 | |
| 472 | #endif /* !_SYS_FBIO_H_ */ |