2
* Id: trident.h,v 1.2 1999/11/02 08:17:24 keithp Exp $
4
* Copyright ļæ½ 1999 Keith Packard
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Keith Packard not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Keith Packard makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
24
/* $RCSId: xc/programs/Xserver/hw/kdrive/trident/trident.h,v 1.8 2000/10/20 00:19:51 keithp Exp $ */
35
* offset from ioport beginning
39
#define TRIDENT_COP_BASE(c) (c->attr.address[1])
40
#define TRIDENT_COP_OFF(c) 0x2100
41
#define TRIDENT_COP_SIZE(c) 0x20000
43
#define TRIDENT_COP_BASE(c) 0xbf000
44
#define TRIDENT_COP_OFF(c) 0x00f00
45
#define TRIDENT_COP_SIZE(c) (0x2000)
48
typedef volatile CARD8 VOL8;
49
typedef volatile CARD16 VOL16;
50
typedef volatile CARD32 VOL32;
53
VOL32 src_start_xy; /* 0x00 */
54
VOL32 src_end_xy; /* 0x04 */
55
VOL32 dst_start_xy; /* 0x08 */
56
VOL32 dst_end_xy; /* 0x0c */
57
VOL32 alpha; /* 0x10 */
58
CARD8 pad14[0xc]; /* 0x14 */
59
VOL32 multi; /* 0x20 */
61
#define COP_MULTI_CLIP_TOP_LEFT 0x10000000
62
#define COP_MULTI_DEPTH 0x40000000
63
#define COP_MULTI_COLOR_KEY 0x70000000
64
#define COP_MULTI_STYLE 0x50000000
65
#define COP_MULTI_PATTERN 0x80000000
66
#define COP_MULTI_ROP 0x90000000
67
#define COP_MULTI_STRIDE 0x60000000
68
#define COP_MULTI_Z 0xa0000000
69
#define COP_MULTI_ALPHA 0xb0000000
70
#define COP_MULTI_TEXTURE 0xd0000000
71
#define COP_MULTI_TEXTURE_BOUND 0xe0000000
72
#define COP_MULTI_TEXTURE_ADVANCED 0x20000000
73
#define COP_MULTI_MASK 0xf0000000
75
#define COP_DEPTH_8 0x00000000
76
#define COP_DEPTH_16 0x00000001
77
#define COP_DEPTH_24_32 0x00000002
78
#define COP_DEPTH_15 0x00000005
79
#define COP_DEPTH_DITHER_DISABLE 0x00000008
82
#define COP_ALPHA_SRC_BLEND_0 0x00000000
83
#define COP_ALPHA_SRC_BLEND_1 0x00000001
84
#define COP_ALPHA_SRC_BLEND_SRC_C 0x00000002
85
#define COP_ALPHA_SRC_BLEND_1_SRC_C 0x00000003
86
#define COP_ALPHA_SRC_BLEND_SRC_A 0x00000004
87
#define COP_ALPHA_SRC_BLEND_1_SRC_A 0x00000005
88
#define COP_ALPHA_SRC_BLEND_DST_A 0x00000006
89
#define COP_ALPHA_SRC_BLEND_1_DST_A 0x00000007
90
#define COP_ALPHA_SRC_BLEND_DST_C 0x00000008
91
#define COP_ALPHA_SRC_BLEND_1_DST_C 0x00000009
92
#define COP_ALPHA_SRC_BLEND_SAT 0x0000000A
93
#define COP_ALPHA_SRC_BLEND_BG 0x0000000B
95
#define COP_ALPHA_DST_BLEND_0 0x00000000
96
#define COP_ALPHA_DST_BLEND_1 0x00000010
97
#define COP_ALPHA_DST_BLEND_SRC_C 0x00000020
98
#define COP_ALPHA_DST_BLEND_1_SRC_C 0x00000030
99
#define COP_ALPHA_DST_BLEND_SRC_A 0x00000040
100
#define COP_ALPHA_DST_BLEND_1_SRC_A 0x00000050
101
#define COP_ALPHA_DST_BLEND_DST_A 0x00000060
102
#define COP_ALPHA_DST_BLEND_1_DST_A 0x00000070
103
#define COP_ALPHA_DST_BLEND_DST_C 0x00000080
104
#define COP_ALPHA_DST_BLEND_1_DST_C 0x00000090
105
#define COP_ALPHA_DST_BLEND_OTHER 0x000000A0
107
#define COP_ALPHA_RESULT_ALPHA 0x00100000
108
#define COP_ALPHA_DEST_ALPHA 0x00200000
109
#define COP_ALPHA_SOURCE_ALPHA 0x00400000
110
#define COP_ALPHA_WRITE_ENABLE 0x00800000
111
#define COP_ALPHA_TEST_ENABLE 0x01000000
112
#define COP_ALPHA_BLEND_ENABLE 0x02000000
113
#define COP_ALPHA_DEST_VALUE 0x04000000
114
#define COP_ALPHA_SOURCE_VALUE 0x08000000
116
VOL32 command; /* 0x24 */
117
#define COP_OP_NULL 0x00000000
118
#define COP_OP_LINE 0x20000000
119
#define COP_OP_BLT 0x80000000
120
#define COP_OP_TEXT 0x90000000
121
#define COP_OP_POLY 0xb0000000
122
#define COP_OP_POLY2 0xe0000000
123
#define COP_SCL_EXPAND 0x00800000
124
#define COP_SCL_OPAQUE 0x00400000
125
#define COP_SCL_REVERSE 0x00200000
126
#define COP_SCL_MONO_OFF 0x001c0000
127
#define COP_LIT_TEXTURE 0x00004000
128
#define COP_BILINEAR 0x00002000
129
#define COP_OP_ZBUF 0x00000800
130
#define COP_OP_ROP 0x00000400
131
#define COP_OP_FG 0x00000200
132
#define COP_OP_FB 0x00000080
133
#define COP_X_REVERSE 0x00000004
134
#define COP_CLIP 0x00000001
135
VOL32 texture_format; /* 0x28 */
136
CARD8 pad2c[0x4]; /* 0x2c */
138
VOL32 clip_bottom_right; /* 0x30 */
139
VOL32 dataIII; /* 0x34 */
140
VOL32 dataIV; /* 0x38 */
141
CARD8 pad3c[0x8]; /* 0x3c */
145
CARD8 pad4c[0x4]; /* 0x4c */
147
VOL32 pattern_fg; /* 0x50 */
148
VOL32 pattern_bg; /* 0x54 */
149
CARD8 pad58[0xc]; /* 0x58 */
151
VOL32 status; /* 0x64 */
152
#define COP_STATUS_BE_BUSY 0x80000000
153
#define COP_STATUS_DPE_BUSY 0x20000000
154
#define COP_STATUS_MI_BUSY 0x10000000
155
#define COP_STATUS_FIFO_BUSY 0x08000000
156
#define COP_STATUS_WB_BUSY 0x00800000
157
#define COP_STATUS_Z_FAILED 0x00400000
158
#define COP_STATUS_EFFECTIVE 0x00200000
159
#define COP_STATUS_LEFT_VIEW 0x00080000
161
CARD8 pad68[0x4]; /* 0x68 */
163
VOL32 src_offset; /* 0x6c */
164
VOL32 z_offset; /* 0x70 */
165
CARD8 pad74[0x4]; /* 0x74 */
167
VOL32 display_offset; /* 0x78 */
168
VOL32 dst_offset; /* 0x7c */
169
CARD8 pad80[0x34]; /* 0x80 */
171
VOL32 semaphore; /* 0xb4 */
174
#define TRI_XY(x,y) ((y) << 16 | (x))
176
typedef struct _tridentSave {
177
CARD8 reg_3c4_0e; /* config port value */
180
CARD8 reg_3d4_62; /* GE setup */
181
CARD8 reg_3ce_21; /* DPMS */
182
CARD8 reg_3c2; /* clock config */
183
CARD8 reg_3c4_16; /* MCLKLow */
184
CARD8 reg_3c4_17; /* MCLKHigh */
185
CARD8 reg_3c4_18; /* ClockLow */
186
CARD8 reg_3c4_19; /* ClockHigh */
189
typedef struct _tridentCardInfo {
191
VesaCardPrivRec vesa;
204
#define getTridentCardInfo(kd) ((TridentCardInfo *) ((kd)->card->driver))
205
#define tridentCardInfo(kd) TridentCardInfo *tridentc = getTridentCardInfo(kd)
207
typedef struct _tridentCursor {
215
#define TRIDENT_CURSOR_WIDTH 64
216
#define TRIDENT_CURSOR_HEIGHT 64
218
typedef struct _tridentScreenInfo {
220
VesaScreenPrivRec vesa;
228
TridentCursor cursor;
231
#define getTridentScreenInfo(kd) ((TridentScreenInfo *) ((kd)->screen->driver))
232
#define tridentScreenInfo(kd) TridentScreenInfo *tridents = getTridentScreenInfo(kd)
235
tridentDrawInit (ScreenPtr pScreen);
238
tridentDrawEnable (ScreenPtr pScreen);
241
tridentDrawSync (ScreenPtr pScreen);
244
tridentDrawDisable (ScreenPtr pScreen);
247
tridentDrawFini (ScreenPtr pScreen);
250
tridentReadIndex (TridentCardInfo *tridentc, CARD16 port, CARD8 index);
253
tridentWriteIndex (TridentCardInfo *tridentc, CARD16 port, CARD8 index, CARD8 value);
256
tridentCursorInit (ScreenPtr pScreen);
259
tridentCursorEnable (ScreenPtr pScreen);
262
tridentCursorDisable (ScreenPtr pScreen);
265
tridentCursorFini (ScreenPtr pScreen);
268
tridentRecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdef);
270
extern KdCardFuncs tridentFuncs;
272
#endif /* _TRIDENT_H_ */