diff options
Diffstat (limited to 'linux-core/drm_vm.c')
-rw-r--r-- | linux-core/drm_vm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 228ea6cd..d4d97a4d 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -715,9 +715,13 @@ static int drm_bo_vm_fault(struct vm_area_struct *vma, unsigned long ret = VM_FAULT_NOPAGE; dev = bo->dev; + err = drm_bo_read_lock(&dev->bm.bm_lock, 1); + if (err) + return VM_FAULT_NOPAGE; err = mutex_lock_interruptible(&bo->mutex); if (err) { + drm_bo_read_unlock(&dev->bm.bm_lock); return VM_FAULT_NOPAGE; } @@ -784,6 +788,7 @@ static int drm_bo_vm_fault(struct vm_area_struct *vma, out_unlock: BUG_ON(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED); mutex_unlock(&bo->mutex); + drm_bo_read_unlock(&dev->bm.bm_lock); return ret; } #endif @@ -792,10 +797,6 @@ static void drm_bo_vm_open_locked(struct vm_area_struct *vma) { struct drm_buffer_object *bo = (struct drm_buffer_object *) vma->vm_private_data; - /* clear the clean flags */ - bo->mem.flags &= ~DRM_BO_FLAG_CLEAN; - bo->mem.proposed_flags &= ~DRM_BO_FLAG_CLEAN; - drm_vm_open_locked(vma); atomic_inc(&bo->usage); #ifdef DRM_ODD_MM_COMPAT |