Rev 5078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5078 | Rev 5271 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | if (r) { |
62 | if (r) { |
63 | dev_err(rdev->dev, "failed to get a new IB (%d)\n", r); |
63 | dev_err(rdev->dev, "failed to get a new IB (%d)\n", r); |
64 | return r; |
64 | return r; |
65 | } |
65 | } |
Line 66... | Line 66... | ||
66 | 66 | ||
67 | r = radeon_semaphore_create(rdev, &ib->semaphore); |
- | |
68 | if (r) { |
- | |
69 | return r; |
- | |
Line 70... | Line 67... | ||
70 | } |
67 | radeon_sync_create(&ib->sync); |
71 | 68 | ||
72 | ib->ring = ring; |
69 | ib->ring = ring; |
73 | ib->fence = NULL; |
70 | ib->fence = NULL; |
Line 94... | Line 91... | ||
94 | * |
91 | * |
95 | * Free an IB (all asics). |
92 | * Free an IB (all asics). |
96 | */ |
93 | */ |
97 | void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) |
94 | void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) |
98 | { |
95 | { |
99 | radeon_semaphore_free(rdev, &ib->semaphore, ib->fence); |
96 | radeon_sync_free(rdev, &ib->sync, ib->fence); |
100 | radeon_sa_bo_free(rdev, &ib->sa_bo, ib->fence); |
97 | radeon_sa_bo_free(rdev, &ib->sa_bo, ib->fence); |
101 | radeon_fence_unref(&ib->fence); |
98 | radeon_fence_unref(&ib->fence); |
102 | } |
99 | } |
Line 103... | Line 100... | ||
103 | 100 | ||
Line 143... | Line 140... | ||
143 | 140 | ||
144 | /* grab a vm id if necessary */ |
141 | /* grab a vm id if necessary */ |
145 | if (ib->vm) { |
142 | if (ib->vm) { |
146 | struct radeon_fence *vm_id_fence; |
143 | struct radeon_fence *vm_id_fence; |
147 | vm_id_fence = radeon_vm_grab_id(rdev, ib->vm, ib->ring); |
144 | vm_id_fence = radeon_vm_grab_id(rdev, ib->vm, ib->ring); |
148 | radeon_semaphore_sync_to(ib->semaphore, vm_id_fence); |
145 | radeon_sync_fence(&ib->sync, vm_id_fence); |
Line 149... | Line 146... | ||
149 | } |
146 | } |
150 | 147 | ||
151 | /* sync with other rings */ |
148 | /* sync with other rings */ |
152 | r = radeon_semaphore_sync_rings(rdev, ib->semaphore, ib->ring); |
149 | r = radeon_sync_rings(rdev, &ib->sync, ib->ring); |
153 | if (r) { |
150 | if (r) { |
154 | dev_err(rdev->dev, "failed to sync rings (%d)\n", r); |
151 | dev_err(rdev->dev, "failed to sync rings (%d)\n", r); |
155 | radeon_ring_unlock_undo(rdev, ring); |
152 | radeon_ring_unlock_undo(rdev, ring); |
Line 156... | Line 153... | ||
156 | return r; |
153 | return r; |
157 | } |
154 | } |
- | 155 | ||
Line 158... | Line 156... | ||
158 | 156 | if (ib->vm) |
|
159 | if (ib->vm) |
157 | radeon_vm_flush(rdev, ib->vm, ib->ring, |
160 | radeon_vm_flush(rdev, ib->vm, ib->ring); |
158 | ib->sync.last_vm_update); |
161 | 159 | ||
162 | if (const_ib) { |
160 | if (const_ib) { |
163 | radeon_ring_ib_execute(rdev, const_ib->ring, const_ib); |
161 | radeon_ring_ib_execute(rdev, const_ib->ring, const_ib); |
164 | radeon_semaphore_free(rdev, &const_ib->semaphore, NULL); |
162 | radeon_sync_free(rdev, &const_ib->sync, NULL); |
165 | } |
163 | } |
Line 267... | Line 265... | ||
267 | if (!ring->ready) |
265 | if (!ring->ready) |
268 | continue; |
266 | continue; |
Line 269... | Line 267... | ||
269 | 267 | ||
270 | r = radeon_ib_test(rdev, i, ring); |
268 | r = radeon_ib_test(rdev, i, ring); |
- | 269 | if (r) { |
|
271 | if (r) { |
270 | radeon_fence_driver_force_completion(rdev, i); |
272 | ring->ready = false; |
271 | ring->ready = false; |
Line 273... | Line 272... | ||
273 | rdev->needs_reset = false; |
272 | rdev->needs_reset = false; |
274 | 273 |