diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-08 06:13:05 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:24 -0500 |
commit | e86f9ceee19ec028ae79a09fe1eaabf315d67969 (patch) | |
tree | 5f9863ae2b5d30ff4dc3579d0395ea486d735d92 /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |
parent | 9f2ade33e659250a810e5bdab0c602085792d5b6 (diff) |
drm/amdgpu: move sync into job object
No need to keep that for every IB.
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 4b2c176b83f2..b5bdd5d59b58 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |||
@@ -74,8 +74,6 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
74 | ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo); | 74 | ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo); |
75 | } | 75 | } |
76 | 76 | ||
77 | amdgpu_sync_create(&ib->sync); | ||
78 | |||
79 | ib->vm = vm; | 77 | ib->vm = vm; |
80 | 78 | ||
81 | return 0; | 79 | return 0; |
@@ -91,7 +89,6 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
91 | */ | 89 | */ |
92 | void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib) | 90 | void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib) |
93 | { | 91 | { |
94 | amdgpu_sync_free(&ib->sync); | ||
95 | amdgpu_sa_bo_free(adev, &ib->sa_bo, &ib->fence->base); | 92 | amdgpu_sa_bo_free(adev, &ib->sa_bo, &ib->fence->base); |
96 | if (ib->fence) | 93 | if (ib->fence) |
97 | fence_put(&ib->fence->base); | 94 | fence_put(&ib->fence->base); |
@@ -121,6 +118,7 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib) | |||
121 | */ | 118 | */ |
122 | int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, | 119 | int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, |
123 | struct amdgpu_ib *ibs, void *owner, | 120 | struct amdgpu_ib *ibs, void *owner, |
121 | struct fence *last_vm_update, | ||
124 | struct fence **f) | 122 | struct fence **f) |
125 | { | 123 | { |
126 | struct amdgpu_device *adev = ring->adev; | 124 | struct amdgpu_device *adev = ring->adev; |
@@ -152,16 +150,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, | |||
152 | return r; | 150 | return r; |
153 | } | 151 | } |
154 | 152 | ||
155 | r = amdgpu_sync_wait(&ibs->sync); | ||
156 | if (r) { | ||
157 | amdgpu_ring_undo(ring); | ||
158 | dev_err(adev->dev, "failed to sync wait (%d)\n", r); | ||
159 | return r; | ||
160 | } | ||
161 | |||
162 | if (vm) { | 153 | if (vm) { |
163 | /* do context switch */ | 154 | /* do context switch */ |
164 | amdgpu_vm_flush(ring, vm, ib->sync.last_vm_update); | 155 | amdgpu_vm_flush(ring, vm, last_vm_update); |
165 | 156 | ||
166 | if (ring->funcs->emit_gds_switch) | 157 | if (ring->funcs->emit_gds_switch) |
167 | amdgpu_ring_emit_gds_switch(ring, ib->vm->ids[ring->idx].id, | 158 | amdgpu_ring_emit_gds_switch(ring, ib->vm->ids[ring->idx].id, |