aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2015-08-02 23:38:09 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:50 -0400
commite40a31159b72742224c249cf57c5313be7ccd629 (patch)
tree6d1bf4338313f616becf5c2394390560db43fbfc
parent1d7dd229f5dded247bc8800f8f4551d3d6314afa (diff)
drm/amdgpu: use kernel fence diretly in amdgpu_bo_fence
Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.h2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 6c63a2c6395c..87d67f8c85c9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -658,13 +658,13 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
658 * @shared: true if fence should be added shared 658 * @shared: true if fence should be added shared
659 * 659 *
660 */ 660 */
661void amdgpu_bo_fence(struct amdgpu_bo *bo, struct amdgpu_fence *fence, 661void amdgpu_bo_fence(struct amdgpu_bo *bo, struct fence *fence,
662 bool shared) 662 bool shared)
663{ 663{
664 struct reservation_object *resv = bo->tbo.resv; 664 struct reservation_object *resv = bo->tbo.resv;
665 665
666 if (shared) 666 if (shared)
667 reservation_object_add_shared_fence(resv, &fence->base); 667 reservation_object_add_shared_fence(resv, fence);
668 else 668 else
669 reservation_object_add_excl_fence(resv, &fence->base); 669 reservation_object_add_excl_fence(resv, fence);
670} 670}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 675bdc30e41d..238465a9ac55 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -161,7 +161,7 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer,
161void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, 161void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
162 struct ttm_mem_reg *new_mem); 162 struct ttm_mem_reg *new_mem);
163int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo); 163int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
164void amdgpu_bo_fence(struct amdgpu_bo *bo, struct amdgpu_fence *fence, 164void amdgpu_bo_fence(struct amdgpu_bo *bo, struct fence *fence,
165 bool shared); 165 bool shared);
166 166
167/* 167/*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index f2166320a5e5..8745d4cc7ae0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -320,7 +320,7 @@ static int amdgpu_vm_run_job(
320 struct amdgpu_cs_parser *sched_job) 320 struct amdgpu_cs_parser *sched_job)
321{ 321{
322 amdgpu_bo_fence(sched_job->job_param.vm.bo, 322 amdgpu_bo_fence(sched_job->job_param.vm.bo,
323 sched_job->ibs[sched_job->num_ibs -1].fence, true); 323 &sched_job->ibs[sched_job->num_ibs -1].fence->base, true);
324 return 0; 324 return 0;
325} 325}
326 326
@@ -397,7 +397,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
397 r = amdgpu_ib_schedule(adev, 1, ib, AMDGPU_FENCE_OWNER_VM); 397 r = amdgpu_ib_schedule(adev, 1, ib, AMDGPU_FENCE_OWNER_VM);
398 if (r) 398 if (r)
399 goto error_free; 399 goto error_free;
400 amdgpu_bo_fence(bo, ib->fence, true); 400 amdgpu_bo_fence(bo, &ib->fence->base, true);
401 } 401 }
402 402
403error_free: 403error_free:
@@ -547,7 +547,7 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev,
547 amdgpu_ib_free(adev, ib); 547 amdgpu_ib_free(adev, ib);
548 return r; 548 return r;
549 } 549 }
550 amdgpu_bo_fence(pd, ib->fence, true); 550 amdgpu_bo_fence(pd, &ib->fence->base, true);
551 } 551 }
552 } 552 }
553 553
@@ -745,7 +745,7 @@ static void amdgpu_vm_fence_pts(struct amdgpu_vm *vm,
745 end >>= amdgpu_vm_block_size; 745 end >>= amdgpu_vm_block_size;
746 746
747 for (i = start; i <= end; ++i) 747 for (i = start; i <= end; ++i)
748 amdgpu_bo_fence(vm->page_tables[i].bo, fence, true); 748 amdgpu_bo_fence(vm->page_tables[i].bo, &fence->base, true);
749} 749}
750 750
751static int amdgpu_vm_bo_update_mapping_run_job( 751static int amdgpu_vm_bo_update_mapping_run_job(