diff options
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_execbuf_util.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 3 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 2 | ||||
-rw-r--r-- | include/drm/ttm/ttm_execbuf_util.h | 3 |
6 files changed, 9 insertions, 6 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 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index e7a58d055041..10fc01f69c40 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -264,7 +264,6 @@ struct vmw_private { | |||
264 | */ | 264 | */ |
265 | 265 | ||
266 | struct vmw_sw_context ctx; | 266 | struct vmw_sw_context ctx; |
267 | uint32_t val_seq; | ||
268 | struct mutex cmdbuf_mutex; | 267 | struct mutex cmdbuf_mutex; |
269 | 268 | ||
270 | /** | 269 | /** |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 76954e3528c1..41b95ed6dbcd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |||
@@ -653,8 +653,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data, | |||
653 | ret = vmw_cmd_check_all(dev_priv, sw_context, cmd, arg->command_size); | 653 | ret = vmw_cmd_check_all(dev_priv, sw_context, cmd, arg->command_size); |
654 | if (unlikely(ret != 0)) | 654 | if (unlikely(ret != 0)) |
655 | goto out_err; | 655 | goto out_err; |
656 | ret = ttm_eu_reserve_buffers(&sw_context->validate_nodes, | 656 | ret = ttm_eu_reserve_buffers(&sw_context->validate_nodes); |
657 | dev_priv->val_seq++); | ||
658 | if (unlikely(ret != 0)) | 657 | if (unlikely(ret != 0)) |
659 | goto out_err; | 658 | goto out_err; |
660 | 659 | ||
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index cfb9ca4ec1c4..e3b2e245db1b 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -515,6 +515,7 @@ struct ttm_bo_global { | |||
515 | * @addr_space_mm: Range manager for the device address space. | 515 | * @addr_space_mm: Range manager for the device address space. |
516 | * lru_lock: Spinlock that protects the buffer+device lru lists and | 516 | * lru_lock: Spinlock that protects the buffer+device lru lists and |
517 | * ddestroy lists. | 517 | * ddestroy lists. |
518 | * @val_seq: Current validation sequence. | ||
518 | * @nice_mode: Try nicely to wait for buffer idle when cleaning a manager. | 519 | * @nice_mode: Try nicely to wait for buffer idle when cleaning a manager. |
519 | * If a GPU lockup has been detected, this is forced to 0. | 520 | * If a GPU lockup has been detected, this is forced to 0. |
520 | * @dev_mapping: A pointer to the struct address_space representing the | 521 | * @dev_mapping: A pointer to the struct address_space representing the |
@@ -544,6 +545,7 @@ struct ttm_bo_device { | |||
544 | * Protected by the global:lru lock. | 545 | * Protected by the global:lru lock. |
545 | */ | 546 | */ |
546 | struct list_head ddestroy; | 547 | struct list_head ddestroy; |
548 | uint32_t val_seq; | ||
547 | 549 | ||
548 | /* | 550 | /* |
549 | * Protected by load / firstopen / lastclose /unload sync. | 551 | * Protected by load / firstopen / lastclose /unload sync. |
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h index 535ab00407e0..26cc7f9ffa41 100644 --- a/include/drm/ttm/ttm_execbuf_util.h +++ b/include/drm/ttm/ttm_execbuf_util.h | |||
@@ -72,7 +72,6 @@ extern void ttm_eu_backoff_reservation(struct list_head *list); | |||
72 | * function ttm_eu_reserve_buffers | 72 | * function ttm_eu_reserve_buffers |
73 | * | 73 | * |
74 | * @list: thread private list of ttm_validate_buffer structs. | 74 | * @list: thread private list of ttm_validate_buffer structs. |
75 | * @val_seq: A unique sequence number. | ||
76 | * | 75 | * |
77 | * Tries to reserve bos pointed to by the list entries for validation. | 76 | * Tries to reserve bos pointed to by the list entries for validation. |
78 | * If the function returns 0, all buffers are marked as "unfenced", | 77 | * If the function returns 0, all buffers are marked as "unfenced", |
@@ -94,7 +93,7 @@ extern void ttm_eu_backoff_reservation(struct list_head *list); | |||
94 | * has failed. | 93 | * has failed. |
95 | */ | 94 | */ |
96 | 95 | ||
97 | extern int ttm_eu_reserve_buffers(struct list_head *list, uint32_t val_seq); | 96 | extern int ttm_eu_reserve_buffers(struct list_head *list); |
98 | 97 | ||
99 | /** | 98 | /** |
100 | * function ttm_eu_fence_buffer_objects. | 99 | * function ttm_eu_fence_buffer_objects. |