1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.48.2.1 2001/05/24 20:12:47 alanh Exp $ */
/*
* Copyright 1997-2001 by Alan Hourihane <alanh@fairlite.demon.co.uk>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Alan Hourihane not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Alan Hourihane makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
* Dirk Hohndel, <hohndel@suse.de>
* Stefan Dirsch, <sndirsch@suse.de>
*
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
* Siemens Nixdorf Informationssysteme
*/
#ifndef _GLINT_H_
#define _GLINT_H_
#include "xaa.h"
#include "xf86RamDac.h"
#include "xf86cmap.h"
#include "xf86i2c.h"
#include "xf86DDC.h"
#ifdef XF86DRI
#include "xf86drm.h"
#include "sarea.h"
#define _XF86DRI_SERVER_
#include "xf86dri.h"
#include "dri.h"
#include "GL/glxint.h"
#include "glint_dripriv.h"
#endif
#define GLINT_MAX_MULTI_DEVICES 2
#define VERSION 4000
#define GLINT_NAME "GLINT"
#define GLINT_DRIVER_NAME "glint"
#define GLINT_MAJOR_VERSION 1
#define GLINT_MINOR_VERSION 0
#define GLINT_PATCHLEVEL 0
typedef struct {
CARD32 glintRegs[0x2000];
CARD32 DacRegs[0x100];
CARD8 cmap[0x300];
} GLINTRegRec, *GLINTRegPtr;
#define GLINTPTR(p) ((GLINTPtr)((p)->driverPrivate))
typedef struct {
int lastInstance;
int refCount;
} GLINTEntRec, *GLINTEntPtr;
typedef struct {
pciVideoPtr PciInfo;
pciVideoPtr MultiPciInfo[GLINT_MAX_MULTI_DEVICES];
int numMultiDevices;
int MultiChip;
Bool MultiAperture;
PCITAG PciTag;
EntityInfoPtr pEnt;
GLINTEntPtr entityPrivate;
RamDacHelperRecPtr RamDac;
int Chipset;
int ChipRev;
int HwBpp;
int BppShift;
int pprod;
CARD32 ForeGroundColor;
CARD32 BackGroundColor;
int bppalign;
CARD32 startxdom;
CARD32 startxsub;
CARD32 starty;
CARD32 count;
CARD32 dy;
CARD32 x;
CARD32 y;
CARD32 w;
CARD32 h;
CARD32 dxdom;
int dwords;
int cpuheight;
int cpucount;
CARD32 planemask;
int realWidth;
CARD32 IOAddress;
unsigned long FbAddress;
int irq;
unsigned char * IOBase;
unsigned char * FbBase;
long FbMapSize;
long IOOffset;
DGAModePtr DGAModes;
int numDGAModes;
Bool DGAactive;
int DGAViewportStatus;
Bool DoubleBuffer;
Bool NoAccel;
Bool FBDev;
Bool ShadowFB;
unsigned char * ShadowPtr;
int ShadowPitch;
Bool Dac6Bit;
Bool HWCursor;
Bool ClippingOn;
Bool UseBlockWrite;
Bool UseFlatPanel;
Bool UseFireGL3000;
CARD8 VGAdata[65536];
Bool STATE;
Bool ScanlineDirect;
int MXFbSize;
CARD32 rasterizerMode;
int MinClock;
int MaxClock;
int RefClock;
GLINTRegRec SavedReg[GLINT_MAX_MULTI_DEVICES];
GLINTRegRec ModeReg[GLINT_MAX_MULTI_DEVICES];
CARD32 AccelFlags;
CARD32 ROP;
CARD32 FrameBufferReadMode;
CARD32 BltScanDirection;
CARD32 TexMapFormat;
CARD32 PixelWidth;
CARD32 FIFOSize;
RamDacRecPtr RamDacRec;
xf86CursorInfoPtr CursorInfoRec;
XAAInfoRecPtr AccelInfoRec;
CloseScreenProcPtr CloseScreen;
ScreenBlockHandlerProcPtr BlockHandler;
GCPtr CurrentGC;
DrawablePtr CurrentDrawable;
I2CBusPtr DDCBus, VSBus;
CARD32 FGCursor;
CARD32 BGCursor;
CARD8 HardwareCursorPattern[1024];
CARD8* XAAScanlineColorExpandBuffers[2];
CARD8* ScratchBuffer;
CARD32 RasterizerSwap;
void (*LoadCursorCallback)(ScrnInfoPtr);
void (*CursorColorCallback)(ScrnInfoPtr);
CARD32 PM3_PixelSize;
CARD32 PM3_Config2D;
CARD32 PM3_Render2D;
CARD32 PM3_AreaStippleMode;
CARD32 PM3_VideoControl;
int InFifoSpace;
#ifdef XF86DRI
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
int drmSubFD;
drmBufMapPtr drmBufs; /* Map of DMA buffers */
int numVisualConfigs;
__GLXvisualConfig* pVisualConfigs;
GLINTConfigPrivPtr pVisualConfigsPriv;
GLINTRegRec DRContextRegs;
#endif
OptionInfoPtr Options;
} GLINTRec, *GLINTPtr;
/* Defines for PCI data */
#define PCI_VENDOR_TI_CHIP_PERMEDIA2 \
((PCI_VENDOR_TI << 16) | PCI_CHIP_TI_PERMEDIA2)
#define PCI_VENDOR_TI_CHIP_PERMEDIA \
((PCI_VENDOR_TI << 16) | PCI_CHIP_TI_PERMEDIA)
#define PCI_VENDOR_3DLABS_CHIP_PERMEDIA \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_PERMEDIA)
#define PCI_VENDOR_3DLABS_CHIP_PERMEDIA2 \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_PERMEDIA2)
#define PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_PERMEDIA2V)
#define PCI_VENDOR_3DLABS_CHIP_PERMEDIA3 \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_PERMEDIA3)
#define PCI_VENDOR_3DLABS_CHIP_300SX \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_300SX)
#define PCI_VENDOR_3DLABS_CHIP_500TX \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_500TX)
#define PCI_VENDOR_3DLABS_CHIP_MX \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_MX)
#define PCI_VENDOR_3DLABS_CHIP_GAMMA \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_GAMMA)
#define PCI_VENDOR_3DLABS_CHIP_DELTA \
((PCI_VENDOR_3DLABS << 16) | PCI_CHIP_DELTA)
/* Prototypes */
void Permedia2StoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs);
void Permedia2InstallColormap(ColormapPtr pmap);
void Permedia2UninstallColormap(ColormapPtr pmap);
int Permedia2ListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
void Permedia2HandleColormaps(ScreenPtr pScreen, ScrnInfoPtr scrnp);
void Permedia2RestoreDACValues(ScrnInfoPtr pScrn);
void Permedia2Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia2Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool Permedia2Init(ScrnInfoPtr pScrn, DisplayModePtr mode);
Bool Permedia2AccelInit(ScreenPtr pScreen);
void Permedia2Sync(ScrnInfoPtr pScrn);
void Permedia2InitializeEngine(ScrnInfoPtr pScrn);
Bool Permedia2HWCursorInit(ScreenPtr pScreen);
void PermediaRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void PermediaSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool PermediaInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
Bool PermediaAccelInit(ScreenPtr pScreen);
void PermediaInitializeEngine(ScrnInfoPtr pScrn);
void Permedia2VRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia2VSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
void Permedia2VPreInit(ScrnInfoPtr pScrn);
Bool Permedia2vHWCursorInit(ScreenPtr pScreen);
void Permedia3PreInit(ScrnInfoPtr pScrn);
int Permedia3MemorySizeDetect(ScrnInfoPtr pScrn);
void Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg);
Bool Permedia3AccelInit(ScreenPtr pScreen);
void Permedia3InitializeEngine(ScrnInfoPtr pScrn);
void Permedia3EnableOffscreen(ScreenPtr pScreen);
void Permedia3Sync(ScrnInfoPtr pScrn);
void DualPermedia3Sync(ScrnInfoPtr pScrn);
void TXRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void TXSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr glintReg);
Bool TXAccelInit(ScreenPtr pScreen);
void TXInitializeEngine(ScrnInfoPtr pScrn);
void SXInitializeEngine(ScrnInfoPtr pScrn);
Bool SXAccelInit(ScreenPtr pScreen);
void DualMXRestore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
void DualMXSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg);
Bool DualMXInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
Bool DualMXAccelInit(ScreenPtr pScreen);
void DualMXInitializeEngine(ScrnInfoPtr pScrn);
void glintOutIBMRGBIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
unsigned char glintInIBMRGBIndReg(ScrnInfoPtr pScrn, CARD32 reg);
void glintIBMWriteAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintIBMReadAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintIBMWriteData(ScrnInfoPtr pScrn, unsigned char data);
Bool glintIBMHWCursorInit(ScreenPtr pScreen);
unsigned char glintIBMReadData(ScrnInfoPtr pScrn);
Bool glintIBM526HWCursorInit(ScreenPtr pScreen);
Bool glintIBM640HWCursorInit(ScreenPtr pScreen);
void glintOutTIIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
unsigned char glintInTIIndReg(ScrnInfoPtr pScrn, CARD32 reg);
void GMX2000OutIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
unsigned char GMX2000InIndReg(ScrnInfoPtr pScrn, CARD32 reg);
void glintTIWriteAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintTIReadAddress(ScrnInfoPtr pScrn, CARD32 index);
void glintTIWriteData(ScrnInfoPtr pScrn, unsigned char data);
unsigned char glintTIReadData(ScrnInfoPtr pScrn);
void GMX2000WriteAddress(ScrnInfoPtr pScrn, CARD32 index);
void GMX2000ReadAddress(ScrnInfoPtr pScrn, CARD32 index);
void GMX2000WriteData(ScrnInfoPtr pScrn, unsigned char data);
unsigned char GMX2000ReadData(ScrnInfoPtr pScrn);
Bool glintTIHWCursorInit(ScreenPtr pScreen);
void Permedia2OutIndReg(ScrnInfoPtr pScrn,
CARD32, unsigned char mask, unsigned char data);
unsigned char Permedia2InIndReg(ScrnInfoPtr pScrn, CARD32);
void Permedia2WriteAddress(ScrnInfoPtr pScrn, CARD32 index);
void Permedia2ReadAddress(ScrnInfoPtr pScrn, CARD32 index);
void Permedia2WriteData(ScrnInfoPtr pScrn, unsigned char data);
unsigned char Permedia2ReadData(ScrnInfoPtr pScrn);
void TIramdacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia2LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia2LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia3LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia3LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
void Permedia2I2CUDelay(I2CBusPtr b, int usec);
void Permedia2I2CPutBits(I2CBusPtr b, int scl, int sda);
void Permedia2I2CGetBits(I2CBusPtr b, int *scl, int *sda);
void Permedia2VideoInit(ScreenPtr pScreen);
void Permedia2VideoUninit(ScrnInfoPtr pScrn);
void Permedia2VideoEnterVT(ScrnInfoPtr pScrn);
void Permedia2VideoLeaveVT(ScrnInfoPtr pScrn);
void Permedia3VideoInit(ScreenPtr pScreen);
void Permedia3VideoUninit(ScrnInfoPtr pScrn);
void Permedia3VideoEnterVT(ScrnInfoPtr pScrn);
void Permedia3VideoLeaveVT(ScrnInfoPtr pScrn);
void Permedia2vOutIndReg(ScrnInfoPtr pScrn,
CARD32, unsigned char mask, unsigned char data);
unsigned char Permedia2vInIndReg(ScrnInfoPtr pScrn, CARD32);
Bool GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
void GLINTAdjustFrame(int scrnIndex, int x, int y, int flags);
extern int partprodPermedia[];
Bool GLINTDGAInit(ScreenPtr pScreen);
Bool GLINTDRIScreenInit(ScreenPtr pScreen);
Bool GLINTDRIFinishScreenInit(ScreenPtr pScreen);
void GLINTDRICloseScreen(ScreenPtr pScreen);
Bool GLINTInitGLXVisuals(ScreenPtr pScreen);
void GLINTDRIWakeupHandler(ScreenPtr pScreen);
void GLINTDRIBlockHandler(ScreenPtr pScreen);
void GLINTDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
void GLINTDRIMoveBuffers(WindowPtr pWin, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index);
void GLINT_VERB_WRITE_REG(GLINTPtr, CARD32 v, int r, char *file, int line);
CARD32 GLINT_VERB_READ_REG(GLINTPtr, CARD32 r, char *file, int line);
void GLINTRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void GLINT_MoveBYTE(CARD32* dest, unsigned char* src, int dwords);
void GLINT_MoveWORDS(CARD32* dest, unsigned short* src, int dwords);
void GLINT_MoveDWORDS(CARD32* dest, CARD32* src, int dwords);
int Shiftbpp(ScrnInfoPtr pScrn, int value);
#endif /* _GLINT_H_ */
|