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.
34 #define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
35 #define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
37 #define NEO_VENDOR 0x10c8
38 #define CAP_NM2070 0x01 /* If it's a NM2070 series */
39 #define CAP_NM2090 0x02 /* If it's a NM2090 series */
40 #define CAP_NM2097 0x03 /* If it's a NM2097 series */
41 #define CAP_NM2200 0x04 /* If it's a NM2200 series */
43 #define NEO_BS0_BLT_BUSY 0x00000001
44 #define NEO_BS0_FIFO_AVAIL 0x00000002
45 #define NEO_BS0_FIFO_PEND 0x00000004
47 #define NEO_BC0_DST_Y_DEC 0x00000001
48 #define NEO_BC0_X_DEC 0x00000002
49 #define NEO_BC0_SRC_TRANS 0x00000004
50 #define NEO_BC0_SRC_IS_FG 0x00000008
51 #define NEO_BC0_SRC_Y_DEC 0x00000010
52 #define NEO_BC0_FILL_PAT 0x00000020
53 #define NEO_BC0_SRC_MONO 0x00000040
54 #define NEO_BC0_SYS_TO_VID 0x00000080
56 #define NEO_BC1_DEPTH8 0x00000100
57 #define NEO_BC1_DEPTH16 0x00000200
58 #define NEO_BC1_X_320 0x00000400
59 #define NEO_BC1_X_640 0x00000800
60 #define NEO_BC1_X_800 0x00000c00
61 #define NEO_BC1_X_1024 0x00001000
62 #define NEO_BC1_X_1152 0x00001400
63 #define NEO_BC1_X_1280 0x00001800
64 #define NEO_BC1_X_1600 0x00001c00
65 #define NEO_BC1_DST_TRANS 0x00002000
66 #define NEO_BC1_MSTR_BLT 0x00004000
67 #define NEO_BC1_FILTER_Z 0x00008000
69 #define NEO_BC2_WR_TR_DST 0x00800000
71 #define NEO_BC3_SRC_XY_ADDR 0x01000000
72 #define NEO_BC3_DST_XY_ADDR 0x02000000
73 #define NEO_BC3_CLIP_ON 0x04000000
74 #define NEO_BC3_FIFO_EN 0x08000000
75 #define NEO_BC3_BLT_ON_ADDR 0x10000000
76 #define NEO_BC3_SKIP_MAPPING 0x80000000
78 #define NEO_MODE1_DEPTH8 0x0100
79 #define NEO_MODE1_DEPTH16 0x0200
80 #define NEO_MODE1_DEPTH24 0x0300
81 #define NEO_MODE1_X_320 0x0400
82 #define NEO_MODE1_X_640 0x0800
83 #define NEO_MODE1_X_800 0x0c00
84 #define NEO_MODE1_X_1024 0x1000
85 #define NEO_MODE1_X_1152 0x1400
86 #define NEO_MODE1_X_1280 0x1800
87 #define NEO_MODE1_X_1600 0x1c00
88 #define NEO_MODE1_BLT_ON_ADDR 0x2000
90 typedef volatile CARD8 VOL8
;
91 typedef volatile CARD16 VOL16
;
92 typedef volatile CARD32 VOL32
;
94 #define NEO_REG_SIZE(c) (0x200000L)
96 typedef volatile struct {
111 CARD32 reserved1
[19];
120 typedef struct _neoCardInfo
{
121 VesaCardPrivRec backendCard
;
133 struct NeoChipInfo
*chip
;
153 #define getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
154 #define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
156 typedef struct _neoScreenInfo
{
157 VesaScreenPrivRec backendScreen
;
164 KdVideoAdaptorPtr pAdaptor
;
165 KaaScreenInfoRec kaa
;
168 #define getNeoScreenInfo(kd) ((NeoScreenInfo *) ((kd)->screen->driver))
169 #define neoScreenInfo(kd) NeoScreenInfo *neos = getNeoScreenInfo(kd)
171 #define SetupNeo(s) KdScreenPriv(s); \
172 neoCardInfo(pScreenPriv); \
173 neoScreenInfo(pScreenPriv);
176 neoPreserve (KdCardInfo
*card
);
179 neoEnable (ScreenPtr pScreen
);
182 neoDisable (ScreenPtr pScreen
);
185 neoMapReg (KdCardInfo
*card
, NeoCardInfo
*nvidiac
);
188 neoUnmapReg (KdCardInfo
*card
, NeoCardInfo
*nvidiac
);
191 neoGetIndex (NeoCardInfo
*nvidiac
, CARD16 addr
, CARD8 id
);
194 neoSetIndex (NeoCardInfo
*nvidiac
, CARD16 addr
, CARD8 id
, CARD8 val
);
197 neoDrawInit (ScreenPtr pScreen
);
200 neoDrawEnable (ScreenPtr pScreen
);
203 neoDrawDisable (ScreenPtr pScreen
);
206 neoDrawFini (ScreenPtr pScreen
);
208 extern KdCardFuncs neoFuncs
;
210 #endif /* _NEOMAGIC_H_ */