Commit 68470ae7 authored by Jerome Glisse's avatar Jerome Glisse Committed by Dave Airlie

drm/radeon: move the semaphore from the fence into the ib

It never really belonged there in the first place.
Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 7c0d409d
...@@ -272,7 +272,6 @@ struct radeon_fence { ...@@ -272,7 +272,6 @@ struct radeon_fence {
uint64_t seq; uint64_t seq;
/* RB, DMA, etc. */ /* RB, DMA, etc. */
unsigned ring; unsigned ring;
struct radeon_semaphore *semaphore;
}; };
int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring); 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,13 +623,14 @@ void radeon_irq_kms_pflip_irq_put(struct radeon_device *rdev, int crtc);
*/ */
struct radeon_ib { struct radeon_ib {
struct radeon_sa_bo *sa_bo; struct radeon_sa_bo *sa_bo;
uint32_t length_dw; uint32_t length_dw;
uint64_t gpu_addr; uint64_t gpu_addr;
uint32_t *ptr; uint32_t *ptr;
struct radeon_fence *fence; struct radeon_fence *fence;
unsigned vm_id; unsigned vm_id;
bool is_const_ib; bool is_const_ib;
struct radeon_semaphore *semaphore;
}; };
struct radeon_ring { struct radeon_ring {
......
...@@ -138,12 +138,12 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p) ...@@ -138,12 +138,12 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
return 0; return 0;
} }
r = radeon_semaphore_create(p->rdev, &p->ib->fence->semaphore); r = radeon_semaphore_create(p->rdev, &p->ib->semaphore);
if (r) { if (r) {
return r; return r;
} }
return radeon_semaphore_sync_rings(p->rdev, p->ib->fence->semaphore, return radeon_semaphore_sync_rings(p->rdev, p->ib->semaphore,
sync_to_ring, p->ring); sync_to_ring, p->ring);
} }
......
...@@ -139,8 +139,6 @@ static void radeon_fence_destroy(struct kref *kref) ...@@ -139,8 +139,6 @@ static void radeon_fence_destroy(struct kref *kref)
fence = container_of(kref, struct radeon_fence, kref); fence = container_of(kref, struct radeon_fence, kref);
fence->seq = RADEON_FENCE_NOTEMITED_SEQ; fence->seq = RADEON_FENCE_NOTEMITED_SEQ;
if (fence->semaphore)
radeon_semaphore_free(fence->rdev, fence->semaphore, NULL);
kfree(fence); kfree(fence);
} }
...@@ -156,7 +154,6 @@ int radeon_fence_create(struct radeon_device *rdev, ...@@ -156,7 +154,6 @@ int radeon_fence_create(struct radeon_device *rdev,
(*fence)->rdev = rdev; (*fence)->rdev = rdev;
(*fence)->seq = RADEON_FENCE_NOTEMITED_SEQ; (*fence)->seq = RADEON_FENCE_NOTEMITED_SEQ;
(*fence)->ring = ring; (*fence)->ring = ring;
(*fence)->semaphore = NULL;
return 0; return 0;
} }
......
...@@ -93,6 +93,7 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, ...@@ -93,6 +93,7 @@ int radeon_ib_get(struct radeon_device *rdev, int ring,
(*ib)->gpu_addr = radeon_sa_bo_gpu_addr((*ib)->sa_bo); (*ib)->gpu_addr = radeon_sa_bo_gpu_addr((*ib)->sa_bo);
(*ib)->vm_id = 0; (*ib)->vm_id = 0;
(*ib)->is_const_ib = false; (*ib)->is_const_ib = false;
(*ib)->semaphore = NULL;
return 0; return 0;
} }
...@@ -105,6 +106,7 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib) ...@@ -105,6 +106,7 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib)
if (tmp == NULL) { if (tmp == NULL) {
return; return;
} }
radeon_semaphore_free(rdev, tmp->semaphore, tmp->fence);
radeon_sa_bo_free(rdev, &tmp->sa_bo, tmp->fence); radeon_sa_bo_free(rdev, &tmp->sa_bo, tmp->fence);
radeon_fence_unref(&tmp->fence); radeon_fence_unref(&tmp->fence);
kfree(tmp); kfree(tmp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment