History

drm/ttm: remove use_ticket parameter from ttm_bo_reserve

Not used any more.

Christian König committed 10 years ago

Commit dfd5e501 parent 5ee7b4125 files · +55 −62Browse files

Unified · Split

25 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +1 −1
  2. drivers/gpu/drm/ast/ast_drv.h +1 −1
  3. drivers/gpu/drm/bochs/bochs_fbdev.c +1 −1
  4. drivers/gpu/drm/bochs/bochs_kms.c +2 −2
  5. drivers/gpu/drm/cirrus/cirrus_drv.h +1 −1
  6. drivers/gpu/drm/mgag200/mgag200_drv.h +1 −1
  7. drivers/gpu/drm/nouveau/nouveau_bo.c +3 −3
  8. drivers/gpu/drm/nouveau/nouveau_display.c +2 −2
  9. drivers/gpu/drm/nouveau/nouveau_gem.c +3 −3
  10. drivers/gpu/drm/qxl/qxl_object.h +2 −2
  11. drivers/gpu/drm/radeon/radeon_object.c +1 −1
  12. drivers/gpu/drm/radeon/radeon_object.h +1 −1
  13. drivers/gpu/drm/ttm/ttm_bo.c +8 −9
  14. drivers/gpu/drm/ttm/ttm_bo_vm.c +1 −1
  15. drivers/gpu/drm/ttm/ttm_execbuf_util.c +1 −2
  16. drivers/gpu/drm/virtio/virtgpu_drv.h +1 −1
  17. drivers/gpu/drm/virtio/virtgpu_object.c +1 −1
  18. drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +1 −1
  19. drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +4 −4
  20. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 −1
  21. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 −3
  22. drivers/gpu/drm/vmwgfx/vmwgfx_mob.c +6 −6
  23. drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +3 −4
  24. drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +1 −1
  25. include/drm/ttm/ttm_bo_driver.h +5 −9
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h+1−1
@@ -71,7 +71,7 @@ static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) · 70 unmodified lines
71{71{
72 int r;72 int r;
73 73
74 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);74 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL);
75 if (unlikely(r != 0)) {75 if (unlikely(r != 0)) {
76 if (r != -ERESTARTSYS)76 if (r != -ERESTARTSYS)
77 dev_err(bo->adev->dev, "%p reserve failed\n", bo);77 dev_err(bo->adev->dev, "%p reserve failed\n", bo);
drivers/gpu/drm/ast/ast_drv.h+1−1
@@ -367,7 +367,7 @@ static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) · 366 unmodified lines
367{367{
368 int ret;368 int ret;
369 369
370 ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, NULL);370 ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
371 if (ret) {371 if (ret) {
372 if (ret != -ERESTARTSYS && ret != -EBUSY)372 if (ret != -ERESTARTSYS && ret != -EBUSY)
373 DRM_ERROR("reserve failed %p\n", bo);373 DRM_ERROR("reserve failed %p\n", bo);
drivers/gpu/drm/bochs/bochs_fbdev.c+1−1
@@ -82,7 +82,7 @@ static int bochsfb_create(struct drm_fb_helper *helper, · 81 unmodified lines
82 82
83 bo = gem_to_bochs_bo(gobj);83 bo = gem_to_bochs_bo(gobj);
84 84
85 ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL);85 ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
86 if (ret)86 if (ret)
87 return ret;87 return ret;
88 88
drivers/gpu/drm/bochs/bochs_kms.c+2−2
@@ -43,7 +43,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, · 42 unmodified lines
43 if (old_fb) {43 if (old_fb) {
44 bochs_fb = to_bochs_framebuffer(old_fb);44 bochs_fb = to_bochs_framebuffer(old_fb);
45 bo = gem_to_bochs_bo(bochs_fb->obj);45 bo = gem_to_bochs_bo(bochs_fb->obj);
46 ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL);46 ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
47 if (ret) {47 if (ret) {
48 DRM_ERROR("failed to reserve old_fb bo\n");48 DRM_ERROR("failed to reserve old_fb bo\n");
49 } else {49 } else {
@@ -57,7 +57,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, · 7 unmodified lines
57 57
58 bochs_fb = to_bochs_framebuffer(crtc->primary->fb);58 bochs_fb = to_bochs_framebuffer(crtc->primary->fb);
59 bo = gem_to_bochs_bo(bochs_fb->obj);59 bo = gem_to_bochs_bo(bochs_fb->obj);
60 ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL);60 ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
61 if (ret)61 if (ret)
62 return ret;62 return ret;
63 63
drivers/gpu/drm/cirrus/cirrus_drv.h+1−1
@@ -245,7 +245,7 @@ static inline int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) · 244 unmodified lines
245{245{
246 int ret;246 int ret;
247 247
248 ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, NULL);248 ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
249 if (ret) {249 if (ret) {
250 if (ret != -ERESTARTSYS && ret != -EBUSY)250 if (ret != -ERESTARTSYS && ret != -EBUSY)
251 DRM_ERROR("reserve failed %p\n", bo);251 DRM_ERROR("reserve failed %p\n", bo);
drivers/gpu/drm/mgag200/mgag200_drv.h+1−1
@@ -281,7 +281,7 @@ static inline int mgag200_bo_reserve(struct mgag200_bo *bo, bool no_wait) · 280 unmodified lines
281{281{
282 int ret;282 int ret;
283 283
284 ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, NULL);284 ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
285 if (ret) {285 if (ret) {
286 if (ret != -ERESTARTSYS && ret != -EBUSY)286 if (ret != -ERESTARTSYS && ret != -EBUSY)
287 DRM_ERROR("reserve failed %p\n", bo);287 DRM_ERROR("reserve failed %p\n", bo);
drivers/gpu/drm/nouveau/nouveau_bo.c+3−3
@@ -312,7 +312,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype, bool contig) · 311 unmodified lines
312 bool force = false, evict = false;312 bool force = false, evict = false;
313 int ret;313 int ret;
314 314
315 ret = ttm_bo_reserve(bo, false, false, false, NULL);315 ret = ttm_bo_reserve(bo, false, false, NULL);
316 if (ret)316 if (ret)
317 return ret;317 return ret;
318 318
@@ -385,7 +385,7 @@ nouveau_bo_unpin(struct nouveau_bo *nvbo) · 66 unmodified lines
385 struct ttm_buffer_object *bo = &nvbo->bo;385 struct ttm_buffer_object *bo = &nvbo->bo;
386 int ret, ref;386 int ret, ref;
387 387
388 ret = ttm_bo_reserve(bo, false, false, false, NULL);388 ret = ttm_bo_reserve(bo, false, false, NULL);
389 if (ret)389 if (ret)
390 return ret;390 return ret;
391 391
@@ -420,7 +420,7 @@ nouveau_bo_map(struct nouveau_bo *nvbo) · 28 unmodified lines
420{420{
421 int ret;421 int ret;
422 422
423 ret = ttm_bo_reserve(&nvbo->bo, false, false, false, NULL);423 ret = ttm_bo_reserve(&nvbo->bo, false, false, NULL);
424 if (ret)424 if (ret)
425 return ret;425 return ret;
426 426
drivers/gpu/drm/nouveau/nouveau_display.c+2−2
@@ -739,7 +739,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, · 738 unmodified lines
739 }739 }
740 740
741 mutex_lock(&cli->mutex);741 mutex_lock(&cli->mutex);
742 ret = ttm_bo_reserve(&new_bo->bo, true, false, false, NULL);742 ret = ttm_bo_reserve(&new_bo->bo, true, false, NULL);
743 if (ret)743 if (ret)
744 goto fail_unpin;744 goto fail_unpin;
745 745
@@ -753,7 +753,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, · 7 unmodified lines
753 if (new_bo != old_bo) {753 if (new_bo != old_bo) {
754 ttm_bo_unreserve(&new_bo->bo);754 ttm_bo_unreserve(&new_bo->bo);
755 755
756 ret = ttm_bo_reserve(&old_bo->bo, true, false, false, NULL);756 ret = ttm_bo_reserve(&old_bo->bo, true, false, NULL);
757 if (ret)757 if (ret)
758 goto fail_unpin;758 goto fail_unpin;
759 }759 }
drivers/gpu/drm/nouveau/nouveau_gem.c+3−3
@@ -71,7 +71,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv) · 70 unmodified lines
71 if (!cli->vm)71 if (!cli->vm)
72 return 0;72 return 0;
73 73
74 ret = ttm_bo_reserve(&nvbo->bo, false, false, false, NULL);74 ret = ttm_bo_reserve(&nvbo->bo, false, false, NULL);
75 if (ret)75 if (ret)
76 return ret;76 return ret;
77 77
@@ -156,7 +156,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) · 78 unmodified lines
156 if (!cli->vm)156 if (!cli->vm)
157 return;157 return;
158 158
159 ret = ttm_bo_reserve(&nvbo->bo, false, false, false, NULL);159 ret = ttm_bo_reserve(&nvbo->bo, false, false, NULL);
160 if (ret)160 if (ret)
161 return;161 return;
162 162
@@ -409,7 +409,7 @@ retry: · 246 unmodified lines
409 break;409 break;
410 }410 }
411 411
412 ret = ttm_bo_reserve(&nvbo->bo, true, false, true, &op->ticket);412 ret = ttm_bo_reserve(&nvbo->bo, true, false, &op->ticket);
413 if (ret) {413 if (ret) {
414 list_splice_tail_init(&vram_list, &op->list);414 list_splice_tail_init(&vram_list, &op->list);
415 list_splice_tail_init(&gart_list, &op->list);415 list_splice_tail_init(&gart_list, &op->list);
drivers/gpu/drm/qxl/qxl_object.h+2−2
@@ -31,7 +31,7 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait) · 30 unmodified lines
31{31{
32 int r;32 int r;
33 33
34 r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, NULL);34 r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
35 if (unlikely(r != 0)) {35 if (unlikely(r != 0)) {
36 if (r != -ERESTARTSYS) {36 if (r != -ERESTARTSYS) {
37 struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;37 struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
@@ -67,7 +67,7 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type, · 29 unmodified lines
67{67{
68 int r;68 int r;
69 69
70 r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, NULL);70 r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
71 if (unlikely(r != 0)) {71 if (unlikely(r != 0)) {
72 if (r != -ERESTARTSYS) {72 if (r != -ERESTARTSYS) {
73 struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;73 struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
drivers/gpu/drm/radeon/radeon_object.c+1−1
@@ -832,7 +832,7 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait) · 831 unmodified lines
832{832{
833 int r;833 int r;
834 834
835 r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, NULL);835 r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
836 if (unlikely(r != 0))836 if (unlikely(r != 0))
837 return r;837 return r;
838 if (mem_type)838 if (mem_type)
drivers/gpu/drm/radeon/radeon_object.h+1−1
@@ -65,7 +65,7 @@ static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr) · 64 unmodified lines
65{65{
66 int r;66 int r;
67 67
68 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, NULL);68 r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL);
69 if (unlikely(r != 0)) {69 if (unlikely(r != 0)) {
70 if (r != -ERESTARTSYS)70 if (r != -ERESTARTSYS)
71 dev_err(bo->rdev->dev, "%p reserve failed\n", bo);71 dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
drivers/gpu/drm/ttm/ttm_bo.c+8−9
@@ -452,7 +452,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) · 451 unmodified lines
452 int ret;452 int ret;
453 453
454 spin_lock(&glob->lru_lock);454 spin_lock(&glob->lru_lock);
455 ret = __ttm_bo_reserve(bo, false, true, false, NULL);455 ret = __ttm_bo_reserve(bo, false, true, NULL);
456 456
457 if (!ret) {457 if (!ret) {
458 if (!ttm_bo_wait(bo, false, false, true)) {458 if (!ttm_bo_wait(bo, false, false, true)) {
@@ -526,7 +526,7 @@ static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo, · 67 unmodified lines
526 return -EBUSY;526 return -EBUSY;
527 527
528 spin_lock(&glob->lru_lock);528 spin_lock(&glob->lru_lock);
529 ret = __ttm_bo_reserve(bo, false, true, false, NULL);529 ret = __ttm_bo_reserve(bo, false, true, NULL);
530 530
531 /*531 /*
532 * We raced, and lost, someone else holds the reservation now,532 * We raced, and lost, someone else holds the reservation now,
@@ -595,11 +595,10 @@ static int ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool remove_all) · 62 unmodified lines
595 kref_get(&nentry->list_kref);595 kref_get(&nentry->list_kref);
596 }596 }
597 597
598 ret = __ttm_bo_reserve(entry, false, true, false, NULL);598 ret = __ttm_bo_reserve(entry, false, true, NULL);
599 if (remove_all && ret) {599 if (remove_all && ret) {
600 spin_unlock(&glob->lru_lock);600 spin_unlock(&glob->lru_lock);
601 ret = __ttm_bo_reserve(entry, false, false,601 ret = __ttm_bo_reserve(entry, false, false, NULL);
602 false, NULL);
603 spin_lock(&glob->lru_lock);602 spin_lock(&glob->lru_lock);
604 }603 }
605 604
@@ -741,7 +740,7 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev, · 135 unmodified lines
741 740
742 spin_lock(&glob->lru_lock);741 spin_lock(&glob->lru_lock);
743 list_for_each_entry(bo, &man->lru, lru) {742 list_for_each_entry(bo, &man->lru, lru) {
744 ret = __ttm_bo_reserve(bo, false, true, false, NULL);743 ret = __ttm_bo_reserve(bo, false, true, NULL);
745 if (!ret) {744 if (!ret) {
746 if (place && (place->fpfn || place->lpfn)) {745 if (place && (place->fpfn || place->lpfn)) {
747 /* Don't evict this BO if it's outside of the746 /* Don't evict this BO if it's outside of the
@@ -1623,7 +1622,7 @@ int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) · 875 unmodified lines
1623 * Using ttm_bo_reserve makes sure the lru lists are updated.1622 * Using ttm_bo_reserve makes sure the lru lists are updated.
1624 */1623 */
1625 1624
1626 ret = ttm_bo_reserve(bo, true, no_wait, false, NULL);1625 ret = ttm_bo_reserve(bo, true, no_wait, NULL);
1627 if (unlikely(ret != 0))1626 if (unlikely(ret != 0))
1628 return ret;1627 return ret;
1629 ret = ttm_bo_wait(bo, false, true, no_wait);1628 ret = ttm_bo_wait(bo, false, true, no_wait);
@@ -1656,7 +1655,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) · 26 unmodified lines
1656 1655
1657 spin_lock(&glob->lru_lock);1656 spin_lock(&glob->lru_lock);
1658 list_for_each_entry(bo, &glob->swap_lru, swap) {1657 list_for_each_entry(bo, &glob->swap_lru, swap) {
1659 ret = __ttm_bo_reserve(bo, false, true, false, NULL);1658 ret = __ttm_bo_reserve(bo, false, true, NULL);
1660 if (!ret)1659 if (!ret)
1661 break;1660 break;
1662 }1661 }
@@ -1755,7 +1754,7 @@ int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo) · 92 unmodified lines
1755 return -ERESTARTSYS;1754 return -ERESTARTSYS;
1756 if (!ww_mutex_is_locked(&bo->resv->lock))1755 if (!ww_mutex_is_locked(&bo->resv->lock))
1757 goto out_unlock;1756 goto out_unlock;
1758 ret = __ttm_bo_reserve(bo, true, false, false, NULL);1757 ret = __ttm_bo_reserve(bo, true, false, NULL);
1759 if (unlikely(ret != 0))1758 if (unlikely(ret != 0))
1760 goto out_unlock;1759 goto out_unlock;
1761 __ttm_bo_unreserve(bo);1760 __ttm_bo_unreserve(bo);
drivers/gpu/drm/ttm/ttm_bo_vm.c+1−1
@@ -108,7 +108,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 107 unmodified lines
108 * for reserve, and if it fails, retry the fault after waiting108 * for reserve, and if it fails, retry the fault after waiting
109 * for the buffer to become unreserved.109 * for the buffer to become unreserved.
110 */110 */
111 ret = ttm_bo_reserve(bo, true, true, false, NULL);111 ret = ttm_bo_reserve(bo, true, true, NULL);
112 if (unlikely(ret != 0)) {112 if (unlikely(ret != 0)) {
113 if (ret != -EBUSY)113 if (ret != -EBUSY)
114 return VM_FAULT_NOPAGE;114 return VM_FAULT_NOPAGE;
drivers/gpu/drm/ttm/ttm_execbuf_util.c+1−2
@@ -112,8 +112,7 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, · 111 unmodified lines
112 list_for_each_entry(entry, list, head) {112 list_for_each_entry(entry, list, head) {
113 struct ttm_buffer_object *bo = entry->bo;113 struct ttm_buffer_object *bo = entry->bo;
114 114
115 ret = __ttm_bo_reserve(bo, intr, (ticket == NULL), true,115 ret = __ttm_bo_reserve(bo, intr, (ticket == NULL), ticket);
116 ticket);
117 if (!ret && unlikely(atomic_read(&bo->cpu_writers) > 0)) {116 if (!ret && unlikely(atomic_read(&bo->cpu_writers) > 0)) {
118 __ttm_bo_unreserve(bo);117 __ttm_bo_unreserve(bo);
119 118
drivers/gpu/drm/virtio/virtgpu_drv.h+1−1
@@ -400,7 +400,7 @@ static inline int virtio_gpu_object_reserve(struct virtio_gpu_object *bo, · 399 unmodified lines
400{400{
401 int r;401 int r;
402 402
403 r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, NULL);403 r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
404 if (unlikely(r != 0)) {404 if (unlikely(r != 0)) {
405 if (r != -ERESTARTSYS) {405 if (r != -ERESTARTSYS) {
406 struct virtio_gpu_device *qdev =406 struct virtio_gpu_device *qdev =
drivers/gpu/drm/virtio/virtgpu_object.c+1−1
@@ -155,7 +155,7 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait) · 154 unmodified lines
155{155{
156 int r;156 int r;
157 157
158 r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, NULL);158 r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
159 if (unlikely(r != 0))159 if (unlikely(r != 0))
160 return r;160 return r;
161 r = ttm_bo_wait(&bo->tbo, true, true, no_wait);161 r = ttm_bo_wait(&bo->tbo, true, true, no_wait);
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c+1−1
@@ -421,7 +421,7 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size) · 420 unmodified lines
421 }421 }
422 422
423 bo = &buf->base;423 bo = &buf->base;
424 WARN_ON_ONCE(ttm_bo_reserve(bo, false, true, false, NULL));424 WARN_ON_ONCE(ttm_bo_reserve(bo, false, true, NULL));
425 425
426 ret = ttm_bo_wait(old_bo, false, false, false);426 ret = ttm_bo_wait(old_bo, false, false, false);
427 if (unlikely(ret != 0)) {427 if (unlikely(ret != 0)) {
drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c+4−4
@@ -56,7 +56,7 @@ int vmw_dmabuf_pin_in_placement(struct vmw_private *dev_priv, · 55 unmodified lines
56 56
57 vmw_execbuf_release_pinned_bo(dev_priv);57 vmw_execbuf_release_pinned_bo(dev_priv);
58 58
59 ret = ttm_bo_reserve(bo, interruptible, false, false, NULL);59 ret = ttm_bo_reserve(bo, interruptible, false, NULL);
60 if (unlikely(ret != 0))60 if (unlikely(ret != 0))
61 goto err;61 goto err;
62 62
@@ -98,7 +98,7 @@ int vmw_dmabuf_pin_in_vram_or_gmr(struct vmw_private *dev_priv, · 35 unmodified lines
98 98
99 vmw_execbuf_release_pinned_bo(dev_priv);99 vmw_execbuf_release_pinned_bo(dev_priv);
100 100
101 ret = ttm_bo_reserve(bo, interruptible, false, false, NULL);101 ret = ttm_bo_reserve(bo, interruptible, false, NULL);
102 if (unlikely(ret != 0))102 if (unlikely(ret != 0))
103 goto err;103 goto err;
104 104
@@ -174,7 +174,7 @@ int vmw_dmabuf_pin_in_start_of_vram(struct vmw_private *dev_priv, · 69 unmodified lines
174 return ret;174 return ret;
175 175
176 vmw_execbuf_release_pinned_bo(dev_priv);176 vmw_execbuf_release_pinned_bo(dev_priv);
177 ret = ttm_bo_reserve(bo, interruptible, false, false, NULL);177 ret = ttm_bo_reserve(bo, interruptible, false, NULL);
178 if (unlikely(ret != 0))178 if (unlikely(ret != 0))
179 goto err_unlock;179 goto err_unlock;
180 180
@@ -225,7 +225,7 @@ int vmw_dmabuf_unpin(struct vmw_private *dev_priv, · 44 unmodified lines
225 if (unlikely(ret != 0))225 if (unlikely(ret != 0))
226 return ret;226 return ret;
227 227
228 ret = ttm_bo_reserve(bo, interruptible, false, false, NULL);228 ret = ttm_bo_reserve(bo, interruptible, false, NULL);
229 if (unlikely(ret != 0))229 if (unlikely(ret != 0))
230 goto err;230 goto err;
231 231
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+1−1
@@ -326,7 +326,7 @@ static int vmw_dummy_query_bo_create(struct vmw_private *dev_priv) · 325 unmodified lines
326 if (unlikely(ret != 0))326 if (unlikely(ret != 0))
327 return ret;327 return ret;
328 328
329 ret = ttm_bo_reserve(&vbo->base, false, true, false, NULL);329 ret = ttm_bo_reserve(&vbo->base, false, true, NULL);
330 BUG_ON(ret != 0);330 BUG_ON(ret != 0);
331 vmw_bo_pin_reserved(vbo, true);331 vmw_bo_pin_reserved(vbo, true);
332 332
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+3−3
@@ -98,7 +98,7 @@ int vmw_cursor_update_dmabuf(struct vmw_private *dev_priv, · 97 unmodified lines
98 kmap_offset = 0;98 kmap_offset = 0;
99 kmap_num = (width*height*4 + PAGE_SIZE - 1) >> PAGE_SHIFT;99 kmap_num = (width*height*4 + PAGE_SIZE - 1) >> PAGE_SHIFT;
100 100
101 ret = ttm_bo_reserve(&dmabuf->base, true, false, false, NULL);101 ret = ttm_bo_reserve(&dmabuf->base, true, false, NULL);
102 if (unlikely(ret != 0)) {102 if (unlikely(ret != 0)) {
103 DRM_ERROR("reserve failed\n");103 DRM_ERROR("reserve failed\n");
104 return -EINVAL;104 return -EINVAL;
@@ -318,7 +318,7 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf, · 213 unmodified lines
318 kmap_offset = cmd->dma.guest.ptr.offset >> PAGE_SHIFT;318 kmap_offset = cmd->dma.guest.ptr.offset >> PAGE_SHIFT;
319 kmap_num = (64*64*4) >> PAGE_SHIFT;319 kmap_num = (64*64*4) >> PAGE_SHIFT;
320 320
321 ret = ttm_bo_reserve(bo, true, false, false, NULL);321 ret = ttm_bo_reserve(bo, true, false, NULL);
322 if (unlikely(ret != 0)) {322 if (unlikely(ret != 0)) {
323 DRM_ERROR("reserve failed\n");323 DRM_ERROR("reserve failed\n");
324 return;324 return;
@@ -1859,7 +1859,7 @@ int vmw_kms_helper_buffer_prepare(struct vmw_private *dev_priv, · 1534 unmodified lines
1859 struct ttm_buffer_object *bo = &buf->base;1859 struct ttm_buffer_object *bo = &buf->base;
1860 int ret;1860 int ret;
1861 1861
1862 ttm_bo_reserve(bo, false, false, interruptible, NULL);1862 ttm_bo_reserve(bo, false, false, NULL);
1863 ret = vmw_validate_single_buffer(dev_priv, bo, interruptible,1863 ret = vmw_validate_single_buffer(dev_priv, bo, interruptible,
1864 validate_as_mob);1864 validate_as_mob);
1865 if (ret)1865 if (ret)
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c+6−6
@@ -222,7 +222,7 @@ static void vmw_takedown_otable_base(struct vmw_private *dev_priv, · 221 unmodified lines
222 if (bo) {222 if (bo) {
223 int ret;223 int ret;
224 224
225 ret = ttm_bo_reserve(bo, false, true, false, NULL);225 ret = ttm_bo_reserve(bo, false, true, NULL);
226 BUG_ON(ret != 0);226 BUG_ON(ret != 0);
227 227
228 vmw_fence_single_bo(bo, NULL);228 vmw_fence_single_bo(bo, NULL);
@@ -262,7 +262,7 @@ static int vmw_otable_batch_setup(struct vmw_private *dev_priv, · 33 unmodified lines
262 if (unlikely(ret != 0))262 if (unlikely(ret != 0))
263 goto out_no_bo;263 goto out_no_bo;
264 264
265 ret = ttm_bo_reserve(batch->otable_bo, false, true, false, NULL);265 ret = ttm_bo_reserve(batch->otable_bo, false, true, NULL);
266 BUG_ON(ret != 0);266 BUG_ON(ret != 0);
267 ret = vmw_bo_driver.ttm_tt_populate(batch->otable_bo->ttm);267 ret = vmw_bo_driver.ttm_tt_populate(batch->otable_bo->ttm);
268 if (unlikely(ret != 0))268 if (unlikely(ret != 0))
@@ -357,7 +357,7 @@ static void vmw_otable_batch_takedown(struct vmw_private *dev_priv, · 88 unmodified lines
357 vmw_takedown_otable_base(dev_priv, i,357 vmw_takedown_otable_base(dev_priv, i,
358 &batch->otables[i]);358 &batch->otables[i]);
359 359
360 ret = ttm_bo_reserve(bo, false, true, false, NULL);360 ret = ttm_bo_reserve(bo, false, true, NULL);
361 BUG_ON(ret != 0);361 BUG_ON(ret != 0);
362 362
363 vmw_fence_single_bo(bo, NULL);363 vmw_fence_single_bo(bo, NULL);
@@ -440,7 +440,7 @@ static int vmw_mob_pt_populate(struct vmw_private *dev_priv, · 76 unmodified lines
440 if (unlikely(ret != 0))440 if (unlikely(ret != 0))
441 return ret;441 return ret;
442 442
443 ret = ttm_bo_reserve(mob->pt_bo, false, true, false, NULL);443 ret = ttm_bo_reserve(mob->pt_bo, false, true, NULL);
444 444
445 BUG_ON(ret != 0);445 BUG_ON(ret != 0);
446 ret = vmw_bo_driver.ttm_tt_populate(mob->pt_bo->ttm);446 ret = vmw_bo_driver.ttm_tt_populate(mob->pt_bo->ttm);
@@ -545,7 +545,7 @@ static void vmw_mob_pt_setup(struct vmw_mob *mob, · 98 unmodified lines
545 const struct vmw_sg_table *vsgt;545 const struct vmw_sg_table *vsgt;
546 int ret;546 int ret;
547 547
548 ret = ttm_bo_reserve(bo, false, true, false, NULL);548 ret = ttm_bo_reserve(bo, false, true, NULL);
549 BUG_ON(ret != 0);549 BUG_ON(ret != 0);
550 550
551 vsgt = vmw_bo_sg_table(bo);551 vsgt = vmw_bo_sg_table(bo);
@@ -595,7 +595,7 @@ void vmw_mob_unbind(struct vmw_private *dev_priv, · 43 unmodified lines
595 struct ttm_buffer_object *bo = mob->pt_bo;595 struct ttm_buffer_object *bo = mob->pt_bo;
596 596
597 if (bo) {597 if (bo) {
598 ret = ttm_bo_reserve(bo, false, true, false, NULL);598 ret = ttm_bo_reserve(bo, false, true, NULL);
599 /*599 /*
600 * Noone else should be using this buffer.600 * Noone else should be using this buffer.
601 */601 */
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+3−4
@@ -129,7 +129,7 @@ static void vmw_resource_release(struct kref *kref) · 128 unmodified lines
129 if (res->backup) {129 if (res->backup) {
130 struct ttm_buffer_object *bo = &res->backup->base;130 struct ttm_buffer_object *bo = &res->backup->base;
131 131
132 ttm_bo_reserve(bo, false, false, false, NULL);132 ttm_bo_reserve(bo, false, false, NULL);
133 if (!list_empty(&res->mob_head) &&133 if (!list_empty(&res->mob_head) &&
134 res->func->unbind != NULL) {134 res->func->unbind != NULL) {
135 struct ttm_validate_buffer val_buf;135 struct ttm_validate_buffer val_buf;
@@ -1717,8 +1717,7 @@ int vmw_resource_pin(struct vmw_resource *res, bool interruptible) · 1581 unmodified lines
1717 if (res->backup) {1717 if (res->backup) {
1718 vbo = res->backup;1718 vbo = res->backup;
1719 1719
1720 ttm_bo_reserve(&vbo->base, interruptible, false, false,1720 ttm_bo_reserve(&vbo->base, interruptible, false, NULL);
1721 NULL);
1722 if (!vbo->pin_count) {1721 if (!vbo->pin_count) {
1723 ret = ttm_bo_validate1722 ret = ttm_bo_validate
1724 (&vbo->base,1723 (&vbo->base,
@@ -1773,7 +1772,7 @@ void vmw_resource_unpin(struct vmw_resource *res) · 48 unmodified lines
1773 if (--res->pin_count == 0 && res->backup) {1772 if (--res->pin_count == 0 && res->backup) {
1774 struct vmw_dma_buffer *vbo = res->backup;1773 struct vmw_dma_buffer *vbo = res->backup;
1775 1774
1776 ttm_bo_reserve(&vbo->base, false, false, false, NULL);1775 ttm_bo_reserve(&vbo->base, false, false, NULL);
1777 vmw_bo_pin_reserved(vbo, false);1776 vmw_bo_pin_reserved(vbo, false);
1778 ttm_bo_unreserve(&vbo->base);1777 ttm_bo_unreserve(&vbo->base);
1779 }1778 }
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c+1−1
@@ -988,7 +988,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv, · 987 unmodified lines
988 if (unlikely(ret != 0))988 if (unlikely(ret != 0))
989 goto out;989 goto out;
990 990
991 ret = ttm_bo_reserve(&buf->base, false, true, false, NULL);991 ret = ttm_bo_reserve(&buf->base, false, true, NULL);
992 if (unlikely(ret != 0))992 if (unlikely(ret != 0))
993 goto no_reserve;993 goto no_reserve;
994 994
include/drm/ttm/ttm_bo_driver.h+5−9
@@ -759,8 +759,7 @@ extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); · 758 unmodified lines
759 * @bo: A pointer to a struct ttm_buffer_object.759 * @bo: A pointer to a struct ttm_buffer_object.
760 * @interruptible: Sleep interruptible if waiting.760 * @interruptible: Sleep interruptible if waiting.
761 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.761 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
762 * @use_ticket: If @bo is already reserved, Only sleep waiting for762 * @ticket: ticket used to acquire the ww_mutex.
763 * it to become unreserved if @ticket->stamp is older.
764 *763 *
765 * Will not remove reserved buffers from the lru lists.764 * Will not remove reserved buffers from the lru lists.
766 * Otherwise identical to ttm_bo_reserve.765 * Otherwise identical to ttm_bo_reserve.
@@ -776,8 +775,7 @@ extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); · 9 unmodified lines
776 * be returned if @use_ticket is set to true.775 * be returned if @use_ticket is set to true.
777 */776 */
778static inline int __ttm_bo_reserve(struct ttm_buffer_object *bo,777static inline int __ttm_bo_reserve(struct ttm_buffer_object *bo,
779 bool interruptible,778 bool interruptible, bool no_wait,
780 bool no_wait, bool use_ticket,
781 struct ww_acquire_ctx *ticket)779 struct ww_acquire_ctx *ticket)
782{780{
783 int ret = 0;781 int ret = 0;
@@ -806,8 +804,7 @@ static inline int __ttm_bo_reserve(struct ttm_buffer_object *bo, · 22 unmodified lines
806 * @bo: A pointer to a struct ttm_buffer_object.804 * @bo: A pointer to a struct ttm_buffer_object.
807 * @interruptible: Sleep interruptible if waiting.805 * @interruptible: Sleep interruptible if waiting.
808 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.806 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
809 * @use_ticket: If @bo is already reserved, Only sleep waiting for807 * @ticket: ticket used to acquire the ww_mutex.
810 * it to become unreserved if @ticket->stamp is older.
811 *808 *
812 * Locks a buffer object for validation. (Or prevents other processes from809 * Locks a buffer object for validation. (Or prevents other processes from
813 * locking it for validation) and removes it from lru lists, while taking810 * locking it for validation) and removes it from lru lists, while taking
@@ -846,15 +843,14 @@ static inline int __ttm_bo_reserve(struct ttm_buffer_object *bo, · 32 unmodified lines
846 * be returned if @use_ticket is set to true.843 * be returned if @use_ticket is set to true.
847 */844 */
848static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,845static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
849 bool interruptible,846 bool interruptible, bool no_wait,
850 bool no_wait, bool use_ticket,
851 struct ww_acquire_ctx *ticket)847 struct ww_acquire_ctx *ticket)
852{848{
853 int ret;849 int ret;
854 850
855 WARN_ON(!atomic_read(&bo->kref.refcount));851 WARN_ON(!atomic_read(&bo->kref.refcount));
856 852
857 ret = __ttm_bo_reserve(bo, interruptible, no_wait, use_ticket, ticket);853 ret = __ttm_bo_reserve(bo, interruptible, no_wait, ticket);
858 if (likely(ret == 0))854 if (likely(ret == 0))
859 ttm_bo_del_sub_from_lru(bo);855 ttm_bo_del_sub_from_lru(bo);
860 856

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t