Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190720
b: refs/heads/master
c: 8cfe92d
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed May 6, 2010
1 parent a5575fc commit 66213b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 58 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: 5be6eff965aee22181d7f6210c2c463420e94e03
refs/heads/master: 8cfe92d683a0041ac8e016a0b0a487c99a78f6c1
30 changes: 1 addition & 29 deletions trunk/drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
}
EXPORT_SYMBOL(ttm_bo_wait);

void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo)
{
atomic_set(&bo->reserved, 0);
wake_up_all(&bo->event_queue);
}

int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool interruptible,
bool no_wait)
{
int ret;

while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) {
if (no_wait)
return -EBUSY;
else if (interruptible) {
ret = wait_event_interruptible
(bo->event_queue, atomic_read(&bo->reserved) == 0);
if (unlikely(ret != 0))
return ret;
} else {
wait_event(bo->event_queue,
atomic_read(&bo->reserved) == 0);
}
}
return 0;
}

int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait)
{
int ret = 0;

/*
* Using ttm_bo_reserve instead of ttm_bo_block_reservation
* makes sure the lru lists are updated.
* Using ttm_bo_reserve makes sure the lru lists are updated.
*/

ret = ttm_bo_reserve(bo, true, no_wait, false, 0);
Expand Down
28 changes: 0 additions & 28 deletions trunk/include/drm/ttm/ttm_bo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo);
extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo,
bool interruptible);

/**
* ttm_bo_block_reservation
*
* @bo: A pointer to a struct ttm_buffer_object.
* @interruptible: Use interruptible sleep when waiting.
* @no_wait: Don't sleep, but rather return -EBUSY.
*
* Block reservation for validation by simply reserving the buffer.
* This is intended for single buffer use only without eviction,
* and thus needs no deadlock protection.
*
* Returns:
* -EBUSY: If no_wait == 1 and the buffer is already reserved.
* -ERESTARTSYS: If interruptible == 1 and the process received a signal
* while sleeping.
*/
extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo,
bool interruptible, bool no_wait);

/**
* ttm_bo_unblock_reservation
*
* @bo: A pointer to a struct ttm_buffer_object.
*
* Unblocks reservation leaving lru lists untouched.
*/
extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo);

/*
* ttm_bo_util.c
*/
Expand Down

0 comments on commit 66213b0

Please sign in to comment.