summaryrefslogtreecommitdiff
path: root/linux-core/drm_compat.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-27 09:27:31 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-27 09:27:31 +0200
commit235f6fc650e9974211843b9196a903963dae0211 (patch)
treec1665e8232044685f7c5e023c0db55ddca6f7cb8 /linux-core/drm_compat.h
parentbd8ca12b7baff778d5bb7b4ad1d38d16b60a4d5a (diff)
Adapt to architecture-specific hooks for gatt pages.
Diffstat (limited to 'linux-core/drm_compat.h')
-rw-r--r--linux-core/drm_compat.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index 779a7000..cf84a70b 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -31,6 +31,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <asm/agp.h>
#ifndef _DRM_COMPAT_H_
#define _DRM_COMPAT_H_
@@ -245,4 +246,26 @@ extern void drm_clear_vma(struct vm_area_struct *vma,
extern pgprot_t vm_get_page_prot(unsigned long vm_flags);
+/*
+ * These are similar to the current kernel gatt pages allocator, only that we
+ * want a struct page pointer instead of a virtual address. This allows for pages
+ * that are not in the kernel linear map.
+ */
+
+#define drm_alloc_gatt_pages(order) virt_to_page(alloc_gatt_pages(order))
+#define drm_free_gatt_pages(pages, order) free_gatt_pages(page_address(pages), order)
+
+#if defined(CONFIG_X86) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
+
+/*
+ * These are too slow in earlier kernels.
+ */
+
+extern int drm_unmap_page_from_agp(struct page *page);
+extern int drm_map_page_into_agp(struct page *page);
+
+#define map_page_into_agp drm_map_page_into_agp
+#define unmap_page_from_agp drm_unmap_page_from_agp
+#endif
+
#endif