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

« back to all changes in this revision

Viewing changes to hw/kdrive/mga/mga.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
 * $Id$
 
3
 *
 
4
 * Copyright � 2003-2004 Anders Carlsson
 
5
 *
 
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 Anders Carlsson not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Anders Carlsson makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * ANDERS CARLSSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL ANDERS CARLSSON 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.
 
23
 */
 
24
/* $Header$ */
 
25
 
 
26
#ifndef _MGA_H_
 
27
#define _MGA_H_
 
28
#include <vesa.h>
 
29
#include <klinux.h>
 
30
 
 
31
#define MGA_REG_BASE(c)     ((c)->attr.address[1])
 
32
#define MGA_REG_SIZE(c)     (0x4000)
 
33
 
 
34
#define MGA_OUT32(mmio, a, v) (*(VOL32 *) ((mmio) + (a)) = (v))
 
35
#define MGA_IN32(mmio, a) (*(VOL32 *) ((mmio) + (a)))
 
36
 
 
37
#define MGA_REG_EXEC            (0x0100)
 
38
#define MGA_REG_DWGCTL          (0x1c00)
 
39
#define MGA_REG_PLNWT           (0x1c1c)
 
40
#define MGA_REG_FCOL            (0x1c24)
 
41
#define MGA_REG_MACCESS         (0x1c04)
 
42
#define MGA_REG_SGN             (0x1c58)
 
43
#define MGA_REG_AR0             (0x1c60)
 
44
#define MGA_REG_AR1             (0x1c64)
 
45
#define MGA_REG_AR2             (0x1c68)
 
46
#define MGA_REG_AR3             (0x1c6C)
 
47
#define MGA_REG_AR4             (0x1c70)
 
48
#define MGA_REG_AR5             (0x1c74)
 
49
#define MGA_REG_AR6             (0x1c78)
 
50
 
 
51
#define MGA_REG_CXBNDRY         (0x1c80)
 
52
#define MGA_REG_FXBNDRY         (0x1c84)
 
53
#define MGA_REG_YDSTLEN         (0x1c88)
 
54
#define MGA_REG_PITCH           (0x1c8c)
 
55
#define MGA_REG_YTOP            (0x1c98)
 
56
#define MGA_REG_YBOT            (0x1c9c)
 
57
#define MGA_REG_FIFOSTATUS      (0x1e10)
 
58
#define MGA_REG_STATUS          (0x1e14)
 
59
#define MGA_REG_CACHEFLUSH      (0x1fff)
 
60
#define MGA_REG_SRCORG          (0x2cb4)
 
61
#define MGA_REG_DSTORG          (0x2cb8)
 
62
 
 
63
#define MGA_G4XX_DEVICE_ID      (0x0525)
 
64
 
 
65
#define MGA_PW8         (0)
 
66
#define MGA_PW16        (1)
 
67
#define MGA_PW24        (2)
 
68
#define MGA_PW32        (3)
 
69
 
 
70
/* Drawing opcodes */
 
71
#define MGA_OPCOD_TRAP   (4)
 
72
#define MGA_OPCOD_TEXTURE_TRAP   (6)
 
73
#define MGA_OPCOD_BITBLT (8)
 
74
 
 
75
#define MGA_DWGCTL_SOLID        (1 << 11)
 
76
#define MGA_DWGCTL_ARZERO       (1 << 12)
 
77
#define MGA_DWGCTL_SGNZERO      (1 << 13)
 
78
#define MGA_DWGCTL_SHIFTZERO    (1 << 14)
 
79
 
 
80
#define MGA_DWGCTL_BFCOL        (2 << 25)
 
81
 
 
82
#define MGA_ATYPE_RPL           (0 << 4)
 
83
#define MGA_ATYPE_RSTR          (1 << 4)
 
84
#define MGA_ATYPE_ZI            (3 << 4)
 
85
#define MGA_ATYPE_BLK           (4 << 4)
 
86
#define MGA_ATYPE_I             (7 << 4)
 
87
 
 
88
typedef volatile CARD8  VOL8;
 
89
typedef volatile CARD16 VOL16;
 
90
typedef volatile CARD32 VOL32;
 
91
                         
 
92
typedef struct _mgaCardInfo {
 
93
    VesaCardPrivRec vesa;
 
94
    CARD8 *reg_base;
 
95
    int fifo_size;
 
96
} MgaCardInfo;
 
97
 
 
98
#define getMgaCardInfo(kd) ((MgaCardInfo *) ((kd)->card->driver))
 
99
#define mgaCardInfo(kd) MgaCardInfo *mgac = getMgaCardInfo(kd)
 
100
 
 
101
typedef struct _mgaScreenInfo {
 
102
    VesaScreenPrivRec vesa;
 
103
 
 
104
    KaaScreenInfoRec kaa;
 
105
 
 
106
    int pitch;
 
107
    int pw;
 
108
} MgaScreenInfo;
 
109
 
 
110
#define getMgaScreenInfo(kd) ((MgaScreenInfo *) ((kd)->screen->driver))
 
111
#define mgaScreenInfo(kd)    MgaScreenInfo *mgas = getMgaScreenInfo(kd)
 
112
 
 
113
 
 
114
VOL8 *mmio;
 
115
 
 
116
 
 
117
Bool
 
118
mgaMapReg (KdCardInfo *card, MgaCardInfo *mgac);
 
119
 
 
120
void
 
121
mgaUnmapReg (KdCardInfo *card, MgaCardInfo *mgac);
 
122
 
 
123
void
 
124
mgaSetMMIO (KdCardInfo *card, MgaCardInfo *mgac);
 
125
 
 
126
void
 
127
mgaResetMMIO (KdCardInfo *card, MgaCardInfo *mgac);
 
128
 
 
129
Bool
 
130
mgaDrawSetup (ScreenPtr pScreen);
 
131
 
 
132
Bool
 
133
mgaDrawInit (ScreenPtr pScreen);
 
134
 
 
135
void
 
136
mgaDrawEnable (ScreenPtr pScreen);
 
137
 
 
138
void
 
139
mgaDrawDisable (ScreenPtr pScreen);
 
140
 
 
141
void
 
142
mgaDrawFini (ScreenPtr pScreen);
 
143
 
 
144
extern KdCardFuncs  mgaFuncs;
 
145
 
 
146
 
 
147
void
 
148
mgaWaitAvail (int n);
 
149
 
 
150
void
 
151
mgaWaitIdle (void);
 
152
 
 
153
Bool
 
154
mgaSetup (ScreenPtr pScreen, int dest_bpp, int wait);
 
155
 
 
156
 
 
157
#if 0
 
158
#define MGA_FALLBACK(x)         \
 
159
do {                            \
 
160
        ErrorF x;               \
 
161
        return FALSE;           \
 
162
} while (0);
 
163
#else
 
164
#define MGA_FALLBACK(x) return FALSE;
 
165
#endif
 
166
 
 
167
#endif /* _MGA_H_ */