mutex_unlock(&bo->mutex);
drm_bo_usage_deref_unlocked(&bo);
+
return ret;
}
ftype,
no_wait);
}
- if (ret && ret != -EAGAIN)
+ if (ret && ret != -EAGAIN)
ret = drm_bo_wait(bo, 0, 1, no_wait, 1);
+
if (ret)
return ret;
}
drm_bo_fill_rep_arg(bo, rep);
mutex_unlock(&bo->mutex);
+
return ret;
}
EXPORT_SYMBOL(drm_bo_do_validate);
}
mutex_unlock(&bo->mutex);
- ret = drm_bo_do_validate(bo, 0, 0, hint & DRM_BO_HINT_DONT_BLOCK,
+ ret = drm_bo_do_validate(bo, 0, 0, hint | DRM_BO_HINT_DONT_FENCE,
0, NULL);
if (ret)
goto out_err_unlocked;
void drm_bo_read_unlock(struct drm_bo_lock *lock)
{
- if (unlikely(atomic_add_negative(-1, &lock->readers)))
- BUG();
- if (atomic_read(&lock->readers) == 0)
+ if (atomic_dec_and_test(&lock->readers))
wake_up_all(&lock->queue);
}
EXPORT_SYMBOL(drm_bo_read_unlock);
{
while (unlikely(atomic_read(&lock->write_lock_pending) != 0)) {
int ret;
-
+
if (!interruptible) {
wait_event(lock->queue,
atomic_read(&lock->write_lock_pending) == 0);
while (unlikely(!atomic_add_unless(&lock->readers, 1, -1))) {
int ret;
-
if (!interruptible) {
wait_event(lock->queue,
atomic_read(&lock->readers) != -1);
* while holding it.
*/
- atomic_dec(&lock->write_lock_pending);
+ if (atomic_dec_and_test(&lock->write_lock_pending))
+ wake_up_all(&lock->queue);
dev = file_priv->minor->dev;
mutex_lock(&dev->struct_mutex);
ret = drm_add_user_object(file_priv, &lock->base, 0);