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 #include <sys/types.h>
38 * Frame buffer descriptor.
39 * Returned by FBIOGTYPE ioctl on frame buffer devices.
42 int fb_type
; /* as defined below */
43 int fb_height
; /* in pixels */
44 int fb_width
; /* in pixels */
45 int fb_depth
; /* bits per pixel */
46 int fb_cmsize
; /* size of color map (entries) */
47 int fb_size
; /* total size in bytes */
51 #define FBIOGTYPE (FIOC|0)
55 struct pixrect
*fbpr_pixrect
; /* Pixrect of dev returned here */
58 #define FBIOGPIXRECT (FIOC|1)
62 * General purpose structure for passing info in and out of frame buffers
66 int fb_physaddr
; /* physical frame buffer address */
67 int fb_hwwidth
; /* fb board width */
68 int fb_hwheight
; /* fb board height */
69 int fb_addrdelta
; /* phys addr diff between boards */
70 unsigned char *fb_ropaddr
; /* fb va thru kernelmap */
71 int fb_unit
; /* minor devnum of fb */
74 #define FBIOGINFO (FIOC|2)
77 * Color map I/O. See also fbcmap_i below.
80 int index
; /* first element (0 origin) */
81 int count
; /* number of elements */
82 unsigned char *red
; /* red color map elements */
83 unsigned char *green
; /* green color map elements */
84 unsigned char *blue
; /* blue color map elements */
90 int32_t index
; /* first element (0 origin) */
91 int32_t count
; /* number of elements */
92 caddr32_t red
; /* red color map elements */
93 caddr32_t green
; /* green color map elements */
94 caddr32_t blue
; /* blue color map elements */
97 #endif /* _SYSCALL32 */
99 #define FBIOPUTCMAP (FIOC|3)
100 #define FBIOGETCMAP (FIOC|4)
105 #define FB_ATTR_NDEVSPECIFIC 8 /* no. of device specific values */
106 #define FB_ATTR_NEMUTYPES 4 /* no. of emulation types */
109 int flags
; /* misc flags */
110 #define FB_ATTR_AUTOINIT 1 /* emulation auto init flag */
111 #define FB_ATTR_DEVSPECIFIC 2 /* dev. specific stuff valid flag */
112 int emu_type
; /* emulation type (-1 if unused) */
113 int dev_specific
[FB_ATTR_NDEVSPECIFIC
]; /* catchall */
117 int real_type
; /* real device type */
118 int owner
; /* PID of owner, 0 if myself */
119 struct fbtype fbtype
; /* fbtype info for real device */
120 struct fbsattr sattr
; /* see above */
121 int emu_types
[FB_ATTR_NEMUTYPES
]; /* possible emulations */
125 #define FBIOSATTR (FIOC|5)
126 #define FBIOGATTR (FIOC|6)
131 * (the unused bits are reserved for future use)
133 #define FBVIDEO_OFF 0
136 #define FBIOSVIDEO (FIOC|7)
137 #define FBIOGVIDEO (FIOC|8)
139 /* Vertical retrace support. */
140 #define FBIOVERTICAL (FIOC|9)
141 #define GRABPAGEALLOC (FIOC|10)
142 #define GRABPAGEFREE (FIOC|11)
143 #define GRABATTACH (FIOC|12)
145 #define FBIOGPLNGRP (FIOC|13)
146 #define FBIOGCMSIZE (FIOC|14)
147 #define FBIOSCMSIZE (FIOC|15)
148 #define FBIOSCMS (FIOC|16)
149 #define FBIOAVAILPLNGRP (FIOC|17)
153 * Structure to pass double buffering state back and forth the device.
156 /* used in devstate */
157 #define FBDBL_AVAIL 0x80000000
158 #define FBDBL_DONT_BLOCK 0x40000000
159 #define FBDBL_AVAIL_PG 0x20000000
161 /* used in read/write/display */
164 #define FBDBL_BOTH (FBDBL_A | FBDBL_B)
165 #define FBDBL_NONE 0x4
168 unsigned int dbl_devstate
;
169 unsigned int dbl_read
;
170 unsigned int dbl_write
;
171 unsigned int dbl_display
;
176 #define FBIODBLGINFO (FIOC|18)
177 #define FBIODBLSINFO (FIOC|19)
179 /* 8-bit emulation in 24-bit ioctls */
181 #define FBIOSWINFD (FIOC|20)
182 #define FBIOSAVWINFD (FIOC|21)
183 #define FBIORESWINFD (FIOC|22)
184 #define FBIOSRWINFD (FIOC|23)
187 * hardware cursor control
195 short set
; /* what to set */
196 #define FB_CUR_SETCUR 0x01
197 #define FB_CUR_SETPOS 0x02
198 #define FB_CUR_SETHOT 0x04
199 #define FB_CUR_SETCMAP 0x08
200 #define FB_CUR_SETSHAPE 0x10
201 #define FB_CUR_SETALL 0x1F
202 short enable
; /* cursor on/off */
203 struct fbcurpos pos
; /* cursor position */
204 struct fbcurpos hot
; /* cursor hot spot */
205 struct fbcmap cmap
; /* color map info */
206 struct fbcurpos size
; /* cursor bit map size */
207 char *image
; /* cursor image bits */
208 char *mask
; /* cursor mask bits */
213 short set
; /* what to set */
214 short enable
; /* cursor on/off */
215 struct fbcurpos pos
; /* cursor position */
216 struct fbcurpos hot
; /* cursor hot spot */
217 struct fbcmap32 cmap
; /* color map info */
218 struct fbcurpos size
; /* cursor bit map size */
219 caddr32_t image
; /* cursor image bits */
220 caddr32_t mask
; /* cursor mask bits */
222 #endif /* _SYSCALL32 */
224 /* set/get cursor attributes/shape */
225 #define FBIOSCURSOR (FIOC|24)
226 #define FBIOGCURSOR (FIOC|25)
228 /* set/get cursor position */
229 #define FBIOSCURPOS (FIOC|26)
230 #define FBIOGCURPOS (FIOC|27)
232 /* get max cursor size */
233 #define FBIOGCURMAX (FIOC|28)
235 /* Window Grabber info ioctl */
236 #define GRABLOCKINFO (FIOC|29)
239 * Window Identification (wid) defines, structures, and ioctls.
241 * Some wids need to be unique when used for things such as double
242 * buffering or rendering clipping. Some wids can be shared when
243 * used for display attributes only. What can be shared and how
244 * may be device dependent. The fb_wid_alloc.wa_type and fb_wid_item
245 * structure members will be left to device specific interpretation.
248 #define FB_WID_SHARED_8 0
249 #define FB_WID_SHARED_24 1
250 #define FB_WID_DBL_8 2
251 #define FB_WID_DBL_24 3
253 struct fb_wid_alloc
{
254 unsigned int wa_type
; /* special attributes */
255 int wa_index
; /* base wid returned */
256 unsigned int wa_count
; /* how many contiguous wids */
260 unsigned int wi_type
; /* special attributes */
261 int wi_index
; /* which lut */
262 unsigned int wi_attrs
; /* which attributes */
263 unsigned int wi_values
[NBBY
*sizeof (int)]; /* the attr values */
267 unsigned int wl_flags
;
268 unsigned int wl_count
;
269 struct fb_wid_item
*wl_list
;
274 struct fb_wid_list32
{
280 #endif /* _SYSCALL32 */
282 struct fb_wid_dbl_info
{
283 struct fb_wid_alloc dbl_wid
;
287 char dbl_write_state
;
290 #define FBIO_WID_ALLOC (FIOC|30)
291 #define FBIO_WID_FREE (FIOC|31)
292 #define FBIO_WID_PUT (FIOC|32)
293 #define FBIO_WID_GET (FIOC|33)
295 #define FBIO_DEVID (FIOC|34)
296 #define FBIO_U_RST (FIOC|35)
297 #define FBIO_FULLSCREEN_ELIMINATION_GROUPS (FIOC|36)
298 #define FBIO_WID_DBL_SET (FIOC|37)
299 #define FBIOVRTOFFSET (FIOC|38)
302 uint16_t terminal_origin_x
;
303 uint16_t terminal_origin_y
;
306 uint16_t font_height
;
307 uint8_t red_mask_size
;
308 uint8_t red_field_position
;
309 uint8_t green_mask_size
;
310 uint8_t green_field_position
;
311 uint8_t blue_mask_size
;
312 uint8_t blue_field_position
;
316 ushort_t accessible_width
; /* accessible bytes in scanline */
317 ushort_t accessible_height
; /* number of accessible scanlines */
318 ushort_t line_bytes
; /* number of bytes/scanline */
319 ushort_t hdb_capable
; /* can this thing hardware db? */
320 ushort_t vmsize
; /* this is Mb of video memory */
321 uchar_t boardrev
; /* board revision # */
322 uchar_t slot
; /* sbus slot # */
323 uint_t pad1
; /* expansion */
327 ushort_t accessible_width
; /* accessible bytes in scanline */
328 ushort_t accessible_height
; /* number of accessible scanlines */
329 ushort_t line_bytes
; /* number of bytes/scanline */
330 ushort_t hdb_capable
; /* can this thing hardware db? */
331 ushort_t vmsize
; /* this is Mb of video memory */
332 uchar_t boardrev
; /* board revision # */
333 uchar_t slot
; /* sbus slot # */
334 uint_t pad1
; /* expansion */
338 ushort_t accessible_width
; /* accessible bytes in scanline */
339 ushort_t accessible_height
; /* number of accessible scanlines */
340 ushort_t line_bytes
; /* number of bytes/scanline */
341 ushort_t hdb_capable
; /* can this thing hardware db? */
342 ushort_t vmsize
; /* this is Mb of video memory */
343 uchar_t boardrev
; /* board revision # */
344 uchar_t slot
; /* sbus slot # */
345 uint_t pad1
; /* expansion */
349 ushort_t accessible_width
; /* accessible bytes in scanline */
350 ushort_t accessible_height
; /* number of accessible scanlines */
351 ushort_t line_bytes
; /* number of bytes/scanline */
352 ushort_t hdb_capable
; /* can this thing hardware db? */
353 ushort_t vmsize
; /* this is Mb of video memory */
354 uchar_t boardrev
; /* board revision # */
355 uchar_t slot
; /* sbus slot # */
356 uint_t pad1
; /* expansion */
359 struct wd90c24a2_info
{
360 ushort_t accessible_width
; /* accessible bytes in scanline */
361 ushort_t accessible_height
; /* number of accessible scanlines */
362 ushort_t line_bytes
; /* number of bytes/scanline */
363 ushort_t hdb_capable
; /* can this thing hardware db? */
364 ushort_t vmsize
; /* this is Mb of video memory */
365 uchar_t boardrev
; /* board revision # */
366 uchar_t slot
; /* sbus slot # */
367 uint_t pad1
; /* expansion */
370 #define MON_TYPE_STEREO 0x8 /* stereo display */
371 #define MON_TYPE_0_OFFSET 0x4 /* black level 0 ire instead of 7.5 */
372 #define MON_TYPE_OVERSCAN 0x2 /* overscan */
373 #define MON_TYPE_GRAY 0x1 /* greyscale monitor */
376 uint_t mon_type
; /* bit array: defined above */
377 uint_t pixfreq
; /* pixel frequency in Hz */
378 uint_t hfreq
; /* horizontal freq in Hz */
379 uint_t vfreq
; /* vertical freq in Hz */
380 uint_t vsync
; /* vertical sync in scanlines */
381 uint_t hsync
; /* horizontal sync in pixels */
382 /* these are in pixel units */
383 ushort_t hfporch
; /* horizontal front porch */
384 ushort_t hbporch
; /* horizontal back porch */
385 ushort_t vfporch
; /* vertical front porch */
386 ushort_t vbporch
; /* vertical back porch */
390 #define FBIOGXINFO (FIOC|39)
391 #define FBIOMONINFO (FIOC|40)
397 unsigned int flags
; /* see below */
398 int id
; /* colormap id for multiple cmaps */
399 int index
; /* first element (0 origin) */
400 int count
; /* number of elements */
401 unsigned char *red
; /* red color map elements */
402 unsigned char *green
; /* green color map elements */
403 unsigned char *blue
; /* blue color map elements */
409 uint32_t flags
; /* see below */
410 int32_t id
; /* colormap id for multiple cmaps */
411 int32_t index
; /* first element (0 origin) */
412 int32_t count
; /* number of elements */
413 caddr32_t red
; /* red color map elements */
414 caddr32_t green
; /* green color map elements */
415 caddr32_t blue
; /* blue color map elements */
418 #endif /* _SYSCALL32 */
420 #define FB_CMAP_BLOCK 0x1 /* wait for vrt before returning */
421 #define FB_CMAP_KERNEL 0x2 /* called within kernel */
423 #define FBIOPUTCMAPI (FIOC|41)
424 #define FBIOGETCMAPI (FIOC|42)
426 /* assigning a given window id to a pixrect - special for PHIGS */
427 #define FBIO_ASSIGNWID (FIOC|43)
429 /* assigning a given window to be stereo */
430 #define FBIO_STEREO (FIOC|44)
431 #define FB_WIN_STEREO 0x2
435 /* frame buffer type codes */
436 #define FBTYPE_NOTYPE (-1) /* for backwards compatibility */
437 #define FBTYPE_SUN1BW 0 /* Multibus mono */
438 #define FBTYPE_SUN1COLOR 1 /* Multibus color */
439 #define FBTYPE_SUN2BW 2 /* memory mono */
440 #define FBTYPE_SUN2COLOR 3 /* color w/rasterop chips */
441 #define FBTYPE_SUN2GP 4 /* GP1/GP2 */
442 #define FBTYPE_SUN5COLOR 5 /* RoadRunner accelerator */
443 #define FBTYPE_SUN3COLOR 6 /* memory color */
444 #define FBTYPE_MEMCOLOR 7 /* memory 24-bit */
445 #define FBTYPE_SUN4COLOR 8 /* memory color w/overlay */
447 #define FBTYPE_NOTSUN1 9 /* reserved for customer */
448 #define FBTYPE_NOTSUN2 10 /* reserved for customer */
449 #define FBTYPE_NOTSUN3 11 /* reserved for customer */
451 #define FBTYPE_SUNFAST_COLOR 12 /* accelerated 8bit */
452 #define FBTYPE_SUNROP_COLOR 13 /* MEMCOLOR with rop h/w */
453 #define FBTYPE_SUNFB_VIDEO 14 /* Simple video mixing */
454 #define FBTYPE_SUNGIFB 15 /* medical image */
455 #define FBTYPE_SUNGPLAS 16 /* plasma panel */
456 #define FBTYPE_SUNGP3 17 /* cg12 running gpsi microcode */
457 #define FBTYPE_SUNGT 18 /* gt graphics accelerator */
458 #define FBTYPE_SUNLEO 19 /* zx graphics accelerator */
459 #define FBTYPE_MDICOLOR 20 /* cgfourteen framebuffer */
461 #define FBTYPE_LASTPLUSONE 21 /* max number of fbs (change as add) */
467 #endif /* _SYS_FBIO_H */