3
* Copyright © 2004 Franco Catrin
5
* Permission to use, copy, modify, distribute, and sell this software and its
6
* documentation for any purpose is hereby granted without fee, provided that
7
* the above copyright notice appear in all copies and that both that
8
* copyright notice and this permission notice appear in supporting
9
* documentation, and that the name of Franco Catrin not be used in
10
* advertising or publicity pertaining to distribution of the software without
11
* specific, written prior permission. Franco Catrin makes no
12
* representations about the suitability of this software for any purpose. It
13
* is provided "as is" without express or implied warranty.
15
* FRANCO CATRIN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17
* EVENT SHALL FRANCO CATRIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
* PERFORMANCE OF THIS SOFTWARE.
33
#define DBGOUT(fmt,a...) fprintf (stderr, fmt, ##a)
35
#define DBGOUT(fmt,a...)
38
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
39
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
41
#define NEO_VENDOR 0x10c8
42
#define CAP_NM2070 0x01 /* If it's a NM2070 series */
43
#define CAP_NM2090 0x02 /* If it's a NM2090 series */
44
#define CAP_NM2097 0x03 /* If it's a NM2097 series */
45
#define CAP_NM2200 0x04 /* If it's a NM2200 series */
47
#define NEO_BS0_BLT_BUSY 0x00000001
48
#define NEO_BS0_FIFO_AVAIL 0x00000002
49
#define NEO_BS0_FIFO_PEND 0x00000004
51
#define NEO_BC0_DST_Y_DEC 0x00000001
52
#define NEO_BC0_X_DEC 0x00000002
53
#define NEO_BC0_SRC_TRANS 0x00000004
54
#define NEO_BC0_SRC_IS_FG 0x00000008
55
#define NEO_BC0_SRC_Y_DEC 0x00000010
56
#define NEO_BC0_FILL_PAT 0x00000020
57
#define NEO_BC0_SRC_MONO 0x00000040
58
#define NEO_BC0_SYS_TO_VID 0x00000080
60
#define NEO_BC1_DEPTH8 0x00000100
61
#define NEO_BC1_DEPTH16 0x00000200
62
#define NEO_BC1_X_320 0x00000400
63
#define NEO_BC1_X_640 0x00000800
64
#define NEO_BC1_X_800 0x00000c00
65
#define NEO_BC1_X_1024 0x00001000
66
#define NEO_BC1_X_1152 0x00001400
67
#define NEO_BC1_X_1280 0x00001800
68
#define NEO_BC1_X_1600 0x00001c00
69
#define NEO_BC1_DST_TRANS 0x00002000
70
#define NEO_BC1_MSTR_BLT 0x00004000
71
#define NEO_BC1_FILTER_Z 0x00008000
73
#define NEO_BC2_WR_TR_DST 0x00800000
75
#define NEO_BC3_SRC_XY_ADDR 0x01000000
76
#define NEO_BC3_DST_XY_ADDR 0x02000000
77
#define NEO_BC3_CLIP_ON 0x04000000
78
#define NEO_BC3_FIFO_EN 0x08000000
79
#define NEO_BC3_BLT_ON_ADDR 0x10000000
80
#define NEO_BC3_SKIP_MAPPING 0x80000000
82
#define NEO_MODE1_DEPTH8 0x0100
83
#define NEO_MODE1_DEPTH16 0x0200
84
#define NEO_MODE1_DEPTH24 0x0300
85
#define NEO_MODE1_X_320 0x0400
86
#define NEO_MODE1_X_640 0x0800
87
#define NEO_MODE1_X_800 0x0c00
88
#define NEO_MODE1_X_1024 0x1000
89
#define NEO_MODE1_X_1152 0x1400
90
#define NEO_MODE1_X_1280 0x1800
91
#define NEO_MODE1_X_1600 0x1c00
92
#define NEO_MODE1_BLT_ON_ADDR 0x2000
94
typedef volatile CARD8 VOL8;
95
typedef volatile CARD16 VOL16;
96
typedef volatile CARD32 VOL32;
98
#define NEO_REG_SIZE(c) (0x200000L)
100
typedef volatile struct {
115
CARD32 reserved1[19];
124
typedef struct _neoCardInfo {
125
VesaCardPrivRec backendCard;
137
struct NeoChipInfo *chip;
157
#define getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
158
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
160
typedef struct _neoScreenInfo {
161
VesaScreenPrivRec backendScreen;
168
KdVideoAdaptorPtr pAdaptor;
169
KaaScreenInfoRec kaa;
172
#define getNeoScreenInfo(kd) ((NeoScreenInfo *) ((kd)->screen->driver))
173
#define neoScreenInfo(kd) NeoScreenInfo *neos = getNeoScreenInfo(kd)
175
#define SetupNeo(s) KdScreenPriv(s); \
176
neoCardInfo(pScreenPriv); \
177
neoScreenInfo(pScreenPriv);
180
neoPreserve (KdCardInfo *card);
183
neoEnable (ScreenPtr pScreen);
186
neoDisable (ScreenPtr pScreen);
189
neoMapReg (KdCardInfo *card, NeoCardInfo *nvidiac);
192
neoUnmapReg (KdCardInfo *card, NeoCardInfo *nvidiac);
195
neoGetIndex (NeoCardInfo *nvidiac, CARD16 addr, CARD8 id);
198
neoSetIndex (NeoCardInfo *nvidiac, CARD16 addr, CARD8 id, CARD8 val);
201
neoDrawInit (ScreenPtr pScreen);
204
neoDrawEnable (ScreenPtr pScreen);
207
neoDrawDisable (ScreenPtr pScreen);
210
neoDrawFini (ScreenPtr pScreen);
212
extern KdCardFuncs neoFuncs;
214
#endif /* _NEOMAGIC_H_ */