summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2010-11-17 12:28:27 +0000
committerDave Airlie <airlied@redhat.com>2010-11-22 13:25:15 +1000
commit68c4fa31aa52765314b4285a7835368ea35b509c (patch)
tree483c669e7308e10205ec675e8bff0cb8098add02 /drivers
parent2357cbe5f4ca8a52329c2c2a26b68839870d5d43 (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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/ttm/ttm_execbuf_util.c15
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,
void ttm_eu_backoff_reservation(struct list_head *list)
{
struct ttm_validate_buffer *entry;
+ struct ttm_bo_global *glob;
- list_for_each_entry(entry, list, head) {
- struct ttm_buffer_object *bo = entry->bo;
- if (!entry->reserved)
- continue;
+ if (list_empty(list))
+ return;
- entry->reserved = false;
- ttm_bo_unreserve(bo);
- }
+ entry = list_first_entry(list, struct ttm_validate_buffer, head);
+ glob = entry->bo->glob;
+ spin_lock(&glob->lru_lock);
+ ttm_eu_backoff_reservation_locked(list);
+ spin_unlock(&glob->lru_lock);
}
EXPORT_SYMBOL(ttm_eu_backoff_reservation);