aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ring.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-05-09 09:34:48 -0400
committerDave Airlie <airlied@redhat.com>2012-05-09 12:22:20 -0400
commit8a47cc9ec1249eefd600adb273148c62879a560d (patch)
tree70cda5e8f7830a508431b1a87c472978c927150b /drivers/gpu/drm/radeon/radeon_ring.c
parent3b7a2b24ea2b703b3af595d0d4ee233ab0b36377 (diff)
drm/radeon: rework locking ring emission mutex in fence deadlock detection v2
Some callers illegal called fence_wait_next/empty while holding the ring emission mutex. So don't relock the mutex in that cases, and move the actual locking into the fence code. v2: Don't try to unlock the mutex if it isn't locked. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ring.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 4ae222bb3ec5..2fdc8c35f87c 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -347,9 +347,7 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi
347 if (ndw < ring->ring_free_dw) { 347 if (ndw < ring->ring_free_dw) {
348 break; 348 break;
349 } 349 }
350 mutex_unlock(&rdev->ring_lock); 350 r = radeon_fence_wait_next_locked(rdev, radeon_ring_index(rdev, ring));
351 r = radeon_fence_wait_next(rdev, radeon_ring_index(rdev, ring));
352 mutex_lock(&rdev->ring_lock);
353 if (r) 351 if (r)
354 return r; 352 return r;
355 } 353 }
@@ -408,7 +406,6 @@ void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring *
408{ 406{
409 int r; 407 int r;
410 408
411 mutex_lock(&rdev->ring_lock);
412 radeon_ring_free_size(rdev, ring); 409 radeon_ring_free_size(rdev, ring);
413 if (ring->rptr == ring->wptr) { 410 if (ring->rptr == ring->wptr) {
414 r = radeon_ring_alloc(rdev, ring, 1); 411 r = radeon_ring_alloc(rdev, ring, 1);
@@ -417,7 +414,6 @@ void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring *
417 radeon_ring_commit(rdev, ring); 414 radeon_ring_commit(rdev, ring);
418 } 415 }
419 } 416 }
420 mutex_unlock(&rdev->ring_lock);
421} 417}
422 418
423void radeon_ring_lockup_update(struct radeon_ring *ring) 419void radeon_ring_lockup_update(struct radeon_ring *ring)