2
* Id: smi.h,v 1.2 1999/11/02 08:17:24 keithp Exp $
4
* Copyright ļæ½ 2001 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
/* $XFree86: xc/programs/Xserver/hw/kdrive/smi/smi.h,v 1.6 2001/07/24 19:06:03 keithp Exp $ */
33
#define subGetColors vesaGetColors
34
#define subPutColors vesaPutColors
35
#define subInitialize vesaInitialize
36
#define subScreenInitialize vesaScreenInitialize
37
#define subInitScreen vesaInitScreen
38
#define subFinishInitScreen vesaFinishInitScreen
39
#define subCreateResources vesaCreateResources
40
#define subRandRSetConfig vesaRandRSetConfig
41
#define subPreserve vesaPreserve
42
#define subEnable vesaEnable
43
#define subDPMS vesaDPMS
44
#define subRestore vesaRestore
45
#define subScreenFini vesaScreenFini
46
#define subCardFini vesaCardFini
47
#define subDisable vesaDisable
48
#define SubCardPrivRec VesaCardPrivRec
49
#define SubScreenPrivRec VesaScreenPrivRec
50
#define subUseMsg() vesaUseMsg()
51
#define subProcessArgument(c,v,i) vesaProcessArgument(c,v,i)
54
#define subGetColors fbdevGetColors
55
#define subPutColors fbdevPutColors
56
#define subInitialize fbdevInitialize
57
#define subScreenInitialize fbdevScreenInitialize
58
#define subInitScreen fbdevInitScreen
59
#define subFinishInitScreen fbdevFinishInitScreen
60
#define subCreateResources fbdevCreateResources
61
#define subRandRSetConfig fbdevRandRSetConfig
62
#define subPreserve fbdevPreserve
63
#define subEnable fbdevEnable
64
#define subDPMS fbdevDPMS
65
#define subRestore fbdevRestore
66
#define subScreenFini fbdevScreenFini
67
#define subCardFini fbdevCardFini
68
#define subDisable fbdevDisable
69
#define SubCardPrivRec FbdevPriv
70
#define SubScreenPrivRec FbdevScrPriv
72
#define subProcessArgument(c,v,i) 0
79
#define DBGOUT(fmt,a...) fprintf (stderr, fmt, ##a)
81
#define DBGOUT(fmt,a...)
84
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
85
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
88
* offset from ioport beginning
91
#define SMI_IO_BASE(c) ((c)->attr.io)
92
#define SMI_REG_BASE(c) ((c)->attr.address[0])
93
#define SMI_REG_SIZE(c) (4096)
95
#define SMI_DPR_OFF(c) (0x00000)
97
typedef volatile CARD8 VOL8;
98
typedef volatile CARD16 VOL16;
99
typedef volatile CARD32 VOL32;
102
typedef struct _DPR {
103
VOL32 src_xy; /* 0x00 */
104
VOL32 dst_xy; /* 0x04 */
105
VOL32 dst_wh; /* 0x08 */
106
VOL32 accel_cmd; /* 0x0c */
107
VOL32 src_stride; /* 0x10 */
110
VOL32 data_format; /* 0x1c */
111
VOL32 transparent; /* 0x20 */
112
VOL32 mask1; /* 0x24 ? */
113
VOL32 mask2; /* 0x28 ? */
114
VOL32 scissors_ul; /* 0x2c */
115
VOL32 scissors_lr; /* 0x30 */
116
VOL32 mask3; /* 0x34 */
117
VOL32 mask4; /* 0x38 */
118
VOL32 dst_stride; /* 0x3c */
119
VOL32 unknown_40; /* 0x40 */
120
VOL32 unknown_44; /* 0x44 */
123
#define SMI_XY(x,y) (((y) & 0x7fff) | (((x) & 0x7fff) << 16))
125
/* 2D Engine commands */
126
#define SMI_TRANSPARENT_SRC 0x00000100
127
#define SMI_TRANSPARENT_DEST 0x00000300
129
#define SMI_OPAQUE_PXL 0x00000000
130
#define SMI_TRANSPARENT_PXL 0x00000400
132
#define SMI_MONO_PACK_8 0x00001000
133
#define SMI_MONO_PACK_16 0x00002000
134
#define SMI_MONO_PACK_32 0x00003000
136
#define SMI_ROP2_SRC 0x00008000
137
#define SMI_ROP2_PAT 0x0000C000
138
#define SMI_ROP3 0x00000000
140
#define SMI_BITBLT 0x00000000
141
#define SMI_RECT_FILL 0x00010000
142
#define SMI_TRAPEZOID_FILL 0x00030000
143
#define SMI_SHORT_STROKE 0x00060000
144
#define SMI_BRESENHAM_LINE 0x00070000
145
#define SMI_HOSTBLT_WRITE 0x00080000
146
#define SMI_HOSTBLT_READ 0x00090000
147
#define SMI_ROTATE_BLT 0x000B0000
149
#define SMI_SRC_COLOR 0x00000000
150
#define SMI_SRC_MONOCHROME 0x00400000
152
#define SMI_GRAPHICS_STRETCH 0x00800000
154
#define SMI_ROTATE_CW 0x01000000
155
#define SMI_ROTATE_CCW 0x02000000
157
#define SMI_MAJOR_X 0x00000000
158
#define SMI_MAJOR_Y 0x04000000
160
#define SMI_LEFT_TO_RIGHT 0x00000000
161
#define SMI_RIGHT_TO_LEFT 0x08000000
163
#define SMI_COLOR_PATTERN 0x40000000
164
#define SMI_MONO_PATTERN 0x00000000
166
#define SMI_QUICK_START 0x10000000
167
#define SMI_START_ENGINE 0x80000000
169
#define VGA_SEQ_INDEX 0x3C4
170
#define VGA_SEQ_DATA 0x3C5
172
typedef struct _smiCardInfo {
180
#define getSmiCardInfo(kd) ((SmiCardInfo *) ((kd)->card->driver))
181
#define smiCardInfo(kd) SmiCardInfo *smic = getSmiCardInfo(kd)
183
typedef struct _smiScreenInfo {
184
SubScreenPrivRec sub;
188
CARD8 dpr_vpr_enable;
189
KaaScreenInfoRec kaa;
192
#define getSmiScreenInfo(kd) ((SmiScreenInfo *) ((kd)->screen->driver))
193
#define smiScreenInfo(kd) SmiScreenInfo *smis = getSmiScreenInfo(kd)
196
smiPreserve (KdCardInfo *card);
199
smiMapReg (KdCardInfo *card, SmiCardInfo *smic);
202
smiUnmapReg (KdCardInfo *card, SmiCardInfo *smic);
205
smiOutb (CARD16 port, CARD8 val);
208
smiInb (CARD16 port);
211
smiGetIndex (SmiCardInfo *smic, CARD16 addr, CARD16 data, CARD8 id);
214
smiSetIndex (SmiCardInfo *smic, CARD16 addr, CARD16 data, CARD8 id, CARD8 val);
217
smiSetMMIO (KdCardInfo *card, SmiCardInfo *smic);
220
smiResetMMIO (KdCardInfo *card, SmiCardInfo *smic);
223
smiEnable (ScreenPtr pScreen);
226
smiDisable (ScreenPtr pScreen);
229
smiWaitAvail(SmiCardInfo *smic, int n);
232
smiWaitIdle (SmiCardInfo *smic);
235
smiDrawSetup (ScreenPtr pScreen);
238
smiDrawInit (ScreenPtr pScreen);
241
smiDrawReinit (ScreenPtr pScreen);
244
smiDrawEnable (ScreenPtr pScreen);
247
smiDrawDisable (ScreenPtr pScreen);
250
smiDrawFini (ScreenPtr pScreen);
253
smiReadIndex (SmiCardInfo *smic, CARD16 port, CARD8 index);
256
smiWriteIndex (SmiCardInfo *smic, CARD16 port, CARD8 index, CARD8 value);
258
extern KdCardFuncs smiFuncs;