diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-05-09 09:35:00 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-09 12:22:49 -0400 |
commit | 68470ae7e67fe15b9ab01e1c1c709e6e2485a8e5 (patch) | |
tree | e403d728a22c66484cb37e8e6e4d29f12e54a241 /drivers/gpu/drm | |
parent | 7c0d409db56dab0fb211d7710403456c7b4b794b (diff) |
drm/radeon: move the semaphore from the fence into the ib
It never really belonged there in the first place.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cs.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fence.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_ring.c | 2 |
4 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 617030727ca8..9507be0f4083 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -272,7 +272,6 @@ struct radeon_fence { | |||
272 | uint64_t seq; | 272 | uint64_t seq; |
273 | /* RB, DMA, etc. */ | 273 | /* RB, DMA, etc. */ |
274 | unsigned ring; | 274 | unsigned ring; |
275 | struct radeon_semaphore *semaphore; | ||
276 | }; | 275 | }; |
277 | 276 | ||
278 | int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring); | 277 | int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring); |
@@ -624,13 +623,14 @@ void radeon_irq_kms_pflip_irq_put(struct radeon_device *rdev, int crtc); | |||
624 | */ | 623 | */ |
625 | 624 | ||
626 | struct radeon_ib { | 625 | struct radeon_ib { |
627 | struct radeon_sa_bo *sa_bo; | 626 | struct radeon_sa_bo *sa_bo; |
628 | uint32_t length_dw; | 627 | uint32_t length_dw; |
629 | uint64_t gpu_addr; | 628 | uint64_t gpu_addr; |
630 | uint32_t *ptr; | 629 | uint32_t *ptr; |
631 | struct radeon_fence *fence; | 630 | struct radeon_fence *fence; |
632 | unsigned vm_id; | 631 | unsigned vm_id; |
633 | bool is_const_ib; | 632 | bool is_const_ib; |
633 | struct radeon_semaphore *semaphore; | ||
634 | }; | 634 | }; |
635 | 635 | ||
636 | struct radeon_ring { | 636 | struct radeon_ring { |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 5c065bf2d162..dcfe2a0bcdc0 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -138,12 +138,12 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p) | |||
138 | return 0; | 138 | return 0; |
139 | } | 139 | } |
140 | 140 | ||
141 | r = radeon_semaphore_create(p->rdev, &p->ib->fence->semaphore); | 141 | r = radeon_semaphore_create(p->rdev, &p->ib->semaphore); |
142 | if (r) { | 142 | if (r) { |
143 | return r; | 143 | return r; |
144 | } | 144 | } |
145 | 145 | ||
146 | return radeon_semaphore_sync_rings(p->rdev, p->ib->fence->semaphore, | 146 | return radeon_semaphore_sync_rings(p->rdev, p->ib->semaphore, |
147 | sync_to_ring, p->ring); | 147 | sync_to_ring, p->ring); |
148 | } | 148 | } |
149 | 149 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 3a49311fc711..48ec5e343844 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c | |||
@@ -139,8 +139,6 @@ static void radeon_fence_destroy(struct kref *kref) | |||
139 | 139 | ||
140 | fence = container_of(kref, struct radeon_fence, kref); | 140 | fence = container_of(kref, struct radeon_fence, kref); |
141 | fence->seq = RADEON_FENCE_NOTEMITED_SEQ; | 141 | fence->seq = RADEON_FENCE_NOTEMITED_SEQ; |
142 | if (fence->semaphore) | ||
143 | radeon_semaphore_free(fence->rdev, fence->semaphore, NULL); | ||
144 | kfree(fence); | 142 | kfree(fence); |
145 | } | 143 | } |
146 | 144 | ||
@@ -156,7 +154,6 @@ int radeon_fence_create(struct radeon_device *rdev, | |||
156 | (*fence)->rdev = rdev; | 154 | (*fence)->rdev = rdev; |
157 | (*fence)->seq = RADEON_FENCE_NOTEMITED_SEQ; | 155 | (*fence)->seq = RADEON_FENCE_NOTEMITED_SEQ; |
158 | (*fence)->ring = ring; | 156 | (*fence)->ring = ring; |
159 | (*fence)->semaphore = NULL; | ||
160 | return 0; | 157 | return 0; |
161 | } | 158 | } |
162 | 159 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index b3d6942a2be9..af8e1ee1dc01 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
@@ -93,6 +93,7 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, | |||
93 | (*ib)->gpu_addr = radeon_sa_bo_gpu_addr((*ib)->sa_bo); | 93 | (*ib)->gpu_addr = radeon_sa_bo_gpu_addr((*ib)->sa_bo); |
94 | (*ib)->vm_id = 0; | 94 | (*ib)->vm_id = 0; |
95 | (*ib)->is_const_ib = false; | 95 | (*ib)->is_const_ib = false; |
96 | (*ib)->semaphore = NULL; | ||
96 | 97 | ||
97 | return 0; | 98 | return 0; |
98 | } | 99 | } |
@@ -105,6 +106,7 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib) | |||
105 | if (tmp == NULL) { | 106 | if (tmp == NULL) { |
106 | return; | 107 | return; |
107 | } | 108 | } |
109 | radeon_semaphore_free(rdev, tmp->semaphore, tmp->fence); | ||
108 | radeon_sa_bo_free(rdev, &tmp->sa_bo, tmp->fence); | 110 | radeon_sa_bo_free(rdev, &tmp->sa_bo, tmp->fence); |
109 | radeon_fence_unref(&tmp->fence); | 111 | radeon_fence_unref(&tmp->fence); |
110 | kfree(tmp); | 112 | kfree(tmp); |