aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2013-01-15 08:57:05 -0500
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2013-01-15 08:57:05 -0500
commit5e45d7dfd74100d622f9cdc70bfd1f9fae1671de (patch)
treeb12de2542f55d332a73fcd7d863bd2e45fd7d4ef /include/drm
parent7a1863084c9d90ce4b67d645bf9b0f1612e68f62 (diff)
drm/ttm: add ttm_bo_reserve_slowpath
Instead of dropping everything, waiting for the bo to be unreserved and trying over, a better strategy would be to do a blocking wait. This can be mapped a lot better to a mutex_lock-like call. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/ttm/ttm_bo_driver.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 6fff43222e20..5af71af6bf88 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -821,6 +821,36 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
821 bool interruptible, 821 bool interruptible,
822 bool no_wait, bool use_sequence, uint32_t sequence); 822 bool no_wait, bool use_sequence, uint32_t sequence);
823 823
824/**
825 * ttm_bo_reserve_slowpath_nolru:
826 * @bo: A pointer to a struct ttm_buffer_object.
827 * @interruptible: Sleep interruptible if waiting.
828 * @sequence: Set (@bo)->sequence to this value after lock
829 *
830 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
831 * from all our other reservations. Because there are no other reservations
832 * held by us, this function cannot deadlock any more.
833 *
834 * Will not remove reserved buffers from the lru lists.
835 * Otherwise identical to ttm_bo_reserve_slowpath.
836 */
837extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo,
838 bool interruptible,
839 uint32_t sequence);
840
841
842/**
843 * ttm_bo_reserve_slowpath:
844 * @bo: A pointer to a struct ttm_buffer_object.
845 * @interruptible: Sleep interruptible if waiting.
846 * @sequence: Set (@bo)->sequence to this value after lock
847 *
848 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
849 * from all our other reservations. Because there are no other reservations
850 * held by us, this function cannot deadlock any more.
851 */
852extern int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
853 bool interruptible, uint32_t sequence);
824 854
825/** 855/**
826 * ttm_bo_reserve_nolru: 856 * ttm_bo_reserve_nolru: