aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_vm.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_vm.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_vm.c')
-rw-r--r--drivers/gpu/drm/drm_vm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 3ffae021d280..0d8bbd72ec55 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -91,7 +91,7 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
91{ 91{
92 struct drm_file *priv = vma->vm_file->private_data; 92 struct drm_file *priv = vma->vm_file->private_data;
93 struct drm_device *dev = priv->minor->dev; 93 struct drm_device *dev = priv->minor->dev;
94 struct drm_map *map = NULL; 94 struct drm_local_map *map = NULL;
95 struct drm_map_list *r_list; 95 struct drm_map_list *r_list;
96 struct drm_hash_item *hash; 96 struct drm_hash_item *hash;
97 97
@@ -176,7 +176,7 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
176 */ 176 */
177static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 177static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
178{ 178{
179 struct drm_map *map = (struct drm_map *) vma->vm_private_data; 179 struct drm_local_map *map = vma->vm_private_data;
180 unsigned long offset; 180 unsigned long offset;
181 unsigned long i; 181 unsigned long i;
182 struct page *page; 182 struct page *page;
@@ -209,7 +209,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
209 struct drm_file *priv = vma->vm_file->private_data; 209 struct drm_file *priv = vma->vm_file->private_data;
210 struct drm_device *dev = priv->minor->dev; 210 struct drm_device *dev = priv->minor->dev;
211 struct drm_vma_entry *pt, *temp; 211 struct drm_vma_entry *pt, *temp;
212 struct drm_map *map; 212 struct drm_local_map *map;
213 struct drm_map_list *r_list; 213 struct drm_map_list *r_list;
214 int found_maps = 0; 214 int found_maps = 0;
215 215
@@ -322,7 +322,7 @@ static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
322 */ 322 */
323static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 323static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
324{ 324{
325 struct drm_map *map = (struct drm_map *) vma->vm_private_data; 325 struct drm_local_map *map = vma->vm_private_data;
326 struct drm_file *priv = vma->vm_file->private_data; 326 struct drm_file *priv = vma->vm_file->private_data;
327 struct drm_device *dev = priv->minor->dev; 327 struct drm_device *dev = priv->minor->dev;
328 struct drm_sg_mem *entry = dev->sg; 328 struct drm_sg_mem *entry = dev->sg;
@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
512 return 0; 512 return 0;
513} 513}
514 514
515unsigned long drm_core_get_map_ofs(struct drm_map * map) 515unsigned long drm_core_get_map_ofs(struct drm_local_map * map)
516{ 516{
517 return map->offset; 517 return map->offset;
518} 518}
@@ -547,7 +547,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
547{ 547{
548 struct drm_file *priv = filp->private_data; 548 struct drm_file *priv = filp->private_data;
549 struct drm_device *dev = priv->minor->dev; 549 struct drm_device *dev = priv->minor->dev;
550 struct drm_map *map = NULL; 550 struct drm_local_map *map = NULL;
551 unsigned long offset = 0; 551 unsigned long offset = 0;
552 struct drm_hash_item *hash; 552 struct drm_hash_item *hash;
553 553