diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-04-28 05:33:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-06 19:21:28 -0400 |
commit | 8cfe92d683a0041ac8e016a0b0a487c99a78f6c1 (patch) | |
tree | 5949c336ea881c9fb51aee811432125451fef45d /drivers | |
parent | 5be6eff965aee22181d7f6210c2c463420e94e03 (diff) |
drm/ttm: Remove the ttm_bo_block_reservation() function.
It's unused and buggy in its current form, since it can place a bo
in the reserved state without removing it from lru lists.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index dd47b2a9a791..0e3754a3a303 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, | |||
1716 | } | 1716 | } |
1717 | EXPORT_SYMBOL(ttm_bo_wait); | 1717 | EXPORT_SYMBOL(ttm_bo_wait); |
1718 | 1718 | ||
1719 | void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo) | ||
1720 | { | ||
1721 | atomic_set(&bo->reserved, 0); | ||
1722 | wake_up_all(&bo->event_queue); | ||
1723 | } | ||
1724 | |||
1725 | int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool interruptible, | ||
1726 | bool no_wait) | ||
1727 | { | ||
1728 | int ret; | ||
1729 | |||
1730 | while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { | ||
1731 | if (no_wait) | ||
1732 | return -EBUSY; | ||
1733 | else if (interruptible) { | ||
1734 | ret = wait_event_interruptible | ||
1735 | (bo->event_queue, atomic_read(&bo->reserved) == 0); | ||
1736 | if (unlikely(ret != 0)) | ||
1737 | return ret; | ||
1738 | } else { | ||
1739 | wait_event(bo->event_queue, | ||
1740 | atomic_read(&bo->reserved) == 0); | ||
1741 | } | ||
1742 | } | ||
1743 | return 0; | ||
1744 | } | ||
1745 | |||
1746 | int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) | 1719 | int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) |
1747 | { | 1720 | { |
1748 | int ret = 0; | 1721 | int ret = 0; |
1749 | 1722 | ||
1750 | /* | 1723 | /* |
1751 | * Using ttm_bo_reserve instead of ttm_bo_block_reservation | 1724 | * Using ttm_bo_reserve makes sure the lru lists are updated. |
1752 | * makes sure the lru lists are updated. | ||
1753 | */ | 1725 | */ |
1754 | 1726 | ||
1755 | ret = ttm_bo_reserve(bo, true, no_wait, false, 0); | 1727 | ret = ttm_bo_reserve(bo, true, no_wait, false, 0); |