aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_memory.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-02 00:55:46 -0500
committerDave Airlie <airlied@redhat.com>2009-03-13 00:23:56 -0400
commitf77d390c9779c496aa5b99ec832996fb76bb1d13 (patch)
tree3e3cccc4ac9416457a944d13b31ef942432717f2 /drivers/gpu/drm/drm_memory.c
parentd883f7f1b75c8dcafa891f7b9e69c5a2f0ff6d66 (diff)
drm: Split drm_map and drm_local_map
Once upon a time, the DRM made the distinction between the drm_map data structure exchanged with user space and the drm_local_map used in the kernel. For some reasons, while the BSD port still has that "feature", the linux part abused drm_map for kernel internal usage as the local map only existed as a typedef of the struct drm_map. This patch fixes it by declaring struct drm_local_map separately (though its content is currently identical to the userspace variant), and changing the kernel code to only use that, except when it's a user<->kernel interface (ie. ioctl). This allows subsequent changes to the in-kernel format I've also replaced the use of drm_local_map_t with struct drm_local_map in a couple of places. Mostly by accident but they are the same (the former is a typedef of the later) and I have some remote plans and half finished patch to completely kill the drm_local_map_t typedef so I left those bits in. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_memory.c')
-rw-r--r--drivers/gpu/drm/drm_memory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index bcc869bc4092..0c707f533eab 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -159,7 +159,7 @@ static inline void *agp_remap(unsigned long offset, unsigned long size,
159 159
160#endif /* debug_memory */ 160#endif /* debug_memory */
161 161
162void drm_core_ioremap(struct drm_map *map, struct drm_device *dev) 162void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
163{ 163{
164 if (drm_core_has_AGP(dev) && 164 if (drm_core_has_AGP(dev) &&
165 dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) 165 dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
@@ -169,7 +169,7 @@ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
169} 169}
170EXPORT_SYMBOL(drm_core_ioremap); 170EXPORT_SYMBOL(drm_core_ioremap);
171 171
172void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev) 172void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
173{ 173{
174 if (drm_core_has_AGP(dev) && 174 if (drm_core_has_AGP(dev) &&
175 dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP) 175 dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
@@ -179,7 +179,7 @@ void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev)
179} 179}
180EXPORT_SYMBOL(drm_core_ioremap_wc); 180EXPORT_SYMBOL(drm_core_ioremap_wc);
181 181
182void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev) 182void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
183{ 183{
184 if (!map->handle || !map->size) 184 if (!map->handle || !map->size)
185 return; 185 return;