diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-13 06:51:31 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-17 15:45:57 -0400 |
commit | a35ebc8c12cc724022f39b32ffb17f63ff16effd (patch) | |
tree | b7ba921616d45c75ff5ea6cdd86f72662148baea /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | b636922553ee2c47b9e3955c5665b8996dfcdbd7 (diff) |
drm/amdgpu: only bind VM shadows after validation v2
No need to do this on every CS.
v2: remove all other bind, reorder code
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@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 | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ff8ab2074a59..f35618e50005 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -165,6 +165,14 @@ static int amdgpu_vm_validate_level(struct amdgpu_vm_pt *parent, | |||
165 | unsigned i; | 165 | unsigned i; |
166 | int r; | 166 | int r; |
167 | 167 | ||
168 | if (parent->bo->shadow) { | ||
169 | struct amdgpu_bo *shadow = parent->bo->shadow; | ||
170 | |||
171 | r = amdgpu_ttm_bind(&shadow->tbo, &shadow->tbo.mem); | ||
172 | if (r) | ||
173 | return r; | ||
174 | } | ||
175 | |||
168 | if (use_cpu_for_update) { | 176 | if (use_cpu_for_update) { |
169 | r = amdgpu_bo_kmap(parent->bo, NULL); | 177 | r = amdgpu_bo_kmap(parent->bo, NULL); |
170 | if (r) | 178 | if (r) |
@@ -1038,11 +1046,6 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev, | |||
1038 | 1046 | ||
1039 | params.func = amdgpu_vm_cpu_set_ptes; | 1047 | params.func = amdgpu_vm_cpu_set_ptes; |
1040 | } else { | 1048 | } else { |
1041 | if (shadow) { | ||
1042 | r = amdgpu_ttm_bind(&shadow->tbo, &shadow->tbo.mem); | ||
1043 | if (r) | ||
1044 | return r; | ||
1045 | } | ||
1046 | ring = container_of(vm->entity.sched, struct amdgpu_ring, | 1049 | ring = container_of(vm->entity.sched, struct amdgpu_ring, |
1047 | sched); | 1050 | sched); |
1048 | 1051 | ||
@@ -1078,15 +1081,6 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev, | |||
1078 | if (bo == NULL) | 1081 | if (bo == NULL) |
1079 | continue; | 1082 | continue; |
1080 | 1083 | ||
1081 | if (bo->shadow) { | ||
1082 | struct amdgpu_bo *pt_shadow = bo->shadow; | ||
1083 | |||
1084 | r = amdgpu_ttm_bind(&pt_shadow->tbo, | ||
1085 | &pt_shadow->tbo.mem); | ||
1086 | if (r) | ||
1087 | return r; | ||
1088 | } | ||
1089 | |||
1090 | pt = amdgpu_bo_gpu_offset(bo); | 1084 | pt = amdgpu_bo_gpu_offset(bo); |
1091 | pt = amdgpu_gart_get_vm_pde(adev, pt); | 1085 | pt = amdgpu_gart_get_vm_pde(adev, pt); |
1092 | if (parent->entries[pt_idx].addr == pt || | 1086 | if (parent->entries[pt_idx].addr == pt || |