Deleted Added
full compact
32c32
< __FBSDID("$FreeBSD: head/sys/dev/drm2/ttm/ttm_bo.c 254862 2013-08-25 14:41:22Z dumbbell $");
---
> __FBSDID("$FreeBSD: head/sys/dev/drm2/ttm/ttm_bo.c 254863 2013-08-25 14:47:22Z dumbbell $");
295a296,345
> int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo,
> bool interruptible, uint32_t sequence)
> {
> bool wake_up = false;
> int ret;
>
> while (unlikely(atomic_xchg(&bo->reserved, 1) != 0)) {
> if (bo->seq_valid && sequence == bo->val_seq) {
> DRM_ERROR(
> "%s: bo->seq_valid && sequence == bo->val_seq",
> __func__);
> }
>
> ret = ttm_bo_wait_unreserved_locked(bo, interruptible);
>
> if (unlikely(ret))
> return ret;
> }
>
> if ((bo->val_seq - sequence < (1 << 31)) || !bo->seq_valid)
> wake_up = true;
>
> /**
> * Wake up waiters that may need to recheck for deadlock,
> * if we decreased the sequence number.
> */
> bo->val_seq = sequence;
> bo->seq_valid = true;
> if (wake_up)
> wakeup(bo);
>
> return 0;
> }
>
> int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
> bool interruptible, uint32_t sequence)
> {
> struct ttm_bo_global *glob = bo->glob;
> int put_count, ret;
>
> ret = ttm_bo_reserve_slowpath_nolru(bo, interruptible, sequence);
> if (likely(!ret)) {
> mtx_lock(&glob->lru_lock);
> put_count = ttm_bo_del_from_lru(bo);
> mtx_unlock(&glob->lru_lock);
> ttm_bo_list_ref_sub(bo, put_count, true);
> }
> return ret;
> }
>