Lines Matching refs:vma

59 	struct vm_area_struct *vma;  member
63 static void drm_vm_open(struct vm_area_struct *vma);
64 static void drm_vm_close(struct vm_area_struct *vma);
67 struct vm_area_struct *vma) in drm_io_prot() argument
69 pgprot_t tmp = vm_get_page_prot(vma->vm_flags); in drm_io_prot()
78 if (efi_range_is_wc(vma->vm_start, vma->vm_end - in drm_io_prot()
79 vma->vm_start)) in drm_io_prot()
89 static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma) in drm_dma_prot() argument
91 pgprot_t tmp = vm_get_page_prot(vma->vm_flags); in drm_dma_prot()
112 struct vm_area_struct *vma = vmf->vma; in drm_vm_fault() local
113 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_fault()
128 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) in drm_vm_fault()
139 resource_size_t offset = vmf->address - vma->vm_start; in drm_vm_fault()
201 struct vm_area_struct *vma = vmf->vma; in drm_vm_shm_fault() local
202 struct drm_local_map *map = vma->vm_private_data; in drm_vm_shm_fault()
210 offset = vmf->address - vma->vm_start; in drm_vm_shm_fault()
230 static void drm_vm_shm_close(struct vm_area_struct *vma) in drm_vm_shm_close() argument
232 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_shm_close()
240 vma->vm_start, vma->vm_end - vma->vm_start); in drm_vm_shm_close()
242 map = vma->vm_private_data; in drm_vm_shm_close()
246 if (pt->vma->vm_private_data == map) in drm_vm_shm_close()
248 if (pt->vma == vma) { in drm_vm_shm_close()
301 struct vm_area_struct *vma = vmf->vma; in drm_vm_dma_fault() local
302 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_dma_fault()
314 offset = vmf->address - vma->vm_start; in drm_vm_dma_fault()
336 struct vm_area_struct *vma = vmf->vma; in drm_vm_sg_fault() local
337 struct drm_local_map *map = vma->vm_private_data; in drm_vm_sg_fault()
338 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_sg_fault()
351 offset = vmf->address - vma->vm_start; in drm_vm_sg_fault()
390 struct vm_area_struct *vma) in drm_vm_open_locked() argument
395 vma->vm_start, vma->vm_end - vma->vm_start); in drm_vm_open_locked()
399 vma_entry->vma = vma; in drm_vm_open_locked()
405 static void drm_vm_open(struct vm_area_struct *vma) in drm_vm_open() argument
407 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_open()
411 drm_vm_open_locked(dev, vma); in drm_vm_open()
416 struct vm_area_struct *vma) in drm_vm_close_locked() argument
421 vma->vm_start, vma->vm_end - vma->vm_start); in drm_vm_close_locked()
424 if (pt->vma == vma) { in drm_vm_close_locked()
440 static void drm_vm_close(struct vm_area_struct *vma) in drm_vm_close() argument
442 struct drm_file *priv = vma->vm_file->private_data; in drm_vm_close()
446 drm_vm_close_locked(dev, vma); in drm_vm_close()
460 static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) in drm_mmap_dma() argument
465 unsigned long length = vma->vm_end - vma->vm_start; in drm_mmap_dma()
470 vma->vm_start, vma->vm_end, vma->vm_pgoff); in drm_mmap_dma()
479 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); in drm_mmap_dma()
481 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; in drm_mmap_dma()
486 vma->vm_page_prot = in drm_mmap_dma()
489 (__pte(pgprot_val(vma->vm_page_prot))))); in drm_mmap_dma()
493 vma->vm_ops = &drm_vm_dma_ops; in drm_mmap_dma()
495 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; in drm_mmap_dma()
497 drm_vm_open_locked(dev, vma); in drm_mmap_dma()
523 static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) in drm_mmap_locked() argument
532 vma->vm_start, vma->vm_end, vma->vm_pgoff); in drm_mmap_locked()
541 if (!vma->vm_pgoff in drm_mmap_locked()
547 return drm_mmap_dma(filp, vma); in drm_mmap_locked()
549 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) { in drm_mmap_locked()
559 if (map->size < vma->vm_end - vma->vm_start) in drm_mmap_locked()
563 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE); in drm_mmap_locked()
565 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW; in drm_mmap_locked()
570 vma->vm_page_prot = in drm_mmap_locked()
573 (__pte(pgprot_val(vma->vm_page_prot))))); in drm_mmap_locked()
587 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); in drm_mmap_locked()
589 vma->vm_ops = &drm_vm_ops; in drm_mmap_locked()
597 vma->vm_page_prot = drm_io_prot(map, vma); in drm_mmap_locked()
598 if (io_remap_pfn_range(vma, vma->vm_start, in drm_mmap_locked()
600 vma->vm_end - vma->vm_start, in drm_mmap_locked()
601 vma->vm_page_prot)) in drm_mmap_locked()
606 vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset)); in drm_mmap_locked()
608 vma->vm_ops = &drm_vm_ops; in drm_mmap_locked()
613 if (remap_pfn_range(vma, vma->vm_start, in drm_mmap_locked()
615 vma->vm_end - vma->vm_start, vma->vm_page_prot)) in drm_mmap_locked()
617 vma->vm_page_prot = drm_dma_prot(map->type, vma); in drm_mmap_locked()
620 vma->vm_ops = &drm_vm_shm_ops; in drm_mmap_locked()
621 vma->vm_private_data = (void *)map; in drm_mmap_locked()
624 vma->vm_ops = &drm_vm_sg_ops; in drm_mmap_locked()
625 vma->vm_private_data = (void *)map; in drm_mmap_locked()
626 vma->vm_page_prot = drm_dma_prot(map->type, vma); in drm_mmap_locked()
631 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; in drm_mmap_locked()
633 drm_vm_open_locked(dev, vma); in drm_mmap_locked()
637 int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma) in drm_legacy_mmap() argument
647 ret = drm_mmap_locked(filp, vma); in drm_legacy_mmap()
657 struct drm_vma_entry *vma, *vma_temp; in drm_legacy_vma_flush() local
660 list_for_each_entry_safe(vma, vma_temp, &dev->vmalist, head) { in drm_legacy_vma_flush()
661 list_del(&vma->head); in drm_legacy_vma_flush()
662 kfree(vma); in drm_legacy_vma_flush()