ffbreg.h revision 1.4 1 /* $NetBSD: ffbreg.h,v 1.4 2004/07/19 01:00:48 heas Exp $ */
2 /* $OpenBSD: creatorreg.h,v 1.5 2002/07/29 06:21:45 jason Exp $ */
3
4 /*
5 * Copyright (c) 2002 Jason L. Wright (jason (at) thought.net)
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Jason L. Wright
19 * 4. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 /* Number of register sets */
36 #define FFB_NREGS 24
37
38 /* Register set numbers */
39 #define FFB_REG_PROM 0
40 #define FFB_REG_DAC 1
41 #define FFB_REG_FBC 2
42 #define FFB_REG_DFB8R 3
43 #define FFB_REG_DFB8G 4
44 #define FFB_REG_DFB8B 5
45 #define FFB_REG_DFB8X 6
46 #define FFB_REG_DFB24 7
47 #define FFB_REG_DFB32 8
48 #define FFB_REG_SFB8R 9
49 #define FFB_REG_SFB8G 10
50 #define FFB_REG_SFB8B 11
51 #define FFB_REG_SFB8X 12
52 #define FFB_REG_SFB32 13
53 #define FFB_REG_SFB64 14
54 #define FFB_REG_DFB422A 15
55
56 #define FFB_DAC_TYPE 0x0
57 #define FFB_DAC_VALUE 0x4
58 #define FFB_DAC_TYPE2 0x8
59 #define FFB_DAC_VALUE2 0xc
60
61 /* DAC "TYPE" commands */
62 #define FFB_DAC_SCMAP 0x2000 /* set (load) cmap */
63 #define FFB_DAC_GSBLANK 0x6000 /* get/set blanking */
64 #define FFB_DAC_GVERS 0x8000 /* get DAC version */
65
66 #define FFB_DAC_BLANK_OFF 0x1
67 #define FFB_DAC_BLANK_HSYNC_DISABLE 0x4
68 #define FFB_DAC_BLANK_VSYNC_DISABLE 0x8
69
70 /* DAC "TYPE2" commands */
71 #define FFB_DAC_CURSENAB 0x100 /* cursor enable */
72 #define FFB_DAC_CURSECMAP 0x102 /* set cursor colormap */
73 #define FFB_DAC_CURSEPOS 0x104 /* set cursor position */
74
75 #define FFB_FBC_ALPHA 0x00c
76 #define FFB_FBC_RED 0x010
77 #define FFB_FBC_GREEN 0x014
78 #define FFB_FBC_BLUE 0x018
79 #define FFB_FBC_DEPTH 0x01c
80 #define FFB_FBC_Y 0x020
81 #define FFB_FBC_X 0x024
82 #define FFB_FBC_RYF 0x030
83 #define FFB_FBC_RXF 0x034
84 #define FFB_FBC_DMYF 0x040
85 #define FFB_FBC_DMXF 0x044
86 #define FFB_FBC_EBYI 0x050
87 #define FFB_FBC_EBXI 0x054
88 #define FFB_FBC_BY 0x060
89 #define FFB_FBC_BX 0x064
90 #define FFB_FBC_DY 0x068
91 #define FFB_FBC_DX 0x06c
92 #define FFB_FBC_BH 0x070
93 #define FFB_FBC_BW 0x074
94 #define FFB_FBC_SUVTX 0x100
95 #define FFB_FBC_PPC 0x200 /* pixel processor control */
96 #define FFB_FBC_WID 0x204 /* current WID */
97 #define FFB_FBC_FG 0x208
98 #define FFB_FBC_BG 0x20c
99 #define FFB_FBC_CONSTY 0x210
100 #define FFB_FBC_CONSTZ 0x214
101 #define FFB_FBC_XCLIP 0x218
102 #define FFB_FBC_DCSS 0x21c
103 #define FFB_FBC_VCLIPMIN 0x220 /* Viewclip XY Min Bounds */
104 #define FFB_FBC_VCLIPMAX 0x224
105 #define FFB_FBC_VCLIPZMIN 0x228
106 #define FFB_FBC_VCLIPZMAX 0x22c
107 #define FFB_FBC_DCSF 0x230
108 #define FFB_FBC_DCSB 0x234
109 #define FFB_FBC_DCZF 0x238
110 #define FFB_FBC_DCZB 0x23c
111 #define FFB_FBC_BLENDC 0x244
112 #define FFB_FBC_BLENDC1 0x248
113 #define FFB_FBC_BLENDC2 0x24c
114 #define FFB_FBC_FBRAMITC 0x250
115 #define FFB_FBC_FBC 0x254 /* Frame Buffer Control */
116 #define FFB_FBC_ROP 0x258 /* Raster OPeration */
117 #define FFB_FBC_CMP 0x25c /* Frame Buffer Compare */
118 #define FFB_FBC_MATCHAB 0x260 /* Buffer AB Match Mask */
119 #define FFB_FBC_MATCHC 0x264
120 #define FFB_FBC_MAGNAB 0x268 /* Buffer AB Magnitude Mask */
121 #define FFB_FBC_MAGNC 0x26c
122 #define FFB_FBC_FBCFG0 0x270
123 #define FFB_FBC_FBCFG1 0x274
124 #define FFB_FBC_FBCFG2 0x278
125 #define FFB_FBC_FBCFG3 0x27c
126 #define FFB_FBC_PPCFG 0x280
127 #define FFB_FBC_PICK 0x284
128 #define FFB_FBC_FILLMODE 0x288
129 #define FFB_FBC_FBRAMWAC 0x28c /* FB RAM Write Address Control */
130 #define FFB_FBC_PMASK 0x290 /* RGB Plane Mask */
131 #define FFB_FBC_XPMASK 0x294 /* X PlaneMask */
132 #define FFB_FBC_YPMASK 0x298
133 #define FFB_FBC_ZPMASK 0x29c
134 #define FFB_FBC_CLIP0MIN 0x2a0 /* Auxilliary Viewport Clips */
135 #define FFB_FBC_CLIP0MAX 0x2a4
136 #define FFB_FBC_CLIP1MIN 0x2a8
137 #define FFB_FBC_CLIP1MAX 0x2ac
138 #define FFB_FBC_CLIP2MIN 0x2b0
139 #define FFB_FBC_CLIP2MAX 0x2b4
140 #define FFB_FBC_CLIP3MIN 0x2b8
141 #define FFB_FBC_CLIP3MAX 0x2bc
142 #define FFB_FBC_RAWBLEND2 0x2c0
143 #define FFB_FBC_RAWPREBLEND 0x2c4
144 #define FFB_FBC_RAWSTENCIL 0x2c8
145 #define FFB_FBC_RAWSTENCILCTL 0x2cc
146 #define FFB_FBC_THREEDRAM1 0x2d0
147 #define FFB_FBC_THREEDRAM2 0x2d4
148 #define FFB_FBC_PASSIN 0x2d8
149 #define FFB_FBC_RAWCLRDEPTH 0x2dc
150 #define FFB_FBC_RAWPMASK 0x2e0
151 #define FFB_FBC_RAWCSRC 0x2e4
152 #define FFB_FBC_RAWMATCH 0x2e8
153 #define FFB_FBC_RAWMAGN 0x2ec
154 #define FFB_FBC_RAWROPBLEND 0x2f0
155 #define FFB_FBC_RAWCMP 0x2f4
156 #define FFB_FBC_RAWWAC 0x2f8
157 #define FFB_FBC_FBRAMID 0x2fc
158 #define FFB_FBC_DRAWOP 0x300 /* Draw OPeration */
159 #define FFB_FBC_FONTLPAT 0x30c /* Line Pattern control */
160 #define FFB_FBC_FONTXY 0x314 /* XY Font coordinate */
161 #define FFB_FBC_FONTW 0x318 /* Font Width */
162 #define FFB_FBC_FONTINC 0x31c /* Font Increment */
163 #define FFB_FBC_FONT 0x320
164 #define FFB_FBC_BLEND2 0x330
165 #define FFB_FBC_PREBLEND 0x334
166 #define FFB_FBC_STENCIL 0x338
167 #define FFB_FBC_STENCILCTL 0x33c
168 #define FFB_FBC_DCSS1 0x350
169 #define FFB_FBC_DCSS2 0x354
170 #define FFB_FBC_DCSS3 0x358
171 #define FFB_FBC_WIDPMASK 0x35c
172 #define FFB_FBC_DCS2 0x360
173 #define FFB_FBC_DCS3 0x364
174 #define FFB_FBC_DCS4 0x368
175 #define FFB_FBC_DCD2 0x370
176 #define FFB_FBC_DCD3 0x374
177 #define FFB_FBC_DCD4 0x378
178 #define FFB_FBC_PATTERN 0x380
179 #define FFB_FBC_DEVID 0x800
180 #define FFB_FBC_UCSR 0x900 /* User Control & Status */
181 #define FFB_FBC_MER 0x980
182
183 #define FFB_FBC_WB_A 0x20000000
184 #define FFB_FBC_WM_COMBINED 0x00080000
185 #define FFB_FBC_RB_A 0x00004000
186 #define FFB_FBC_SB_BOTH 0x00003000
187 #define FFB_FBC_ZE_OFF 0x00000400
188 #define FFB_FBC_YE_OFF 0x00000100
189 #define FFB_FBC_XE_ON 0x00000080
190 #define FFB_FBC_XE_OFF 0x00000040
191 #define FFB_FBC_RGBE_ON 0x0000002a
192 #define FFB_FBC_RGBE_MASK 0x0000003f
193
194 #define FBC_PPC_FW_DIS 0x00800000 /* force wid disable */
195 #define FBC_PPC_FW_ENA 0x00c00000 /* force wid enable */
196 #define FBC_PPC_ACE_DIS 0x00040000 /* aux clip disable */
197 #define FBC_PPC_ACE_AUXSUB 0x00080000 /* aux clip add */
198 #define FBC_PPC_ACE_AUXADD 0x000c0000 /* aux clip subtract */
199 #define FBC_PPC_DCE_DIS 0x00020000 /* depth cue disable */
200 #define FBC_PPC_DCE_ENA 0x00020000 /* depth cue enable */
201 #define FBC_PPC_ABE_DIS 0x00008000 /* alpha blend disable */
202 #define FBC_PPC_ABE_ENA 0x0000c000 /* alpha blend enable */
203 #define FBC_PPC_VCE_DIS 0x00001000 /* view clip disable */
204 #define FBC_PPC_VCE_2D 0x00002000 /* view clip 2d */
205 #define FBC_PPC_VCE_3D 0x00003000 /* view clip 3d */
206 #define FBC_PPC_APE_DIS 0x00000800 /* area pattern disable */
207 #define FBC_PPC_APE_ENA 0x00000c00 /* area pattern enable */
208 #define FBC_PPC_TBE_OPAQUE 0x00000200 /* opaque background */
209 #define FBC_PPC_TBE_TRANSPAR 0x00000300 /* transparent background */
210 #define FBC_PPC_ZS_VAR 0x00000080 /* z source ??? */
211 #define FBC_PPC_ZS_CONST 0x000000c0 /* z source ??? */
212 #define FBC_PPC_YS_VAR 0x00000020 /* y source ??? */
213 #define FBC_PPC_YS_CONST 0x00000030 /* y source ??? */
214 #define FBC_PPC_XS_WID 0x00000004 /* x source ??? */
215 #define FBC_PPC_XS_VAR 0x00000008 /* x source ??? */
216 #define FBC_PPC_XS_CONST 0x0000000c /* x source ??? */
217 #define FBC_PPC_CS_VAR 0x00000002 /* color source ??? */
218 #define FBC_PPC_CS_CONST 0x00000003 /* color source ??? */
219
220 #define FBC_ROP_NEW 0x83
221 #define FBC_ROP_OLD 0x85
222
223 #define FBC_UCSR_FIFO_MASK 0x00000fff
224 #define FBC_UCSR_FB_BUSY 0x01000000
225 #define FBC_UCSR_RP_BUSY 0x02000000
226 #define FBC_UCSR_READ_ERR 0x40000000
227 #define FBC_UCSR_FIFO_OVFL 0x80000000
228
229 #define FBC_DRAWOP_DOT 0x00
230 #define FBC_DRAWOP_AADOT 0x01
231 #define FBC_DRAWOP_BRLINECAP 0x02
232 #define FBC_DRAWOP_BRLINEOPEN 0x03
233 #define FBC_DRAWOP_DDLINE 0x04
234 #define FBC_DRAWOP_AALINE 0x05
235 #define FBC_DRAWOP_TRIANGLE 0x06
236 #define FBC_DRAWOP_POLYGON 0x07
237 #define FBC_DRAWOP_RECTANGLE 0x08
238 #define FBC_DRAWOP_FASTFILL 0x09
239 #define FBC_DRAWOP_BCOPY 0x0a /* block copy: not implemented */
240 #define FBC_DRAWOP_VSCROLL 0x0b /* vertical scroll */
241