1 /* $OpenBSD: creatorreg.h,v 1.9 2009/11/30 23:32:57 kettenis Exp $ */ 2 3 /* 4 * Copyright (c) 2002 Jason L. Wright (jason@thought.net) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 25 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /* Number of register sets */ 30 #define FFB_NREGS 24 31 32 /* Register set numbers */ 33 #define FFB_REG_PROM 0 34 #define FFB_REG_DAC 1 35 #define FFB_REG_FBC 2 36 #define FFB_REG_DFB8R 3 37 #define FFB_REG_DFB8G 4 38 #define FFB_REG_DFB8B 5 39 #define FFB_REG_DFB8X 6 40 #define FFB_REG_DFB24 7 41 #define FFB_REG_DFB32 8 42 #define FFB_REG_SFB8R 9 43 #define FFB_REG_SFB8G 10 44 #define FFB_REG_SFB8B 11 45 #define FFB_REG_SFB8X 12 46 #define FFB_REG_SFB32 13 47 #define FFB_REG_SFB64 14 48 #define FFB_REG_DFB422A 15 49 50 /* Virtual offsets */ 51 #define FFB_VOFF_SFB8R 0x00000000UL 52 #define FFB_VOFF_SFB8G 0x00400000UL 53 #define FFB_VOFF_SFB8B 0x00800000UL 54 #define FFB_VOFF_SFB8X 0x00c00000UL 55 #define FFB_VOFF_SFB32 0x01000000UL 56 #define FFB_VOFF_SFB64 0x02000000UL 57 #define FFB_VOFF_FBC_REGS 0x04000000UL 58 #define FFB_VOFF_BM_FBC_REGS 0x04002000UL 59 #define FFB_VOFF_DFB8R 0x04004000UL 60 #define FFB_VOFF_DFB8G 0x04404000UL 61 #define FFB_VOFF_DFB8B 0x04804000UL 62 #define FFB_VOFF_DFB8X 0x04c04000UL 63 #define FFB_VOFF_DFB24 0x05004000UL 64 #define FFB_VOFF_DFB32 0x06004000UL 65 #define FFB_VOFF_DFB422A 0x07004000UL /* DFB 422 mode write to A */ 66 #define FFB_VOFF_DFB422AD 0x07804000UL /* DFB 422 mode with line doubling */ 67 #define FFB_VOFF_DFB24B 0x08004000UL /* DFB 24bit mode write to B */ 68 #define FFB_VOFF_DFB422B 0x09004000UL /* DFB 422 mode write to B */ 69 #define FFB_VOFF_DFB422BD 0x09804000UL /* DFB 422 mode with line doubling */ 70 #define FFB_VOFF_SFB16Z 0x0a004000UL /* 16bit mode Z planes */ 71 #define FFB_VOFF_SFB8Z 0x0a404000UL /* 8bit mode Z planes */ 72 #define FFB_VOFF_SFB422 0x0ac04000UL /* SFB 422 mode write to A/B */ 73 #define FFB_VOFF_SFB422D 0x0b404000UL /* SFB 422 mode with line doubling */ 74 #define FFB_VOFF_FBC_KREGS 0x0bc04000UL 75 #define FFB_VOFF_DAC 0x0bc06000UL 76 #define FFB_VOFF_PROM 0x0bc08000UL 77 #define FFB_VOFF_EXP 0x0bc18000UL 78 79 /* Virtual lengths */ 80 #define FFB_VLEN_SFB8R 0x0400000 81 #define FFB_VLEN_SFB8G 0x0400000 82 #define FFB_VLEN_SFB8B 0x0400000 83 #define FFB_VLEN_SFB8X 0x0400000 84 #define FFB_VLEN_SFB32 0x1000000 85 #define FFB_VLEN_SFB64 0x2000000 86 #define FFB_VLEN_FBC_REGS 0x0002000 87 #define FFB_VLEN_BM_FBC_REGS 0x0002000 88 #define FFB_VLEN_DFB8R 0x0400000 89 #define FFB_VLEN_DFB8G 0x0400000 90 #define FFB_VLEN_DFB8B 0x0400000 91 #define FFB_VLEN_DFB8X 0x0400000 92 #define FFB_VLEN_DFB24 0x1000000 93 #define FFB_VLEN_DFB32 0x1000000 94 #define FFB_VLEN_DFB422A 0x0800000 95 #define FFB_VLEN_DFB422AD 0x0800000 96 #define FFB_VLEN_DFB24B 0x1000000 97 #define FFB_VLEN_DFB422B 0x0800000 98 #define FFB_VLEN_DFB422BD 0x0800000 99 #define FFB_VLEN_SFB16Z 0x0800000 100 #define FFB_VLEN_SFB8Z 0x0800000 101 #define FFB_VLEN_SFB422 0x0800000 102 #define FFB_VLEN_SFB422D 0x0800000 103 #define FFB_VLEN_FBC_KREGS 0x0002000 104 #define FFB_VLEN_DAC 0x0002000 105 #define FFB_VLEN_PROM 0x0010000 106 #define FFB_VLEN_EXP 0x0002000 107 108 /* Physical offsets */ 109 #define FFB_POFF_SFB8R 0x04000000UL 110 #define FFB_POFF_SFB8G 0x04400000UL 111 #define FFB_POFF_SFB8B 0x04800000UL 112 #define FFB_POFF_SFB8X 0x04c00000UL 113 #define FFB_POFF_SFB32 0x05000000UL 114 #define FFB_POFF_SFB64 0x06000000UL 115 #define FFB_POFF_FBC_REGS 0x00600000UL 116 #define FFB_POFF_BM_FBC_REGS 0x00600000UL 117 #define FFB_POFF_DFB8R 0x01000000UL 118 #define FFB_POFF_DFB8G 0x01400000UL 119 #define FFB_POFF_DFB8B 0x01800000UL 120 #define FFB_POFF_DFB8X 0x01c00000UL 121 #define FFB_POFF_DFB24 0x02000000UL 122 #define FFB_POFF_DFB32 0x03000000UL 123 #define FFB_POFF_FBC_KREGS 0x00610000UL 124 #define FFB_POFF_DAC 0x00400000UL 125 #define FFB_POFF_PROM 0x00000000UL 126 #define FFB_POFF_EXP 0x00200000UL 127 #define FFB_POFF_DFB422A 0x09000000UL 128 #define FFB_POFF_DFB422AD 0x09800000UL 129 #define FFB_POFF_DFB24B 0x0a000000UL 130 #define FFB_POFF_DFB422B 0x0b000000UL 131 #define FFB_POFF_DFB422BD 0x0b800000UL 132 #define FFB_POFF_SFB16Z 0x0c800000UL 133 #define FFB_POFF_SFB8Z 0x0c000000UL 134 #define FFB_POFF_SFB422 0x0d000000UL 135 #define FFB_POFF_SFB422D 0x0d800000UL 136 137 #define FFB_FBC_ALPHA 0x00c 138 #define FFB_FBC_RED 0x010 139 #define FFB_FBC_GREEN 0x014 140 #define FFB_FBC_BLUE 0x018 141 #define FFB_FBC_DEPTH 0x01c 142 #define FFB_FBC_Y 0x020 143 #define FFB_FBC_X 0x024 144 #define FFB_FBC_RYF 0x030 145 #define FFB_FBC_RXF 0x034 146 #define FFB_FBC_DMYF 0x040 147 #define FFB_FBC_DMXF 0x044 148 #define FFB_FBC_EBYI 0x050 149 #define FFB_FBC_EBXI 0x054 150 #define FFB_FBC_BY 0x060 151 #define FFB_FBC_BX 0x064 152 #define FFB_FBC_DY 0x068 153 #define FFB_FBC_DX 0x06c 154 #define FFB_FBC_BH 0x070 155 #define FFB_FBC_BW 0x074 156 #define FFB_FBC_SUVTX 0x100 157 #define FFB_FBC_PPC 0x200 /* pixel processor control */ 158 #define FFB_FBC_WID 0x204 159 #define FFB_FBC_FG 0x208 160 #define FFB_FBC_BG 0x20c 161 #define FFB_FBC_CONSTY 0x210 162 #define FFB_FBC_CONSTZ 0x214 163 #define FFB_FBC_XCLIP 0x218 164 #define FFB_FBC_DCSS 0x21c 165 #define FFB_FBC_VCLIPMIN 0x220 166 #define FFB_FBC_VCLIPMAX 0x224 167 #define FFB_FBC_VCLIPZMIN 0x228 168 #define FFB_FBC_VCLIPZMAX 0x22c 169 #define FFB_FBC_DCSF 0x230 170 #define FFB_FBC_DCSB 0x234 171 #define FFB_FBC_DCZF 0x238 172 #define FFB_FBC_DCZB 0x23c 173 #define FFB_FBC_BLENDC 0x244 174 #define FFB_FBC_BLENDC1 0x248 175 #define FFB_FBC_BLENDC2 0x24c 176 #define FFB_FBC_FBRAMITC 0x250 177 #define FFB_FBC_FBC 0x254 /* Frame Buffer Control */ 178 #define FFB_FBC_ROP 0x258 /* Raster OPeration */ 179 #define FFB_FBC_CMP 0x25c /* Frame Buffer Compare */ 180 #define FFB_FBC_MATCHAB 0x260 /* Buffer AB Match Mask */ 181 #define FFB_FBC_MATCHC 0x264 182 #define FFB_FBC_MAGNAB 0x268 /* Buffer AB Magnitude Mask */ 183 #define FFB_FBC_MAGNC 0x26c 184 #define FFB_FBC_FBCFG0 0x270 185 #define FFB_FBC_FBCFG1 0x274 186 #define FFB_FBC_FBCFG2 0x278 187 #define FFB_FBC_FBCFG3 0x27c 188 #define FFB_FBC_PPCFG 0x280 189 #define FFB_FBC_PICK 0x284 190 #define FFB_FBC_FILLMODE 0x288 191 #define FFB_FBC_FBRAMWAC 0x28c 192 #define FFB_FBC_PMASK 0x290 /* RGB Plane Mask */ 193 #define FFB_FBC_XPMASK 0x294 /* X PlaneMask */ 194 #define FFB_FBC_YPMASK 0x298 195 #define FFB_FBC_ZPMASK 0x29c 196 #define FFB_FBC_CLIP0MIN 0x2a0 197 #define FFB_FBC_CLIP0MAX 0x2a4 198 #define FFB_FBC_CLIP1MIN 0x2a8 199 #define FFB_FBC_CLIP1MAX 0x2ac 200 #define FFB_FBC_CLIP2MIN 0x2b0 201 #define FFB_FBC_CLIP2MAX 0x2b4 202 #define FFB_FBC_CLIP3MIN 0x2b8 203 #define FFB_FBC_CLIP3MAX 0x2bc 204 #define FFB_FBC_RAWBLEND2 0x2c0 205 #define FFB_FBC_RAWPREBLEND 0x2c4 206 #define FFB_FBC_RAWSTENCIL 0x2c8 207 #define FFB_FBC_RAWSTENCILCTL 0x2cc 208 #define FFB_FBC_THREEDRAM1 0x2d0 209 #define FFB_FBC_THREEDRAM2 0x2d4 210 #define FFB_FBC_PASSIN 0x2d8 211 #define FFB_FBC_RAWCLRDEPTH 0x2dc 212 #define FFB_FBC_RAWPMASK 0x2e0 213 #define FFB_FBC_RAWCSRC 0x2e4 214 #define FFB_FBC_RAWMATCH 0x2e8 215 #define FFB_FBC_RAWMAGN 0x2ec 216 #define FFB_FBC_RAWROPBLEND 0x2f0 217 #define FFB_FBC_RAWCMP 0x2f4 218 #define FFB_FBC_RAWWAC 0x2f8 219 #define FFB_FBC_FBRAMID 0x2fc 220 #define FFB_FBC_DRAWOP 0x300 /* Draw OPeration */ 221 #define FFB_FBC_FONTLPAT 0x30c 222 #define FFB_FBC_FONTXY 0x314 223 #define FFB_FBC_FONTW 0x318 /* Font Width */ 224 #define FFB_FBC_FONTINC 0x31c /* Font Increment */ 225 #define FFB_FBC_FONT 0x320 226 #define FFB_FBC_BLEND2 0x330 227 #define FFB_FBC_PREBLEND 0x334 228 #define FFB_FBC_STENCIL 0x338 229 #define FFB_FBC_STENCILCTL 0x33c 230 #define FFB_FBC_DCSS1 0x350 231 #define FFB_FBC_DCSS2 0x354 232 #define FFB_FBC_DCSS3 0x358 233 #define FFB_FBC_WIDPMASK 0x35c 234 #define FFB_FBC_DCS2 0x360 235 #define FFB_FBC_DCS3 0x364 236 #define FFB_FBC_DCS4 0x368 237 #define FFB_FBC_DCD2 0x370 238 #define FFB_FBC_DCD3 0x374 239 #define FFB_FBC_DCD4 0x378 240 #define FFB_FBC_PATTERN 0x380 241 #define FFB_FBC_DEVID 0x800 242 #define FFB_FBC_UCSR 0x900 /* User Control & Status */ 243 #define FFB_FBC_MER 0x980 244 245 #define FFB_FBC_FEM 0x1540 246 #define FFB_FBC_SRAMAR 0x1550 247 248 #define FFB_FBC_ASCR 0x10800 249 #define FFB_FBC_KCSR 0x10900 250 #define FFB_FBC_SRAM36 0x114c0 251 252 #define FFB_FBC_WB_A 0x20000000 253 #define FFB_FBC_WM_COMBINED 0x00080000 254 #define FFB_FBC_RB_A 0x00004000 255 #define FFB_FBC_SB_BOTH 0x00003000 256 #define FFB_FBC_ZE_OFF 0x00000400 257 #define FFB_FBC_YE_OFF 0x00000100 258 #define FFB_FBC_XE_ON 0x00000080 259 #define FFB_FBC_XE_OFF 0x00000040 260 #define FFB_FBC_RGBE_ON 0x0000002a 261 #define FFB_FBC_RGBE_MASK 0x0000003f 262 263 #define FBC_PPC_FW_DIS 0x00800000 /* force wid disable */ 264 #define FBC_PPC_FW_ENA 0x00c00000 /* force wid enable */ 265 #define FBC_PPC_ACE_DIS 0x00040000 /* aux clip disable */ 266 #define FBC_PPC_ACE_AUXSUB 0x00080000 /* aux clip add */ 267 #define FBC_PPC_ACE_AUXADD 0x000c0000 /* aux clip subtract */ 268 #define FBC_PPC_DCE_DIS 0x00020000 /* depth cue disable */ 269 #define FBC_PPC_DCE_ENA 0x00020000 /* depth cue enable */ 270 #define FBC_PPC_ABE_DIS 0x00008000 /* alpha blend disable */ 271 #define FBC_PPC_ABE_ENA 0x0000c000 /* alpha blend enable */ 272 #define FBC_PPC_VCE_DIS 0x00001000 /* view clip disable */ 273 #define FBC_PPC_VCE_2D 0x00002000 /* view clip 2d */ 274 #define FBC_PPC_VCE_3D 0x00003000 /* view clip 3d */ 275 #define FBC_PPC_APE_DIS 0x00000800 /* area pattern disable */ 276 #define FBC_PPC_APE_ENA 0x00000c00 /* area pattern enable */ 277 #define FBC_PPC_TBE_OPAQUE 0x00000200 /* opaque background */ 278 #define FBC_PPC_TBE_TRANSPAR 0x00000300 /* transparent background */ 279 #define FBC_PPC_ZS_VAR 0x00000080 /* z source ??? */ 280 #define FBC_PPC_ZS_CONST 0x000000c0 /* z source ??? */ 281 #define FBC_PPC_YS_VAR 0x00000020 /* y source ??? */ 282 #define FBC_PPC_YS_CONST 0x00000030 /* y source ??? */ 283 #define FBC_PPC_XS_WID 0x00000004 /* x source ??? */ 284 #define FBC_PPC_XS_VAR 0x00000008 /* x source ??? */ 285 #define FBC_PPC_XS_CONST 0x0000000c /* x source ??? */ 286 #define FBC_PPC_CS_VAR 0x00000002 /* color source ??? */ 287 #define FBC_PPC_CS_CONST 0x00000003 /* color source ??? */ 288 289 #define FBC_ROP_NEW 0x83 290 #define FBC_ROP_OLD 0x85 291 292 #define FBC_UCSR_FIFO_MASK 0x00000fff 293 #define FBC_UCSR_FB_BUSY 0x01000000 294 #define FBC_UCSR_RP_BUSY 0x02000000 295 #define FBC_UCSR_READ_ERR 0x40000000 296 #define FBC_UCSR_FIFO_OVFL 0x80000000 297 298 #define FBC_ASCR_STOP 0x00020000 299 #define FBC_ASCR_RESTART 0x00040000 300 301 #define FBC_DRAWOP_DOT 0x00 302 #define FBC_DRAWOP_AADOT 0x01 303 #define FBC_DRAWOP_BRLINECAP 0x02 304 #define FBC_DRAWOP_BRLINEOPEN 0x03 305 #define FBC_DRAWOP_DDLINE 0x04 306 #define FBC_DRAWOP_AALINE 0x05 307 #define FBC_DRAWOP_TRIANGLE 0x06 308 #define FBC_DRAWOP_POLYGON 0x07 309 #define FBC_DRAWOP_RECTANGLE 0x08 310 #define FBC_DRAWOP_FASTFILL 0x09 311 #define FBC_DRAWOP_BCOPY 0x0a /* block copy: not implemented */ 312 #define FBC_DRAWOP_VSCROLL 0x0b /* vertical scroll */ 313 314 #define FFB_DAC_TYPE 0x00 315 #define FFB_DAC_VALUE 0x04 316 #define FFB_DAC_TYPE2 0x08 317 #define FFB_DAC_VALUE2 0x0c 318 319 #define DAC_TYPE_CMAP 0x2000 /* load cmap */ 320 #define DAC_TYPE_BLANK 0x6000 /* blank/unblank */ 321 #define DAC_TYPE_GETREV 0x8000 /* get dac revision */ 322 323 #define DAC_TYPE2_CURSENAB 0x100 /* cursor enable */ 324 #define DAC_TYPE2_CURSCMAP 0x102 /* set cursor colormap */ 325 #define DAC_TYPE2_CURSPOS 0x104 /* set cursor position */ 326 327 #define DAC_BLANK_VIDEO_ENABLE 0x00000001 328 #define DAC_BLANK_HSYNC_DISABLE 0x00000004 329 #define DAC_BLANK_VSYNC_DISABLE 0x00000008 330