Initial mach64 driver import for DRI mach64-0-0-6 branch,
[mesa.git] / src / mesa / drivers / dri / mach64 / server / mach64_dri.h
1 /* $XFree86$ */ /* -*- mode: c; c-basic-offset: 3 -*- */
2 /*
3 * Copyright 2000 Gareth Hughes
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /*
26 * Authors:
27 * Gareth Hughes <gareth@valinux.com>
28 * Leif Delgass <ldelgass@retinalburn.net>
29 */
30
31 #ifndef __MACH64_DRI_H__
32 #define __MACH64_DRI_H__ 1
33
34 #include "xf86drm.h"
35 #include "mach64_common.h"
36
37 typedef struct {
38 drmHandle fbHandle;
39
40 drmHandle regsHandle;
41 drmSize regsSize;
42
43 int IsPCI;
44
45 drmHandle agpHandle; /* Handle from drmAgpAlloc */
46 unsigned long agpOffset;
47 drmSize agpSize;
48 int agpMode;
49
50 /* DMA descriptor ring */
51 unsigned long ringStart; /* Offset into AGP space */
52 drmHandle ringHandle; /* Handle from drmAddMap */
53 drmSize ringMapSize; /* Size of map */
54 int ringSize; /* Size of ring (in kB) */
55 drmAddress ringMap; /* Map */
56
57 /* vertex buffer data */
58 unsigned long bufferStart; /* Offset into AGP space */
59 drmHandle bufferHandle; /* Handle from drmAddMap */
60 drmSize bufferMapSize; /* Size of map */
61 int bufferSize; /* Size of buffers (in MB) */
62 drmAddress bufferMap; /* Map */
63
64 drmBufMapPtr drmBuffers; /* Buffer map */
65 int numBuffers; /* Number of buffers */
66
67 /* AGP Texture data */
68 unsigned long agpTexStart; /* Offset into AGP space */
69 drmHandle agpTexHandle; /* Handle from drmAddMap */
70 drmSize agpTexMapSize; /* Size of map */
71 int agpTexSize; /* Size of AGP tex space (in MB) */
72 drmAddress agpTexMap; /* Map */
73 int log2AGPTexGran;
74
75 int fbX;
76 int fbY;
77 int backX;
78 int backY;
79 int depthX;
80 int depthY;
81
82 int frontOffset;
83 int frontPitch;
84 int backOffset;
85 int backPitch;
86 int depthOffset;
87 int depthPitch;
88
89 int textureOffset;
90 int textureSize;
91 int logTextureGranularity;
92 } ATIDRIServerInfoRec, *ATIDRIServerInfoPtr;
93
94 typedef struct {
95 int chipset;
96 int width;
97 int height;
98 int mem;
99 int cpp;
100
101 int IsPCI;
102 int AGPMode;
103
104 unsigned int frontOffset;
105 unsigned int frontPitch;
106
107 unsigned int backOffset;
108 unsigned int backPitch;
109
110 unsigned int depthOffset;
111 unsigned int depthPitch;
112
113 unsigned int textureOffset;
114 unsigned int textureSize;
115 int logTextureGranularity;
116
117 drmHandle regs;
118 drmSize regsSize;
119
120 drmHandle agp;
121 drmSize agpSize;
122 unsigned int agpTextureOffset;
123 unsigned int agpTextureSize;
124 int logAgpTextureGranularity;
125 } ATIDRIRec, *ATIDRIPtr;
126
127 #endif /* __MACH64_DRI_H__ */