1 | /* xf86drmCompat.h -- OS-independent header for old device specific DRM user-level
|
---|
2 | * library interface
|
---|
3 | *
|
---|
4 | * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
|
---|
5 | * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
|
---|
6 | * All Rights Reserved.
|
---|
7 | *
|
---|
8 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
9 | * copy of this software and associated documentation files (the "Software"),
|
---|
10 | * to deal in the Software without restriction, including without limitation
|
---|
11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
12 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
13 | * Software is furnished to do so, subject to the following conditions:
|
---|
14 | *
|
---|
15 | * The above copyright notice and this permission notice (including the next
|
---|
16 | * paragraph) shall be included in all copies or substantial portions of the
|
---|
17 | * Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
22 | * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
23 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
24 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
---|
25 | * DEALINGS IN THE SOFTWARE.
|
---|
26 | *
|
---|
27 | * Authors:
|
---|
28 | * Gareth Hughes <[email protected]>
|
---|
29 | * Kevin E. Martin <[email protected]>
|
---|
30 | * Keith Whitwell <[email protected]>
|
---|
31 | *
|
---|
32 | * Backwards compatability modules broken out by:
|
---|
33 | * Jens Owen <[email protected]>
|
---|
34 | *
|
---|
35 | * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmCompat.h,v 1.1 2002/10/30 12:52:23 alanh Exp $
|
---|
36 | *
|
---|
37 | */
|
---|
38 |
|
---|
39 | #ifndef _XF86DRI_COMPAT_H_
|
---|
40 | #define _XF86DRI_COMPAT_H_
|
---|
41 |
|
---|
42 | /* WARNING: Do not change, or add, anything to this file. It is only provided
|
---|
43 | * for binary backwards compatability with the old driver specific DRM
|
---|
44 | * extensions used before XFree86 4.3.
|
---|
45 | */
|
---|
46 |
|
---|
47 | #ifndef __user
|
---|
48 | #define __user
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | /* I810 */
|
---|
52 |
|
---|
53 | typedef struct {
|
---|
54 | unsigned int start;
|
---|
55 | unsigned int end;
|
---|
56 | unsigned int size;
|
---|
57 | unsigned int mmio_offset;
|
---|
58 | unsigned int buffers_offset;
|
---|
59 | int sarea_off;
|
---|
60 |
|
---|
61 | unsigned int front_offset;
|
---|
62 | unsigned int back_offset;
|
---|
63 | unsigned int depth_offset;
|
---|
64 | unsigned int overlay_offset;
|
---|
65 | unsigned int overlay_physical;
|
---|
66 | unsigned int w;
|
---|
67 | unsigned int h;
|
---|
68 | unsigned int pitch;
|
---|
69 | unsigned int pitch_bits;
|
---|
70 | } drmCompatI810Init;
|
---|
71 |
|
---|
72 | extern Bool drmI810CleanupDma(int driSubFD);
|
---|
73 | extern Bool drmI810InitDma(int driSubFD, drmCompatI810Init *info );
|
---|
74 |
|
---|
75 | /* Mga */
|
---|
76 |
|
---|
77 | typedef struct {
|
---|
78 | unsigned long sarea_priv_offset;
|
---|
79 | int chipset;
|
---|
80 | int sgram;
|
---|
81 | unsigned int maccess;
|
---|
82 | unsigned int fb_cpp;
|
---|
83 | unsigned int front_offset, front_pitch;
|
---|
84 | unsigned int back_offset, back_pitch;
|
---|
85 | unsigned int depth_cpp;
|
---|
86 | unsigned int depth_offset, depth_pitch;
|
---|
87 | unsigned int texture_offset[2];
|
---|
88 | unsigned int texture_size[2];
|
---|
89 | unsigned long fb_offset;
|
---|
90 | unsigned long mmio_offset;
|
---|
91 | unsigned long status_offset;
|
---|
92 | unsigned long warp_offset;
|
---|
93 | unsigned long primary_offset;
|
---|
94 | unsigned long buffers_offset;
|
---|
95 | } drmCompatMGAInit;
|
---|
96 |
|
---|
97 | extern int drmMGAInitDMA( int fd, drmCompatMGAInit *info );
|
---|
98 | extern int drmMGACleanupDMA( int fd );
|
---|
99 | extern int drmMGAFlushDMA( int fd, drmLockFlags flags );
|
---|
100 | extern int drmMGAEngineReset( int fd );
|
---|
101 | extern int drmMGAFullScreen( int fd, int enable );
|
---|
102 | extern int drmMGASwapBuffers( int fd );
|
---|
103 | extern int drmMGAClear( int fd, unsigned int flags,
|
---|
104 | unsigned int clear_color, unsigned int clear_depth,
|
---|
105 | unsigned int color_mask, unsigned int depth_mask );
|
---|
106 | extern int drmMGAFlushVertexBuffer( int fd, int indx, int used, int discard );
|
---|
107 | extern int drmMGAFlushIndices( int fd, int indx,
|
---|
108 | int start, int end, int discard );
|
---|
109 | extern int drmMGATextureLoad( int fd, int indx,
|
---|
110 | unsigned int dstorg, unsigned int length );
|
---|
111 | extern int drmMGAAgpBlit( int fd, unsigned int planemask,
|
---|
112 | unsigned int src, int src_pitch,
|
---|
113 | unsigned int dst, int dst_pitch,
|
---|
114 | int delta_sx, int delta_sy,
|
---|
115 | int delta_dx, int delta_dy,
|
---|
116 | int height, int ydir );
|
---|
117 |
|
---|
118 | /* R128 */
|
---|
119 |
|
---|
120 | typedef struct {
|
---|
121 | unsigned long sarea_priv_offset;
|
---|
122 | int is_pci;
|
---|
123 | int cce_mode;
|
---|
124 | int cce_secure;
|
---|
125 | int ring_size;
|
---|
126 | int usec_timeout;
|
---|
127 | unsigned int fb_bpp;
|
---|
128 | unsigned int front_offset, front_pitch;
|
---|
129 | unsigned int back_offset, back_pitch;
|
---|
130 | unsigned int depth_bpp;
|
---|
131 | unsigned int depth_offset, depth_pitch;
|
---|
132 | unsigned int span_offset;
|
---|
133 | unsigned long fb_offset;
|
---|
134 | unsigned long mmio_offset;
|
---|
135 | unsigned long ring_offset;
|
---|
136 | unsigned long ring_rptr_offset;
|
---|
137 | unsigned long buffers_offset;
|
---|
138 | unsigned long agp_textures_offset;
|
---|
139 | } drmCompatR128Init;
|
---|
140 |
|
---|
141 | extern int drmR128InitCCE( int fd, drmCompatR128Init *info );
|
---|
142 | extern int drmR128CleanupCCE( int fd );
|
---|
143 | extern int drmR128StartCCE( int fd );
|
---|
144 | extern int drmR128StopCCE( int fd );
|
---|
145 | extern int drmR128ResetCCE( int fd );
|
---|
146 | extern int drmR128WaitForIdleCCE( int fd );
|
---|
147 | extern int drmR128EngineReset( int fd );
|
---|
148 | extern int drmR128FullScreen( int fd, int enable );
|
---|
149 | extern int drmR128SwapBuffers( int fd );
|
---|
150 | extern int drmR128Clear( int fd, unsigned int flags,
|
---|
151 | unsigned int clear_color, unsigned int clear_depth,
|
---|
152 | unsigned int color_mask, unsigned int depth_mask );
|
---|
153 | extern int drmR128FlushVertexBuffer( int fd, int prim, int indx,
|
---|
154 | int count, int discard );
|
---|
155 | extern int drmR128FlushIndices( int fd, int prim, int indx,
|
---|
156 | int start, int end, int discard );
|
---|
157 | extern int drmR128TextureBlit( int fd, int indx,
|
---|
158 | int offset, int pitch, int format,
|
---|
159 | int x, int y, int width, int height );
|
---|
160 | extern int drmR128WriteDepthSpan( int fd, int n, int x, int y,
|
---|
161 | const unsigned int depth[],
|
---|
162 | const unsigned char mask[] );
|
---|
163 | extern int drmR128WriteDepthPixels( int fd, int n,
|
---|
164 | const int x[], const int y[],
|
---|
165 | const unsigned int depth[],
|
---|
166 | const unsigned char mask[] );
|
---|
167 | extern int drmR128ReadDepthSpan( int fd, int n, int x, int y );
|
---|
168 | extern int drmR128ReadDepthPixels( int fd, int n,
|
---|
169 | const int x[], const int y[] );
|
---|
170 | extern int drmR128PolygonStipple( int fd, unsigned int *mask );
|
---|
171 | extern int drmR128FlushIndirectBuffer( int fd, int indx,
|
---|
172 | int start, int end, int discard );
|
---|
173 |
|
---|
174 | /* Radeon */
|
---|
175 |
|
---|
176 | typedef struct {
|
---|
177 | unsigned long sarea_priv_offset;
|
---|
178 | int is_pci;
|
---|
179 | int cp_mode;
|
---|
180 | int agp_size;
|
---|
181 | int ring_size;
|
---|
182 | int usec_timeout;
|
---|
183 |
|
---|
184 | unsigned int fb_bpp;
|
---|
185 | unsigned int front_offset, front_pitch;
|
---|
186 | unsigned int back_offset, back_pitch;
|
---|
187 | unsigned int depth_bpp;
|
---|
188 | unsigned int depth_offset, depth_pitch;
|
---|
189 |
|
---|
190 | unsigned long fb_offset;
|
---|
191 | unsigned long mmio_offset;
|
---|
192 | unsigned long ring_offset;
|
---|
193 | unsigned long ring_rptr_offset;
|
---|
194 | unsigned long buffers_offset;
|
---|
195 | unsigned long agp_textures_offset;
|
---|
196 | } drmCompatRadeonInit;
|
---|
197 |
|
---|
198 | typedef struct {
|
---|
199 | unsigned int x;
|
---|
200 | unsigned int y;
|
---|
201 | unsigned int width;
|
---|
202 | unsigned int height;
|
---|
203 | void *data;
|
---|
204 | } drmCompatRadeonTexImage;
|
---|
205 |
|
---|
206 | extern int drmRadeonInitCP( int fd, drmCompatRadeonInit *info );
|
---|
207 | extern int drmRadeonCleanupCP( int fd );
|
---|
208 | extern int drmRadeonStartCP( int fd );
|
---|
209 | extern int drmRadeonStopCP( int fd );
|
---|
210 | extern int drmRadeonResetCP( int fd );
|
---|
211 | extern int drmRadeonWaitForIdleCP( int fd );
|
---|
212 | extern int drmRadeonEngineReset( int fd );
|
---|
213 | extern int drmRadeonFullScreen( int fd, int enable );
|
---|
214 | extern int drmRadeonSwapBuffers( int fd );
|
---|
215 | extern int drmRadeonClear( int fd, unsigned int flags,
|
---|
216 | unsigned int clear_color, unsigned int clear_depth,
|
---|
217 | unsigned int color_mask, unsigned int stencil,
|
---|
218 | void *boxes, int nbox );
|
---|
219 | extern int drmRadeonFlushVertexBuffer( int fd, int prim, int indx,
|
---|
220 | int count, int discard );
|
---|
221 | extern int drmRadeonFlushIndices( int fd, int prim, int indx,
|
---|
222 | int start, int end, int discard );
|
---|
223 | extern int drmRadeonLoadTexture( int fd, int offset, int pitch, int format,
|
---|
224 | int width, int height,
|
---|
225 | drmCompatRadeonTexImage *image );
|
---|
226 | extern int drmRadeonPolygonStipple( int fd, unsigned int *mask );
|
---|
227 | extern int drmRadeonFlushIndirectBuffer( int fd, int indx,
|
---|
228 | int start, int end, int discard );
|
---|
229 |
|
---|
230 | /* SiS */
|
---|
231 | extern Bool drmSiSAgpInit(int driSubFD, int offset, int size);
|
---|
232 |
|
---|
233 | /* I830 */
|
---|
234 | typedef struct {
|
---|
235 | unsigned int start;
|
---|
236 | unsigned int end;
|
---|
237 | unsigned int size;
|
---|
238 | unsigned int mmio_offset;
|
---|
239 | unsigned int buffers_offset;
|
---|
240 | int sarea_off;
|
---|
241 | unsigned int front_offset;
|
---|
242 | unsigned int back_offset;
|
---|
243 | unsigned int depth_offset;
|
---|
244 | unsigned int w;
|
---|
245 | unsigned int h;
|
---|
246 | unsigned int pitch;
|
---|
247 | unsigned int pitch_bits;
|
---|
248 | unsigned int cpp;
|
---|
249 | } drmCompatI830Init;
|
---|
250 |
|
---|
251 | extern Bool drmI830CleanupDma(int driSubFD);
|
---|
252 | extern Bool drmI830InitDma(int driSubFD, drmCompatI830Init *info );
|
---|
253 |
|
---|
254 | #endif
|
---|
255 |
|
---|
256 | /* WARNING: Do not change, or add, anything to this file. It is only provided
|
---|
257 | * for binary backwards compatability with the old driver specific DRM
|
---|
258 | * extensions used before XFree86 4.3.
|
---|
259 | */
|
---|