diff options
author | Christian König <deathsimple@vodafone.de> | 2012-05-09 09:34:45 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-09 12:22:14 -0400 |
commit | d6999bc7b5f4b4554ebba5b48377903fa20198db (patch) | |
tree | 6dc61cf64362c4682d2bed9d591d8677376af795 /drivers/gpu/drm/radeon/radeon_ring.c | |
parent | 133f4cb3365ef8e57c4837ffbe15de74684f6e19 (diff) |
drm/radeon: replace the per ring mutex with a global one
A single global mutex for ring submissions seems sufficient.
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.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 2eb4c6ed198a..a4d60ae524b1 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
@@ -346,9 +346,9 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi | |||
346 | if (ndw < ring->ring_free_dw) { | 346 | if (ndw < ring->ring_free_dw) { |
347 | break; | 347 | break; |
348 | } | 348 | } |
349 | mutex_unlock(&ring->mutex); | 349 | mutex_unlock(&rdev->ring_lock); |
350 | r = radeon_fence_wait_next(rdev, radeon_ring_index(rdev, ring)); | 350 | r = radeon_fence_wait_next(rdev, radeon_ring_index(rdev, ring)); |
351 | mutex_lock(&ring->mutex); | 351 | mutex_lock(&rdev->ring_lock); |
352 | if (r) | 352 | if (r) |
353 | return r; | 353 | return r; |
354 | } | 354 | } |
@@ -361,10 +361,10 @@ int radeon_ring_lock(struct radeon_device *rdev, struct radeon_ring *ring, unsig | |||
361 | { | 361 | { |
362 | int r; | 362 | int r; |
363 | 363 | ||
364 | mutex_lock(&ring->mutex); | 364 | mutex_lock(&rdev->ring_lock); |
365 | r = radeon_ring_alloc(rdev, ring, ndw); | 365 | r = radeon_ring_alloc(rdev, ring, ndw); |
366 | if (r) { | 366 | if (r) { |
367 | mutex_unlock(&ring->mutex); | 367 | mutex_unlock(&rdev->ring_lock); |
368 | return r; | 368 | return r; |
369 | } | 369 | } |
370 | return 0; | 370 | return 0; |
@@ -389,20 +389,25 @@ void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring) | |||
389 | void radeon_ring_unlock_commit(struct radeon_device *rdev, struct radeon_ring *ring) | 389 | void radeon_ring_unlock_commit(struct radeon_device *rdev, struct radeon_ring *ring) |
390 | { | 390 | { |
391 | radeon_ring_commit(rdev, ring); | 391 | radeon_ring_commit(rdev, ring); |
392 | mutex_unlock(&ring->mutex); | 392 | mutex_unlock(&rdev->ring_lock); |
393 | } | 393 | } |
394 | 394 | ||
395 | void radeon_ring_unlock_undo(struct radeon_device *rdev, struct radeon_ring *ring) | 395 | void radeon_ring_undo(struct radeon_ring *ring) |
396 | { | 396 | { |
397 | ring->wptr = ring->wptr_old; | 397 | ring->wptr = ring->wptr_old; |
398 | mutex_unlock(&ring->mutex); | 398 | } |
399 | |||
400 | void radeon_ring_unlock_undo(struct radeon_device *rdev, struct radeon_ring *ring) | ||
401 | { | ||
402 | radeon_ring_undo(ring); | ||
403 | mutex_unlock(&rdev->ring_lock); | ||
399 | } | 404 | } |
400 | 405 | ||
401 | void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring *ring) | 406 | void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring *ring) |
402 | { | 407 | { |
403 | int r; | 408 | int r; |
404 | 409 | ||
405 | mutex_lock(&ring->mutex); | 410 | mutex_lock(&rdev->ring_lock); |
406 | radeon_ring_free_size(rdev, ring); | 411 | radeon_ring_free_size(rdev, ring); |
407 | if (ring->rptr == ring->wptr) { | 412 | if (ring->rptr == ring->wptr) { |
408 | r = radeon_ring_alloc(rdev, ring, 1); | 413 | r = radeon_ring_alloc(rdev, ring, 1); |
@@ -411,7 +416,7 @@ void radeon_ring_force_activity(struct radeon_device *rdev, struct radeon_ring * | |||
411 | radeon_ring_commit(rdev, ring); | 416 | radeon_ring_commit(rdev, ring); |
412 | } | 417 | } |
413 | } | 418 | } |
414 | mutex_unlock(&ring->mutex); | 419 | mutex_unlock(&rdev->ring_lock); |
415 | } | 420 | } |
416 | 421 | ||
417 | void radeon_ring_lockup_update(struct radeon_ring *ring) | 422 | void radeon_ring_lockup_update(struct radeon_ring *ring) |
@@ -520,11 +525,12 @@ void radeon_ring_fini(struct radeon_device *rdev, struct radeon_ring *ring) | |||
520 | int r; | 525 | int r; |
521 | struct radeon_bo *ring_obj; | 526 | struct radeon_bo *ring_obj; |
522 | 527 | ||
523 | mutex_lock(&ring->mutex); | 528 | mutex_lock(&rdev->ring_lock); |
524 | ring_obj = ring->ring_obj; | 529 | ring_obj = ring->ring_obj; |
530 | ring->ready = false; | ||
525 | ring->ring = NULL; | 531 | ring->ring = NULL; |
526 | ring->ring_obj = NULL; | 532 | ring->ring_obj = NULL; |
527 | mutex_unlock(&ring->mutex); | 533 | mutex_unlock(&rdev->ring_lock); |
528 | 534 | ||
529 | if (ring_obj) { | 535 | if (ring_obj) { |
530 | r = radeon_bo_reserve(ring_obj, false); | 536 | r = radeon_bo_reserve(ring_obj, false); |