4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1986,1997-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI" /* SunOS4.1.2 5.49 */
32 #include <sys/types.h>
40 * Frame buffer descriptor.
41 * Returned by FBIOGTYPE ioctl on frame buffer devices.
44 int fb_type
; /* as defined below */
45 int fb_height
; /* in pixels */
46 int fb_width
; /* in pixels */
47 int fb_depth
; /* bits per pixel */
48 int fb_cmsize
; /* size of color map (entries) */
49 int fb_size
; /* total size in bytes */
53 #define FBIOGTYPE (FIOC|0)
57 struct pixrect
*fbpr_pixrect
; /* Pixrect of dev returned here */
60 #define FBIOGPIXRECT (FIOC|1)
64 * General purpose structure for passing info in and out of frame buffers
68 int fb_physaddr
; /* physical frame buffer address */
69 int fb_hwwidth
; /* fb board width */
70 int fb_hwheight
; /* fb board height */
71 int fb_addrdelta
; /* phys addr diff between boards */
72 unsigned char *fb_ropaddr
; /* fb va thru kernelmap */
73 int fb_unit
; /* minor devnum of fb */
76 #define FBIOGINFO (FIOC|2)
79 * Color map I/O. See also fbcmap_i below.
82 int index
; /* first element (0 origin) */
83 int count
; /* number of elements */
84 unsigned char *red
; /* red color map elements */
85 unsigned char *green
; /* green color map elements */
86 unsigned char *blue
; /* blue color map elements */
92 int32_t index
; /* first element (0 origin) */
93 int32_t count
; /* number of elements */
94 caddr32_t red
; /* red color map elements */
95 caddr32_t green
; /* green color map elements */
96 caddr32_t blue
; /* blue color map elements */
99 #endif /* _SYSCALL32 */
101 #define FBIOPUTCMAP (FIOC|3)
102 #define FBIOGETCMAP (FIOC|4)
107 #define FB_ATTR_NDEVSPECIFIC 8 /* no. of device specific values */
108 #define FB_ATTR_NEMUTYPES 4 /* no. of emulation types */
111 int flags
; /* misc flags */
112 #define FB_ATTR_AUTOINIT 1 /* emulation auto init flag */
113 #define FB_ATTR_DEVSPECIFIC 2 /* dev. specific stuff valid flag */
114 int emu_type
; /* emulation type (-1 if unused) */
115 int dev_specific
[FB_ATTR_NDEVSPECIFIC
]; /* catchall */
119 int real_type
; /* real device type */
120 int owner
; /* PID of owner, 0 if myself */
121 struct fbtype fbtype
; /* fbtype info for real device */
122 struct fbsattr sattr
; /* see above */
123 int emu_types
[FB_ATTR_NEMUTYPES
]; /* possible emulations */
127 #define FBIOSATTR (FIOC|5)
128 #define FBIOGATTR (FIOC|6)
133 * (the unused bits are reserved for future use)
135 #define FBVIDEO_OFF 0
138 #define FBIOSVIDEO (FIOC|7)
139 #define FBIOGVIDEO (FIOC|8)
141 /* Vertical retrace support. */
142 #define FBIOVERTICAL (FIOC|9)
143 #define GRABPAGEALLOC (FIOC|10)
144 #define GRABPAGEFREE (FIOC|11)
145 #define GRABATTACH (FIOC|12)
147 #define FBIOGPLNGRP (FIOC|13)
148 #define FBIOGCMSIZE (FIOC|14)
149 #define FBIOSCMSIZE (FIOC|15)
150 #define FBIOSCMS (FIOC|16)
151 #define FBIOAVAILPLNGRP (FIOC|17)
155 * Structure to pass double buffering state back and forth the device.
158 /* used in devstate */
159 #define FBDBL_AVAIL 0x80000000
160 #define FBDBL_DONT_BLOCK 0x40000000
161 #define FBDBL_AVAIL_PG 0x20000000
163 /* used in read/write/display */
166 #define FBDBL_BOTH (FBDBL_A | FBDBL_B)
167 #define FBDBL_NONE 0x4
170 unsigned int dbl_devstate
;
171 unsigned int dbl_read
;
172 unsigned int dbl_write
;
173 unsigned int dbl_display
;
178 #define FBIODBLGINFO (FIOC|18)
179 #define FBIODBLSINFO (FIOC|19)
181 /* 8-bit emulation in 24-bit ioctls */
183 #define FBIOSWINFD (FIOC|20)
184 #define FBIOSAVWINFD (FIOC|21)
185 #define FBIORESWINFD (FIOC|22)
186 #define FBIOSRWINFD (FIOC|23)
189 * hardware cursor control
197 short set
; /* what to set */
198 #define FB_CUR_SETCUR 0x01
199 #define FB_CUR_SETPOS 0x02
200 #define FB_CUR_SETHOT 0x04
201 #define FB_CUR_SETCMAP 0x08
202 #define FB_CUR_SETSHAPE 0x10
203 #define FB_CUR_SETALL 0x1F
204 short enable
; /* cursor on/off */
205 struct fbcurpos pos
; /* cursor position */
206 struct fbcurpos hot
; /* cursor hot spot */
207 struct fbcmap cmap
; /* color map info */
208 struct fbcurpos size
; /* cursor bit map size */
209 char *image
; /* cursor image bits */
210 char *mask
; /* cursor mask bits */
215 short set
; /* what to set */
216 short enable
; /* cursor on/off */
217 struct fbcurpos pos
; /* cursor position */
218 struct fbcurpos hot
; /* cursor hot spot */
219 struct fbcmap32 cmap
; /* color map info */
220 struct fbcurpos size
; /* cursor bit map size */
221 caddr32_t image
; /* cursor image bits */
222 caddr32_t mask
; /* cursor mask bits */
224 #endif /* _SYSCALL32 */
226 /* set/get cursor attributes/shape */
227 #define FBIOSCURSOR (FIOC|24)
228 #define FBIOGCURSOR (FIOC|25)
230 /* set/get cursor position */
231 #define FBIOSCURPOS (FIOC|26)
232 #define FBIOGCURPOS (FIOC|27)
234 /* get max cursor size */
235 #define FBIOGCURMAX (FIOC|28)
237 /* Window Grabber info ioctl */
238 #define GRABLOCKINFO (FIOC|29)
241 * Window Identification (wid) defines, structures, and ioctls.
243 * Some wids need to be unique when used for things such as double
244 * buffering or rendering clipping. Some wids can be shared when
245 * used for display attributes only. What can be shared and how
246 * may be device dependent. The fb_wid_alloc.wa_type and fb_wid_item
247 * structure members will be left to device specific interpretation.
250 #define FB_WID_SHARED_8 0
251 #define FB_WID_SHARED_24 1
252 #define FB_WID_DBL_8 2
253 #define FB_WID_DBL_24 3
255 struct fb_wid_alloc
{
256 unsigned int wa_type
; /* special attributes */
257 int wa_index
; /* base wid returned */
258 unsigned int wa_count
; /* how many contiguous wids */
262 unsigned int wi_type
; /* special attributes */
263 int wi_index
; /* which lut */
264 unsigned int wi_attrs
; /* which attributes */
265 unsigned int wi_values
[NBBY
*sizeof (int)]; /* the attr values */
269 unsigned int wl_flags
;
270 unsigned int wl_count
;
271 struct fb_wid_item
*wl_list
;
276 struct fb_wid_list32
{
282 #endif /* _SYSCALL32 */
284 struct fb_wid_dbl_info
{
285 struct fb_wid_alloc dbl_wid
;
289 char dbl_write_state
;
292 #define FBIO_WID_ALLOC (FIOC|30)
293 #define FBIO_WID_FREE (FIOC|31)
294 #define FBIO_WID_PUT (FIOC|32)
295 #define FBIO_WID_GET (FIOC|33)
297 #define FBIO_DEVID (FIOC|34)
298 #define FBIO_U_RST (FIOC|35)
299 #define FBIO_FULLSCREEN_ELIMINATION_GROUPS (FIOC|36)
300 #define FBIO_WID_DBL_SET (FIOC|37)
301 #define FBIOVRTOFFSET (FIOC|38)
304 ushort_t accessible_width
; /* accessible bytes in scanline */
305 ushort_t accessible_height
; /* number of accessible scanlines */
306 ushort_t line_bytes
; /* number of bytes/scanline */
307 ushort_t hdb_capable
; /* can this thing hardware db? */
308 ushort_t vmsize
; /* this is Mb of video memory */
309 uchar_t boardrev
; /* board revision # */
310 uchar_t slot
; /* sbus slot # */
311 uint_t pad1
; /* expansion */
315 ushort_t accessible_width
; /* accessible bytes in scanline */
316 ushort_t accessible_height
; /* number of accessible scanlines */
317 ushort_t line_bytes
; /* number of bytes/scanline */
318 ushort_t hdb_capable
; /* can this thing hardware db? */
319 ushort_t vmsize
; /* this is Mb of video memory */
320 uchar_t boardrev
; /* board revision # */
321 uchar_t slot
; /* sbus slot # */
322 uint_t pad1
; /* expansion */
326 ushort_t accessible_width
; /* accessible bytes in scanline */
327 ushort_t accessible_height
; /* number of accessible scanlines */
328 ushort_t line_bytes
; /* number of bytes/scanline */
329 ushort_t hdb_capable
; /* can this thing hardware db? */
330 ushort_t vmsize
; /* this is Mb of video memory */
331 uchar_t boardrev
; /* board revision # */
332 uchar_t slot
; /* sbus slot # */
333 uint_t pad1
; /* expansion */
337 ushort_t accessible_width
; /* accessible bytes in scanline */
338 ushort_t accessible_height
; /* number of accessible scanlines */
339 ushort_t line_bytes
; /* number of bytes/scanline */
340 ushort_t hdb_capable
; /* can this thing hardware db? */
341 ushort_t vmsize
; /* this is Mb of video memory */
342 uchar_t boardrev
; /* board revision # */
343 uchar_t slot
; /* sbus slot # */
344 uint_t pad1
; /* expansion */
347 struct wd90c24a2_info
{
348 ushort_t accessible_width
; /* accessible bytes in scanline */
349 ushort_t accessible_height
; /* number of accessible scanlines */
350 ushort_t line_bytes
; /* number of bytes/scanline */
351 ushort_t hdb_capable
; /* can this thing hardware db? */
352 ushort_t vmsize
; /* this is Mb of video memory */
353 uchar_t boardrev
; /* board revision # */
354 uchar_t slot
; /* sbus slot # */
355 uint_t pad1
; /* expansion */
358 #define MON_TYPE_STEREO 0x8 /* stereo display */
359 #define MON_TYPE_0_OFFSET 0x4 /* black level 0 ire instead of 7.5 */
360 #define MON_TYPE_OVERSCAN 0x2 /* overscan */
361 #define MON_TYPE_GRAY 0x1 /* greyscale monitor */
364 uint_t mon_type
; /* bit array: defined above */
365 uint_t pixfreq
; /* pixel frequency in Hz */
366 uint_t hfreq
; /* horizontal freq in Hz */
367 uint_t vfreq
; /* vertical freq in Hz */
368 uint_t vsync
; /* vertical sync in scanlines */
369 uint_t hsync
; /* horizontal sync in pixels */
370 /* these are in pixel units */
371 ushort_t hfporch
; /* horizontal front porch */
372 ushort_t hbporch
; /* horizontal back porch */
373 ushort_t vfporch
; /* vertical front porch */
374 ushort_t vbporch
; /* vertical back porch */
378 #define FBIOGXINFO (FIOC|39)
379 #define FBIOMONINFO (FIOC|40)
385 unsigned int flags
; /* see below */
386 int id
; /* colormap id for multiple cmaps */
387 int index
; /* first element (0 origin) */
388 int count
; /* number of elements */
389 unsigned char *red
; /* red color map elements */
390 unsigned char *green
; /* green color map elements */
391 unsigned char *blue
; /* blue color map elements */
397 uint32_t flags
; /* see below */
398 int32_t id
; /* colormap id for multiple cmaps */
399 int32_t index
; /* first element (0 origin) */
400 int32_t count
; /* number of elements */
401 caddr32_t red
; /* red color map elements */
402 caddr32_t green
; /* green color map elements */
403 caddr32_t blue
; /* blue color map elements */
406 #endif /* _SYSCALL32 */
408 #define FB_CMAP_BLOCK 0x1 /* wait for vrt before returning */
409 #define FB_CMAP_KERNEL 0x2 /* called within kernel */
411 #define FBIOPUTCMAPI (FIOC|41)
412 #define FBIOGETCMAPI (FIOC|42)
414 /* assigning a given window id to a pixrect - special for PHIGS */
415 #define FBIO_ASSIGNWID (FIOC|43)
417 /* assigning a given window to be stereo */
418 #define FBIO_STEREO (FIOC|44)
419 #define FB_WIN_STEREO 0x2
423 /* frame buffer type codes */
424 #define FBTYPE_NOTYPE (-1) /* for backwards compatibility */
425 #define FBTYPE_SUN1BW 0 /* Multibus mono */
426 #define FBTYPE_SUN1COLOR 1 /* Multibus color */
427 #define FBTYPE_SUN2BW 2 /* memory mono */
428 #define FBTYPE_SUN2COLOR 3 /* color w/rasterop chips */
429 #define FBTYPE_SUN2GP 4 /* GP1/GP2 */
430 #define FBTYPE_SUN5COLOR 5 /* RoadRunner accelerator */
431 #define FBTYPE_SUN3COLOR 6 /* memory color */
432 #define FBTYPE_MEMCOLOR 7 /* memory 24-bit */
433 #define FBTYPE_SUN4COLOR 8 /* memory color w/overlay */
435 #define FBTYPE_NOTSUN1 9 /* reserved for customer */
436 #define FBTYPE_NOTSUN2 10 /* reserved for customer */
437 #define FBTYPE_NOTSUN3 11 /* reserved for customer */
439 #define FBTYPE_SUNFAST_COLOR 12 /* accelerated 8bit */
440 #define FBTYPE_SUNROP_COLOR 13 /* MEMCOLOR with rop h/w */
441 #define FBTYPE_SUNFB_VIDEO 14 /* Simple video mixing */
442 #define FBTYPE_SUNGIFB 15 /* medical image */
443 #define FBTYPE_SUNGPLAS 16 /* plasma panel */
444 #define FBTYPE_SUNGP3 17 /* cg12 running gpsi microcode */
445 #define FBTYPE_SUNGT 18 /* gt graphics accelerator */
446 #define FBTYPE_SUNLEO 19 /* zx graphics accelerator */
447 #define FBTYPE_MDICOLOR 20 /* cgfourteen framebuffer */
449 #define FBTYPE_LASTPLUSONE 21 /* max number of fbs (change as add) */
455 #endif /* _SYS_FBIO_H */