]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/ttm/ttm_bo_vm.c
mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf
[karo-tx-linux.git] / drivers / gpu / drm / ttm / ttm_bo_vm.c
index 88169141bef546e193ac4ed7f6f5ae7f82cba3ab..35ffb3754febc5e2acccfffe0d8c8cc9dc8a8909 100644 (file)
@@ -43,7 +43,6 @@
 #define TTM_BO_VM_NUM_PREFAULT 16
 
 static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
-                               struct vm_area_struct *vma,
                                struct vm_fault *vmf)
 {
        int ret = 0;
@@ -67,7 +66,7 @@ static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
                        goto out_unlock;
 
                ttm_bo_reference(bo);
-               up_read(&vma->vm_mm->mmap_sem);
+               up_read(&vmf->vma->vm_mm->mmap_sem);
                (void) dma_fence_wait(bo->moving, true);
                ttm_bo_unreserve(bo);
                ttm_bo_unref(&bo);
@@ -92,8 +91,9 @@ out_unlock:
        return ret;
 }
 
-static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ttm_bo_vm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct ttm_buffer_object *bo = (struct ttm_buffer_object *)
            vma->vm_private_data;
        struct ttm_bo_device *bdev = bo->bdev;
@@ -124,7 +124,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                if (vmf->flags & FAULT_FLAG_ALLOW_RETRY) {
                        if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
                                ttm_bo_reference(bo);
-                               up_read(&vma->vm_mm->mmap_sem);
+                               up_read(&vmf->vma->vm_mm->mmap_sem);
                                (void) ttm_bo_wait_unreserved(bo);
                                ttm_bo_unref(&bo);
                        }
@@ -168,7 +168,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
         * Wait for buffer data in transit, due to a pipelined
         * move.
         */
-       ret = ttm_bo_vm_fault_idle(bo, vma, vmf);
+       ret = ttm_bo_vm_fault_idle(bo, vmf);
        if (unlikely(ret != 0)) {
                retval = ret;