aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/drm_vm.c')
-rw-r--r--drivers/char/drm/drm_vm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 945df72a51a9..c234c6f24a8d 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -90,7 +90,7 @@ static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma)
90static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 90static 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->head->dev; 93 struct drm_device *dev = priv->minor->dev;
94 struct drm_map *map = NULL; 94 struct drm_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;
@@ -207,7 +207,7 @@ static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
207static void drm_vm_shm_close(struct vm_area_struct *vma) 207static void drm_vm_shm_close(struct vm_area_struct *vma)
208{ 208{
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->head->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_map *map;
213 struct drm_map_list *r_list; 213 struct drm_map_list *r_list;
@@ -286,7 +286,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
286static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 286static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
287{ 287{
288 struct drm_file *priv = vma->vm_file->private_data; 288 struct drm_file *priv = vma->vm_file->private_data;
289 struct drm_device *dev = priv->head->dev; 289 struct drm_device *dev = priv->minor->dev;
290 struct drm_device_dma *dma = dev->dma; 290 struct drm_device_dma *dma = dev->dma;
291 unsigned long offset; 291 unsigned long offset;
292 unsigned long page_nr; 292 unsigned long page_nr;
@@ -321,7 +321,7 @@ static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
321{ 321{
322 struct drm_map *map = (struct drm_map *) vma->vm_private_data; 322 struct drm_map *map = (struct drm_map *) vma->vm_private_data;
323 struct drm_file *priv = vma->vm_file->private_data; 323 struct drm_file *priv = vma->vm_file->private_data;
324 struct drm_device *dev = priv->head->dev; 324 struct drm_device *dev = priv->minor->dev;
325 struct drm_sg_mem *entry = dev->sg; 325 struct drm_sg_mem *entry = dev->sg;
326 unsigned long offset; 326 unsigned long offset;
327 unsigned long map_offset; 327 unsigned long map_offset;
@@ -402,7 +402,7 @@ static struct vm_operations_struct drm_vm_sg_ops = {
402static void drm_vm_open_locked(struct vm_area_struct *vma) 402static void drm_vm_open_locked(struct vm_area_struct *vma)
403{ 403{
404 struct drm_file *priv = vma->vm_file->private_data; 404 struct drm_file *priv = vma->vm_file->private_data;
405 struct drm_device *dev = priv->head->dev; 405 struct drm_device *dev = priv->minor->dev;
406 struct drm_vma_entry *vma_entry; 406 struct drm_vma_entry *vma_entry;
407 407
408 DRM_DEBUG("0x%08lx,0x%08lx\n", 408 DRM_DEBUG("0x%08lx,0x%08lx\n",
@@ -420,7 +420,7 @@ static void drm_vm_open_locked(struct vm_area_struct *vma)
420static void drm_vm_open(struct vm_area_struct *vma) 420static void drm_vm_open(struct vm_area_struct *vma)
421{ 421{
422 struct drm_file *priv = vma->vm_file->private_data; 422 struct drm_file *priv = vma->vm_file->private_data;
423 struct drm_device *dev = priv->head->dev; 423 struct drm_device *dev = priv->minor->dev;
424 424
425 mutex_lock(&dev->struct_mutex); 425 mutex_lock(&dev->struct_mutex);
426 drm_vm_open_locked(vma); 426 drm_vm_open_locked(vma);
@@ -438,7 +438,7 @@ static void drm_vm_open(struct vm_area_struct *vma)
438static void drm_vm_close(struct vm_area_struct *vma) 438static void drm_vm_close(struct vm_area_struct *vma)
439{ 439{
440 struct drm_file *priv = vma->vm_file->private_data; 440 struct drm_file *priv = vma->vm_file->private_data;
441 struct drm_device *dev = priv->head->dev; 441 struct drm_device *dev = priv->minor->dev;
442 struct drm_vma_entry *pt, *temp; 442 struct drm_vma_entry *pt, *temp;
443 443
444 DRM_DEBUG("0x%08lx,0x%08lx\n", 444 DRM_DEBUG("0x%08lx,0x%08lx\n",
@@ -473,7 +473,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
473 struct drm_device_dma *dma; 473 struct drm_device_dma *dma;
474 unsigned long length = vma->vm_end - vma->vm_start; 474 unsigned long length = vma->vm_end - vma->vm_start;
475 475
476 dev = priv->head->dev; 476 dev = priv->minor->dev;
477 dma = dev->dma; 477 dma = dev->dma;
478 DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", 478 DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
479 vma->vm_start, vma->vm_end, vma->vm_pgoff); 479 vma->vm_start, vma->vm_end, vma->vm_pgoff);
@@ -543,7 +543,7 @@ EXPORT_SYMBOL(drm_core_get_reg_ofs);
543static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) 543static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
544{ 544{
545 struct drm_file *priv = filp->private_data; 545 struct drm_file *priv = filp->private_data;
546 struct drm_device *dev = priv->head->dev; 546 struct drm_device *dev = priv->minor->dev;
547 struct drm_map *map = NULL; 547 struct drm_map *map = NULL;
548 unsigned long offset = 0; 548 unsigned long offset = 0;
549 struct drm_hash_item *hash; 549 struct drm_hash_item *hash;
@@ -640,12 +640,12 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
640 /* Don't let this area swap. Change when 640 /* Don't let this area swap. Change when
641 DRM_KERNEL advisory is supported. */ 641 DRM_KERNEL advisory is supported. */
642 vma->vm_flags |= VM_RESERVED; 642 vma->vm_flags |= VM_RESERVED;
643 vma->vm_page_prot = drm_dma_prot(map->type, vma);
644 break; 643 break;
645 case _DRM_SCATTER_GATHER: 644 case _DRM_SCATTER_GATHER:
646 vma->vm_ops = &drm_vm_sg_ops; 645 vma->vm_ops = &drm_vm_sg_ops;
647 vma->vm_private_data = (void *)map; 646 vma->vm_private_data = (void *)map;
648 vma->vm_flags |= VM_RESERVED; 647 vma->vm_flags |= VM_RESERVED;
648 vma->vm_page_prot = drm_dma_prot(map->type, vma);
649 break; 649 break;
650 default: 650 default:
651 return -EINVAL; /* This should never happen. */ 651 return -EINVAL; /* This should never happen. */
@@ -661,7 +661,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
661int drm_mmap(struct file *filp, struct vm_area_struct *vma) 661int drm_mmap(struct file *filp, struct vm_area_struct *vma)
662{ 662{
663 struct drm_file *priv = filp->private_data; 663 struct drm_file *priv = filp->private_data;
664 struct drm_device *dev = priv->head->dev; 664 struct drm_device *dev = priv->minor->dev;
665 int ret; 665 int ret;
666 666
667 mutex_lock(&dev->struct_mutex); 667 mutex_lock(&dev->struct_mutex);