diff options
author | Dave Airlie <airlied@redhat.com> | 2010-11-21 22:24:40 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-21 22:24:40 -0500 |
commit | d6ea88865d3e5b0c62040531310c1f2c6a994f46 (patch) | |
tree | b80a7cbc6eeab003b412e3037fd335ce9d572f67 /include/drm/ttm/ttm_bo_driver.h | |
parent | 27641c3f003e7f3b6585c01d8a788883603eb262 (diff) |
drm/ttm: Add a bo list reserve fastpath (v2)
Makes it possible to reserve a list of buffer objects with a single
spin lock / unlock if there is no contention.
Should improve cpu usage on SMP kernels.
v2: Initialize private list members on reserve and don't call
ttm_bo_list_ref_sub() with zero put_count.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/ttm/ttm_bo_driver.h')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 8e0c848326b6..95068e6024db 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -864,6 +864,20 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
864 | bool interruptible, | 864 | bool interruptible, |
865 | bool no_wait, bool use_sequence, uint32_t sequence); | 865 | bool no_wait, bool use_sequence, uint32_t sequence); |
866 | 866 | ||
867 | |||
868 | /** | ||
869 | * ttm_bo_reserve_locked: | ||
870 | * | ||
871 | * Similar to ttm_bo_reserve, but must be called with the glob::lru_lock | ||
872 | * spinlock held, and will not remove reserved buffers from the lru lists. | ||
873 | * The function may release the LRU spinlock if it needs to sleep. | ||
874 | */ | ||
875 | |||
876 | extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | ||
877 | bool interruptible, | ||
878 | bool no_wait, bool use_sequence, | ||
879 | uint32_t sequence); | ||
880 | |||
867 | /** | 881 | /** |
868 | * ttm_bo_unreserve | 882 | * ttm_bo_unreserve |
869 | * | 883 | * |