diff options
author | Christian König <christian.koenig@amd.com> | 2016-06-15 07:44:04 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 14:54:41 -0400 |
commit | 281d144ddd4f6b3944c32ab0f346b03f0de0e6b8 (patch) | |
tree | 384ec5f120b6f6a3ad9fd40d1bc757200fd0370c /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 3ddf4ad9179779693a7656e67872fc37cc49e92b (diff) |
drm/amdgpu: save the PD addr before scheduling the job
When we pipeline evictions the page directory could already be
moving somewhere else when grab_id is called.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 18daa2d64d57..adb87789cc34 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -177,7 +177,6 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, | |||
177 | struct amdgpu_sync *sync, struct fence *fence, | 177 | struct amdgpu_sync *sync, struct fence *fence, |
178 | unsigned *vm_id, uint64_t *vm_pd_addr) | 178 | unsigned *vm_id, uint64_t *vm_pd_addr) |
179 | { | 179 | { |
180 | uint64_t pd_addr = amdgpu_bo_gpu_offset(vm->page_directory); | ||
181 | struct amdgpu_device *adev = ring->adev; | 180 | struct amdgpu_device *adev = ring->adev; |
182 | struct fence *updates = sync->last_vm_update; | 181 | struct fence *updates = sync->last_vm_update; |
183 | struct amdgpu_vm_id *id, *idle; | 182 | struct amdgpu_vm_id *id, *idle; |
@@ -250,7 +249,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, | |||
250 | if (atomic64_read(&id->owner) != vm->client_id) | 249 | if (atomic64_read(&id->owner) != vm->client_id) |
251 | continue; | 250 | continue; |
252 | 251 | ||
253 | if (pd_addr != id->pd_gpu_addr) | 252 | if (*vm_pd_addr != id->pd_gpu_addr) |
254 | continue; | 253 | continue; |
255 | 254 | ||
256 | if (!same_ring && | 255 | if (!same_ring && |
@@ -298,14 +297,13 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, | |||
298 | fence_put(id->flushed_updates); | 297 | fence_put(id->flushed_updates); |
299 | id->flushed_updates = fence_get(updates); | 298 | id->flushed_updates = fence_get(updates); |
300 | 299 | ||
301 | id->pd_gpu_addr = pd_addr; | 300 | id->pd_gpu_addr = *vm_pd_addr; |
302 | 301 | ||
303 | list_move_tail(&id->list, &adev->vm_manager.ids_lru); | 302 | list_move_tail(&id->list, &adev->vm_manager.ids_lru); |
304 | atomic64_set(&id->owner, vm->client_id); | 303 | atomic64_set(&id->owner, vm->client_id); |
305 | vm->ids[ring->idx] = id; | 304 | vm->ids[ring->idx] = id; |
306 | 305 | ||
307 | *vm_id = id - adev->vm_manager.ids; | 306 | *vm_id = id - adev->vm_manager.ids; |
308 | *vm_pd_addr = pd_addr; | ||
309 | trace_amdgpu_vm_grab_id(vm, ring->idx, *vm_id, *vm_pd_addr); | 307 | trace_amdgpu_vm_grab_id(vm, ring->idx, *vm_id, *vm_pd_addr); |
310 | 308 | ||
311 | error: | 309 | error: |