xref: /illumos-gate/usr/src/uts/common/sys/fbio.h (revision 82bb7c22)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright (c) 1986,1997-1998 by Sun Microsystems, Inc.
247c478bd9Sstevel@tonic-gate  * All rights reserved.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_FBIO_H
287c478bd9Sstevel@tonic-gate #define	_SYS_FBIO_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #include <sys/types.h>
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifndef ASM
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * Frame buffer descriptor.
397c478bd9Sstevel@tonic-gate  * Returned by FBIOGTYPE ioctl on frame buffer devices.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate struct	fbtype {
427c478bd9Sstevel@tonic-gate 	int	fb_type;	/* as defined below */
437c478bd9Sstevel@tonic-gate 	int	fb_height;	/* in pixels */
447c478bd9Sstevel@tonic-gate 	int	fb_width;	/* in pixels */
457c478bd9Sstevel@tonic-gate 	int	fb_depth;	/* bits per pixel */
467c478bd9Sstevel@tonic-gate 	int	fb_cmsize;	/* size of color map (entries) */
477c478bd9Sstevel@tonic-gate 	int	fb_size;	/* total size in bytes */
487c478bd9Sstevel@tonic-gate };
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #define	FIOC		('F'<<8)
517c478bd9Sstevel@tonic-gate #define	FBIOGTYPE	(FIOC|0)
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
547c478bd9Sstevel@tonic-gate struct	fbpixrect {
557c478bd9Sstevel@tonic-gate 	struct	pixrect *fbpr_pixrect;	/* Pixrect of dev returned here */
567c478bd9Sstevel@tonic-gate };
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate #define	FBIOGPIXRECT	(FIOC|1)
597c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * General purpose structure for passing info in and out of frame buffers
637c478bd9Sstevel@tonic-gate  * (used for gp1)
647c478bd9Sstevel@tonic-gate  */
657c478bd9Sstevel@tonic-gate struct	fbinfo {
667c478bd9Sstevel@tonic-gate 	int		fb_physaddr;	/* physical frame buffer address */
677c478bd9Sstevel@tonic-gate 	int		fb_hwwidth;	/* fb board width */
687c478bd9Sstevel@tonic-gate 	int		fb_hwheight;	/* fb board height */
697c478bd9Sstevel@tonic-gate 	int		fb_addrdelta;	/* phys addr diff between boards */
707c478bd9Sstevel@tonic-gate 	unsigned char	*fb_ropaddr;	/* fb va thru kernelmap */
717c478bd9Sstevel@tonic-gate 	int		fb_unit;	/* minor devnum of fb */
727c478bd9Sstevel@tonic-gate };
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate #define	FBIOGINFO	(FIOC|2)
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate /*
777c478bd9Sstevel@tonic-gate  * Color map I/O.  See also fbcmap_i below.
787c478bd9Sstevel@tonic-gate  */
797c478bd9Sstevel@tonic-gate struct	fbcmap {
807c478bd9Sstevel@tonic-gate 	int		index;		/* first element (0 origin) */
817c478bd9Sstevel@tonic-gate 	int		count;		/* number of elements */
827c478bd9Sstevel@tonic-gate 	unsigned char	*red;		/* red color map elements */
837c478bd9Sstevel@tonic-gate 	unsigned char	*green;		/* green color map elements */
847c478bd9Sstevel@tonic-gate 	unsigned char	*blue;		/* blue color map elements */
857c478bd9Sstevel@tonic-gate };
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate struct	fbcmap32 {
907c478bd9Sstevel@tonic-gate 	int32_t		index;		/* first element (0 origin) */
917c478bd9Sstevel@tonic-gate 	int32_t		count;		/* number of elements */
92*82bb7c22SToomas Soome 	caddr32_t	red;		/* red color map elements */
93*82bb7c22SToomas Soome 	caddr32_t	green;		/* green color map elements */
94*82bb7c22SToomas Soome 	caddr32_t	blue;		/* blue color map elements */
957c478bd9Sstevel@tonic-gate };
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #define	FBIOPUTCMAP	(FIOC|3)
1007c478bd9Sstevel@tonic-gate #define	FBIOGETCMAP	(FIOC|4)
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate /*
1037c478bd9Sstevel@tonic-gate  * Set/Get attributes
1047c478bd9Sstevel@tonic-gate  */
1057c478bd9Sstevel@tonic-gate #define	FB_ATTR_NDEVSPECIFIC	8	/* no. of device specific values */
1067c478bd9Sstevel@tonic-gate #define	FB_ATTR_NEMUTYPES	4	/* no. of emulation types */
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate struct fbsattr {
1097c478bd9Sstevel@tonic-gate 	int	flags;			/* misc flags */
1107c478bd9Sstevel@tonic-gate #define	FB_ATTR_AUTOINIT	1	/* emulation auto init flag */
1117c478bd9Sstevel@tonic-gate #define	FB_ATTR_DEVSPECIFIC	2	/* dev. specific stuff valid flag */
1127c478bd9Sstevel@tonic-gate 	int	emu_type;		/* emulation type (-1 if unused) */
1137c478bd9Sstevel@tonic-gate 	int	dev_specific[FB_ATTR_NDEVSPECIFIC];	/* catchall */
1147c478bd9Sstevel@tonic-gate };
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate struct fbgattr {
1177c478bd9Sstevel@tonic-gate 	int	real_type;		/* real device type */
1187c478bd9Sstevel@tonic-gate 	int	owner;			/* PID of owner, 0 if myself */
1197c478bd9Sstevel@tonic-gate 	struct fbtype fbtype;		/* fbtype info for real device */
1207c478bd9Sstevel@tonic-gate 	struct fbsattr sattr;		/* see above */
1217c478bd9Sstevel@tonic-gate 	int	emu_types[FB_ATTR_NEMUTYPES];	/* possible emulations */
1227c478bd9Sstevel@tonic-gate 						/* (-1 if unused) */
1237c478bd9Sstevel@tonic-gate };
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate #define	FBIOSATTR	(FIOC|5)
1267c478bd9Sstevel@tonic-gate #define	FBIOGATTR	(FIOC|6)
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate /*
1307c478bd9Sstevel@tonic-gate  * Video control
1317c478bd9Sstevel@tonic-gate  * (the unused bits are reserved for future use)
1327c478bd9Sstevel@tonic-gate  */
1337c478bd9Sstevel@tonic-gate #define	FBVIDEO_OFF	0
1347c478bd9Sstevel@tonic-gate #define	FBVIDEO_ON	1
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate #define	FBIOSVIDEO	(FIOC|7)
1377c478bd9Sstevel@tonic-gate #define	FBIOGVIDEO	(FIOC|8)
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /* Vertical retrace support. */
1407c478bd9Sstevel@tonic-gate #define	FBIOVERTICAL	(FIOC|9)
1417c478bd9Sstevel@tonic-gate #define	GRABPAGEALLOC	(FIOC|10)
1427c478bd9Sstevel@tonic-gate #define	GRABPAGEFREE	(FIOC|11)
1437c478bd9Sstevel@tonic-gate #define	GRABATTACH	(FIOC|12)
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #define	FBIOGPLNGRP	(FIOC|13)
1467c478bd9Sstevel@tonic-gate #define	FBIOGCMSIZE	(FIOC|14)
1477c478bd9Sstevel@tonic-gate #define	FBIOSCMSIZE	(FIOC|15)
1487c478bd9Sstevel@tonic-gate #define	FBIOSCMS	(FIOC|16)
1497c478bd9Sstevel@tonic-gate #define	FBIOAVAILPLNGRP (FIOC|17)
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate /*
1537c478bd9Sstevel@tonic-gate  * Structure to pass double buffering state back and forth the device.
1547c478bd9Sstevel@tonic-gate  */
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate /* used in devstate */
1577c478bd9Sstevel@tonic-gate #define	FBDBL_AVAIL	0x80000000
1587c478bd9Sstevel@tonic-gate #define	FBDBL_DONT_BLOCK 0x40000000
1597c478bd9Sstevel@tonic-gate #define	FBDBL_AVAIL_PG	0x20000000
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate /* used in read/write/display */
1627c478bd9Sstevel@tonic-gate #define	FBDBL_A	 0x1
1637c478bd9Sstevel@tonic-gate #define	FBDBL_B	 0x2
1647c478bd9Sstevel@tonic-gate #define	FBDBL_BOTH	(FBDBL_A | FBDBL_B)
1657c478bd9Sstevel@tonic-gate #define	FBDBL_NONE	0x4
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate struct fbdblinfo {
1687c478bd9Sstevel@tonic-gate 	unsigned int	dbl_devstate;
1697c478bd9Sstevel@tonic-gate 	unsigned int	dbl_read;
1707c478bd9Sstevel@tonic-gate 	unsigned int	dbl_write;
1717c478bd9Sstevel@tonic-gate 	unsigned int	dbl_display;
1727c478bd9Sstevel@tonic-gate 	int		dbl_depth;
1737c478bd9Sstevel@tonic-gate 	char		dbl_wid;
1747c478bd9Sstevel@tonic-gate };
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate #define	FBIODBLGINFO	(FIOC|18)
1777c478bd9Sstevel@tonic-gate #define	FBIODBLSINFO	(FIOC|19)
1787c478bd9Sstevel@tonic-gate 
1797c478bd9Sstevel@tonic-gate /* 8-bit emulation in 24-bit ioctls */
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #define	FBIOSWINFD	(FIOC|20)
1827c478bd9Sstevel@tonic-gate #define	FBIOSAVWINFD	(FIOC|21)
1837c478bd9Sstevel@tonic-gate #define	FBIORESWINFD	(FIOC|22)
1847c478bd9Sstevel@tonic-gate #define	FBIOSRWINFD	(FIOC|23)
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate /*
1877c478bd9Sstevel@tonic-gate  * hardware cursor control
1887c478bd9Sstevel@tonic-gate  */
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate struct fbcurpos {
1917c478bd9Sstevel@tonic-gate 	short x, y;
1927c478bd9Sstevel@tonic-gate };
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate struct fbcursor {
1957c478bd9Sstevel@tonic-gate 	short set;		/* what to set */
1967c478bd9Sstevel@tonic-gate #define	FB_CUR_SETCUR	0x01
1977c478bd9Sstevel@tonic-gate #define	FB_CUR_SETPOS	0x02
1987c478bd9Sstevel@tonic-gate #define	FB_CUR_SETHOT	0x04
1997c478bd9Sstevel@tonic-gate #define	FB_CUR_SETCMAP	0x08
2007c478bd9Sstevel@tonic-gate #define	FB_CUR_SETSHAPE 0x10
2017c478bd9Sstevel@tonic-gate #define	FB_CUR_SETALL	0x1F
2027c478bd9Sstevel@tonic-gate 	short enable;		/* cursor on/off */
2037c478bd9Sstevel@tonic-gate 	struct fbcurpos pos;	/* cursor position */
2047c478bd9Sstevel@tonic-gate 	struct fbcurpos hot;	/* cursor hot spot */
2057c478bd9Sstevel@tonic-gate 	struct fbcmap cmap;	/* color map info */
2067c478bd9Sstevel@tonic-gate 	struct fbcurpos size;	/* cursor bit map size */
2077c478bd9Sstevel@tonic-gate 	char *image;		/* cursor image bits */
2087c478bd9Sstevel@tonic-gate 	char *mask;		/* cursor mask bits */
2097c478bd9Sstevel@tonic-gate };
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
2127c478bd9Sstevel@tonic-gate struct fbcursor32 {
2137c478bd9Sstevel@tonic-gate 	short set;		/* what to set */
2147c478bd9Sstevel@tonic-gate 	short enable;		/* cursor on/off */
2157c478bd9Sstevel@tonic-gate 	struct fbcurpos pos;	/* cursor position */
2167c478bd9Sstevel@tonic-gate 	struct fbcurpos hot;	/* cursor hot spot */
2177c478bd9Sstevel@tonic-gate 	struct fbcmap32 cmap;	/* color map info */
2187c478bd9Sstevel@tonic-gate 	struct fbcurpos size;	/* cursor bit map size */
2197c478bd9Sstevel@tonic-gate 	caddr32_t image;	/* cursor image bits */
2207c478bd9Sstevel@tonic-gate 	caddr32_t mask;		/* cursor mask bits */
2217c478bd9Sstevel@tonic-gate };
2227c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate /* set/get cursor attributes/shape */
2257c478bd9Sstevel@tonic-gate #define	FBIOSCURSOR	(FIOC|24)
2267c478bd9Sstevel@tonic-gate #define	FBIOGCURSOR	(FIOC|25)
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate /* set/get cursor position */
2297c478bd9Sstevel@tonic-gate #define	FBIOSCURPOS	(FIOC|26)
2307c478bd9Sstevel@tonic-gate #define	FBIOGCURPOS	(FIOC|27)
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate /* get max cursor size */
2337c478bd9Sstevel@tonic-gate #define	FBIOGCURMAX	(FIOC|28)
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /* Window Grabber info ioctl */
2367c478bd9Sstevel@tonic-gate #define	GRABLOCKINFO	(FIOC|29)
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate /*
2397c478bd9Sstevel@tonic-gate  * Window Identification (wid) defines, structures, and ioctls.
2407c478bd9Sstevel@tonic-gate  *
2417c478bd9Sstevel@tonic-gate  * Some wids need to be unique when used for things such as double
2427c478bd9Sstevel@tonic-gate  * buffering or rendering clipping.  Some wids can be shared when
2437c478bd9Sstevel@tonic-gate  * used for display attributes only.  What can be shared and how
2447c478bd9Sstevel@tonic-gate  * may be device dependent.  The fb_wid_alloc.wa_type and fb_wid_item
2457c478bd9Sstevel@tonic-gate  * structure members will be left to device specific interpretation.
2467c478bd9Sstevel@tonic-gate  */
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate #define	FB_WID_SHARED_8		0
2497c478bd9Sstevel@tonic-gate #define	FB_WID_SHARED_24	1
2507c478bd9Sstevel@tonic-gate #define	FB_WID_DBL_8		2
2517c478bd9Sstevel@tonic-gate #define	FB_WID_DBL_24		3
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate struct fb_wid_alloc {
2547c478bd9Sstevel@tonic-gate 	unsigned int	wa_type;	/* special attributes		*/
2557c478bd9Sstevel@tonic-gate 	int		wa_index;	/* base wid returned		*/
2567c478bd9Sstevel@tonic-gate 	unsigned int	wa_count;	/* how many contiguous wids	*/
2577c478bd9Sstevel@tonic-gate };
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate struct fb_wid_item {
2607c478bd9Sstevel@tonic-gate 	unsigned int	wi_type;	/* special attributes		*/
2617c478bd9Sstevel@tonic-gate 	int		wi_index;	/* which lut			*/
2627c478bd9Sstevel@tonic-gate 	unsigned int	wi_attrs;	/* which attributes		*/
2637c478bd9Sstevel@tonic-gate 	unsigned int	wi_values[NBBY*sizeof (int)]; /* the attr values */
2647c478bd9Sstevel@tonic-gate };
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate struct fb_wid_list {
2677c478bd9Sstevel@tonic-gate 	unsigned int	wl_flags;
2687c478bd9Sstevel@tonic-gate 	unsigned int	wl_count;
2697c478bd9Sstevel@tonic-gate 	struct fb_wid_item	*wl_list;
2707c478bd9Sstevel@tonic-gate };
2717c478bd9Sstevel@tonic-gate 
2727c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate struct fb_wid_list32 {
2757c478bd9Sstevel@tonic-gate 	uint32_t	wl_flags;
2767c478bd9Sstevel@tonic-gate 	uint32_t	wl_count;
2777c478bd9Sstevel@tonic-gate 	caddr32_t	wl_list;
2787c478bd9Sstevel@tonic-gate };
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
2817c478bd9Sstevel@tonic-gate 
2827c478bd9Sstevel@tonic-gate struct fb_wid_dbl_info {
2837c478bd9Sstevel@tonic-gate 	struct fb_wid_alloc dbl_wid;
2847c478bd9Sstevel@tonic-gate 	char		dbl_fore;
2857c478bd9Sstevel@tonic-gate 	char		dbl_back;
2867c478bd9Sstevel@tonic-gate 	char		dbl_read_state;
2877c478bd9Sstevel@tonic-gate 	char		dbl_write_state;
2887c478bd9Sstevel@tonic-gate };
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate #define	FBIO_WID_ALLOC	(FIOC|30)
2917c478bd9Sstevel@tonic-gate #define	FBIO_WID_FREE	(FIOC|31)
2927c478bd9Sstevel@tonic-gate #define	FBIO_WID_PUT	(FIOC|32)
2937c478bd9Sstevel@tonic-gate #define	FBIO_WID_GET	(FIOC|33)
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate #define	FBIO_DEVID	(FIOC|34)
2967c478bd9Sstevel@tonic-gate #define	FBIO_U_RST	(FIOC|35)
2977c478bd9Sstevel@tonic-gate #define	FBIO_FULLSCREEN_ELIMINATION_GROUPS	(FIOC|36)
2987c478bd9Sstevel@tonic-gate #define	FBIO_WID_DBL_SET	(FIOC|37)
2997c478bd9Sstevel@tonic-gate #define	FBIOVRTOFFSET	(FIOC|38)
3007c478bd9Sstevel@tonic-gate 
301*82bb7c22SToomas Soome struct gfxfb_info {
302*82bb7c22SToomas Soome 	uint16_t terminal_origin_x;
303*82bb7c22SToomas Soome 	uint16_t terminal_origin_y;
304*82bb7c22SToomas Soome 	uint32_t pitch;
305*82bb7c22SToomas Soome 	uint16_t font_width;
306*82bb7c22SToomas Soome 	uint16_t font_height;
307*82bb7c22SToomas Soome 	uint8_t red_mask_size;
308*82bb7c22SToomas Soome 	uint8_t red_field_position;
309*82bb7c22SToomas Soome 	uint8_t green_mask_size;
310*82bb7c22SToomas Soome 	uint8_t green_field_position;
311*82bb7c22SToomas Soome 	uint8_t blue_mask_size;
312*82bb7c22SToomas Soome 	uint8_t blue_field_position;
313*82bb7c22SToomas Soome };
314*82bb7c22SToomas Soome 
3157c478bd9Sstevel@tonic-gate struct cg6_info {
3167c478bd9Sstevel@tonic-gate 	ushort_t  accessible_width;	/* accessible bytes in scanline */
3177c478bd9Sstevel@tonic-gate 	ushort_t  accessible_height;	/* number of accessible scanlines */
3187c478bd9Sstevel@tonic-gate 	ushort_t  line_bytes;		/* number of bytes/scanline */
3197c478bd9Sstevel@tonic-gate 	ushort_t  hdb_capable;		/* can this thing hardware db? */
3207c478bd9Sstevel@tonic-gate 	ushort_t  vmsize;		/* this is Mb of video memory */
3217c478bd9Sstevel@tonic-gate 	uchar_t	  boardrev;		/* board revision # */
3227c478bd9Sstevel@tonic-gate 	uchar_t	  slot;			/* sbus slot # */
3237c478bd9Sstevel@tonic-gate 	uint_t	  pad1;			/* expansion */
3247c478bd9Sstevel@tonic-gate };
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate struct s3_info {
3277c478bd9Sstevel@tonic-gate 	ushort_t  accessible_width;	/* accessible bytes in scanline */
3287c478bd9Sstevel@tonic-gate 	ushort_t  accessible_height;	/* number of accessible scanlines */
3297c478bd9Sstevel@tonic-gate 	ushort_t  line_bytes;		/* number of bytes/scanline */
3307c478bd9Sstevel@tonic-gate 	ushort_t  hdb_capable;		/* can this thing hardware db? */
3317c478bd9Sstevel@tonic-gate 	ushort_t  vmsize;		/* this is Mb of video memory */
3327c478bd9Sstevel@tonic-gate 	uchar_t	  boardrev;		/* board revision # */
3337c478bd9Sstevel@tonic-gate 	uchar_t	  slot;			/* sbus slot # */
3347c478bd9Sstevel@tonic-gate 	uint_t	  pad1;			/* expansion */
3357c478bd9Sstevel@tonic-gate };
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate struct p9000_info {
3387c478bd9Sstevel@tonic-gate 	ushort_t  accessible_width;	/* accessible bytes in scanline */
3397c478bd9Sstevel@tonic-gate 	ushort_t  accessible_height;	/* number of accessible scanlines */
3407c478bd9Sstevel@tonic-gate 	ushort_t  line_bytes;		/* number of bytes/scanline */
3417c478bd9Sstevel@tonic-gate 	ushort_t  hdb_capable;		/* can this thing hardware db? */
3427c478bd9Sstevel@tonic-gate 	ushort_t  vmsize;		/* this is Mb of video memory */
3437c478bd9Sstevel@tonic-gate 	uchar_t	  boardrev;		/* board revision # */
3447c478bd9Sstevel@tonic-gate 	uchar_t	  slot;			/* sbus slot # */
3457c478bd9Sstevel@tonic-gate 	uint_t	  pad1;			/* expansion */
3467c478bd9Sstevel@tonic-gate };
3477c478bd9Sstevel@tonic-gate 
3487c478bd9Sstevel@tonic-gate struct p9100_info {
3497c478bd9Sstevel@tonic-gate 	ushort_t  accessible_width;	/* accessible bytes in scanline */
3507c478bd9Sstevel@tonic-gate 	ushort_t  accessible_height;	/* number of accessible scanlines */
3517c478bd9Sstevel@tonic-gate 	ushort_t  line_bytes;		/* number of bytes/scanline */
3527c478bd9Sstevel@tonic-gate 	ushort_t  hdb_capable;		/* can this thing hardware db? */
3537c478bd9Sstevel@tonic-gate 	ushort_t  vmsize;		/* this is Mb of video memory */
3547c478bd9Sstevel@tonic-gate 	uchar_t	  boardrev;		/* board revision # */
3557c478bd9Sstevel@tonic-gate 	uchar_t	  slot;			/* sbus slot # */
3567c478bd9Sstevel@tonic-gate 	uint_t	  pad1;			/* expansion */
3577c478bd9Sstevel@tonic-gate };
3587c478bd9Sstevel@tonic-gate 
3597c478bd9Sstevel@tonic-gate struct wd90c24a2_info {
3607c478bd9Sstevel@tonic-gate 	ushort_t  accessible_width;	/* accessible bytes in scanline */
3617c478bd9Sstevel@tonic-gate 	ushort_t  accessible_height;	/* number of accessible scanlines */
3627c478bd9Sstevel@tonic-gate 	ushort_t  line_bytes;		/* number of bytes/scanline */
3637c478bd9Sstevel@tonic-gate 	ushort_t  hdb_capable;		/* can this thing hardware db? */
3647c478bd9Sstevel@tonic-gate 	ushort_t  vmsize;		/* this is Mb of video memory */
3657c478bd9Sstevel@tonic-gate 	uchar_t	  boardrev;		/* board revision # */
3667c478bd9Sstevel@tonic-gate 	uchar_t	  slot;			/* sbus slot # */
3677c478bd9Sstevel@tonic-gate 	uint_t	  pad1;			/* expansion */
3687c478bd9Sstevel@tonic-gate };
3697c478bd9Sstevel@tonic-gate 
3707c478bd9Sstevel@tonic-gate #define	MON_TYPE_STEREO		0x8	/* stereo display */
3717c478bd9Sstevel@tonic-gate #define	MON_TYPE_0_OFFSET	0x4	/* black level 0 ire instead of 7.5 */
3727c478bd9Sstevel@tonic-gate #define	MON_TYPE_OVERSCAN	0x2	/* overscan */
3737c478bd9Sstevel@tonic-gate #define	MON_TYPE_GRAY		0x1	/* greyscale monitor */
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate struct mon_info {
3767c478bd9Sstevel@tonic-gate 	uint_t	  mon_type;		/* bit array: defined above */
3777c478bd9Sstevel@tonic-gate 	uint_t	  pixfreq;		/* pixel frequency in Hz */
3787c478bd9Sstevel@tonic-gate 	uint_t	  hfreq;		/* horizontal freq in Hz */
3797c478bd9Sstevel@tonic-gate 	uint_t	  vfreq;		/* vertical freq in Hz */
3807c478bd9Sstevel@tonic-gate 	uint_t	  vsync;		/* vertical sync in scanlines */
3817c478bd9Sstevel@tonic-gate 	uint_t	  hsync;		/* horizontal sync in pixels */
3827c478bd9Sstevel@tonic-gate 					/* these are in pixel units */
3837c478bd9Sstevel@tonic-gate 	ushort_t  hfporch;		/* horizontal front porch */
3847c478bd9Sstevel@tonic-gate 	ushort_t  hbporch;		/* horizontal back porch */
3857c478bd9Sstevel@tonic-gate 	ushort_t  vfporch;		/* vertical front porch */
3867c478bd9Sstevel@tonic-gate 	ushort_t  vbporch;		/* vertical back porch */
3877c478bd9Sstevel@tonic-gate };
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate 
3907c478bd9Sstevel@tonic-gate #define	FBIOGXINFO	(FIOC|39)
3917c478bd9Sstevel@tonic-gate #define	FBIOMONINFO	(FIOC|40)
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate /*
3947c478bd9Sstevel@tonic-gate  * Color map I/O.
3957c478bd9Sstevel@tonic-gate  */
3967c478bd9Sstevel@tonic-gate struct	fbcmap_i {
3977c478bd9Sstevel@tonic-gate 	unsigned int	flags;		/* see below */
3987c478bd9Sstevel@tonic-gate 	int		id;		/* colormap id for multiple cmaps */
3997c478bd9Sstevel@tonic-gate 	int		index;		/* first element (0 origin) */
4007c478bd9Sstevel@tonic-gate 	int		count;		/* number of elements */
4017c478bd9Sstevel@tonic-gate 	unsigned char	*red;		/* red color map elements */
4027c478bd9Sstevel@tonic-gate 	unsigned char	*green;		/* green color map elements */
4037c478bd9Sstevel@tonic-gate 	unsigned char	*blue;		/* blue color map elements */
4047c478bd9Sstevel@tonic-gate };
4057c478bd9Sstevel@tonic-gate 
4067c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
4077c478bd9Sstevel@tonic-gate 
4087c478bd9Sstevel@tonic-gate struct	fbcmap_i32 {
4097c478bd9Sstevel@tonic-gate 	uint32_t	flags;		/* see below */
4107c478bd9Sstevel@tonic-gate 	int32_t		id;		/* colormap id for multiple cmaps */
4117c478bd9Sstevel@tonic-gate 	int32_t		index;		/* first element (0 origin) */
4127c478bd9Sstevel@tonic-gate 	int32_t		count;		/* number of elements */
4137c478bd9Sstevel@tonic-gate 	caddr32_t	red;		/* red color map elements */
4147c478bd9Sstevel@tonic-gate 	caddr32_t	green;		/* green color map elements */
4157c478bd9Sstevel@tonic-gate 	caddr32_t	blue;		/* blue color map elements */
4167c478bd9Sstevel@tonic-gate };
4177c478bd9Sstevel@tonic-gate 
4187c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
4197c478bd9Sstevel@tonic-gate 
4207c478bd9Sstevel@tonic-gate #define	FB_CMAP_BLOCK	0x1	/* wait for vrt before returning */
4217c478bd9Sstevel@tonic-gate #define	FB_CMAP_KERNEL	0x2	/* called within kernel */
4227c478bd9Sstevel@tonic-gate 
4237c478bd9Sstevel@tonic-gate #define	FBIOPUTCMAPI	(FIOC|41)
4247c478bd9Sstevel@tonic-gate #define	FBIOGETCMAPI	(FIOC|42)
4257c478bd9Sstevel@tonic-gate 
4267c478bd9Sstevel@tonic-gate /* assigning a given window id to a pixrect - special for PHIGS */
4277c478bd9Sstevel@tonic-gate #define	FBIO_ASSIGNWID	(FIOC|43)
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate /* assigning a given window to be stereo */
4307c478bd9Sstevel@tonic-gate #define	FBIO_STEREO	(FIOC|44)
4317c478bd9Sstevel@tonic-gate #define	FB_WIN_STEREO	    0x2
4327c478bd9Sstevel@tonic-gate 
4337c478bd9Sstevel@tonic-gate #endif	/* !ASM */
4347c478bd9Sstevel@tonic-gate 
4357c478bd9Sstevel@tonic-gate /* frame buffer type codes */
4367c478bd9Sstevel@tonic-gate #define	FBTYPE_NOTYPE		(-1)	/* for backwards compatibility */
4377c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN1BW		0	/* Multibus mono */
4387c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN1COLOR	1	/* Multibus color */
4397c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN2BW		2	/* memory mono */
4407c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN2COLOR	3	/* color w/rasterop chips */
4417c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN2GP		4	/* GP1/GP2 */
4427c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN5COLOR	5	/* RoadRunner accelerator */
4437c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN3COLOR	6	/* memory color */
4447c478bd9Sstevel@tonic-gate #define	FBTYPE_MEMCOLOR		7	/* memory 24-bit */
4457c478bd9Sstevel@tonic-gate #define	FBTYPE_SUN4COLOR	8	/* memory color w/overlay */
4467c478bd9Sstevel@tonic-gate 
4477c478bd9Sstevel@tonic-gate #define	FBTYPE_NOTSUN1		9	/* reserved for customer */
4487c478bd9Sstevel@tonic-gate #define	FBTYPE_NOTSUN2		10	/* reserved for customer */
4497c478bd9Sstevel@tonic-gate #define	FBTYPE_NOTSUN3		11	/* reserved for customer */
4507c478bd9Sstevel@tonic-gate 
4517c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNFAST_COLOR	12	/* accelerated 8bit */
4527c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNROP_COLOR	13	/* MEMCOLOR with rop h/w */
4537c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNFB_VIDEO	14	/* Simple video mixing */
4547c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNGIFB		15	/* medical image */
4557c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNGPLAS		16	/* plasma panel */
4567c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNGP3		17	/* cg12 running gpsi microcode */
4577c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNGT		18	/* gt graphics accelerator */
4587c478bd9Sstevel@tonic-gate #define	FBTYPE_SUNLEO		19	/* zx graphics accelerator */
4597c478bd9Sstevel@tonic-gate #define	FBTYPE_MDICOLOR		20	/* cgfourteen framebuffer */
4607c478bd9Sstevel@tonic-gate 
4617c478bd9Sstevel@tonic-gate #define	FBTYPE_LASTPLUSONE	21	/* max number of fbs (change as add) */
4627c478bd9Sstevel@tonic-gate 
4637c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4647c478bd9Sstevel@tonic-gate }
4657c478bd9Sstevel@tonic-gate #endif
4667c478bd9Sstevel@tonic-gate 
4677c478bd9Sstevel@tonic-gate #endif	/* _SYS_FBIO_H */
468