diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-17 07:28:27 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-21 22:25:15 -0500 |
commit | 68c4fa31aa52765314b4285a7835368ea35b509c (patch) | |
tree | 483c669e7308e10205ec675e8bff0cb8098add02 | |
parent | 2357cbe5f4ca8a52329c2c2a26b68839870d5d43 (diff) |
drm/ttm: Optimize ttm_eu_backoff_reservation
Avoid the ttm_bo_unreserve() spinlocks by calling
ttm_eu_backoff_reservation_locked under the lru spinlock.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jerome Glisse <j.glisse@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_execbuf_util.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index 201a71d111ec..7dcc6470e2f5 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c | |||
@@ -101,15 +101,16 @@ static int ttm_eu_wait_unreserved_locked(struct list_head *list, | |||
101 | void ttm_eu_backoff_reservation(struct list_head *list) | 101 | void ttm_eu_backoff_reservation(struct list_head *list) |
102 | { | 102 | { |
103 | struct ttm_validate_buffer *entry; | 103 | struct ttm_validate_buffer *entry; |
104 | struct ttm_bo_global *glob; | ||
104 | 105 | ||
105 | list_for_each_entry(entry, list, head) { | 106 | if (list_empty(list)) |
106 | struct ttm_buffer_object *bo = entry->bo; | 107 | return; |
107 | if (!entry->reserved) | ||
108 | continue; | ||
109 | 108 | ||
110 | entry->reserved = false; | 109 | entry = list_first_entry(list, struct ttm_validate_buffer, head); |
111 | ttm_bo_unreserve(bo); | 110 | glob = entry->bo->glob; |
112 | } | 111 | spin_lock(&glob->lru_lock); |
112 | ttm_eu_backoff_reservation_locked(list); | ||
113 | spin_unlock(&glob->lru_lock); | ||
113 | } | 114 | } |
114 | EXPORT_SYMBOL(ttm_eu_backoff_reservation); | 115 | EXPORT_SYMBOL(ttm_eu_backoff_reservation); |
115 | 116 | ||