Skip to content

Commit 8cfe92d

Browse files
thomashvmwairlied
authored andcommitted
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>
1 parent 5be6eff commit 8cfe92d

File tree

2 files changed

+1
-57
lines changed

2 files changed

+1
-57
lines changed

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
17161716
}
17171717
EXPORT_SYMBOL(ttm_bo_wait);
17181718

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-
17461719
int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait)
17471720
{
17481721
int ret = 0;
17491722

17501723
/*
1751-
* Using ttm_bo_reserve instead of ttm_bo_block_reservation
1752-
* makes sure the lru lists are updated.
1724+
* Using ttm_bo_reserve makes sure the lru lists are updated.
17531725
*/
17541726

17551727
ret = ttm_bo_reserve(bo, true, no_wait, false, 0);

include/drm/ttm/ttm_bo_driver.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -789,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo);
789789
extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo,
790790
bool interruptible);
791791

792-
/**
793-
* ttm_bo_block_reservation
794-
*
795-
* @bo: A pointer to a struct ttm_buffer_object.
796-
* @interruptible: Use interruptible sleep when waiting.
797-
* @no_wait: Don't sleep, but rather return -EBUSY.
798-
*
799-
* Block reservation for validation by simply reserving the buffer.
800-
* This is intended for single buffer use only without eviction,
801-
* and thus needs no deadlock protection.
802-
*
803-
* Returns:
804-
* -EBUSY: If no_wait == 1 and the buffer is already reserved.
805-
* -ERESTARTSYS: If interruptible == 1 and the process received a signal
806-
* while sleeping.
807-
*/
808-
extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo,
809-
bool interruptible, bool no_wait);
810-
811-
/**
812-
* ttm_bo_unblock_reservation
813-
*
814-
* @bo: A pointer to a struct ttm_buffer_object.
815-
*
816-
* Unblocks reservation leaving lru lists untouched.
817-
*/
818-
extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo);
819-
820792
/*
821793
* ttm_bo_util.c
822794
*/

0 commit comments

Comments
 (0)