Lines Matching refs:vma

61 	struct vm_area_struct *vma;
65 static void drm_vm_open(struct vm_area_struct *vma);
66 static void drm_vm_close(struct vm_area_struct *vma);
69 struct vm_area_struct *vma)
71 pgprot_t tmp = vm_get_page_prot(vma->vm_flags);
83 if (efi_range_is_wc(vma->vm_start, vma->vm_end -
84 vma->vm_start))
94 static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma)
96 pgprot_t tmp = vm_get_page_prot(vma->vm_flags);
107 * \param vma virtual memory area.
117 struct vm_area_struct *vma = vmf->vma;
118 struct drm_file *priv = vma->vm_file->private_data;
133 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash))
144 resource_size_t offset = vmf->address - vma->vm_start;
197 * \param vma virtual memory area.
206 struct vm_area_struct *vma = vmf->vma;
207 struct drm_local_map *map = vma->vm_private_data;
215 offset = vmf->address - vma->vm_start;
230 * \param vma virtual memory area.
235 static void drm_vm_shm_close(struct vm_area_struct *vma)
237 struct drm_file *priv = vma->vm_file->private_data;
245 vma->vm_start, vma->vm_end - vma->vm_start);
247 map = vma->vm_private_data;
251 if (pt->vma->vm_private_data == map)
253 if (pt->vma == vma) {
306 struct vm_area_struct *vma = vmf->vma;
307 struct drm_file *priv = vma->vm_file->private_data;
319 offset = vmf->address - vma->vm_start;
341 struct vm_area_struct *vma = vmf->vma;
342 struct drm_local_map *map = vma->vm_private_data;
343 struct drm_file *priv = vma->vm_file->private_data;
356 offset = vmf->address - vma->vm_start;
395 struct vm_area_struct *vma)
400 vma->vm_start, vma->vm_end - vma->vm_start);
404 vma_entry->vma = vma;
410 static void drm_vm_open(struct vm_area_struct *vma)
412 struct drm_file *priv = vma->vm_file->private_data;
416 drm_vm_open_locked(dev, vma);
421 struct vm_area_struct *vma)
426 vma->vm_start, vma->vm_end - vma->vm_start);
429 if (pt->vma == vma) {
440 * \param vma virtual memory area.
442 * Search the \p vma private data entry in drm_device::vmalist, unlink it, and
445 static void drm_vm_close(struct vm_area_struct *vma)
447 struct drm_file *priv = vma->vm_file->private_data;
451 drm_vm_close_locked(dev, vma);
459 * \param vma virtual memory area.
465 static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
470 unsigned long length = vma->vm_end - vma->vm_start;
475 vma->vm_start, vma->vm_end, vma->vm_pgoff);
484 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
486 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
491 vma->vm_page_prot =
494 (__pte(pgprot_val(vma->vm_page_prot)))));
498 vma->vm_ops = &drm_vm_dma_ops;
500 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
502 drm_vm_open_locked(dev, vma);
519 * \param vma virtual memory area.
528 static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
537 vma->vm_start, vma->vm_end, vma->vm_pgoff);
546 if (!vma->vm_pgoff
552 return drm_mmap_dma(filp, vma);
554 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) {
564 if (map->size < vma->vm_end - vma->vm_start)
568 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
570 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
575 vma->vm_page_prot =
578 (__pte(pgprot_val(vma->vm_page_prot)))));
592 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
594 vma->vm_ops = &drm_vm_ops;
602 vma->vm_page_prot = drm_io_prot(map, vma);
603 if (io_remap_pfn_range(vma, vma->vm_start,
605 vma->vm_end - vma->vm_start,
606 vma->vm_page_prot))
611 vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
613 vma->vm_ops = &drm_vm_ops;
618 if (remap_pfn_range(vma, vma->vm_start,
620 vma->vm_end - vma->vm_start, vma->vm_page_prot))
622 vma->vm_page_prot = drm_dma_prot(map->type, vma);
625 vma->vm_ops = &drm_vm_shm_ops;
626 vma->vm_private_data = (void *)map;
629 vma->vm_ops = &drm_vm_sg_ops;
630 vma->vm_private_data = (void *)map;
631 vma->vm_page_prot = drm_dma_prot(map->type, vma);
636 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
638 drm_vm_open_locked(dev, vma);
642 int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma)
652 ret = drm_mmap_locked(filp, vma);
662 struct drm_vma_entry *vma, *vma_temp;
664 /* Clear vma list (only needed for legacy drivers) */
665 list_for_each_entry_safe(vma, vma_temp, &dev->vmalist, head) {
666 list_del(&vma->head);
667 kfree(vma);