aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-11-19 08:01:22 -0500
committerAlex Deucher <alexander.deucher@amd.com>2014-11-20 13:00:16 -0500
commit975700d2cc84408efa9b2360e38b1ab95368556f (patch)
tree6febce37bebd30a98b36061712d374588434b78e /drivers/gpu/drm/radeon/radeon.h
parente0602c35fe3bcbe5fe9179be78882b3101780781 (diff)
drm/radeon: split semaphore and sync object handling v2
Previously we just allocated space for four hardware semaphores in each software semaphore object. Make software semaphore objects represent only one hardware semaphore address again by splitting the sync code into it's own object. v2: fix typo in comment Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 39f7716343a4..7cda6d77aeb0 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -150,9 +150,6 @@ extern int radeon_backlight;
150/* number of hw syncs before falling back on blocking */ 150/* number of hw syncs before falling back on blocking */
151#define RADEON_NUM_SYNCS 4 151#define RADEON_NUM_SYNCS 4
152 152
153/* number of hw syncs before falling back on blocking */
154#define RADEON_NUM_SYNCS 4
155
156/* hardcode those limit for now */ 153/* hardcode those limit for now */
157#define RADEON_VA_IB_OFFSET (1 << 20) 154#define RADEON_VA_IB_OFFSET (1 << 20)
158#define RADEON_VA_RESERVED_SIZE (8 << 20) 155#define RADEON_VA_RESERVED_SIZE (8 << 20)
@@ -576,10 +573,9 @@ int radeon_mode_dumb_mmap(struct drm_file *filp,
576 * Semaphores. 573 * Semaphores.
577 */ 574 */
578struct radeon_semaphore { 575struct radeon_semaphore {
579 struct radeon_sa_bo *sa_bo; 576 struct radeon_sa_bo *sa_bo;
580 signed waiters; 577 signed waiters;
581 uint64_t gpu_addr; 578 uint64_t gpu_addr;
582 struct radeon_fence *sync_to[RADEON_NUM_RINGS];
583}; 579};
584 580
585int radeon_semaphore_create(struct radeon_device *rdev, 581int radeon_semaphore_create(struct radeon_device *rdev,
@@ -588,20 +584,32 @@ bool radeon_semaphore_emit_signal(struct radeon_device *rdev, int ring,
588 struct radeon_semaphore *semaphore); 584 struct radeon_semaphore *semaphore);
589bool radeon_semaphore_emit_wait(struct radeon_device *rdev, int ring, 585bool radeon_semaphore_emit_wait(struct radeon_device *rdev, int ring,
590 struct radeon_semaphore *semaphore); 586 struct radeon_semaphore *semaphore);
591void radeon_semaphore_sync_fence(struct radeon_semaphore *semaphore,
592 struct radeon_fence *fence);
593int radeon_semaphore_sync_resv(struct radeon_device *rdev,
594 struct radeon_semaphore *semaphore,
595 struct reservation_object *resv,
596 bool shared);
597int radeon_semaphore_sync_rings(struct radeon_device *rdev,
598 struct radeon_semaphore *semaphore,
599 int waiting_ring);
600void radeon_semaphore_free(struct radeon_device *rdev, 587void radeon_semaphore_free(struct radeon_device *rdev,
601 struct radeon_semaphore **semaphore, 588 struct radeon_semaphore **semaphore,
602 struct radeon_fence *fence); 589 struct radeon_fence *fence);
603 590
604/* 591/*
592 * Synchronization
593 */
594struct radeon_sync {
595 struct radeon_semaphore *semaphores[RADEON_NUM_SYNCS];
596 struct radeon_fence *sync_to[RADEON_NUM_RINGS];
597};
598
599void radeon_sync_create(struct radeon_sync *sync);
600void radeon_sync_fence(struct radeon_sync *sync,
601 struct radeon_fence *fence);
602int radeon_sync_resv(struct radeon_device *rdev,
603 struct radeon_sync *sync,
604 struct reservation_object *resv,
605 bool shared);
606int radeon_sync_rings(struct radeon_device *rdev,
607 struct radeon_sync *sync,
608 int waiting_ring);
609void radeon_sync_free(struct radeon_device *rdev, struct radeon_sync *sync,
610 struct radeon_fence *fence);
611
612/*
605 * GART structures, functions & helpers 613 * GART structures, functions & helpers
606 */ 614 */
607struct radeon_mc; 615struct radeon_mc;
@@ -818,7 +826,7 @@ struct radeon_ib {
818 struct radeon_fence *fence; 826 struct radeon_fence *fence;
819 struct radeon_vm *vm; 827 struct radeon_vm *vm;
820 bool is_const_ib; 828 bool is_const_ib;
821 struct radeon_semaphore *semaphore; 829 struct radeon_sync sync;
822}; 830};
823 831
824struct radeon_ring { 832struct radeon_ring {