summaryrefslogtreecommitdiff
path: root/linux-core/drm_vm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-04-13 14:49:14 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-04-14 12:13:33 +0200
commitc9b73ef6daff75df27d17260a9fc84e68f1b21b4 (patch)
treefdaa75f6dbd1a0c6c7c4b5fc567cd005f5f62f6d /linux-core/drm_vm.c
parent65dd0e68ff0e0e354925adb7d5fffeb0ffbb485c (diff)
Unlock the BO mutex while waiting for idle, unmapped, unfenced.
Move unfenced checking into idle checking. Never time out while waiting for software events like unmapped or unfenced.
Diffstat (limited to 'linux-core/drm_vm.c')
-rw-r--r--linux-core/drm_vm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index a09bcddb..cabfb8f4 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -748,12 +748,14 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma,
return NOPFN_REFAULT;
}
- err = drm_bo_wait(bo, 0, 0, 0);
+ err = drm_bo_wait(bo, 0, 1, 0, 1);
if (err) {
ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT;
goto out_unlock;
}
+ bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED;
+
/*
* If buffer happens to be in a non-mappable location,
* move it to a mappable.
@@ -806,6 +808,7 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma,
goto out_unlock;
}
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;