2 * AGPGART backend specific includes. Not for userspace consumption.
4 * Copyright (C) 2002-2003 Dave Jones
5 * Copyright (C) 1999 Jeff Hartmann
6 * Copyright (C) 1999 Precision Insight, Inc.
7 * Copyright (C) 1999 Xi Graphics, Inc.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
25 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #ifndef _AGP_BACKEND_H
30 #define _AGP_BACKEND_H 1
52 struct agp_kern_info
{
53 struct agp_version version
;
54 struct pci_dev
*device
;
55 enum chipset_type chipset
;
59 int max_memory
; /* In pages */
61 int cant_use_aperture
;
62 unsigned long page_mask
;
63 struct vm_operations_struct
*vm_ops
;
67 * The agp_memory structure has information about the block of agp memory
68 * allocated. A caller may manipulate the next and prev pointers to link
69 * each allocated item into a list. These pointers are ignored by the backend.
70 * Everything else should never be written to, but the caller may read any of
71 * the items to detrimine the status of this block of agp memory.
76 struct agp_memory
*next
;
77 struct agp_memory
*prev
;
79 int num_scratch_pages
;
80 unsigned long *memory
;
88 #define AGP_NORMAL_MEMORY 0
90 extern void agp_free_memory(struct agp_memory
*);
91 extern struct agp_memory
*agp_allocate_memory(size_t, u32
);
92 extern int agp_copy_info(struct agp_kern_info
*);
93 extern int agp_bind_memory(struct agp_memory
*, off_t
);
94 extern int agp_unbind_memory(struct agp_memory
*);
95 extern void agp_enable(u32
);
96 extern int agp_backend_acquire(void);
97 extern void agp_backend_release(void);
100 * Interface between drm and agp code. When agp initializes, it makes
101 * the below structure available via inter_module_register(), drm might
102 * use it. Keith Owens <kaos@ocs.com.au> 28 Oct 2000.
105 void (*free_memory
)(struct agp_memory
*);
106 struct agp_memory
* (*allocate_memory
)(size_t, u32
);
107 int (*bind_memory
)(struct agp_memory
*, off_t
);
108 int (*unbind_memory
)(struct agp_memory
*);
110 int (*acquire
)(void);
111 void (*release
)(void);
112 int (*copy_info
)(struct agp_kern_info
*);
115 extern const drm_agp_t
*drm_agp_p
;
117 #endif /* __KERNEL__ */
118 #endif /* _AGP_BACKEND_H */