xref: /original-bsd/sys/news3400/iop/fbreg.h (revision 4f00418d)
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 contributed to Berkeley by
6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  * from: $Hdr: fbreg.h,v 4.300 91/06/27 20:43:07 root Rel41 $ SONY
11  *
12  *	@(#)fbreg.h	8.1 (Berkeley) 06/11/93
13  */
14 
15 #ifdef KERNEL
16 
17 struct fb_softc {
18 	int	fbs_state;
19 	int	fbs_device;
20 	lScrType fbs_type;
21 	int	fbs_flag;
22 };
23 
24 #if defined(news3200) || defined(news3400)
25 #define	splfb		spl3
26 #endif
27 #ifdef news3800
28 #define	splfb		spl4
29 #endif
30 
31 /*
32  * state of fbstate
33  */
34 #define	FB_BUSY		01	/* fb is busy */
35 #define FB_WANTED	02	/* fb is wanted */
36 #define FB_WAIT		04	/* fb is waiting for command complete */
37 #define FB_DELAY	010	/* fb is busy, but not wait (inner ioctl) */
38 #define FB_DELAY2	020	/* fb is busy, but not wait (outer ioctl) */
39 
40 /*
41  * physical page map for IOP
42  */
43 #define FB_MAX_IO	(2048*1024)	/* 2048 KB */
44 #define NFBMAP	(FB_MAX_IO / NBPG + 1)	/* maximum number of pages */
45 
46 struct fb_map {
47 	caddr_t		fm_vaddr;	/* virtual address */
48 	unsigned	fm_offset;	/* offset into first page */
49 	unsigned	fm_count;	/* byte counts */
50 	caddr_t		fm_addr[NFBMAP]; /* first addr into page */
51 };
52 
53 extern struct fb_map	fbmap[];
54 
55 /*
56  * fbreg definition
57  */
58 struct fbreg {
59 	u_char	fb_command;	/* command byte */
60 	u_char	fb_result;	/* result byte */
61 	u_char	fb_device;	/* device type */
62 	u_char	fb_unit;	/* unit no */
63 
64 	union {
65 	    lBitblt	_fb_bitblt;		/* bitblt command */
66 	    lBatchBitblt _fb_batchbitblt;	/* batch bitblt command */
67 	    lTileBitblt	_fb_tilebitblt;		/* tile bitblt command */
68 	    lBitblt3	_fb_bitblt3;		/* 3 operand bitblt command */
69 	    lPrimLine	_fb_polyline;		/* (disjoint) polyline */
70 	    lPrimRect	_fb_rectangle;		/* rectangle */
71 	    lPrimFill	_fb_fillscan;		/* fill pattern */
72 	    lPrimMarker	_fb_polymarker;		/* polymarker */
73 	    lPrimText	_fb_text;		/* text display */
74 	    lPrimDot	_fb_polydot;		/* polydot */
75 	    lScrType	_fb_scrtype;		/* screen type */
76 	    lCursor2	_fb_cursor;		/* cursor area */
77 	    lPalette	_fb_palette;		/* get/set palette */
78 	    lPoint	_fb_point;
79 	    int		_fb_data;
80 	    lVideoCtl	_fb_videoctl;
81 	    lVideoStatus _fb_videostatus;
82 	    lFbIoctl	_fb_ioctl;
83 	} fb_un;
84 };
85 
86 #define fb_bitblt	fb_un._fb_bitblt
87 #define fb_batchbitblt	fb_un._fb_batchbitblt
88 #define fb_tilebitblt	fb_un._fb_tilebitblt
89 #define fb_bitblt3	fb_un._fb_bitblt3
90 #define fb_polyline	fb_un._fb_polyline
91 #define fb_rectangle	fb_un._fb_rectangle
92 #define fb_fillscan	fb_un._fb_fillscan
93 #define fb_polymarker	fb_un._fb_polymarker
94 #define fb_text		fb_un._fb_text
95 #define fb_polydot	fb_un._fb_polydot
96 #define fb_scrtype	fb_un._fb_scrtype
97 #define fb_cursor	fb_un._fb_cursor
98 #define fb_palette	fb_un._fb_palette
99 #define fb_point	fb_un._fb_point
100 #define fb_data		fb_un._fb_data
101 #define fb_videoctl	fb_un._fb_videoctl
102 #define fb_videostatus	fb_un._fb_videostatus
103 #define fb_fbioctl	fb_un._fb_ioctl
104 
105 /* command definiton */
106 #define FB_CPROBE	0	/* probe */
107 #define FB_CATTACH	1	/* attach */
108 #define FB_COPEN	2	/* read from Frame Buffer */
109 #define FB_CCLOSE	3	/* write to Frame Buffer */
110 #define FB_CBITBLT	4	/* bitblt */
111 #define FB_CBATCHBITBLT	5	/* bitblt */
112 #define FB_CSETSCR	6	/* set display screen */
113 #define FB_CGETSCR	7	/* get display screen */
114 #define FB_CSETDIM	8	/* set dimmer level */
115 #define FB_CGETDIM	9	/* get dimmer level */
116 #define FB_CDRAW	10	/* graphic primitive drawing */
117 #define FB_CPOLYLINE	11
118 #define FB_CDJPOLYLINE	12
119 #define FB_CRECTANGLE	13
120 #define FB_CFILLSCAN	14
121 #define FB_CPOLYMARKER	15
122 #define FB_CTEXT	16
123 #define FB_CPOLYDOT	17
124 #define FB_CSETSCRMODE	18
125 #define FB_CGETSCRMODE	19
126 #define FB_CGETSCRTYPE	20	/* get screen type (b/w or color8 or...) */
127 #define FB_CSETPALETTE	21
128 #define FB_CGETPALETTE	22
129 #define FB_CSELPALETTE	23	/* select current palette */
130 #define FB_CSETDADDR	24	/* set display address */
131 
132 #define FB_CTILEBITBLT	30	/* tile bitblt */
133 #define FB_CBITBLT3	31	/* 3 operand bitblt */
134 
135 #define FB_CSETCURSOR	50
136 #define FB_CUNSETCURSOR	51
137 #define FB_CSHOWCURSOR	52
138 #define FB_CHIDECURSOR	53
139 #define FB_CSETXY	54
140 #define FB_CAUTODIM	55
141 
142 #define FB_CSETVIDEO	60
143 #define FB_CGETVIDEO	61
144 #define FB_CSETPMODE	62
145 #define FB_CGETPMODE	63
146 
147 #define FB_CGETPAGE	70
148 
149 #define FB_CIOCTL	80
150 
151 /* result definiton */
152 #define FB_ROK		0	/* OK */
153 #define FB_RERROR	1	/* some error occurred */
154 
155 #define	FBUNIT(dev)	(minor(dev) & 0x7f)
156 #define	FBVIDEO(dev)	(minor(dev) & 0x80)
157 
158 #define FBPRI	(PRIBIO+1)
159 
160 #define ASROM_SIZE	0x10000		/* size of auto-select ROM */
161 #define ASREG_SIZE	0x10000		/* size of auto-select control reg. */
162 #define ASREG_SIZE2	0x40000		/* size of 2nd area */
163 
164 #endif /* KERNEL */
165