aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-09-16 08:07:46 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-28 16:16:22 -0400
commit2befa60e4c538a094853ea00ac03b209b7ad272d (patch)
tree6175fc95d8d69dbe627aa670866e535bdc3c206e /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent2a82ec21b9ba342dc90e054458e430f577beca89 (diff)
drm/amdgpu: fix initializing the VM BO shadow
We need to clear the shadows as well. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net> 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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 04aa5a77e953..3a43000bdf8c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1435,6 +1435,15 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
1435 goto error_free; 1435 goto error_free;
1436 } 1436 }
1437 1437
1438 if (pt->shadow) {
1439 r = amdgpu_vm_clear_bo(adev, vm, pt->shadow);
1440 if (r) {
1441 amdgpu_bo_unref(&pt->shadow);
1442 amdgpu_bo_unref(&pt);
1443 goto error_free;
1444 }
1445 }
1446
1438 entry->robj = pt; 1447 entry->robj = pt;
1439 entry->priority = 0; 1448 entry->priority = 0;
1440 entry->tv.bo = &entry->robj->tbo; 1449 entry->tv.bo = &entry->robj->tbo;
@@ -1632,6 +1641,12 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
1632 if (r) 1641 if (r)
1633 goto error_unreserve; 1642 goto error_unreserve;
1634 1643
1644 if (vm->page_directory->shadow) {
1645 r = amdgpu_vm_clear_bo(adev, vm, vm->page_directory->shadow);
1646 if (r)
1647 goto error_unreserve;
1648 }
1649
1635 vm->last_eviction_counter = atomic64_read(&adev->num_evictions); 1650 vm->last_eviction_counter = atomic64_read(&adev->num_evictions);
1636 amdgpu_bo_unreserve(vm->page_directory); 1651 amdgpu_bo_unreserve(vm->page_directory);
1637 1652