1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux 1 2 #ifndef _UAPI_LINUX_FB_H 3 #define _UAPI_LINUX_FB_H 4 5 #include <linux/types.h> 6 #include <linux/i2c.h> 7 #include <linux/vesa.h> 8 9 /* Definitions of frame buffers 10 11 #define FB_MAX 32 /* suf 12 13 /* ioctls 14 0x46 is 'F' 15 #define FBIOGET_VSCREENINFO 0x4600 16 #define FBIOPUT_VSCREENINFO 0x4601 17 #define FBIOGET_FSCREENINFO 0x4602 18 #define FBIOGETCMAP 0x4604 19 #define FBIOPUTCMAP 0x4605 20 #define FBIOPAN_DISPLAY 0x4606 21 #ifndef __KERNEL__ 22 #define FBIO_CURSOR _IOWR('F', 0x08 23 #endif 24 /* 0x4607-0x460B are defined below */ 25 /* #define FBIOGET_MONITORSPEC 0x460C */ 26 /* #define FBIOPUT_MONITORSPEC 0x460D */ 27 /* #define FBIOSWITCH_MONIBIT 0x460E */ 28 #define FBIOGET_CON2FBMAP 0x460F 29 #define FBIOPUT_CON2FBMAP 0x4610 30 #define FBIOBLANK 0x4611 31 #define FBIOGET_VBLANK _IOR('F', 0x12 32 #define FBIO_ALLOC 0x4613 33 #define FBIO_FREE 0x4614 34 #define FBIOGET_GLYPH 0x4615 35 #define FBIOGET_HWCINFO 0x4616 36 #define FBIOPUT_MODEINFO 0x4617 37 #define FBIOGET_DISPINFO 0x4618 38 #define FBIO_WAITFORVSYNC _IOW('F', 0x20 39 40 #define FB_TYPE_PACKED_PIXELS 0 41 #define FB_TYPE_PLANES 1 42 #define FB_TYPE_INTERLEAVED_PLANES 2 43 #define FB_TYPE_TEXT 3 44 #define FB_TYPE_VGA_PLANES 4 45 #define FB_TYPE_FOURCC 5 46 47 #define FB_AUX_TEXT_MDA 0 /* Mon 48 #define FB_AUX_TEXT_CGA 1 /* CGA 49 #define FB_AUX_TEXT_S3_MMIO 2 /* S3 50 #define FB_AUX_TEXT_MGA_STEP16 3 /* MGA 51 #define FB_AUX_TEXT_MGA_STEP8 4 /* oth 52 #define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-1 53 #define FB_AUX_TEXT_SVGA_MASK 7 /* low 54 #define FB_AUX_TEXT_SVGA_STEP2 8 /* SVG 55 #define FB_AUX_TEXT_SVGA_STEP4 9 /* SVG 56 #define FB_AUX_TEXT_SVGA_STEP8 10 /* SVG 57 #define FB_AUX_TEXT_SVGA_STEP16 11 /* SVG 58 #define FB_AUX_TEXT_SVGA_LAST 15 /* res 59 60 #define FB_AUX_VGA_PLANES_VGA4 0 61 #define FB_AUX_VGA_PLANES_CFB4 1 62 #define FB_AUX_VGA_PLANES_CFB8 2 63 64 #define FB_VISUAL_MONO01 0 65 #define FB_VISUAL_MONO10 1 66 #define FB_VISUAL_TRUECOLOR 2 67 #define FB_VISUAL_PSEUDOCOLOR 3 68 #define FB_VISUAL_DIRECTCOLOR 4 69 #define FB_VISUAL_STATIC_PSEUDOCOLOR 5 70 #define FB_VISUAL_FOURCC 6 71 72 #define FB_ACCEL_NONE 0 /* no 73 #define FB_ACCEL_ATARIBLITT 1 /* Ata 74 #define FB_ACCEL_AMIGABLITT 2 /* Ami 75 #define FB_ACCEL_S3_TRIO64 3 /* Cyb 76 #define FB_ACCEL_NCR_77C32BLT 4 /* Ret 77 #define FB_ACCEL_S3_VIRGE 5 /* Cyb 78 #define FB_ACCEL_ATI_MACH64GX 6 /* ATI 79 #define FB_ACCEL_DEC_TGA 7 /* DEC 80 #define FB_ACCEL_ATI_MACH64CT 8 /* ATI 81 #define FB_ACCEL_ATI_MACH64VT 9 /* ATI 82 #define FB_ACCEL_ATI_MACH64GT 10 /* ATI 83 #define FB_ACCEL_SUN_CREATOR 11 /* Sun 84 #define FB_ACCEL_SUN_CGSIX 12 /* Sun 85 #define FB_ACCEL_SUN_LEO 13 /* Sun 86 #define FB_ACCEL_IMS_TWINTURBO 14 /* IMS 87 #define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dl 88 #define FB_ACCEL_MATROX_MGA2064W 16 /* Mat 89 #define FB_ACCEL_MATROX_MGA1064SG 17 /* Mat 90 #define FB_ACCEL_MATROX_MGA2164W 18 /* Mat 91 #define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Mat 92 #define FB_ACCEL_MATROX_MGAG100 20 /* Mat 93 #define FB_ACCEL_MATROX_MGAG200 21 /* Mat 94 #define FB_ACCEL_SUN_CG14 22 /* Sun 95 #define FB_ACCEL_SUN_BWTWO 23 /* Sun 96 #define FB_ACCEL_SUN_CGTHREE 24 /* Sun 97 #define FB_ACCEL_SUN_TCX 25 /* Sun 98 #define FB_ACCEL_MATROX_MGAG400 26 /* Mat 99 #define FB_ACCEL_NV3 27 /* nVi 100 #define FB_ACCEL_NV4 28 /* nVi 101 #define FB_ACCEL_NV5 29 /* nVi 102 #define FB_ACCEL_CT_6555x 30 /* C&T 103 #define FB_ACCEL_3DFX_BANSHEE 31 /* 3Df 104 #define FB_ACCEL_ATI_RAGE128 32 /* ATI 105 #define FB_ACCEL_IGS_CYBER2000 33 /* Cyb 106 #define FB_ACCEL_IGS_CYBER2010 34 /* Cyb 107 #define FB_ACCEL_IGS_CYBER5000 35 /* Cyb 108 #define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 109 #define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dl 110 #define FB_ACCEL_ATI_RADEON 38 /* ATI 111 #define FB_ACCEL_I810 39 /* Int 112 #define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 113 #define FB_ACCEL_SIS_XABRE 41 /* SiS 114 #define FB_ACCEL_I830 42 /* Int 115 #define FB_ACCEL_NV_10 43 /* nVi 116 #define FB_ACCEL_NV_20 44 /* nVi 117 #define FB_ACCEL_NV_30 45 /* nVi 118 #define FB_ACCEL_NV_40 46 /* nVi 119 #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI 120 #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI 121 #define FB_ACCEL_OMAP1610 49 /* TI 122 #define FB_ACCEL_TRIDENT_TGUI 50 /* Tri 123 #define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Tri 124 #define FB_ACCEL_TRIDENT_BLADE3D 52 /* Tri 125 #define FB_ACCEL_TRIDENT_BLADEXP 53 /* Tri 126 #define FB_ACCEL_CIRRUS_ALPINE 53 /* Cir 127 #define FB_ACCEL_NEOMAGIC_NM2070 90 /* Neo 128 #define FB_ACCEL_NEOMAGIC_NM2090 91 /* Neo 129 #define FB_ACCEL_NEOMAGIC_NM2093 92 /* Neo 130 #define FB_ACCEL_NEOMAGIC_NM2097 93 /* Neo 131 #define FB_ACCEL_NEOMAGIC_NM2160 94 /* Neo 132 #define FB_ACCEL_NEOMAGIC_NM2200 95 /* Neo 133 #define FB_ACCEL_NEOMAGIC_NM2230 96 /* Neo 134 #define FB_ACCEL_NEOMAGIC_NM2360 97 /* Neo 135 #define FB_ACCEL_NEOMAGIC_NM2380 98 /* Neo 136 #define FB_ACCEL_PXA3XX 99 /* PXA 137 138 #define FB_ACCEL_SAVAGE4 0x80 /* S3 139 #define FB_ACCEL_SAVAGE3D 0x81 /* S3 140 #define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 141 #define FB_ACCEL_SAVAGE2000 0x83 /* S3 142 #define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 143 #define FB_ACCEL_SAVAGE_MX 0x85 /* S3 144 #define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 145 #define FB_ACCEL_SAVAGE_IX 0x87 /* S3 146 #define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 147 #define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 148 #define FB_ACCEL_S3TWISTER_P 0x8a /* S3 149 #define FB_ACCEL_S3TWISTER_K 0x8b /* S3 150 #define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 151 #define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 152 #define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 153 154 #define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKU 155 156 #define FB_CAP_FOURCC 1 /* Dev 157 158 struct fb_fix_screeninfo { 159 char id[16]; /* ide 160 unsigned long smem_start; /* Sta 161 /* (ph 162 __u32 smem_len; /* Len 163 __u32 type; /* see 164 __u32 type_aux; /* Int 165 __u32 visual; /* see 166 __u16 xpanstep; /* zer 167 __u16 ypanstep; /* zer 168 __u16 ywrapstep; /* zer 169 __u32 line_length; /* len 170 unsigned long mmio_start; /* Sta 171 /* (ph 172 __u32 mmio_len; /* Len 173 __u32 accel; /* Ind 174 /* sp 175 __u16 capabilities; /* see 176 __u16 reserved[2]; /* Res 177 }; 178 179 /* Interpretation of offset for color fields: 180 * inside a "pixel" value, which is exactly 'b 181 * can use the offset as right argument to <<) 182 * stream and is written to video memory as th 183 * 184 * For pseudocolor: offset and length should b 185 * components. Offset specifies the position o 186 * of the palette index in a pixel value. Leng 187 * of available palette entries (i.e. # of ent 188 */ 189 struct fb_bitfield { 190 __u32 offset; /* beg 191 __u32 length; /* len 192 __u32 msb_right; /* != 193 /* rig 194 }; 195 196 #define FB_NONSTD_HAM 1 /* Hol 197 #define FB_NONSTD_REV_PIX_IN_B 2 /* ord 198 199 #define FB_ACTIVATE_NOW 0 /* set 200 #define FB_ACTIVATE_NXTOPEN 1 /* act 201 #define FB_ACTIVATE_TEST 2 /* don 202 #define FB_ACTIVATE_MASK 15 203 /* val 204 #define FB_ACTIVATE_VBL 16 /* act 205 #define FB_CHANGE_CMAP_VBL 32 /* cha 206 #define FB_ACTIVATE_ALL 64 /* cha 207 #define FB_ACTIVATE_FORCE 128 /* for 208 #define FB_ACTIVATE_INV_MODE 256 /* inv 209 #define FB_ACTIVATE_KD_TEXT 512 /* for 210 211 #define FB_ACCELF_TEXT 1 /* (OB 212 213 #define FB_SYNC_HOR_HIGH_ACT 1 /* hor 214 #define FB_SYNC_VERT_HIGH_ACT 2 /* ver 215 #define FB_SYNC_EXT 4 /* ext 216 #define FB_SYNC_COMP_HIGH_ACT 8 /* com 217 #define FB_SYNC_BROADCAST 16 /* bro 218 /* vto 219 /* vto 220 #define FB_SYNC_ON_GREEN 32 /* syn 221 222 #define FB_VMODE_NONINTERLACED 0 /* non 223 #define FB_VMODE_INTERLACED 1 /* int 224 #define FB_VMODE_DOUBLE 2 /* dou 225 #define FB_VMODE_ODD_FLD_FIRST 4 /* int 226 #define FB_VMODE_MASK 255 227 228 #define FB_VMODE_YWRAP 256 /* ywr 229 #define FB_VMODE_SMOOTH_XPAN 512 /* smo 230 #define FB_VMODE_CONUPDATE 512 /* don 231 232 /* 233 * Display rotation support 234 */ 235 #define FB_ROTATE_UR 0 236 #define FB_ROTATE_CW 1 237 #define FB_ROTATE_UD 2 238 #define FB_ROTATE_CCW 3 239 240 #define PICOS2KHZ(a) (1000000000UL/(a)) 241 #define KHZ2PICOS(a) (1000000000UL/(a)) 242 243 struct fb_var_screeninfo { 244 __u32 xres; /* vis 245 __u32 yres; 246 __u32 xres_virtual; /* vir 247 __u32 yres_virtual; 248 __u32 xoffset; /* off 249 __u32 yoffset; /* res 250 251 __u32 bits_per_pixel; /* gue 252 __u32 grayscale; /* 0 = 253 /* >1 254 struct fb_bitfield red; /* bit 255 struct fb_bitfield green; /* els 256 struct fb_bitfield blue; 257 struct fb_bitfield transp; /* tra 258 259 __u32 nonstd; /* != 260 261 __u32 activate; /* see 262 263 __u32 height; /* hei 264 __u32 width; /* wid 265 266 __u32 accel_flags; /* (OB 267 268 /* Timing: All values in pixclocks, ex 269 __u32 pixclock; /* pix 270 __u32 left_margin; /* tim 271 __u32 right_margin; /* tim 272 __u32 upper_margin; /* tim 273 __u32 lower_margin; 274 __u32 hsync_len; /* len 275 __u32 vsync_len; /* len 276 __u32 sync; /* see 277 __u32 vmode; /* see 278 __u32 rotate; /* ang 279 __u32 colorspace; /* col 280 __u32 reserved[4]; /* Res 281 }; 282 283 struct fb_cmap { 284 __u32 start; /* Fir 285 __u32 len; /* Num 286 __u16 *red; /* Red 287 __u16 *green; 288 __u16 *blue; 289 __u16 *transp; /* tra 290 }; 291 292 struct fb_con2fbmap { 293 __u32 console; 294 __u32 framebuffer; 295 }; 296 297 enum { 298 /* screen: unblanked, hsync: on, vsyn 299 FB_BLANK_UNBLANK = VESA_NO_BLANK 300 301 /* screen: blanked, hsync: on, vsyn 302 FB_BLANK_NORMAL = VESA_NO_BLANK 303 304 /* screen: blanked, hsync: on, vsyn 305 FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SU 306 307 /* screen: blanked, hsync: off, vsyn 308 FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SU 309 310 /* screen: blanked, hsync: off, vsyn 311 FB_BLANK_POWERDOWN = VESA_POWERDOW 312 }; 313 314 #define FB_VBLANK_VBLANKING 0x001 /* cur 315 #define FB_VBLANK_HBLANKING 0x002 /* cur 316 #define FB_VBLANK_HAVE_VBLANK 0x004 /* ver 317 #define FB_VBLANK_HAVE_HBLANK 0x008 /* hor 318 #define FB_VBLANK_HAVE_COUNT 0x010 /* glo 319 #define FB_VBLANK_HAVE_VCOUNT 0x020 /* the 320 #define FB_VBLANK_HAVE_HCOUNT 0x040 /* the 321 #define FB_VBLANK_VSYNCING 0x080 /* cur 322 #define FB_VBLANK_HAVE_VSYNC 0x100 /* ver 323 324 struct fb_vblank { 325 __u32 flags; /* FB_ 326 __u32 count; /* cou 327 __u32 vcount; /* cur 328 __u32 hcount; /* cur 329 __u32 reserved[4]; /* res 330 }; 331 332 /* Internal HW accel */ 333 #define ROP_COPY 0 334 #define ROP_XOR 1 335 336 struct fb_copyarea { 337 __u32 dx; 338 __u32 dy; 339 __u32 width; 340 __u32 height; 341 __u32 sx; 342 __u32 sy; 343 }; 344 345 struct fb_fillrect { 346 __u32 dx; /* screen-relative */ 347 __u32 dy; 348 __u32 width; 349 __u32 height; 350 __u32 color; 351 __u32 rop; 352 }; 353 354 struct fb_image { 355 __u32 dx; /* Where to pl 356 __u32 dy; 357 __u32 width; /* Size of ima 358 __u32 height; 359 __u32 fg_color; /* Only used w 360 __u32 bg_color; 361 __u8 depth; /* Depth of th 362 const char *data; /* Pointer to 363 struct fb_cmap cmap; /* color map i 364 }; 365 366 /* 367 * hardware cursor control 368 */ 369 370 #define FB_CUR_SETIMAGE 0x01 371 #define FB_CUR_SETPOS 0x02 372 #define FB_CUR_SETHOT 0x04 373 #define FB_CUR_SETCMAP 0x08 374 #define FB_CUR_SETSHAPE 0x10 375 #define FB_CUR_SETSIZE 0x20 376 #define FB_CUR_SETALL 0xFF 377 378 struct fbcurpos { 379 __u16 x, y; 380 }; 381 382 struct fb_cursor { 383 __u16 set; /* what to set 384 __u16 enable; /* cursor on/o 385 __u16 rop; /* bitop opera 386 const char *mask; /* cursor mask 387 struct fbcurpos hot; /* cursor hot 388 struct fb_image image; /* Cursor imag 389 }; 390 391 /* Settings for the generic backlight code */ 392 #define FB_BACKLIGHT_LEVELS 128 393 #define FB_BACKLIGHT_MAX 0xFF 394 395 396 #endif /* _UAPI_LINUX_FB_H */ 397
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.