diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-17 07:28:31 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-21 22:25:21 -0500 |
commit | 65705962025df490d13df59ec57c5329d1bd0a16 (patch) | |
tree | aa9d40bbd1a842aaada664d9d0fa6a317ec1755f /drivers/gpu/drm/ttm | |
parent | 95762c2b34069bf4adb7929969f1f5f5fc8a38df (diff) |
drm/ttm/vmwgfx: Have TTM manage the validation sequence.
Rather than having the driver supply the validation sequence, leave that
responsibility to TTM. This saves some confusion and a function argument.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_execbuf_util.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 551a5d31cadf..25e4c2a1d1d8 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1539,6 +1539,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, | |||
1539 | bdev->dev_mapping = NULL; | 1539 | bdev->dev_mapping = NULL; |
1540 | bdev->glob = glob; | 1540 | bdev->glob = glob; |
1541 | bdev->need_dma32 = need_dma32; | 1541 | bdev->need_dma32 = need_dma32; |
1542 | bdev->val_seq = 0; | ||
1542 | spin_lock_init(&bdev->fence_lock); | 1543 | spin_lock_init(&bdev->fence_lock); |
1543 | mutex_lock(&glob->device_list_mutex); | 1544 | mutex_lock(&glob->device_list_mutex); |
1544 | list_add_tail(&bdev->device_list, &glob->device_list); | 1545 | list_add_tail(&bdev->device_list, &glob->device_list); |
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index b6da65cc502a..3832fe10b4df 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c | |||
@@ -126,11 +126,12 @@ EXPORT_SYMBOL(ttm_eu_backoff_reservation); | |||
126 | * buffers in different orders. | 126 | * buffers in different orders. |
127 | */ | 127 | */ |
128 | 128 | ||
129 | int ttm_eu_reserve_buffers(struct list_head *list, uint32_t val_seq) | 129 | int ttm_eu_reserve_buffers(struct list_head *list) |
130 | { | 130 | { |
131 | struct ttm_bo_global *glob; | 131 | struct ttm_bo_global *glob; |
132 | struct ttm_validate_buffer *entry; | 132 | struct ttm_validate_buffer *entry; |
133 | int ret; | 133 | int ret; |
134 | uint32_t val_seq; | ||
134 | 135 | ||
135 | if (list_empty(list)) | 136 | if (list_empty(list)) |
136 | return 0; | 137 | return 0; |
@@ -146,6 +147,8 @@ int ttm_eu_reserve_buffers(struct list_head *list, uint32_t val_seq) | |||
146 | 147 | ||
147 | retry: | 148 | retry: |
148 | spin_lock(&glob->lru_lock); | 149 | spin_lock(&glob->lru_lock); |
150 | val_seq = entry->bo->bdev->val_seq++; | ||
151 | |||
149 | list_for_each_entry(entry, list, head) { | 152 | list_for_each_entry(entry, list, head) { |
150 | struct ttm_buffer_object *bo = entry->bo; | 153 | struct ttm_buffer_object *bo = entry->bo; |
151 | 154 | ||