First import
[xorg_rtime.git] / xorg-server-1.4 / hw / kdrive / pm2 / glint_regs.h
blob84f220298f0680b59500f1e7528772b34528c229
2 /*
3 * glint register file
5 * Copyright by Stefan Dirsch, Dirk Hohndel, Alan Hourihane
6 * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
7 * Dirk Hohndel, <hohndel@suse.de>
8 * Stefan Dirsch, <sndirsch@suse.de>
9 * Simon P., <sim@suse.de>
11 * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
12 * Siemens Nixdorf Informationssysteme
14 */
16 #ifndef _GLINTREG_H_
17 #define _GLINTREG_H_
19 /* The chips we know */
20 #define PCI_CHIP_3DLABS_300SX 0x01
21 #define PCI_CHIP_3DLABS_500TX 0x02
22 #define PCI_CHIP_3DLABS_DELTA 0x03
23 #define PCI_CHIP_3DLABS_PERMEDIA 0x04
24 #define PCI_CHIP_3DLABS_MX 0x06
25 #define PCI_CHIP_3DLABS_PERMEDIA2 0x07
26 #define PCI_CHIP_3DLABS_GAMMA 0x08
27 #define PCI_CHIP_3DLABS_PERMEDIA2V 0x09
28 #define PCI_CHIP_3DLABS_PERMEDIA3 0x0A
29 #define PCI_CHIP_3DLABS_PERMEDIA4 0x0C
30 #define PCI_CHIP_3DLABS_R4 0x0D
31 #define PCI_CHIP_3DLABS_GAMMA2 0x0E
33 /* The boards we know */
34 #define IS_GLORIAXXL ((pGlint->PciInfo->subsysVendor == 0x1048) && \
35 (pGlint->PciInfo->subsysCard == 0x0a42))
37 #define IS_GLORIASYNERGY ((pGlint->PciInfo->subsysVendor == 0x1048) && \
38 (pGlint->PciInfo->subsysCard == 0x0a32))
40 #define IS_GMX2000 ((pGlint->PciInfo->subsysVendor == 0x3d3d) && \
41 (pGlint->PciInfo->subsysCard == 0x0106))
43 #define IS_J2000 ((pGlint->PciInfo->subsysVendor == 0x1097) && \
44 (pGlint->PciInfo->subsysCard == 0x3d32))
46 #define IS_JPRO ((pGlint->PciInfo->subsysVendor == 0x1097) && \
47 (pGlint->PciInfo->subsysCard == 0x3db3))
49 /* COMPAQ OEM VX1 PCI
50 * subsys == 0x0121 if VGA is enabled
51 * subsys == 0x000a if VGA has never been enabled
53 #define IS_PCI_QVX1 (pGlint->PciInfo->subsysVendor == 0x3d3d && \
54 ((pGlint->PciInfo->subsysCard == 0x0121) || \
55 (pGlint->PciInfo->subsysCard == 0x000a)))
57 /* COMPAQ OEM VX1 AGP
58 * subsys == 0x0144 if VGA is enabled
59 * subsys == 0x000c if VGA has never been enabled
61 #define IS_AGP_QVX1 (pGlint->PciInfo->subsysVendor == 0x3d3d && \
62 ((pGlint->PciInfo->subsysCard == 0x0144) || \
63 (pGlint->PciInfo->subsysCard == 0x000c)))
65 #define IS_QVX1 (IS_PCI_QVX1 || IS_AGP_QVX1)
67 #define IS_ELSA_SYNERGY ((pGlint->PciInfo->subsysVendor == 0x1048) && \
68 (pGlint->PciInfo->subsysCard == 0x0a32))
70 /* COMPAQ OEM Permedia 2V with VGA disable jumper - 0x13e9 ? */
71 #define IS_QPM2V ((pGlint->PciInfo->subsysVendor == 0x13e9) && \
72 ((pGlint->PciInfo->subsysCard == 0x0100) || \
73 (pGlint->PciInfo->subsysCard == 0x0002)))
75 /**********************************************
76 * GLINT 500TX Configuration Region Registers *
77 ***********************************************/
79 /* Device Identification */
80 #define CFGVendorId 0x0000
81 #define PCI_VENDOR_3DLABS 0x3D3D
82 #define PCI_VENDOR_TI 0x104C
83 #define CFGDeviceId 0x0002
85 #define CFGRevisionId 0x08
86 #define CFGClassCode 0x09
87 #define CFGHeaderType 0x0E
89 /* Device Control/Status */
90 #define CFGCommand 0x04
91 #define CFGStatus 0x06
93 /* Miscellaneous Functions */
94 #define CFGBist 0x0f
95 #define CFGLatTimer 0x0d
96 #define CFGCacheLine 0x0c
97 #define CFGMaxLat 0x3f
98 #define CFGMinGrant 0x3e
99 #define CFGIntPin 0x3d
100 #define CFGIntLine 0x3c
102 /* Base Adresses */
103 #define CFGBaseAddr0 0x10
104 #define CFGBaseAddr1 0x14
105 #define CFGBaseAddr2 0x18
106 #define CFGBaseAddr3 0x1C
107 #define CFGBaseAddr4 0x20
108 #define CFGRomAddr 0x30
112 /**********************************
113 * GLINT 500TX Region 0 Registers *
114 **********************************/
116 /* Control Status Registers */
117 #define ResetStatus 0x0000
118 #define IntEnable 0x0008
119 #define IntFlags 0x0010
120 #define InFIFOSpace 0x0018
121 #define OutFIFOWords 0x0020
122 #define DMAAddress 0x0028
123 #define DMACount 0x0030
124 #define ErrorFlags 0x0038
125 #define VClkCtl 0x0040
126 #define TestRegister 0x0048
127 #define Aperture0 0x0050
128 #define Aperture1 0x0058
129 #define DMAControl 0x0060
130 #define FIFODis 0x0068
132 /* GLINT PerMedia Region 0 additional Registers */
133 #define ChipConfig 0x0070
134 # define SCLK_SEL_MASK (3 << 10)
135 # define SCLK_SEL_MCLK_HALF (3 << 10)
137 #define ByDMAControl 0x00D8
139 /* GLINT 500TX LocalBuffer Registers */
140 #define LBMemoryCtl 0x1000
141 # define LBNumBanksMask 0x00000001
142 # define LBNumBanks1 (0)
143 # define LBNumBanks2 (1)
144 # define LBPageSizeMask 0x00000006
145 # define LBPageSize256 (0<<1)
146 # define LBPageSize512 (1<<1)
147 # define LBPageSize1024 (2<<1)
148 # define LBPageSize2048 (3<<1)
149 # define LBRASCASLowMask 0x00000018
150 # define LBRASCASLow2 (0<<3)
151 # define LBRASCASLow3 (1<<3)
152 # define LBRASCASLow4 (2<<3)
153 # define LBRASCASLow5 (3<<3)
154 # define LBRASPrechargeMask 0x00000060
155 # define LBRASPrecharge2 (0<<5)
156 # define LBRASPrecharge3 (1<<5)
157 # define LBRASPrecharge4 (2<<5)
158 # define LBRASPrecharge5 (3<<5)
159 # define LBCASLowMask 0x00000180
160 # define LBCASLow1 (0<<7)
161 # define LBCASLow2 (1<<7)
162 # define LBCASLow3 (2<<7)
163 # define LBCASLow4 (3<<7)
164 # define LBPageModeMask 0x00000200
165 # define LBPageModeEnabled (0<<9)
166 # define LBPageModeDisabled (1<<9)
167 # define LBRefreshCountMask 0x0003fc00
168 # define LBRefreshCountShift 10
170 #define LBMemoryEDO 0x1008
171 # define LBEDOMask 0x00000001
172 # define LBEDODisabled (0)
173 # define LBEDOEnabled (1)
174 # define LBEDOBankSizeMask 0x0000000e
175 # define LBEDOBankSizeDiabled (0<<1)
176 # define LBEDOBankSize256K (1<<1)
177 # define LBEDOBankSize512K (2<<1)
178 # define LBEDOBankSize1M (3<<1)
179 # define LBEDOBankSize2M (4<<1)
180 # define LBEDOBankSize4M (5<<1)
181 # define LBEDOBankSize8M (6<<1)
182 # define LBEDOBankSize16M (7<<1)
183 # define LBTwoPageDetectorMask 0x00000010
184 # define LBSinglePageDetector (0<<4)
185 # define LBTwoPageDetector (1<<4)
187 /* GLINT PerMedia Memory Control Registers */
188 #define PMReboot 0x1000
189 #define PMRomControl 0x1040
190 #define PMBootAddress 0x1080
191 #define PMMemConfig 0x10C0
192 # define RowCharge8 1 << 10
193 # define TimeRCD8 1 << 7
194 # define TimeRC8 0x6 << 3
195 # define TimeRP8 1
196 # define CAS3Latency8 0 << 16
197 # define BootAdress8 0x10
198 # define NumberBanks8 0x3 << 29
199 # define RefreshCount8 0x41 << 21
200 # define TimeRASMin8 1 << 13
201 # define DeadCycle8 1 << 17
202 # define BankDelay8 0 << 18
203 # define Burst1Cycle8 1 << 31
204 # define SDRAM8 0 << 4
206 # define RowCharge6 1 << 10
207 # define TimeRCD6 1 << 7
208 # define TimeRC6 0x6 << 3
209 # define TimeRP6 0x2
210 # define CAS3Latency6 1 << 16
211 # define BootAdress6 0x60
212 # define NumberBanks6 0x2 << 29
213 # define RefreshCount6 0x41 << 21
214 # define TimeRASMin6 1 << 13
215 # define DeadCycle6 1 << 17
216 # define BankDelay6 0 << 18
217 # define Burst1Cycle6 1 << 31
218 # define SDRAM6 0 << 4
220 # define RowCharge4 0 << 10
221 # define TimeRCD4 0 << 7
222 # define TimeRC4 0x4 << 3
223 # define TimeRP4 1
224 # define CAS3Latency4 0 << 16
225 # define BootAdress4 0x10
226 # define NumberBanks4 1 << 29
227 # define RefreshCount4 0x30 << 21
228 # define TimeRASMin4 1 << 13
229 # define DeadCycle4 0 << 17
230 # define BankDelay4 0 << 18
231 # define Burst1Cycle4 1 << 31
232 # define SDRAM4 0 << 4
234 /* Permedia 2 Control */
235 #define MemControl 0x1040
237 #define PMBypassWriteMask 0x1100
238 #define PMFramebufferWriteMask 0x1140
239 #define PMCount 0x1180
241 /* Framebuffer Registers */
242 #define FBMemoryCtl 0x1800
243 #define FBModeSel 0x1808
244 #define FBGCWrMask 0x1810
245 #define FBGCColorLower 0x1818
246 #define FBTXMemCtl 0x1820
247 #define FBWrMaskk 0x1830
248 #define FBGCColorUpper 0x1838
250 /* Core FIFO */
251 #define OutputFIFO 0x2000
253 /* 500TX Internal Video Registers */
254 #define VTGHLimit 0x3000
255 #define VTGHSyncStart 0x3008
256 #define VTGHSyncEnd 0x3010
257 #define VTGHBlankEnd 0x3018
258 #define VTGVLimit 0x3020
259 #define VTGVSyncStart 0x3028
260 #define VTGVSyncEnd 0x3030
261 #define VTGVBlankEnd 0x3038
262 #define VTGHGateStart 0x3040
263 #define VTGHGateEnd 0x3048
264 #define VTGVGateStart 0x3050
265 #define VTGVGateEnd 0x3058
266 #define VTGPolarity 0x3060
267 #define VTGFrameRowAddr 0x3068
268 #define VTGVLineNumber 0x3070
269 #define VTGSerialClk 0x3078
270 #define VTGModeCtl 0x3080
272 /* Permedia Video Control Registers */
273 #define PMScreenBase 0x3000
274 #define PMScreenStride 0x3008
275 #define PMHTotal 0x3010
276 #define PMHgEnd 0x3018
277 #define PMHbEnd 0x3020
278 #define PMHsStart 0x3028
279 #define PMHsEnd 0x3030
280 #define PMVTotal 0x3038
281 #define PMVbEnd 0x3040
282 #define PMVsStart 0x3048
283 #define PMVsEnd 0x3050
284 #define PMVideoControl 0x3058
285 #define PMInterruptLine 0x3060
286 #define PMDDCData 0x3068
287 # define DataIn (1<<0)
288 # define ClkIn (1<<1)
289 # define DataOut (1<<2)
290 # define ClkOut (1<<3)
291 #define PMLineCount 0x3070
292 #define PMFifoControl 0x3078
294 /* Permedia 2 RAMDAC Registers */
295 #define PM2DACWriteAddress 0x4000
296 #define PM2DACIndexReg 0x4000
297 #define PM2DACData 0x4008
298 #define PM2DACReadMask 0x4010
299 #define PM2DACReadAddress 0x4018
300 #define PM2DACCursorColorAddress 0x4020
301 #define PM2DACCursorColorData 0x4028
302 #define PM2DACIndexData 0x4050
303 #define PM2DACCursorData 0x4058
304 #define PM2DACCursorXLsb 0x4060
305 #define PM2DACCursorXMsb 0x4068
306 #define PM2DACCursorYLsb 0x4070
307 #define PM2DACCursorYMsb 0x4078
308 #define PM2DACCursorControl 0x06
310 #define PM2DACIndexCMR 0x18
311 # define PM2DAC_TRUECOLOR 0x80
312 # define PM2DAC_RGB 0x20
313 # define PM2DAC_GRAPHICS 0x10
314 # define PM2DAC_PACKED 0x09
315 # define PM2DAC_8888 0x08
316 # define PM2DAC_565 0x06
317 # define PM2DAC_4444 0x05
318 # define PM2DAC_5551 0x04
319 # define PM2DAC_2321 0x03
320 # define PM2DAC_2320 0x02
321 # define PM2DAC_332 0x01
322 # define PM2DAC_CI8 0x00
324 #define PM2DACIndexMDCR 0x19
325 #define PM2DACIndexPalettePage 0x1c
326 #define PM2DACIndexMCR 0x1e
327 #define PM2DACIndexClockAM 0x20
328 #define PM2DACIndexClockAN 0x21
329 #define PM2DACIndexClockAP 0x22
330 #define PM2DACIndexClockBM 0x23
331 #define PM2DACIndexClockBN 0x24
332 #define PM2DACIndexClockBP 0x25
333 #define PM2DACIndexClockCM 0x26
334 #define PM2DACIndexClockCN 0x27
335 #define PM2DACIndexClockCP 0x28
336 #define PM2DACIndexClockStatus 0x29
337 #define PM2DACIndexMemClockM 0x30
338 #define PM2DACIndexMemClockN 0x31
339 #define PM2DACIndexMemClockP 0x32
340 #define PM2DACIndexMemClockStatus 0x33
341 #define PM2DACIndexColorKeyControl 0x40
342 #define PM2DACIndexColorKeyOverlay 0x41
343 #define PM2DACIndexColorKeyRed 0x42
344 #define PM2DACIndexColorKeyGreen 0x43
345 #define PM2DACIndexColorKeyBlue 0x44
347 /* Permedia 2V extensions */
348 #define PM2VDACRDMiscControl 0x000
349 #define PM2VDACRDSyncControl 0x001
350 #define PM2VDACRDDACControl 0x002
351 #define PM2VDACRDPixelSize 0x003
352 #define PM2VDACRDColorFormat 0x004
353 #define PM2VDACRDCursorMode 0x005
354 #define PM2VDACRDCursorXLow 0x007
355 #define PM2VDACRDCursorXHigh 0x008
356 #define PM2VDACRDCursorYLow 0x009
357 #define PM2VDACRDCursorYHigh 0x00A
358 #define PM2VDACRDCursorHotSpotX 0x00B
359 #define PM2VDACRDCursorHotSpotY 0x00C
360 #define PM2VDACRDOverlayKey 0x00D
361 #define PM2VDACRDPan 0x00E
362 #define PM2VDACRDSense 0x00F
363 #define PM2VDACRDCheckControl 0x018
364 #define PM2VDACIndexClockControl 0x200
365 #define PM2VDACRDDClk0PreScale 0x201
366 #define PM2VDACRDDClk0FeedbackScale 0x202
367 #define PM2VDACRDDClk0PostScale 0x203
368 #define PM2VDACRDDClk1PreScale 0x204
369 #define PM2VDACRDDClk1FeedbackScale 0x205
370 #define PM2VDACRDDClk1PostScale 0x206
371 #define PM2VDACRDMClkControl 0x20D
372 #define PM2VDACRDMClkPreScale 0x20E
373 #define PM2VDACRDMClkFeedbackScale 0x20F
374 #define PM2VDACRDMClkPostScale 0x210
375 #define PM2VDACRDCursorPalette 0x303
376 #define PM2VDACRDCursorPattern 0x400
377 #define PM2VDACIndexRegLow 0x4020
378 #define PM2VDACIndexRegHigh 0x4028
379 #define PM2VDACIndexData 0x4030
381 #define PM2VDACRDIndexControl 0x4038
382 /* Permedia 2 Video Streams Unit Registers */
383 # define VSBIntFlag (1<<8)
384 # define VSAIntFlag (1<<9)
386 #define VSConfiguration 0x5800
387 # define VS_UnitMode_ROM 0
388 # define VS_UnitMode_AB8 3
389 # define VS_UnitMode_Mask 7
390 # define VS_GPBusMode_A (1<<3)
391 # define VS_HRefPolarityA (1<<9)
392 # define VS_VRefPolarityA (1<<10)
393 # define VS_VActivePolarityA (1<<11)
394 # define VS_UseFieldA (1<<12)
395 # define VS_FieldPolarityA (1<<13)
396 # define VS_FieldEdgeA (1<<14)
397 # define VS_VActiveVBIA (1<<15)
398 # define VS_InterlaceA (1<<16)
399 # define VS_ReverseDataA (1<<17)
400 # define VS_HRefPolarityB (1<<18)
401 # define VS_VRefPolarityB (1<<19)
402 # define VS_VActivePolarityB (1<<20)
403 # define VS_UseFieldB (1<<21)
404 # define VS_FieldPolarityB (1<<22)
405 # define VS_FieldEdgeB (1<<23)
406 # define VS_VActiveVBIB (1<<24)
407 # define VS_InterlaceB (1<<25)
408 # define VS_ColorSpaceB_RGB (1<<26)
409 # define VS_ReverseDataB (1<<27)
410 # define VS_DoubleEdgeB (1<<28)
412 #define VSStatus 0x5808
413 # define VS_FieldOne0A (1<<9)
414 # define VS_FieldOne1A (1<<10)
415 # define VS_FieldOne2A (1<<11)
416 # define VS_InvalidInterlaceA (1<<12)
417 # define VS_FieldOne0B (1<<17)
418 # define VS_FieldOne1B (1<<18)
419 # define VS_FieldOne2B (1<<19)
420 # define VS_InvalidInterlaceB (1<<20)
422 #define VSSerialBusControl 0x5810
424 #define VSABase 0x5900
425 # define VSA_Video (1<<0)
426 # define VSA_VBI (1<<1)
427 # define VSA_BufferCtl (1<<2)
428 # define VSA_MirrorX (1<<7)
429 # define VSA_MirrorY (1<<8)
430 # define VSA_Discard_None (0<<9)
431 # define VSA_Discard_FieldOne (1<<9)
432 # define VSA_Discard_FieldTwo (2<<9)
433 # define VSA_CombineFields (1<<11)
434 # define VSA_LockToStreamB (1<<12)
436 #define VSBBase 0x5A00
437 # define VSB_Video (1<<0)
438 # define VSB_VBI (1<<1)
439 # define VSB_BufferCtl (1<<2)
440 # define VSB_CombineFields (1<<3)
441 # define VSB_RGBOrder (1<<11)
442 # define VSB_GammaCorrect (1<<12)
443 # define VSB_LockToStreamA (1<<13)
445 #define VSControl 0x0000
446 #define VSInterrupt 0x0008
447 #define VSCurrentLine 0x0010
448 #define VSVideoAddressHost 0x0018
449 #define VSVideoAddressIndex 0x0020
450 #define VSVideoAddress0 0x0028
451 #define VSVideoAddress1 0x0030
452 #define VSVideoAddress2 0x0038
453 #define VSVideoStride 0x0040
454 #define VSVideoStartLine 0x0048
455 #define VSVideoEndLine 0x0050
456 #define VSVideoStartData 0x0058
457 #define VSVideoEndData 0x0060
458 #define VSVBIAddressHost 0x0068
459 #define VSVBIAddressIndex 0x0070
460 #define VSVBIAddress0 0x0078
461 #define VSVBIAddress1 0x0080
462 #define VSVBIAddress2 0x0088
463 #define VSVBIStride 0x0090
464 #define VSVBIStartLine 0x0098
465 #define VSVBIEndLine 0x00A0
466 #define VSVBIStartData 0x00A8
467 #define VSVBIEndData 0x00B0
468 #define VSFifoControl 0x00B8
470 /**********************************
471 * GLINT Delta Region 0 Registers *
472 **********************************/
474 /* Control Status Registers */
475 #define DResetStatus 0x0800
476 #define DIntEnable 0x0808
477 #define DIntFlags 0x0810
478 #define DErrorFlags 0x0838
479 #define DTestRegister 0x0848
480 #define DFIFODis 0x0868
484 /**********************************
485 * GLINT Gamma Region 0 Registers *
486 **********************************/
488 /* Control Status Registers */
489 #define GInFIFOSpace 0x0018
490 #define GDMAAddress 0x0028
491 #define GDMACount 0x0030
492 #define GDMAControl 0x0060
493 #define GOutDMA 0x0080
494 #define GOutDMACount 0x0088
495 #define GResetStatus 0x0800
496 #define GIntEnable 0x0808
497 #define GIntFlags 0x0810
498 #define GErrorFlags 0x0838
499 #define GTestRegister 0x0848
500 #define GFIFODis 0x0868
502 #define GChipConfig 0x0870
503 # define GChipAGPCapable 1 << 0
504 # define GChipAGPSideband 1 << 1
505 # define GChipMultiGLINTApMask 3 << 19
506 # define GChipMultiGLINTAp_0M 0 << 19
507 # define GChipMultiGLINTAp_16M 1 << 19
508 # define GChipMultiGLINTAp_32M 2 << 19
509 # define GChipMultiGLINTAp_64M 3 << 19
511 #define GCSRAperture 0x0878
512 # define GCSRSecondaryGLINTMapEn 1 << 0
513 # define GCSRBitSwap 1 << 1
515 #define GPageTableAddr 0x0c00
516 #define GPageTableLength 0x0c08
517 #define GDelayTimer 0x0c38
518 #define GCommandMode 0x0c40
519 #define GCommandIntEnable 0x0c48
520 #define GCommandIntFlags 0x0c50
521 #define GCommandErrorFlags 0x0c58
522 #define GCommandStatus 0x0c60
523 #define GCommandFaultingAddr 0x0c68
524 #define GVertexFaultingAddr 0x0c70
525 #define GWriteFaultingAddr 0x0c88
526 #define GFeedbackSelectCount 0x0c98
527 #define GGammaProcessorMode 0x0cb8
528 #define GVGAShadow 0x0d00
529 #define GMultGLINTAperture 0x0d08
530 #define GMultGLINT1 0x0d10
531 #define GMultGLINT2 0x0d18
533 /************************
534 * GLINT Core Registers *
535 ************************/
537 #define GLINT_TAG(major,offset) (((major) << 7) | ((offset) << 3))
538 #define GLINT_TAG_ADDR(major,offset) (0x8000 | GLINT_TAG((major),(offset)))
540 #define UNIT_DISABLE 0
541 #define UNIT_ENABLE 1
543 #define StartXDom GLINT_TAG_ADDR(0x00,0x00)
544 #define dXDom GLINT_TAG_ADDR(0x00,0x01)
545 #define StartXSub GLINT_TAG_ADDR(0x00,0x02)
546 #define dXSub GLINT_TAG_ADDR(0x00,0x03)
547 #define StartY GLINT_TAG_ADDR(0x00,0x04)
548 #define dY GLINT_TAG_ADDR(0x00,0x05)
549 #define GLINTCount GLINT_TAG_ADDR(0x00,0x06)
551 #define Render GLINT_TAG_ADDR(0x00,0x07)
552 # define AreaStippleEnable 0x00001
553 # define LineStippleEnable 0x00002
554 # define ResetLineStipple 0x00004
555 # define FastFillEnable 0x00008
556 # define PrimitiveLine 0
557 # define PrimitiveTrapezoid 0x00040
558 # define PrimitivePoint 0x00080
559 # define PrimitiveRectangle 0x000C0
560 # define AntialiasEnable 0x00100
561 # define AntialiasingQuality 0x00200
562 # define UsePointTable 0x00400
563 # define SyncOnBitMask 0x00800
564 # define SyncOnHostData 0x01000
565 # define TextureEnable 0x02000
566 # define FogEnable 0x04000
567 # define CoverageEnable 0x08000
568 # define SubPixelCorrectionEnable 0x10000
569 # define SpanOperation 0x40000
570 # define XPositive 1<<21
571 # define YPositive 1<<22
573 #define ContinueNewLine GLINT_TAG_ADDR(0x00,0x08)
574 #define ContinueNewDom GLINT_TAG_ADDR(0x00,0x09)
575 #define ContinueNewSub GLINT_TAG_ADDR(0x00,0x0a)
576 #define Continue GLINT_TAG_ADDR(0x00,0x0b)
577 #define FlushSpan GLINT_TAG_ADDR(0x00,0x0c)
578 #define BitMaskPattern GLINT_TAG_ADDR(0x00,0x0d)
580 #define PointTable0 GLINT_TAG_ADDR(0x01,0x00)
581 #define PointTable1 GLINT_TAG_ADDR(0x01,0x01)
582 #define PointTable2 GLINT_TAG_ADDR(0x01,0x02)
583 #define PointTable3 GLINT_TAG_ADDR(0x01,0x03)
585 #define RasterizerMode GLINT_TAG_ADDR(0x01,0x04)
586 #define RMMultiGLINT 1<<17
587 #define BitMaskPackingEachScanline 1<<9
588 #define ForceBackgroundColor 1<<6
589 #define InvertBitMask 1<<1
591 #define YLimits GLINT_TAG_ADDR(0x01,0x05)
592 #define ScanLineOwnership GLINT_TAG_ADDR(0x01,0x06)
593 #define WaitForCompletion GLINT_TAG_ADDR(0x01,0x07)
594 #define PixelSize GLINT_TAG_ADDR(0x01,0x08)
595 #define XLimits GLINT_TAG_ADDR(0x01,0x09) /* PM only */
597 #define RectangleOrigin GLINT_TAG_ADDR(0x01,0x0A) /* PM2 only */
598 #define RectangleSize GLINT_TAG_ADDR(0x01,0x0B) /* PM2 only */
600 #define PackedDataLimits GLINT_TAG_ADDR(0x02,0x0a) /* PM only */
602 #define ScissorMode GLINT_TAG_ADDR(0x03,0x00)
603 # define SCI_USER 0x01
604 # define SCI_SCREEN 0x02
605 # define SCI_USERANDSCREEN 0x03
607 #define ScissorMinXY GLINT_TAG_ADDR(0x03,0x01)
608 #define ScissorMaxXY GLINT_TAG_ADDR(0x03,0x02)
609 #define ScreenSize GLINT_TAG_ADDR(0x03,0x03)
610 #define AreaStippleMode GLINT_TAG_ADDR(0x03,0x04)
611 /* 0: */
612 /* NoMirrorY */
613 /* NoMirrorX */
614 /* NoInvertPattern */
615 /* YAddress_1bit */
616 /* XAddress_1bit */
617 /* UNIT_DISABLE */
619 # define ASM_XAddress_2bit 1 << 1
620 # define ASM_XAddress_3bit 2 << 1
621 # define ASM_XAddress_4bit 3 << 1
622 # define ASM_XAddress_5bit 4 << 1
623 # define ASM_YAddress_2bit 1 << 4
624 # define ASM_YAddress_3bit 2 << 4
625 # define ASM_YAddress_4bit 3 << 4
626 # define ASM_YAddress_5bit 4 << 4
627 # define ASM_InvertPattern 1 << 17
628 # define ASM_MirrorX 1 << 18
629 # define ASM_MirrorY 1 << 19
631 #define LineStippleMode GLINT_TAG_ADDR(0x03,0x05)
632 #define LoadLineStippleCounters GLINT_TAG_ADDR(0x03,0x06)
633 #define UpdateLineStippleCounters GLINT_TAG_ADDR(0x03,0x07)
634 #define SaveLineStippleState GLINT_TAG_ADDR(0x03,0x08)
635 #define WindowOrigin GLINT_TAG_ADDR(0x03,0x09)
637 #define AreaStipplePattern0 GLINT_TAG_ADDR(0x04,0x00)
638 #define AreaStipplePattern1 GLINT_TAG_ADDR(0x04,0x01)
639 #define AreaStipplePattern2 GLINT_TAG_ADDR(0x04,0x02)
640 #define AreaStipplePattern3 GLINT_TAG_ADDR(0x04,0x03)
641 #define AreaStipplePattern4 GLINT_TAG_ADDR(0x04,0x04)
642 #define AreaStipplePattern5 GLINT_TAG_ADDR(0x04,0x05)
643 #define AreaStipplePattern6 GLINT_TAG_ADDR(0x04,0x06)
644 #define AreaStipplePattern7 GLINT_TAG_ADDR(0x04,0x07)
646 #define TextureAddressMode GLINT_TAG_ADDR(0x07,0x00)
647 #define SStart GLINT_TAG_ADDR(0x07,0x01)
648 #define dSdx GLINT_TAG_ADDR(0x07,0x02)
649 #define dSdyDom GLINT_TAG_ADDR(0x07,0x03)
650 #define TStart GLINT_TAG_ADDR(0x07,0x04)
651 #define dTdx GLINT_TAG_ADDR(0x07,0x05)
652 #define dTdyDom GLINT_TAG_ADDR(0x07,0x06)
653 #define QStart GLINT_TAG_ADDR(0x07,0x07)
654 #define dQdx GLINT_TAG_ADDR(0x07,0x08)
655 #define dQdyDom GLINT_TAG_ADDR(0x07,0x09)
656 #define LOD GLINT_TAG_ADDR(0x07,0x0A)
657 #define dSdy GLINT_TAG_ADDR(0x07,0x0B)
658 #define dTdy GLINT_TAG_ADDR(0x07,0x0C)
659 #define dQdy GLINT_TAG_ADDR(0x07,0x0D)
661 #define TextureReadMode GLINT_TAG_ADDR(0x09,0x00)
663 #define TextureFormat GLINT_TAG_ADDR(0x09,0x01)
664 # define Texture_4_Components 3 << 3
665 # define Texture_Texel 0
667 #define TextureCacheControl GLINT_TAG_ADDR(0x09,0x02)
668 # define TextureCacheControlEnable 2
669 # define TextureCacheControlInvalidate 1
671 #define GLINTBorderColor GLINT_TAG_ADDR(0x09,0x05)
673 #define TexelLUTIndex GLINT_TAG_ADDR(0x09,0x08)
674 #define TexelLUTData GLINT_TAG_ADDR(0x09,0x09)
675 #define TexelLUTAddress GLINT_TAG_ADDR(0x09,0x0A)
676 #define TexelLUTTransfer GLINT_TAG_ADDR(0x09,0x0B)
678 #define TextureFilterMode GLINT_TAG_ADDR(0x09,0x0C)
680 #define TextureChromaUpper GLINT_TAG_ADDR(0x09,0x0D)
681 #define TextureChromaLower GLINT_TAG_ADDR(0x09,0x0E)
683 #define TxBaseAddr0 GLINT_TAG_ADDR(0x0A,0x00)
684 #define TxBaseAddr1 GLINT_TAG_ADDR(0x0A,0x01)
685 #define TxBaseAddr2 GLINT_TAG_ADDR(0x0A,0x02)
686 #define TxBaseAddr3 GLINT_TAG_ADDR(0x0A,0x03)
687 #define TxBaseAddr4 GLINT_TAG_ADDR(0x0A,0x04)
688 #define TxBaseAddr5 GLINT_TAG_ADDR(0x0A,0x05)
689 #define TxBaseAddr6 GLINT_TAG_ADDR(0x0A,0x06)
690 #define TxBaseAddr7 GLINT_TAG_ADDR(0x0A,0x07)
691 #define TxBaseAddr8 GLINT_TAG_ADDR(0x0A,0x08)
692 #define TxBaseAddr9 GLINT_TAG_ADDR(0x0A,0x09)
693 #define TxBaseAddr10 GLINT_TAG_ADDR(0x0A,0x0A)
694 #define TxBaseAddr11 GLINT_TAG_ADDR(0x0A,0x0B)
696 #define PMTextureBaseAddress GLINT_TAG_ADDR(0x0b,0x00)
697 #define PMTextureMapFormat GLINT_TAG_ADDR(0x0b,0x01)
698 #define PMTextureDataFormat GLINT_TAG_ADDR(0x0b,0x02)
700 #define Texel0 GLINT_TAG_ADDR(0x0c,0x00)
701 #define Texel1 GLINT_TAG_ADDR(0x0c,0x01)
702 #define Texel2 GLINT_TAG_ADDR(0x0c,0x02)
703 #define Texel3 GLINT_TAG_ADDR(0x0c,0x03)
704 #define Texel4 GLINT_TAG_ADDR(0x0c,0x04)
705 #define Texel5 GLINT_TAG_ADDR(0x0c,0x05)
706 #define Texel6 GLINT_TAG_ADDR(0x0c,0x06)
707 #define Texel7 GLINT_TAG_ADDR(0x0c,0x07)
709 #define Interp0 GLINT_TAG_ADDR(0x0c,0x08)
710 #define Interp1 GLINT_TAG_ADDR(0x0c,0x09)
711 #define Interp2 GLINT_TAG_ADDR(0x0c,0x0a)
712 #define Interp3 GLINT_TAG_ADDR(0x0c,0x0b)
713 #define Interp4 GLINT_TAG_ADDR(0x0c,0x0c)
715 #define TextureFilter GLINT_TAG_ADDR(0x0c,0x0d)
716 #define PMTextureReadMode GLINT_TAG_ADDR(0x0c,0x0e)
717 #define TexelLUTMode GLINT_TAG_ADDR(0x0c,0x0f)
719 #define TextureColorMode GLINT_TAG_ADDR(0x0d,0x00)
720 # define TextureTypeOpenGL 0
721 # define TextureTypeApple 1 << 4
722 # define TextureKsDDA 1 << 5 /* only Apple-Mode */
723 # define TextureKdDDA 1 << 6 /* only Apple-Mode */
725 #define TextureEnvColor GLINT_TAG_ADDR(0x0d,0x01)
726 #define FogMode GLINT_TAG_ADDR(0x0d,0x02)
727 /* 0: */
728 /* FOG RGBA */
729 /* UNIT_DISABLE */
730 # define FOG_CI 0x0002
732 #define FogColor GLINT_TAG_ADDR(0x0d,0x03)
733 #define FStart GLINT_TAG_ADDR(0x0d,0x04)
734 #define dFdx GLINT_TAG_ADDR(0x0d,0x05)
735 #define dFdyDom GLINT_TAG_ADDR(0x0d,0x06)
736 #define KsStart GLINT_TAG_ADDR(0x0d,0x09)
737 #define dKsdx GLINT_TAG_ADDR(0x0d,0x0a)
738 #define dKsdyDom GLINT_TAG_ADDR(0x0d,0x0b)
739 #define KdStart GLINT_TAG_ADDR(0x0d,0x0c)
740 #define dKdStart GLINT_TAG_ADDR(0x0d,0x0d)
741 #define dKddyDom GLINT_TAG_ADDR(0x0d,0x0e)
743 #define RStart GLINT_TAG_ADDR(0x0f,0x00)
744 #define dRdx GLINT_TAG_ADDR(0x0f,0x01)
745 #define dRdyDom GLINT_TAG_ADDR(0x0f,0x02)
746 #define GStart GLINT_TAG_ADDR(0x0f,0x03)
747 #define dGdx GLINT_TAG_ADDR(0x0f,0x04)
748 #define dGdyDom GLINT_TAG_ADDR(0x0f,0x05)
749 #define BStart GLINT_TAG_ADDR(0x0f,0x06)
750 #define dBdx GLINT_TAG_ADDR(0x0f,0x07)
751 #define dBdyDom GLINT_TAG_ADDR(0x0f,0x08)
752 #define AStart GLINT_TAG_ADDR(0x0f,0x09)
753 #define dAdx GLINT_TAG_ADDR(0x0f,0x0a)
754 #define dAdyDom GLINT_TAG_ADDR(0x0f,0x0b)
755 #define ColorDDAMode GLINT_TAG_ADDR(0x0f,0x0c)
756 /* 0:*/
757 /* UNIT_DISABLE */
758 # define CDDA_FlatShading 0
759 # define CDDA_GouraudShading 0x0002
762 #define ConstantColor GLINT_TAG_ADDR(0x0f,0x0d)
763 #define GLINTColor GLINT_TAG_ADDR(0x0f,0x0e)
764 #define AlphaTestMode GLINT_TAG_ADDR(0x10,0x00)
765 #define AntialiasMode GLINT_TAG_ADDR(0x10,0x01)
766 #define AlphaBlendMode GLINT_TAG_ADDR(0x10,0x02)
767 /* 0: */
768 /* SrcZERO */
769 /* DstZERO */
770 /* ColorFormat8888 */
771 /* AlphaBuffer present */
772 /* ColorOrderBGR */
773 /* TypeOpenGL */
774 /* DstFBData */
775 /* UNIT_DISABLE */
777 # define ABM_SrcONE 1 << 1
778 # define ABM_SrcDST_COLOR 2 << 1
779 # define ABM_SrcONE_MINUS_DST_COLOR 3 << 1
780 # define ABM_SrcSRC_ALPHA 4 << 1
781 # define ABM_SrcONE_MINUS_SRC_ALPHA 5 << 1
782 # define ABM_SrcDST_ALPHA 6 << 1
783 # define ABM_SrcONE_MINUS_DST_ALPHA 7 << 1
784 # define ABM_SrcSRC_ALPHA_SATURATE 8 << 1
785 # define ABM_DstONE 1 << 5
786 # define ABM_DstSRC_COLOR 2 << 5
787 # define ABM_DstONE_MINUS_SRC_COLOR 3 << 5
788 # define ABM_DstSRC_ALPHA 4 << 5
789 # define ABM_DstONE_MINUS_SRC_ALPHA 5 << 5
790 # define ABM_DstDST_ALPHA 6 << 5
791 # define ABM_DstONE_MINUS_DST_ALPHA 7 << 5
792 # define ABM_ColorFormat5555 1 << 8
793 # define ABM_ColorFormat4444 2 << 8
794 # define ABM_ColorFormat4444_Front 3 << 8
795 # define ABM_ColorFormat4444_Back 4 << 8
796 # define ABM_ColorFormat332_Front 5 << 8
797 # define ABM_ColorFormat332_Back 6 << 8
798 # define ABM_ColorFormat121_Front 7 << 8
799 # define ABM_ColorFormat121_Back 8 << 8
800 # define ABM_ColorFormat555_Back 13 << 8
801 # define ABM_ColorFormat_CI8 14 << 8
802 # define ABM_ColorFormat_CI4 15 << 8
803 # define ABM_NoAlphaBuffer 0x1000
804 # define ABM_ColorOrderRGB 0x2000
805 # define ABM_TypeQuickDraw3D 0x4000
806 # define ABM_DstFBSourceData 0x8000
808 #define DitherMode GLINT_TAG_ADDR(0x10,0x03)
809 /* 0: */
810 /* ColorOrder BGR */
811 /* AlphaDitherDefault */
812 /* ColorFormat8888 */
813 /* TruncateMode */
814 /* DitherDisable */
815 /* UNIT_DISABLE */
817 # define DTM_DitherEnable 1 << 1
818 # define DTM_ColorFormat5555 1 << 2
819 # define DTM_ColorFormat4444 2 << 2
820 # define DTM_ColorFormat4444_Front 3 << 2
821 # define DTM_ColorFormat4444_Back 4 << 2
822 # define DTM_ColorFormat332_Front 5 << 2
823 # define DTM_ColorFormat332_Back 6 << 2
824 # define DTM_ColorFormat121_Front 7 << 2
825 # define DTM_ColorFormat121_Back 8 << 2
826 # define DTM_ColorFormat555_Back 13 << 2
827 # define DTM_ColorFormat_CI8 14 << 2
828 # define DTM_ColorFormat_CI4 15 << 2
829 # define DTM_ColorOrderRGB 1 << 10
830 # define DTM_NoAlphaDither 1 << 14
831 # define DTM_RoundMode 1 << 15
833 #define FBSoftwareWriteMask GLINT_TAG_ADDR(0x10,0x04)
834 #define LogicalOpMode GLINT_TAG_ADDR(0x10,0x05)
835 # define Use_ConstantFBWriteData 0x40
838 #define FBWriteData GLINT_TAG_ADDR(0x10,0x06)
839 #define RouterMode GLINT_TAG_ADDR(0x10,0x08)
840 # define ROUTER_Depth_Texture 1
841 # define ROUTER_Texture_Depth 0
844 #define LBReadMode GLINT_TAG_ADDR(0x11,0x00)
845 /* 0: */
846 /* SrcNoRead */
847 /* DstNoRead */
848 /* DataLBDefault */
849 /* WinTopLeft */
850 /* NoPatch */
851 /* ScanlineInterval1 */
853 # define LBRM_SrcEnable 1 << 9
854 # define LBRM_DstEnable 1 << 10
855 # define LBRM_DataLBStencil 1 << 16
856 # define LBRM_DataLBDepth 2 << 16
857 # define LBRM_WinBottomLeft 1 << 18
858 # define LBRM_DoPatch 1 << 19
860 # define LBRM_ScanlineInt2 1 << 20
861 # define LBRM_ScanlineInt4 2 << 20
862 # define LBRM_ScanlineInt8 3 << 20
865 #define LBReadFormat GLINT_TAG_ADDR(0x11,0x01)
866 # define LBRF_DepthWidth15 0x03 /* only permedia */
867 # define LBRF_DepthWidth16 0x00
868 # define LBRF_DepthWidth24 0x01
869 # define LBRF_DepthWidth32 0x02
871 # define LBRF_StencilWidth0 (0 << 2)
872 # define LBRF_StencilWidth4 (1 << 2)
873 # define LBRF_StencilWidth8 (2 << 2)
875 # define LBRF_StencilPos16 (0 << 4)
876 # define LBRF_StencilPos20 (1 << 4)
877 # define LBRF_StencilPos24 (2 << 4)
878 # define LBRF_StencilPos28 (3 << 4)
879 # define LBRF_StencilPos32 (4 << 4)
881 # define LBRF_FrameCount0 (0 << 7)
882 # define LBRF_FrameCount4 (1 << 7)
883 # define LBRF_FrameCount8 (2 << 7)
885 # define LBRF_FrameCountPos16 (0 << 9)
886 # define LBRF_FrameCountPos20 (1 << 9)
887 # define LBRF_FrameCountPos24 (2 << 9)
888 # define LBRF_FrameCountPos28 (3 << 9)
889 # define LBRF_FrameCountPos32 (4 << 9)
890 # define LBRF_FrameCountPos36 (5 << 9)
891 # define LBRF_FrameCountPos40 (6 << 9)
893 # define LBRF_GIDWidth0 (0 << 12)
894 # define LBRF_GIDWidth4 (1 << 12)
896 # define LBRF_GIDPos16 (0 << 13)
897 # define LBRF_GIDPos20 (1 << 13)
898 # define LBRF_GIDPos24 (2 << 13)
899 # define LBRF_GIDPos28 (3 << 13)
900 # define LBRF_GIDPos32 (4 << 13)
901 # define LBRF_GIDPos36 (5 << 13)
902 # define LBRF_GIDPos40 (6 << 13)
903 # define LBRF_GIDPos44 (7 << 13)
904 # define LBRF_GIDPos48 (8 << 13)
906 # define LBRF_Compact32 (1 << 17)
910 #define LBSourceOffset GLINT_TAG_ADDR(0x11,0x02)
911 #define LBStencil GLINT_TAG_ADDR(0x11,0x05)
912 #define LBDepth GLINT_TAG_ADDR(0x11,0x06)
913 #define LBWindowBase GLINT_TAG_ADDR(0x11,0x07)
914 #define LBWriteMode GLINT_TAG_ADDR(0x11,0x08)
915 # define LBWM_WriteEnable 0x1
916 # define LBWM_UpLoad_LBDepth 0x2
917 # define LBWM_UpLoad_LBStencil 0x4
919 #define LBWriteFormat GLINT_TAG_ADDR(0x11,0x09)
922 #define TextureData GLINT_TAG_ADDR(0x11,0x0d)
923 #define TextureDownloadOffset GLINT_TAG_ADDR(0x11,0x0e)
924 #define LBWindowOffset GLINT_TAG_ADDR(0x11,0x0f)
926 #define GLINTWindow GLINT_TAG_ADDR(0x13,0x00)
927 # define GWIN_UnitEnable (1 << 0)
928 # define GWIN_ForceLBUpdate (1 << 3)
929 # define GWIN_LBUpdateSourceREG (1 << 4)
930 # define GWIN_LBUpdateSourceLB (0 << 4)
931 # define GWIN_StencilFCP (1 << 17)
932 # define GWIN_DepthFCP (1 << 18)
933 # define GWIN_OverrideWriteFilter (1 << 19)
934 # define GWIN_DisableLBUpdate 0x40000 /* ??? is this needed, set by permedia (2) modules */
936 #define StencilMode GLINT_TAG_ADDR(0x13,0x01)
937 #define StencilData GLINT_TAG_ADDR(0x13,0x02)
938 #define GLINTStencil GLINT_TAG_ADDR(0x13,0x03)
939 #define DepthMode GLINT_TAG_ADDR(0x13,0x04)
940 /* 0: */
941 /* WriteDisable */
942 /* SrcCompFragment */
943 /* CompFuncNEVER */
944 /* UNIT_DISABLE */
946 # define DPM_WriteEnable 1 << 1
947 # define DPM_SrcCompLBData 1 << 2
948 # define DPM_SrcCompDregister 2 << 2
949 # define DPM_SrcCompLBSourceData 3 << 2
950 # define DPM_CompFuncLESS 1 << 4
951 # define DPM_CompFuncEQUAL 2 << 4
952 # define DPM_CompFuncLESS_OR_EQ 3 << 4
953 # define DPM_CompFuncGREATER 4 << 4
954 # define DPM_CompFuncNOT_EQ 5 << 4
955 # define DPM_CompFuncGREATER_OR_EQ 6 << 4
956 # define DPM_CompFuncALWAYS 7 << 4
958 #define GLINTDepth GLINT_TAG_ADDR(0x13,0x05)
959 #define ZStartU GLINT_TAG_ADDR(0x13,0x06)
960 #define ZStartL GLINT_TAG_ADDR(0x13,0x07)
961 #define dZdxU GLINT_TAG_ADDR(0x13,0x08)
962 #define dZdxL GLINT_TAG_ADDR(0x13,0x09)
963 #define dZdyDomU GLINT_TAG_ADDR(0x13,0x0a)
964 #define dZdyDomL GLINT_TAG_ADDR(0x13,0x0b)
965 #define FastClearDepth GLINT_TAG_ADDR(0x13,0x0c)
967 #define FBReadMode GLINT_TAG_ADDR(0x15,0x00)
968 /* 0: */
969 /* SrcNoRead */
970 /* DstNoRead */
971 /* DataFBDefault */
972 /* WinTopLeft */
973 /* ScanlineInterval1 */
975 # define FBRM_SrcEnable 1 << 9
976 # define FBRM_DstEnable 1 << 10
977 # define FBRM_DataFBColor 1 << 15
978 # define FBRM_WinBottomLeft 1 << 16
979 # define FBRM_Packed 1 << 19
980 # define FBRM_ScanlineInt2 1 << 23
981 # define FBRM_ScanlineInt4 2 << 23
982 # define FBRM_ScanlineInt8 3 << 23
985 #define FBSourceOffset GLINT_TAG_ADDR(0x15,0x01)
986 #define FBPixelOffset GLINT_TAG_ADDR(0x15,0x02)
987 #define FBColor GLINT_TAG_ADDR(0x15,0x03)
988 #define FBData GLINT_TAG_ADDR(0x15,0x04)
989 #define FBSourceData GLINT_TAG_ADDR(0x15,0x05)
991 #define FBWindowBase GLINT_TAG_ADDR(0x15,0x06)
992 #define FBWriteMode GLINT_TAG_ADDR(0x15,0x07)
993 /* 0: */
994 /* FBWM_NoColorUpload */
995 /* FBWM_WriteDisable */
996 # define FBWM_WriteEnable 1
997 # define FBWM_UploadColor 1 << 3
998 # define FBWM_Enable0 1 << 12 /* PM3 */
1000 #define FBHardwareWriteMask GLINT_TAG_ADDR(0x15,0x08)
1001 #define FBBlockColor GLINT_TAG_ADDR(0x15,0x09)
1002 #define FBReadPixel GLINT_TAG_ADDR(0x15,0x0a) /* PM */
1003 #define PatternRamMode GLINT_TAG_ADDR(0x15,0x0f)
1005 #define PatternRamData0 GLINT_TAG_ADDR(0x16,0x00)
1006 #define PatternRamData1 GLINT_TAG_ADDR(0x16,0x01)
1007 #define PatternRamData2 GLINT_TAG_ADDR(0x16,0x02)
1008 #define PatternRamData3 GLINT_TAG_ADDR(0x16,0x03)
1009 #define PatternRamData4 GLINT_TAG_ADDR(0x16,0x04)
1010 #define PatternRamData5 GLINT_TAG_ADDR(0x16,0x05)
1011 #define PatternRamData6 GLINT_TAG_ADDR(0x16,0x06)
1012 #define PatternRamData7 GLINT_TAG_ADDR(0x16,0x07)
1014 #define FilterMode GLINT_TAG_ADDR(0x18,0x00)
1015 /* 0: */
1016 /* CullDepthTags */
1017 /* CullDepthData */
1018 /* CullStencilTags */
1019 /* CullStencilData */
1020 /* CullColorTag */
1021 /* CullColorData */
1022 /* CullSyncTag */
1023 /* CullSyncData */
1024 /* CullStatisticTag */
1025 /* CullStatisticData */
1027 # define FM_PassDepthTags 0x0010
1028 # define FM_PassDepthData 0x0020
1029 # define FM_PassStencilTags 0x0040
1030 # define FM_PassStencilData 0x0080
1031 # define FM_PassColorTag 0x0100
1032 # define FM_PassColorData 0x0200
1033 # define FM_PassSyncTag 0x0400
1034 # define FM_PassSyncData 0x0800
1035 # define FM_PassStatisticTag 0x1000
1036 # define FM_PassStatisticData 0x2000
1038 #define Sync_tag 0x0188
1040 #define StatisticMode GLINT_TAG_ADDR(0x18,0x01)
1041 #define MinRegion GLINT_TAG_ADDR(0x18,0x02)
1042 #define MaxRegion GLINT_TAG_ADDR(0x18,0x03)
1043 #define ResetPickResult GLINT_TAG_ADDR(0x18,0x04)
1044 #define MitHitRegion GLINT_TAG_ADDR(0x18,0x05)
1045 #define MaxHitRegion GLINT_TAG_ADDR(0x18,0x06)
1046 #define PickResult GLINT_TAG_ADDR(0x18,0x07)
1047 #define GlintSync GLINT_TAG_ADDR(0x18,0x08)
1049 #define FBBlockColorU GLINT_TAG_ADDR(0x18,0x0d)
1050 #define FBBlockColorL GLINT_TAG_ADDR(0x18,0x0e)
1051 #define SuspendUntilFrameBlank GLINT_TAG_ADDR(0x18,0x0f)
1053 #define KsRStart GLINT_TAG_ADDR(0x19,0x00)
1054 #define dKsRdx GLINT_TAG_ADDR(0x19,0x01)
1055 #define dKsRdyDom GLINT_TAG_ADDR(0x19,0x02)
1056 #define KsGStart GLINT_TAG_ADDR(0x19,0x03)
1057 #define dKsGdx GLINT_TAG_ADDR(0x19,0x04)
1058 #define dKsGdyDom GLINT_TAG_ADDR(0x19,0x05)
1059 #define KsBStart GLINT_TAG_ADDR(0x19,0x06)
1060 #define dKsBdx GLINT_TAG_ADDR(0x19,0x07)
1061 #define dKsBdyDom GLINT_TAG_ADDR(0x19,0x08)
1063 #define KdRStart GLINT_TAG_ADDR(0x1A,0x00)
1064 #define dKdRdx GLINT_TAG_ADDR(0x1A,0x01)
1065 #define dKdRdyDom GLINT_TAG_ADDR(0x1A,0x02)
1066 #define KdGStart GLINT_TAG_ADDR(0x1A,0x03)
1067 #define dKdGdx GLINT_TAG_ADDR(0x1A,0x04)
1068 #define dKdGdyDom GLINT_TAG_ADDR(0x1A,0x05)
1069 #define KdBStart GLINT_TAG_ADDR(0x1A,0x06)
1070 #define dKdBdx GLINT_TAG_ADDR(0x1A,0x07)
1071 #define dKdBdyDom GLINT_TAG_ADDR(0x1A,0x08)
1073 #define FBSourceBase GLINT_TAG_ADDR(0x1B,0x00)
1074 #define FBSourceDelta GLINT_TAG_ADDR(0x1B,0x01)
1075 #define Config GLINT_TAG_ADDR(0x1B,0x02)
1076 #define CFBRM_SrcEnable 1<<0
1077 #define CFBRM_DstEnable 1<<1
1078 #define CFBRM_Packed 1<<2
1079 #define CWM_Enable 1<<3
1080 #define CCDDA_Enable 1<<4
1081 #define CLogOp_Enable 1<<5
1082 #define ContextDump GLINT_TAG_ADDR(0x1B,0x08)
1083 #define ContextRestore GLINT_TAG_ADDR(0x1B,0x09)
1084 #define ContextData GLINT_TAG_ADDR(0x1B,0x0a)
1086 #define TexelLUT0 GLINT_TAG_ADDR(0x1D,0x00)
1087 #define TexelLUT1 GLINT_TAG_ADDR(0x1D,0x01)
1088 #define TexelLUT2 GLINT_TAG_ADDR(0x1D,0x02)
1089 #define TexelLUT3 GLINT_TAG_ADDR(0x1D,0x03)
1090 #define TexelLUT4 GLINT_TAG_ADDR(0x1D,0x04)
1091 #define TexelLUT5 GLINT_TAG_ADDR(0x1D,0x05)
1092 #define TexelLUT6 GLINT_TAG_ADDR(0x1D,0x06)
1093 #define TexelLUT7 GLINT_TAG_ADDR(0x1D,0x07)
1094 #define TexelLUT8 GLINT_TAG_ADDR(0x1D,0x08)
1095 #define TexelLUT9 GLINT_TAG_ADDR(0x1D,0x09)
1096 #define TexelLUT10 GLINT_TAG_ADDR(0x1D,0x0A)
1097 #define TexelLUT11 GLINT_TAG_ADDR(0x1D,0x0B)
1098 #define TexelLUT12 GLINT_TAG_ADDR(0x1D,0x0C)
1099 #define TexelLUT13 GLINT_TAG_ADDR(0x1D,0x0D)
1100 #define TexelLUT14 GLINT_TAG_ADDR(0x1D,0x0E)
1101 #define TexelLUT15 GLINT_TAG_ADDR(0x1D,0x0F)
1103 #define YUVMode GLINT_TAG_ADDR(0x1E,0x00)
1104 #define ChromaUpper GLINT_TAG_ADDR(0x1E,0x01)
1105 #define ChromaLower GLINT_TAG_ADDR(0x1E,0x02)
1106 #define ChromaTestMode GLINT_TAG_ADDR(0x1E,0x03)
1109 /******************************
1110 * GLINT Delta Core Registers *
1111 ******************************/
1113 #define V0FixedTag GLINT_TAG_ADDR(0x20,0x00)
1114 #define V1FixedTag GLINT_TAG_ADDR(0x21,0x00)
1115 #define V2FixedTag GLINT_TAG_ADDR(0x22,0x00)
1116 #define V0FloatTag GLINT_TAG_ADDR(0x23,0x00)
1117 #define V1FloatTag GLINT_TAG_ADDR(0x24,0x00)
1118 #define V2FloatTag GLINT_TAG_ADDR(0x25,0x00)
1120 #define VPAR_s 0x00
1121 #define VPAR_t 0x08
1122 #define VPAR_q 0x10
1123 #define VPAR_Ks 0x18
1124 #define VPAR_Kd 0x20
1126 /* have changed colors in ramdac !
1127 #define VPAR_R 0x28
1128 #define VPAR_G 0x30
1129 #define VPAR_B 0x38
1130 #define VPAR_A 0x40
1132 #define VPAR_B 0x28
1133 #define VPAR_G 0x30
1134 #define VPAR_R 0x38
1135 #define VPAR_A 0x40
1137 #define VPAR_f 0x48
1139 #define VPAR_x 0x50
1140 #define VPAR_y 0x58
1141 #define VPAR_z 0x60
1143 #define DeltaModeTag GLINT_TAG_ADDR(0x26,0x00)
1144 /* 0: */
1145 /* GLINT_300SX */
1147 /* DeltaMode Register Bit Field Assignments */
1148 # define DM_GLINT_300SX 0x0000
1149 # define DM_GLINT_500TX 0x0001
1150 # define DM_PERMEDIA 0x0002
1151 # define DM_Depth_16BPP (1 << 2)
1152 # define DM_Depth_24BPP (2 << 2)
1153 # define DM_Depth_32BPP (3 << 2)
1154 # define DM_FogEnable 0x0010
1155 # define DM_TextureEnable 0x0020
1156 # define DM_SmoothShadingEnable 0x0040
1157 # define DM_DepthEnable 0x0080
1158 # define DM_SpecularTextureEnable 0x0100
1159 # define DM_DiffuseTextureEnable 0x0200
1160 # define DM_SubPixelCorrectionEnable 0x0400
1161 # define DM_DiamondExit 0x0800
1162 # define DM_NoDraw 0x1000
1163 # define DM_ClampEnable 0x2000
1164 # define DM_ClampedTexParMode 0x4000
1165 # define DM_NormalizedTexParMode 0xC000
1168 # define DDCMD_AreaStrippleEnable 0x0001
1169 # define DDCMD_LineStrippleEnable 0x0002
1170 # define DDCMD_ResetLineStripple 1 << 2
1171 # define DDCMD_FastFillEnable 1 << 3
1172 /* 2 Bits reserved */
1173 # define DDCMD_PrimitiveType_Point 2 << 6
1174 # define DDCMD_PrimitiveType_Line 0 << 6
1175 # define DDCMD_PrimitiveType_Trapezoid 1 << 6
1176 # define DDCMD_AntialiasEnable 1 << 8
1177 # define DDCMD_AntialiasingQuality 1 << 9
1178 # define DDCMD_UsePointTable 1 << 10
1179 # define DDCMD_SyncOnBitMask 1 << 11
1180 # define DDCMD_SyncOnHostDate 1 << 12
1181 # define DDCMD_TextureEnable 1 << 13
1182 # define DDCMD_FogEnable 1 << 14
1183 # define DDCMD_CoverageEnable 1 << 15
1184 # define DDCMD_SubPixelCorrectionEnable 1 << 16
1188 #define DrawTriangle GLINT_TAG_ADDR(0x26,0x01)
1189 #define RepeatTriangle GLINT_TAG_ADDR(0x26,0x02)
1190 #define DrawLine01 GLINT_TAG_ADDR(0x26,0x03)
1191 #define DrawLine10 GLINT_TAG_ADDR(0x26,0x04)
1192 #define RepeatLine GLINT_TAG_ADDR(0x26,0x05)
1193 #define BroadcastMask GLINT_TAG_ADDR(0x26,0x0F)
1195 /* Permedia 3 - Accelerator Extensions */
1196 #define FillRectanglePosition 0x8348
1197 #define FillRender2D 0x8350
1198 #define FBDstReadBufAddr0 0xAE80
1199 #define FBDstReadBufOffset0 0xAEA0
1200 #define FBDstReadBufWidth0 0xAEC0
1201 #define FBDstReadMode 0xAEE0
1202 #define FBDRM_Enable0 1<<8
1203 #define FBDRM_Blocking 1<<24
1204 #define FBDstReadEnables 0xAEE8
1205 #define FBSrcReadMode 0xAF00
1206 #define FBSRM_Blocking 1<<11
1207 #define FBSrcReadBufAddr 0xAF08
1208 #define FBSrcReadBufOffset0 0xAF10
1209 #define FBSrcReadBufWidth 0xAF18
1210 #define FBWriteBufAddr0 0xB000
1211 #define FBWriteBufOffset0 0xB020
1212 #define FBWriteBufWidth0 0xB040
1213 #define FBBlockColorBack 0xB0A0
1214 #define ForegroundColor 0xB0C0
1215 #define BackgroundColor 0xB0C8
1216 #define RectanglePosition 0xB600
1217 #define Render2D 0xB640
1219 /* Colorformats */
1220 #define BGR555 1
1221 #define BGR565 16
1222 #define CI8 14
1223 #define CI4 15
1225 #if 0
1227 #ifdef DEBUG
1228 #define GLINT_WRITE_REG(v,r) \
1229 GLINT_VERB_WRITE_REG(pGlint,v,r,__FILE__,__LINE__)
1230 #define GLINT_READ_REG(r) \
1231 GLINT_VERB_READ_REG(pGlint,r,__FILE__,__LINE__)
1232 #else
1234 #define GLINT_WRITE_REG(v,r) \
1235 MMIO_OUT32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r), (v))
1236 #define GLINT_READ_REG(r) \
1237 MMIO_IN32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r))
1239 #endif /* DEBUG */
1241 #define GLINT_WAIT(n) \
1242 do{ \
1243 if (pGlint->InFifoSpace>=(n)) \
1244 pGlint->InFifoSpace -= (n); \
1245 else { \
1246 int tmp; \
1247 while((tmp=GLINT_READ_REG(InFIFOSpace))<(n)); \
1248 /* Clamp value due to bugs in PM3 */ \
1249 if (tmp > pGlint->FIFOSize) \
1250 tmp = pGlint->FIFOSize; \
1251 pGlint->InFifoSpace = tmp - (n); \
1253 }while(0)
1255 #define GLINTDACDelay(x) do { \
1256 int delay = x; \
1257 while(delay--){(void)GLINT_READ_REG(InFIFOSpace);}; \
1258 } while(0)
1260 #define GLINT_MASK_WRITE_REG(v,m,r) \
1261 GLINT_WRITE_REG((GLINT_READ_REG(r)&(m))|(v),r)
1263 #define GLINT_SLOW_WRITE_REG(v,r) \
1264 do{ \
1265 mem_barrier(); \
1266 GLINT_WAIT(pGlint->FIFOSize); \
1267 mem_barrier(); \
1268 GLINT_WRITE_REG(v,r); \
1269 }while(0)
1271 #define GLINT_SET_INDEX(index) \
1272 do{ \
1273 GLINT_SLOW_WRITE_REG(((index)>>8)&0xff,PM2VDACIndexRegHigh); \
1274 GLINT_SLOW_WRITE_REG((index)&0xff,PM2VDACIndexRegLow); \
1275 } while(0)
1277 #define REPLICATE(r) \
1279 if (pScrn->bitsPerPixel == 16) { \
1280 r &= 0xFFFF; \
1281 r |= (r<<16); \
1282 } else \
1283 if (pScrn->bitsPerPixel == 8) { \
1284 r &= 0xFF; \
1285 r |= (r<<8); \
1286 r |= (r<<16); \
1290 #ifndef XF86DRI
1291 #define LOADROP(rop) \
1293 if (pGlint->ROP != rop) { \
1294 GLINT_WRITE_REG(rop<<1|UNIT_ENABLE, LogicalOpMode); \
1295 pGlint->ROP = rop; \
1298 #else
1299 #define LOADROP(rop) \
1301 GLINT_WRITE_REG(rop<<1|UNIT_ENABLE, LogicalOpMode); \
1302 pGlint->ROP = rop; \
1304 #endif
1306 #define CHECKCLIPPING \
1308 if (pGlint->ClippingOn) { \
1309 pGlint->ClippingOn = FALSE; \
1310 GLINT_WAIT(1); \
1311 GLINT_WRITE_REG(0, ScissorMode); \
1315 #ifndef XF86DRI
1316 #define DO_PLANEMASK(planemask) \
1318 if (planemask != pGlint->planemask) { \
1319 pGlint->planemask = planemask; \
1320 REPLICATE(planemask); \
1321 GLINT_WRITE_REG(planemask, FBHardwareWriteMask);\
1324 #else
1325 #define DO_PLANEMASK(planemask) \
1327 pGlint->planemask = planemask; \
1328 REPLICATE(planemask); \
1329 GLINT_WRITE_REG(planemask, FBHardwareWriteMask);\
1331 #endif
1333 /* Permedia Save/Restore functions */
1335 #define STOREREG(address,value) \
1336 pReg->glintRegs[address >> 3] = value;
1338 #define SAVEREG(address) \
1339 pReg->glintRegs[address >> 3] = GLINT_READ_REG(address);
1341 #define RESTOREREG(address) \
1342 GLINT_SLOW_WRITE_REG(pReg->glintRegs[address >> 3], address);
1344 #define STOREDAC(address,value) \
1345 pReg->DacRegs[address] = value;
1347 #define P2VOUT(address) \
1348 Permedia2vOutIndReg(pScrn, address, 0x00, pReg->DacRegs[address]);
1350 #define P2VIN(address) \
1351 pReg->DacRegs[address] = Permedia2vInIndReg(pScrn, address);
1353 /* RamDac Save/Restore functions, used by external DAC's */
1355 #define STORERAMDAC(address,value) \
1356 ramdacReg->DacRegs[address] = value;
1358 /* Multi Chip access */
1360 #define ACCESSCHIP1() \
1361 pGlint->IOOffset = 0;
1363 #define ACCESSCHIP2() \
1364 pGlint->IOOffset = 0x10000;
1366 #endif /* 0 */
1368 #define GLINT_XY(x,y) (((x) & 0x0FFF) | (((y) & 0x0FFF) << 16))
1370 #endif