diff options
Diffstat (limited to 'drivers/gpu/drm/drm_memory.c')
-rw-r--r-- | drivers/gpu/drm/drm_memory.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c index 00c67c0f2381..a521ef6ff807 100644 --- a/drivers/gpu/drm/drm_memory.c +++ b/drivers/gpu/drm/drm_memory.c | |||
@@ -36,8 +36,20 @@ | |||
36 | #include <linux/highmem.h> | 36 | #include <linux/highmem.h> |
37 | #include <linux/export.h> | 37 | #include <linux/export.h> |
38 | #include <drm/drmP.h> | 38 | #include <drm/drmP.h> |
39 | #include "drm_legacy.h" | ||
39 | 40 | ||
40 | #if __OS_HAS_AGP | 41 | #if __OS_HAS_AGP |
42 | |||
43 | #ifdef HAVE_PAGE_AGP | ||
44 | # include <asm/agp.h> | ||
45 | #else | ||
46 | # ifdef __powerpc__ | ||
47 | # define PAGE_AGP __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) | ||
48 | # else | ||
49 | # define PAGE_AGP PAGE_KERNEL | ||
50 | # endif | ||
51 | #endif | ||
52 | |||
41 | static void *agp_remap(unsigned long offset, unsigned long size, | 53 | static void *agp_remap(unsigned long offset, unsigned long size, |
42 | struct drm_device * dev) | 54 | struct drm_device * dev) |
43 | { | 55 | { |
@@ -108,25 +120,25 @@ static inline void *agp_remap(unsigned long offset, unsigned long size, | |||
108 | 120 | ||
109 | #endif /* agp */ | 121 | #endif /* agp */ |
110 | 122 | ||
111 | void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) | 123 | void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev) |
112 | { | 124 | { |
113 | if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) | 125 | if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) |
114 | map->handle = agp_remap(map->offset, map->size, dev); | 126 | map->handle = agp_remap(map->offset, map->size, dev); |
115 | else | 127 | else |
116 | map->handle = ioremap(map->offset, map->size); | 128 | map->handle = ioremap(map->offset, map->size); |
117 | } | 129 | } |
118 | EXPORT_SYMBOL(drm_core_ioremap); | 130 | EXPORT_SYMBOL(drm_legacy_ioremap); |
119 | 131 | ||
120 | void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) | 132 | void drm_legacy_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) |
121 | { | 133 | { |
122 | if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) | 134 | if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) |
123 | map->handle = agp_remap(map->offset, map->size, dev); | 135 | map->handle = agp_remap(map->offset, map->size, dev); |
124 | else | 136 | else |
125 | map->handle = ioremap_wc(map->offset, map->size); | 137 | map->handle = ioremap_wc(map->offset, map->size); |
126 | } | 138 | } |
127 | EXPORT_SYMBOL(drm_core_ioremap_wc); | 139 | EXPORT_SYMBOL(drm_legacy_ioremap_wc); |
128 | 140 | ||
129 | void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev) | 141 | void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev) |
130 | { | 142 | { |
131 | if (!map->handle || !map->size) | 143 | if (!map->handle || !map->size) |
132 | return; | 144 | return; |
@@ -136,4 +148,4 @@ void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev) | |||
136 | else | 148 | else |
137 | iounmap(map->handle); | 149 | iounmap(map->handle); |
138 | } | 150 | } |
139 | EXPORT_SYMBOL(drm_core_ioremapfree); | 151 | EXPORT_SYMBOL(drm_legacy_ioremapfree); |