aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_vm.c')
-rw-r--r--drivers/gpu/drm/drm_vm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 23a824e6a22a..db7bd292410b 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -514,8 +514,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
514 514
515 vma->vm_ops = &drm_vm_dma_ops; 515 vma->vm_ops = &drm_vm_dma_ops;
516 516
517 vma->vm_flags |= VM_RESERVED; /* Don't swap */ 517 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
518 vma->vm_flags |= VM_DONTEXPAND;
519 518
520 drm_vm_open_locked(dev, vma); 519 drm_vm_open_locked(dev, vma);
521 return 0; 520 return 0;
@@ -643,21 +642,16 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
643 case _DRM_SHM: 642 case _DRM_SHM:
644 vma->vm_ops = &drm_vm_shm_ops; 643 vma->vm_ops = &drm_vm_shm_ops;
645 vma->vm_private_data = (void *)map; 644 vma->vm_private_data = (void *)map;
646 /* Don't let this area swap. Change when
647 DRM_KERNEL advisory is supported. */
648 vma->vm_flags |= VM_RESERVED;
649 break; 645 break;
650 case _DRM_SCATTER_GATHER: 646 case _DRM_SCATTER_GATHER:
651 vma->vm_ops = &drm_vm_sg_ops; 647 vma->vm_ops = &drm_vm_sg_ops;
652 vma->vm_private_data = (void *)map; 648 vma->vm_private_data = (void *)map;
653 vma->vm_flags |= VM_RESERVED;
654 vma->vm_page_prot = drm_dma_prot(map->type, vma); 649 vma->vm_page_prot = drm_dma_prot(map->type, vma);
655 break; 650 break;
656 default: 651 default:
657 return -EINVAL; /* This should never happen. */ 652 return -EINVAL; /* This should never happen. */
658 } 653 }
659 vma->vm_flags |= VM_RESERVED; /* Don't swap */ 654 vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
660 vma->vm_flags |= VM_DONTEXPAND;
661 655
662 drm_vm_open_locked(dev, vma); 656 drm_vm_open_locked(dev, vma);
663 return 0; 657 return 0;