Skip to content

Commit 5a383d4

Browse files
icklerodrigovivi
authored andcommitted
drm/i915/gt: Pin the rings before marking active
On eviction, we acquire the vm->mutex and then wait on the vma->active. Therefore when binding and pinning the vma, we must follow the same sequence, lock/pin the vma then mark it active. Otherwise, we mark the vma as active, then wait for the vm->mutex, and meanwhile the evictor holding the mutex waits upon us to complete our activity. Fixes: 8ccfc20 ("drm/i915/gt: Mark ring->vma as active while pinned") Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: <[email protected]> # v5.6+ Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 8567774) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent cf1976b commit 5a383d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/i915/gt/intel_context.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,25 @@ static int __ring_active(struct intel_ring *ring)
204204
{
205205
int err;
206206

207-
err = i915_active_acquire(&ring->vma->active);
207+
err = intel_ring_pin(ring);
208208
if (err)
209209
return err;
210210

211-
err = intel_ring_pin(ring);
211+
err = i915_active_acquire(&ring->vma->active);
212212
if (err)
213-
goto err_active;
213+
goto err_pin;
214214

215215
return 0;
216216

217-
err_active:
218-
i915_active_release(&ring->vma->active);
217+
err_pin:
218+
intel_ring_unpin(ring);
219219
return err;
220220
}
221221

222222
static void __ring_retire(struct intel_ring *ring)
223223
{
224-
intel_ring_unpin(ring);
225224
i915_active_release(&ring->vma->active);
225+
intel_ring_unpin(ring);
226226
}
227227

228228
__i915_active_call

0 commit comments

Comments
 (0)