aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/ttm/ttm_bo_driver.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e3a43a47d78c..6fff43222e20 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -790,16 +790,7 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
790 * to make room for a buffer already reserved. (Buffers are reserved before 790 * to make room for a buffer already reserved. (Buffers are reserved before
791 * they are evicted). The following algorithm prevents such deadlocks from 791 * they are evicted). The following algorithm prevents such deadlocks from
792 * occurring: 792 * occurring:
793 * 1) Buffers are reserved with the lru spinlock held. Upon successful 793 * Processes attempting to reserve multiple buffers other than for eviction,
794 * reservation they are removed from the lru list. This stops a reserved buffer
795 * from being evicted. However the lru spinlock is released between the time
796 * a buffer is selected for eviction and the time it is reserved.
797 * Therefore a check is made when a buffer is reserved for eviction, that it
798 * is still the first buffer in the lru list, before it is removed from the
799 * list. @check_lru == 1 forces this check. If it fails, the function returns
800 * -EINVAL, and the caller should then choose a new buffer to evict and repeat
801 * the procedure.
802 * 2) Processes attempting to reserve multiple buffers other than for eviction,
803 * (typically execbuf), should first obtain a unique 32-bit 794 * (typically execbuf), should first obtain a unique 32-bit
804 * validation sequence number, 795 * validation sequence number,
805 * and call this function with @use_sequence == 1 and @sequence == the unique 796 * and call this function with @use_sequence == 1 and @sequence == the unique
@@ -832,7 +823,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
832 823
833 824
834/** 825/**
835 * ttm_bo_reserve_locked: 826 * ttm_bo_reserve_nolru:
836 * 827 *
837 * @bo: A pointer to a struct ttm_buffer_object. 828 * @bo: A pointer to a struct ttm_buffer_object.
838 * @interruptible: Sleep interruptible if waiting. 829 * @interruptible: Sleep interruptible if waiting.
@@ -840,9 +831,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
840 * @use_sequence: If @bo is already reserved, Only sleep waiting for 831 * @use_sequence: If @bo is already reserved, Only sleep waiting for
841 * it to become unreserved if @sequence < (@bo)->sequence. 832 * it to become unreserved if @sequence < (@bo)->sequence.
842 * 833 *
843 * Must be called with struct ttm_bo_global::lru_lock held, 834 * Will not remove reserved buffers from the lru lists.
844 * and will not remove reserved buffers from the lru lists.
845 * The function may release the LRU spinlock if it needs to sleep.
846 * Otherwise identical to ttm_bo_reserve. 835 * Otherwise identical to ttm_bo_reserve.
847 * 836 *
848 * Returns: 837 * Returns:
@@ -855,7 +844,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
855 * -EDEADLK: Bo already reserved using @sequence. This error code will only 844 * -EDEADLK: Bo already reserved using @sequence. This error code will only
856 * be returned if @use_sequence is set to true. 845 * be returned if @use_sequence is set to true.
857 */ 846 */
858extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, 847extern int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo,
859 bool interruptible, 848 bool interruptible,
860 bool no_wait, bool use_sequence, 849 bool no_wait, bool use_sequence,
861 uint32_t sequence); 850 uint32_t sequence);