reservation_object_add_shared_fence(bo->resv, &release->base);
ttm_bo_add_to_lru(bo);
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
spin_unlock(&glob->lru_lock);
ww_acquire_fini(&release->ticket);
ttm_bo_add_to_lru(bo);
}
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
if (bo->resv != &bo->ttm_resv)
reservation_object_unlock(&bo->ttm_resv);
if (ret && !no_wait_gpu) {
long lret;
- ww_mutex_unlock(&bo->resv->lock);
+
+ reservation_object_unlock(bo->resv);
spin_unlock(&glob->lru_lock);
lret = reservation_object_wait_timeout_rcu(resv, true,
}
if (ret || unlikely(list_empty(&bo->ddestroy))) {
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
spin_unlock(&glob->lru_lock);
return ret;
}
if (place && !bdev->driver->eviction_valuable(bo,
place)) {
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
ret = -EBUSY;
continue;
}
* already swapped buffer.
*/
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
kref_put(&bo->list_kref, ttm_bo_release_list);
return ret;
}
ret = __ttm_bo_reserve(bo, true, false, NULL);
if (unlikely(ret != 0))
goto out_unlock;
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
out_unlock:
mutex_unlock(&bo->wu_mutex);
list_for_each_entry_continue_reverse(entry, list, head) {
struct ttm_buffer_object *bo = entry->bo;
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
}
struct ttm_buffer_object *bo = entry->bo;
ttm_bo_add_to_lru(bo);
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
spin_unlock(&glob->lru_lock);
ret = __ttm_bo_reserve(bo, intr, (ticket == NULL), ticket);
if (!ret && unlikely(atomic_read(&bo->cpu_writers) > 0)) {
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
ret = -EBUSY;
else
reservation_object_add_excl_fence(bo->resv, fence);
ttm_bo_add_to_lru(bo);
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
spin_unlock(&glob->lru_lock);
if (ticket)
return ret;
}
-/**
- * __ttm_bo_unreserve
- * @bo: A pointer to a struct ttm_buffer_object.
- *
- * Unreserve a previous reservation of @bo where the buffer object is
- * already on lru lists.
- */
-static inline void __ttm_bo_unreserve(struct ttm_buffer_object *bo)
-{
- ww_mutex_unlock(&bo->resv->lock);
-}
-
/**
* ttm_bo_unreserve
*
ttm_bo_add_to_lru(bo);
spin_unlock(&bo->glob->lru_lock);
}
- __ttm_bo_unreserve(bo);
+ reservation_object_unlock(bo->resv);
}
/**