Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334728
b: refs/heads/master
c: b8e902f
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Oct 23, 2012
1 parent ba78b7e commit 14bffa5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7bc17a7837bf4ec8fd2d63438c0b6b0160c454c1
refs/heads/master: b8e902f24fdd16c4373ddc37a4e150c4afe9c6db
20 changes: 12 additions & 8 deletions trunk/drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,21 +580,28 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
if (unlikely(ret != 0))
return ret;

retry_reserve:
spin_lock(&glob->lru_lock);

if (unlikely(list_empty(&bo->ddestroy))) {
spin_unlock(&glob->lru_lock);
return 0;
}

ret = ttm_bo_reserve_locked(bo, interruptible,
no_wait_reserve, false, 0);
ret = ttm_bo_reserve_locked(bo, false, true, false, 0);

if (unlikely(ret != 0)) {
if (unlikely(ret == -EBUSY)) {
spin_unlock(&glob->lru_lock);
return ret;
if (likely(!no_wait_reserve))
ret = ttm_bo_wait_unreserved(bo, interruptible);
if (unlikely(ret != 0))
return ret;

goto retry_reserve;
}

BUG_ON(ret != 0);

/**
* We can re-check for sync object without taking
* the bo::lock since setting the sync object requires
Expand Down Expand Up @@ -811,10 +818,7 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
no_wait_reserve, no_wait_gpu);
kref_put(&bo->list_kref, ttm_bo_release_list);

if (likely(ret == 0 || ret == -ERESTARTSYS))
return ret;

goto retry;
return ret;
}

ret = ttm_bo_reserve_locked(bo, false, true, false, 0);
Expand Down

0 comments on commit 14bffa5

Please sign in to comment.