diff options
author | Christian König <christian.koenig@amd.com> | 2017-08-18 09:50:17 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-24 11:48:42 -0400 |
commit | 2e8f9fbe985e930055eb55323b8491cc668b178f (patch) | |
tree | 00bef81123e581ae3b780287560156a80e2bddb3 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | db63042b332ae048ca640b3d1aed508973c40c8c (diff) |
drm/amdgpu: fix and cleanup shadow handling
Set the shadow flag on the shadow and not the parent, always bind shadow BOs
during allocation instead of manually, use the reservation_object wrappers
to grab the lock.
This fixes a couple of issues with binding the shadow BOs as well as correctly
evicting them when memory becomes tight.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-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_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ba475af99332..96ec4e2b56e9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -165,14 +165,6 @@ 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 | |||
176 | if (use_cpu_for_update) { | 168 | if (use_cpu_for_update) { |
177 | r = amdgpu_bo_kmap(parent->bo, NULL); | 169 | r = amdgpu_bo_kmap(parent->bo, NULL); |
178 | if (r) | 170 | if (r) |