Home | History | Annotate | Download | only in drm

Lines Matching refs:vma

67 	struct vm_area_struct *vma;
71 static void drm_vm_open(struct vm_area_struct *vma);
72 static void drm_vm_close(struct vm_area_struct *vma);
75 struct vm_area_struct *vma)
77 pgprot_t tmp = vm_get_page_prot(vma->vm_flags);
89 if (efi_range_is_wc(vma->vm_start, vma->vm_end -
90 vma->vm_start))
100 static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma)
102 pgprot_t tmp = vm_get_page_prot(vma->vm_flags);
113 * \param vma virtual memory area.
123 struct vm_area_struct *vma = vmf->vma;
124 struct drm_file *priv = vma->vm_file->private_data;
139 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash))
150 resource_size_t offset = vmf->address - vma->vm_start;
203 * \param vma virtual memory area.
212 struct vm_area_struct *vma = vmf->vma;
213 struct drm_local_map *map = vma->vm_private_data;
221 offset = vmf->address - vma->vm_start;
236 * \param vma virtual memory area.
241 static void drm_vm_shm_close(struct vm_area_struct *vma)
243 struct drm_file *priv = vma->vm_file->private_data;
251 vma->vm_start, vma->vm_end - vma->vm_start);
253 map = vma->vm_private_data;
257 if (pt->vma->vm_private_data == map)
259 if (pt->vma == vma) {
314 struct vm_area_struct *vma = vmf->vma;
315 struct drm_file *priv = vma->vm_file->private_data;
327 offset = vmf->address - vma->vm_start;
349 struct vm_area_struct *vma = vmf->vma;
350 struct drm_local_map *map = vma->vm_private_data;
351 struct drm_file *priv = vma->vm_file->private_data;
364 offset = vmf->address - vma->vm_start;
403 struct vm_area_struct *vma)
408 vma->vm_start, vma->vm_end - vma->vm_start);
412 vma_entry->vma = vma;
418 static void drm_vm_open(struct vm_area_struct *vma)
420 struct drm_file *priv = vma->vm_file->private_data;
424 drm_vm_open_locked(dev, vma);
429 struct vm_area_struct *vma)
434 vma->vm_start, vma->vm_end - vma->vm_start);
437 if (pt->vma == vma) {
448 * \param vma virtual memory area.
450 * Search the \p vma private data entry in drm_device::vmalist, unlink it, and
453 static void drm_vm_close(struct vm_area_struct *vma)
455 struct drm_file *priv = vma->vm_file->private_data;
459 drm_vm_close_locked(dev, vma);
467 * \param vma virtual memory area.
473 static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
478 unsigned long length = vma->vm_end - vma->vm_start;
483 vma->vm_start, vma->vm_end, vma->vm_pgoff);
492 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
494 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
499 vma->vm_page_prot =
502 (__pte(pgprot_val(vma->vm_page_prot)))));
506 vma->vm_ops = &drm_vm_dma_ops;
508 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
510 drm_vm_open_locked(dev, vma);
527 * \param vma virtual memory area.
536 static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
545 vma->vm_start, vma->vm_end, vma->vm_pgoff);
554 if (!vma->vm_pgoff
560 return drm_mmap_dma(filp, vma);
562 if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) {
572 if (map->size < vma->vm_end - vma->vm_start)
576 vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
578 pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
583 vma->vm_page_prot =
586 (__pte(pgprot_val(vma->vm_page_prot)))));
600 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
602 vma->vm_ops = &drm_vm_ops;
610 vma->vm_page_prot = drm_io_prot(map, vma);
611 if (io_remap_pfn_range(vma, vma->vm_start,
613 vma->vm_end - vma->vm_start,
614 vma->vm_page_prot))
619 vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
621 vma->vm_ops = &drm_vm_ops;
626 if (remap_pfn_range(vma, vma->vm_start,
628 vma->vm_end - vma->vm_start, vma->vm_page_prot))
630 vma->vm_page_prot = drm_dma_prot(map->type, vma);
633 vma->vm_ops = &drm_vm_shm_ops;
634 vma->vm_private_data = (void *)map;
637 vma->vm_ops = &drm_vm_sg_ops;
638 vma->vm_private_data = (void *)map;
639 vma->vm_page_prot = drm_dma_prot(map->type, vma);
644 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
646 drm_vm_open_locked(dev, vma);
650 int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma)
660 ret = drm_mmap_locked(filp, vma);
670 struct drm_vma_entry *vma, *vma_temp;
672 /* Clear vma list (only needed for legacy drivers) */
673 list_for_each_entry_safe(vma, vma_temp, &dev->vmalist, head) {
674 list_del(&vma->head);
675 kfree(vma);