diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-05-09 09:34:57 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-09 12:22:40 -0400 |
commit | a8c05940bd590d96229bc170a63f14a22fb9c803 (patch) | |
tree | 74619acfa5d70690b437d3477b14513caf22bbc2 /drivers/gpu/drm/radeon/radeon.h | |
parent | c3b7fe8b8a0b717f90a4a0c49cffae27e46e3fb7 (diff) |
drm/radeon: simplify semaphore handling v2
Directly use the suballocator to get small chunks of memory.
It's equally fast and doesn't crash when we encounter a GPU reset.
v2: rebased on new SA interface.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index cc7f16ab257f..45164e101257 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -434,34 +434,13 @@ int radeon_mode_dumb_destroy(struct drm_file *file_priv, | |||
434 | /* | 434 | /* |
435 | * Semaphores. | 435 | * Semaphores. |
436 | */ | 436 | */ |
437 | struct radeon_ring; | ||
438 | |||
439 | #define RADEON_SEMAPHORE_BO_SIZE 256 | ||
440 | |||
441 | struct radeon_semaphore_driver { | ||
442 | rwlock_t lock; | ||
443 | struct list_head bo; | ||
444 | }; | ||
445 | |||
446 | struct radeon_semaphore_bo; | ||
447 | |||
448 | /* everything here is constant */ | 437 | /* everything here is constant */ |
449 | struct radeon_semaphore { | 438 | struct radeon_semaphore { |
450 | struct list_head list; | 439 | struct radeon_sa_bo *sa_bo; |
440 | signed waiters; | ||
451 | uint64_t gpu_addr; | 441 | uint64_t gpu_addr; |
452 | uint32_t *cpu_ptr; | ||
453 | struct radeon_semaphore_bo *bo; | ||
454 | }; | 442 | }; |
455 | 443 | ||
456 | struct radeon_semaphore_bo { | ||
457 | struct list_head list; | ||
458 | struct radeon_ib *ib; | ||
459 | struct list_head free; | ||
460 | struct radeon_semaphore semaphores[RADEON_SEMAPHORE_BO_SIZE/8]; | ||
461 | unsigned nused; | ||
462 | }; | ||
463 | |||
464 | void radeon_semaphore_driver_fini(struct radeon_device *rdev); | ||
465 | int radeon_semaphore_create(struct radeon_device *rdev, | 444 | int radeon_semaphore_create(struct radeon_device *rdev, |
466 | struct radeon_semaphore **semaphore); | 445 | struct radeon_semaphore **semaphore); |
467 | void radeon_semaphore_emit_signal(struct radeon_device *rdev, int ring, | 446 | void radeon_semaphore_emit_signal(struct radeon_device *rdev, int ring, |
@@ -473,7 +452,8 @@ int radeon_semaphore_sync_rings(struct radeon_device *rdev, | |||
473 | bool sync_to[RADEON_NUM_RINGS], | 452 | bool sync_to[RADEON_NUM_RINGS], |
474 | int dst_ring); | 453 | int dst_ring); |
475 | void radeon_semaphore_free(struct radeon_device *rdev, | 454 | void radeon_semaphore_free(struct radeon_device *rdev, |
476 | struct radeon_semaphore *semaphore); | 455 | struct radeon_semaphore *semaphore, |
456 | struct radeon_fence *fence); | ||
477 | 457 | ||
478 | /* | 458 | /* |
479 | * GART structures, functions & helpers | 459 | * GART structures, functions & helpers |
@@ -1540,7 +1520,6 @@ struct radeon_device { | |||
1540 | struct radeon_mman mman; | 1520 | struct radeon_mman mman; |
1541 | struct radeon_fence_driver fence_drv[RADEON_NUM_RINGS]; | 1521 | struct radeon_fence_driver fence_drv[RADEON_NUM_RINGS]; |
1542 | wait_queue_head_t fence_queue; | 1522 | wait_queue_head_t fence_queue; |
1543 | struct radeon_semaphore_driver semaphore_drv; | ||
1544 | struct mutex ring_lock; | 1523 | struct mutex ring_lock; |
1545 | struct radeon_ring ring[RADEON_NUM_RINGS]; | 1524 | struct radeon_ring ring[RADEON_NUM_RINGS]; |
1546 | struct radeon_ib_pool ib_pool; | 1525 | struct radeon_ib_pool ib_pool; |