From c9b73ef6daff75df27d17260a9fc84e68f1b21b4 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sun, 13 Apr 2008 14:49:14 +0200 Subject: 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. --- linux-core/drm_vm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'linux-core/drm_vm.c') 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; -- cgit v1.2.3