OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [linux/] [agp_backend.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * AGPGART module version 0.99
3
 * Copyright (C) 1999 Jeff Hartmann
4
 * Copyright (C) 1999 Precision Insight, Inc.
5
 * Copyright (C) 1999 Xi Graphics, Inc.
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a
8
 * copy of this software and associated documentation files (the "Software"),
9
 * to deal in the Software without restriction, including without limitation
10
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
 * and/or sell copies of the Software, and to permit persons to whom the
12
 * Software is furnished to do so, subject to the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be included
15
 * in all copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20
 * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
21
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
 *
25
 */
26
 
27
#ifndef _AGP_BACKEND_H
28
#define _AGP_BACKEND_H 1
29
 
30
#ifndef TRUE
31
#define TRUE 1
32
#endif
33
 
34
#ifndef FALSE
35
#define FALSE 0
36
#endif
37
 
38
#define AGPGART_VERSION_MAJOR 0
39
#define AGPGART_VERSION_MINOR 99
40
 
41
enum chipset_type {
42
        NOT_SUPPORTED,
43
        INTEL_GENERIC,
44
        INTEL_LX,
45
        INTEL_BX,
46
        INTEL_GX,
47
        INTEL_I810,
48
        INTEL_I815,
49
        INTEL_I820,
50
        INTEL_I830_M,
51
        INTEL_I845_G,
52
        INTEL_I840,
53
        INTEL_I845,
54
        INTEL_I850,
55
        INTEL_I855_PM,
56
        INTEL_I860,
57
        INTEL_I865_G,
58
        INTEL_I7205,
59
        INTEL_I7505,
60
        INTEL_460GX,
61
        VIA_GENERIC,
62
        VIA_VP3,
63
        VIA_MVP3,
64
        VIA_MVP4,
65
        VIA_APOLLO_PLE133,
66
        VIA_APOLLO_PRO,
67
        VIA_APOLLO_KX133,
68
        VIA_APOLLO_KT133,
69
        VIA_APOLLO_KM266,
70
        VIA_APOLLO_KT400,
71
        VIA_CLE266,
72
        VIA_APOLLO_P4M266,
73
        VIA_APOLLO_P4X400,
74
        SIS_GENERIC,
75
        AMD_GENERIC,
76
        AMD_IRONGATE,
77
        AMD_761,
78
        AMD_762,
79
        AMD_8151,
80
        ALI_M1541,
81
        ALI_M1621,
82
        ALI_M1631,
83
        ALI_M1632,
84
        ALI_M1641,
85
        ALI_M1644,
86
        ALI_M1647,
87
        ALI_M1651,
88
        ALI_M1671,
89
        ALI_GENERIC,
90
        SVWRKS_HE,
91
        SVWRKS_LE,
92
        SVWRKS_GENERIC,
93
        NVIDIA_NFORCE,
94
        NVIDIA_NFORCE2,
95
        NVIDIA_NFORCE3,
96
        NVIDIA_GENERIC,
97
        HP_ZX1,
98
        ATI_RS100,
99
        ATI_RS200,
100
        ATI_RS250,
101
        ATI_RS300_100,
102
        ATI_RS300_133,
103
        ATI_RS300_166,
104
        ATI_RS300_200
105
};
106
 
107
typedef struct _agp_version {
108
        u16 major;
109
        u16 minor;
110
} agp_version;
111
 
112
typedef struct _agp_kern_info {
113
        agp_version version;
114
        struct pci_dev *device;
115
        enum chipset_type chipset;
116
        unsigned long mode;
117
        off_t aper_base;
118
        size_t aper_size;
119
        int max_memory;         /* In pages */
120
        int current_memory;
121
        int cant_use_aperture;
122
        unsigned long page_mask;
123
} agp_kern_info;
124
 
125
/*
126
 * The agp_memory structure has information
127
 * about the block of agp memory allocated.
128
 * A caller may manipulate the next and prev
129
 * pointers to link each allocated item into
130
 * a list.  These pointers are ignored by the
131
 * backend.  Everything else should never be
132
 * written to, but the caller may read any of
133
 * the items to detrimine the status of this
134
 * block of agp memory.
135
 *
136
 */
137
 
138
typedef struct _agp_memory {
139
        int key;
140
        struct _agp_memory *next;
141
        struct _agp_memory *prev;
142
        size_t page_count;
143
        int num_scratch_pages;
144
        unsigned long *memory;
145
        off_t pg_start;
146
        u32 type;
147
        u32 physical;
148
        u8 is_bound;
149
        u8 is_flushed;
150
} agp_memory;
151
 
152
#define AGP_NORMAL_MEMORY 0
153
 
154
extern void agp_free_memory(agp_memory *);
155
 
156
/*
157
 * agp_free_memory :
158
 *
159
 * This function frees memory associated with
160
 * an agp_memory pointer.  It is the only function
161
 * that can be called when the backend is not owned
162
 * by the caller.  (So it can free memory on client
163
 * death.)
164
 *
165
 * It takes an agp_memory pointer as an argument.
166
 *
167
 */
168
 
169
extern agp_memory *agp_allocate_memory(size_t, u32);
170
 
171
/*
172
 * agp_allocate_memory :
173
 *
174
 * This function allocates a group of pages of
175
 * a certain type.
176
 *
177
 * It takes a size_t argument of the number of pages, and
178
 * an u32 argument of the type of memory to be allocated.
179
 * Every agp bridge device will allow you to allocate
180
 * AGP_NORMAL_MEMORY which maps to physical ram.  Any other
181
 * type is device dependant.
182
 *
183
 * It returns NULL whenever memory is unavailable.
184
 *
185
 */
186
 
187
extern int agp_copy_info(agp_kern_info *);
188
 
189
/*
190
 * agp_copy_info :
191
 *
192
 * This function copies information about the
193
 * agp bridge device and the state of the agp
194
 * backend into an agp_kern_info pointer.
195
 *
196
 * It takes an agp_kern_info pointer as an
197
 * argument.  The caller should insure that
198
 * this pointer is valid.
199
 *
200
 */
201
 
202
extern int agp_bind_memory(agp_memory *, off_t);
203
 
204
/*
205
 * agp_bind_memory :
206
 *
207
 * This function binds an agp_memory structure
208
 * into the graphics aperture translation table.
209
 *
210
 * It takes an agp_memory pointer and an offset into
211
 * the graphics aperture translation table as arguments
212
 *
213
 * It returns -EINVAL if the pointer == NULL.
214
 * It returns -EBUSY if the area of the table
215
 * requested is already in use.
216
 *
217
 */
218
 
219
extern int agp_unbind_memory(agp_memory *);
220
 
221
/*
222
 * agp_unbind_memory :
223
 *
224
 * This function removes an agp_memory structure
225
 * from the graphics aperture translation table.
226
 *
227
 * It takes an agp_memory pointer as an argument.
228
 *
229
 * It returns -EINVAL if this piece of agp_memory
230
 * is not currently bound to the graphics aperture
231
 * translation table or if the agp_memory
232
 * pointer == NULL
233
 *
234
 */
235
 
236
extern void agp_enable(u32);
237
 
238
/*
239
 * agp_enable :
240
 *
241
 * This function initializes the agp point-to-point
242
 * connection.
243
 *
244
 * It takes an agp mode register as an argument
245
 *
246
 */
247
 
248
extern int agp_backend_acquire(void);
249
 
250
/*
251
 * agp_backend_acquire :
252
 *
253
 * This Function attempts to acquire the agp
254
 * backend.
255
 *
256
 * returns -EBUSY if agp is in use,
257
 * returns 0 if the caller owns the agp backend
258
 */
259
 
260
extern void agp_backend_release(void);
261
 
262
/*
263
 * agp_backend_release :
264
 *
265
 * This Function releases the lock on the agp
266
 * backend.
267
 *
268
 * The caller must insure that the graphics
269
 * aperture translation table is read for use
270
 * by another entity.  (Ensure that all memory
271
 * it bound is unbound.)
272
 *
273
 */
274
 
275
typedef struct {
276
        void       (*free_memory)(agp_memory *);
277
        agp_memory *(*allocate_memory)(size_t, u32);
278
        int        (*bind_memory)(agp_memory *, off_t);
279
        int        (*unbind_memory)(agp_memory *);
280
        void       (*enable)(u32);
281
        int        (*acquire)(void);
282
        void       (*release)(void);
283
        int        (*copy_info)(agp_kern_info *);
284
} drm_agp_t;
285
 
286
extern const drm_agp_t *drm_agp_p;
287
 
288
/*
289
 * Interface between drm and agp code.  When agp initializes, it makes
290
 * the above structure available via inter_module_register(), drm might
291
 * use it.  Keith Owens <kaos@ocs.com.au> 28 Oct 2000.
292
 */
293
 
294
#endif                          /* _AGP_BACKEND_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.