xref: /original-bsd/sys/sys/fbio.h (revision c3e32dec)
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.1 (Berkeley) 06/02/93
12  *
13  * from: $Header: fbio.h,v 1.3 91/12/13 22:16:32 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