diff options
author | Christian König <christian.koenig@amd.com> | 2018-09-21 12:09:59 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-07 17:53:45 -0500 |
commit | 0aa7aa24cc11720a05b4492345f0adba8373c226 (patch) | |
tree | f4ba93248ad15f996e960530b5f7a974c1c0e290 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 049aca4363d8af87cab8d53de5401602db3b9999 (diff) |
drm/amdgpu: always reserve two slots for the VM
And drop the now superflous extra reservations.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Huang Rui <ray.huang@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 | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 39fb5d24cc51..b303ac79c2f6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -617,7 +617,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, | |||
617 | { | 617 | { |
618 | entry->priority = 0; | 618 | entry->priority = 0; |
619 | entry->tv.bo = &vm->root.base.bo->tbo; | 619 | entry->tv.bo = &vm->root.base.bo->tbo; |
620 | entry->tv.num_shared = 1; | 620 | /* One for the VM updates and one for the CS job */ |
621 | entry->tv.num_shared = 2; | ||
621 | entry->user_pages = NULL; | 622 | entry->user_pages = NULL; |
622 | list_add(&entry->tv.head, validated); | 623 | list_add(&entry->tv.head, validated); |
623 | } | 624 | } |
@@ -773,10 +774,6 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
773 | 774 | ||
774 | ring = container_of(vm->entity.rq->sched, struct amdgpu_ring, sched); | 775 | ring = container_of(vm->entity.rq->sched, struct amdgpu_ring, sched); |
775 | 776 | ||
776 | r = reservation_object_reserve_shared(bo->tbo.resv, 1); | ||
777 | if (r) | ||
778 | return r; | ||
779 | |||
780 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | 777 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); |
781 | if (r) | 778 | if (r) |
782 | goto error; | 779 | goto error; |
@@ -1842,10 +1839,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, | |||
1842 | if (r) | 1839 | if (r) |
1843 | goto error_free; | 1840 | goto error_free; |
1844 | 1841 | ||
1845 | r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv, 1); | ||
1846 | if (r) | ||
1847 | goto error_free; | ||
1848 | |||
1849 | r = amdgpu_vm_update_ptes(¶ms, start, last + 1, addr, flags); | 1842 | r = amdgpu_vm_update_ptes(¶ms, start, last + 1, addr, flags); |
1850 | if (r) | 1843 | if (r) |
1851 | goto error_free; | 1844 | goto error_free; |
@@ -3026,6 +3019,10 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
3026 | if (r) | 3019 | if (r) |
3027 | goto error_free_root; | 3020 | goto error_free_root; |
3028 | 3021 | ||
3022 | r = reservation_object_reserve_shared(root->tbo.resv, 1); | ||
3023 | if (r) | ||
3024 | goto error_unreserve; | ||
3025 | |||
3029 | r = amdgpu_vm_clear_bo(adev, vm, root, | 3026 | r = amdgpu_vm_clear_bo(adev, vm, root, |
3030 | adev->vm_manager.root_level, | 3027 | adev->vm_manager.root_level, |
3031 | vm->pte_support_ats); | 3028 | vm->pte_support_ats); |