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