xref: /original-bsd/sys/sys/fbio.h (revision 95ecee29)
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  * %sccs.include.redist.c%
10  *
11  *	@(#)fbio.h	8.2 (Berkeley) 10/30/93
12  *
13  * from: $Header: fbio.h,v 1.6 93/10/31 06:01:56 torek Exp $ (LBL)
14  */
15 
16 /*
17  * Frame buffer ioctls (from Sprite, trimmed to essentials for X11).
18  */
19 
20 /*
21  * Frame buffer type codes.
22  */
23 #define	FBTYPE_SUN1BW		0	/* multibus mono */
24 #define	FBTYPE_SUN1COLOR	1	/* multibus color */
25 #define	FBTYPE_SUN2BW		2	/* memory mono */
26 #define	FBTYPE_SUN2COLOR	3	/* color w/rasterop chips */
27 #define	FBTYPE_SUN2GP		4	/* GP1/GP2 */
28 #define	FBTYPE_SUN5COLOR	5	/* RoadRunner accelerator */
29 #define	FBTYPE_SUN3COLOR	6	/* memory color */
30 #define	FBTYPE_MEMCOLOR		7	/* memory 24-bit */
31 #define	FBTYPE_SUN4COLOR	8	/* memory color w/overlay */
32 
33 #define	FBTYPE_NOTSUN1		9	/* reserved for customer */
34 #define	FBTYPE_NOTSUN2		10	/* reserved for customer */
35 #define	FBTYPE_NOTSUN3		11	/* reserved for customer */
36 
37 #define	FBTYPE_SUNFAST_COLOR	12	/* accelerated 8bit */
38 #define	FBTYPE_SUNROP_COLOR	13	/* MEMCOLOR with rop h/w */
39 #define	FBTYPE_SUNFB_VIDEO	14	/* Simple video mixing */
40 #define	FBTYPE_RESERVED5	15	/* reserved, do not use */
41 #define	FBTYPE_RESERVED4	16	/* reserved, do not use */
42 #define	FBTYPE_RESERVED3	17	/* reserved, do not use */
43 #define	FBTYPE_RESERVED2	18	/* reserved, do not use */
44 #define	FBTYPE_RESERVED1	19	/* reserved, do not use */
45 
46 #define	FBTYPE_LASTPLUSONE	20	/* max number of fbs (change as add) */
47 
48 /*
49  * Frame buffer descriptor as returned by FBIOGTYPE.
50  */
51 struct fbtype {
52 	int	fb_type;	/* as defined above */
53 	int	fb_height;	/* in pixels */
54 	int	fb_width;	/* in pixels */
55 	int	fb_depth;	/* bits per pixel */
56 	int	fb_cmsize;	/* size of color map (entries) */
57 	int	fb_size;	/* total size in bytes */
58 };
59 #define	FBIOGTYPE	_IOR('F', 0, struct fbtype)
60 
61 #ifdef notdef
62 /*
63  * General purpose structure for passing info in and out of frame buffers
64  * (used for gp1) -- unsupported.
65  */
66 struct fbinfo {
67 	int	fb_physaddr;	/* physical frame buffer address */
68 	int	fb_hwwidth;	/* fb board width */
69 	int	fb_hwheight;	/* fb board height */
70 	int	fb_addrdelta;	/* phys addr diff between boards */
71 	u_char	*fb_ropaddr;	/* fb virtual addr */
72 	int	fb_unit;	/* minor devnum of fb */
73 };
74 #define	FBIOGINFO	_IOR('F', 2, struct fbinfo)
75 #endif
76 
77 /*
78  * Color map I/O.
79  */
80 struct fbcmap {
81 	int	index;		/* first element (0 origin) */
82 	int	count;		/* number of elements */
83 	u_char	*red;		/* red color map elements */
84 	u_char	*green;		/* green color map elements */
85 	u_char	*blue;		/* blue color map elements */
86 };
87 #define	FBIOPUTCMAP	_IOW('F', 3, struct fbcmap)
88 #define	FBIOGETCMAP	_IOW('F', 4, struct fbcmap)
89 
90 /*
91  * Set/get attributes.
92  */
93 #define	FB_ATTR_NDEVSPECIFIC	8	/* no. of device specific values */
94 #define	FB_ATTR_NEMUTYPES	4	/* no. of emulation types */
95 
96 struct fbsattr {
97 	int	flags;			/* flags; see below */
98 	int	emu_type;		/* emulation type (-1 if unused) */
99 	int	dev_specific[FB_ATTR_NDEVSPECIFIC];	/* catchall */
100 };
101 #define	FB_ATTR_AUTOINIT	1	/* emulation auto init flag */
102 #define	FB_ATTR_DEVSPECIFIC	2	/* dev. specific stuff valid flag */
103 
104 struct fbgattr {
105 	int	real_type;		/* real device type */
106 	int	owner;			/* PID of owner, 0 if myself */
107 	struct	fbtype fbtype;		/* fbtype info for real device */
108 	struct	fbsattr sattr;		/* see above */
109 	int	emu_types[FB_ATTR_NEMUTYPES];	/* possible emulations */
110 						/* (-1 if unused) */
111 };
112 /*	FBIOSATTR	_IOW('F', 5, struct fbsattr) -- unsupported */
113 #define	FBIOGATTR	_IOR('F', 6, struct fbgattr)
114 
115 /*
116  * Video control.
117  */
118 #define	FBVIDEO_OFF		0
119 #define	FBVIDEO_ON		1
120 
121 #define	FBIOSVIDEO	_IOW('F', 7, int)
122 #define	FBIOGVIDEO	_IOR('F', 8, int)
123 
124 /*
125  * Hardware cursor control (for, e.g., CG6).  A rather complex and icky
126  * interface that smells like VMS, but there it is....
127  */
128 struct fbcurpos {
129 	short	x;
130 	short	y;
131 };
132 
133 struct fbcursor {
134 	short	set;		/* flags; see below */
135 	short	enable;		/* nonzero => cursor on, 0 => cursor off */
136 	struct	fbcurpos pos;	/* position on display */
137 	struct	fbcurpos hot;	/* hot-spot within cursor */
138 	struct	fbcmap cmap;	/* cursor color map */
139 	struct	fbcurpos size;	/* number of valid bits in image & mask */
140 	caddr_t	image;		/* cursor image bits */
141 	caddr_t	mask;		/* cursor mask bits */
142 };
143 #define	FB_CUR_SETCUR	0x01	/* set on/off (i.e., obey fbcursor.enable) */
144 #define	FB_CUR_SETPOS	0x02	/* set position */
145 #define	FB_CUR_SETHOT	0x04	/* set hot-spot */
146 #define	FB_CUR_SETCMAP	0x08	/* set cursor color map */
147 #define	FB_CUR_SETSHAPE	0x10	/* set size & bits */
148 #define	FB_CUR_SETALL	(FB_CUR_SETCUR | FB_CUR_SETPOS | FB_CUR_SETHOT | \
149 			 FB_CUR_SETCMAP | FB_CUR_SETSHAPE)
150 
151 /* controls for cursor attributes & shape (including position) */
152 #define	FBIOSCURSOR	_IOW('F', 24, struct fbcursor)
153 #define	FBIOGCURSOR	_IOWR('F', 25, struct fbcursor)
154 
155 /* controls for cursor position only */
156 #define	FBIOSCURPOS	_IOW('F', 26, struct fbcurpos)
157 #define	FBIOGCURPOS	_IOW('F', 27, struct fbcurpos)
158 
159 /* get maximum cursor size */
160 #define	FBIOGCURMAX	_IOR('F', 28, struct fbcurpos)
161