~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to hw/kdrive/neomagic/neomagic.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 * Copyright © 2004 Franco Catrin
 
4
 *
 
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.
 
14
 *
 
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.
 
22
 */
 
23
 
 
24
#ifndef _NEOMAGIC_H_
 
25
#define _NEOMAGIC_H_
 
26
#include <backend.h>
 
27
#include "kxv.h"
 
28
#include "klinux.h"
 
29
 
 
30
 
 
31
#define DEBUG
 
32
#ifdef DEBUG
 
33
#define DBGOUT(fmt,a...) fprintf (stderr, fmt, ##a)
 
34
#else
 
35
#define DBGOUT(fmt,a...)
 
36
#endif
 
37
 
 
38
#define ENTER()    DBGOUT("Enter %s\n", __FUNCTION__)
 
39
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
 
40
 
 
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 */
 
46
 
 
47
#define NEO_BS0_BLT_BUSY        0x00000001
 
48
#define NEO_BS0_FIFO_AVAIL      0x00000002
 
49
#define NEO_BS0_FIFO_PEND       0x00000004
 
50
 
 
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
 
59
 
 
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
 
72
 
 
73
#define NEO_BC2_WR_TR_DST       0x00800000
 
74
 
 
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
 
81
 
 
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
 
93
 
 
94
typedef volatile CARD8    VOL8;
 
95
typedef volatile CARD16    VOL16;
 
96
typedef volatile CARD32    VOL32;
 
97
 
 
98
#define NEO_REG_SIZE(c)        (0x200000L)
 
99
 
 
100
typedef volatile struct {
 
101
    CARD32 bltStat;
 
102
    CARD32 bltCntl;
 
103
    CARD32 xpColor;
 
104
    CARD32 fgColor;
 
105
    CARD32 bgColor;
 
106
    CARD32 pitch;
 
107
    CARD32 clipLT;
 
108
    CARD32 clipRB;
 
109
    CARD32 srcBitOffset;
 
110
    CARD32 srcStart;
 
111
    CARD32 reserved0;
 
112
    CARD32 dstStart;
 
113
    CARD32 xyExt;
 
114
 
 
115
    CARD32 reserved1[19];
 
116
 
 
117
    CARD32 pageCntl;
 
118
    CARD32 pageBase;
 
119
    CARD32 postBase;
 
120
    CARD32 postPtr;
 
121
    CARD32 dataPtr;
 
122
} NeoMMIO;
 
123
 
 
124
typedef struct _neoCardInfo {
 
125
    VesaCardPrivRec backendCard;
 
126
 
 
127
    CARD32 reg_base;
 
128
    NeoMMIO *mmio;
 
129
    int dstOrg;
 
130
    int dstPitch;
 
131
    int dstPixelWidth;
 
132
 
 
133
    int srcOrg;
 
134
    int srcPitch;
 
135
    int srcPixelWidth;
 
136
 
 
137
    struct NeoChipInfo *chip;
 
138
 
 
139
    CARD32 bltCntl;
 
140
 
 
141
} NeoCardInfo;
 
142
 
 
143
struct NeoChipInfo {
 
144
    CARD16 vendor;
 
145
    CARD16 device;
 
146
    CARD8 caps;
 
147
    char *name;
 
148
    int videoRam;
 
149
    int maxClock;
 
150
    int cursorMem;
 
151
    int cursorOff;
 
152
    int linearSize;
 
153
    int maxWidth;
 
154
    int maxHeight;
 
155
};
 
156
 
 
157
#define getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
 
158
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
 
159
 
 
160
typedef struct _neoScreenInfo {
 
161
    VesaScreenPrivRec backendScreen;
 
162
 
 
163
    CARD8 *screen;
 
164
    CARD8 *off_screen;
 
165
    int off_screen_size;
 
166
    int pitch;
 
167
    int depth;
 
168
    KdVideoAdaptorPtr pAdaptor;
 
169
    KaaScreenInfoRec kaa;
 
170
} NeoScreenInfo;
 
171
 
 
172
#define getNeoScreenInfo(kd) ((NeoScreenInfo *) ((kd)->screen->driver))
 
173
#define neoScreenInfo(kd) NeoScreenInfo *neos = getNeoScreenInfo(kd)
 
174
 
 
175
#define SetupNeo(s) KdScreenPriv(s); \
 
176
                    neoCardInfo(pScreenPriv); \
 
177
                    neoScreenInfo(pScreenPriv);
 
178
 
 
179
void
 
180
neoPreserve (KdCardInfo *card);
 
181
 
 
182
Bool
 
183
neoEnable (ScreenPtr pScreen);
 
184
 
 
185
void
 
186
neoDisable (ScreenPtr pScreen);
 
187
 
 
188
Bool
 
189
neoMapReg (KdCardInfo *card, NeoCardInfo *nvidiac);
 
190
 
 
191
void
 
192
neoUnmapReg (KdCardInfo *card, NeoCardInfo *nvidiac);
 
193
 
 
194
CARD8
 
195
neoGetIndex (NeoCardInfo *nvidiac, CARD16 addr,  CARD8 id);
 
196
 
 
197
void
 
198
neoSetIndex (NeoCardInfo *nvidiac, CARD16 addr,  CARD8 id, CARD8 val);
 
199
 
 
200
Bool
 
201
neoDrawInit (ScreenPtr pScreen);
 
202
 
 
203
void
 
204
neoDrawEnable (ScreenPtr pScreen);
 
205
 
 
206
void
 
207
neoDrawDisable (ScreenPtr pScreen);
 
208
 
 
209
void
 
210
neoDrawFini (ScreenPtr pScreen);
 
211
 
 
212
extern KdCardFuncs  neoFuncs;
 
213
 
 
214
#endif /* _NEOMAGIC_H_ */