diff options
author | Christian König <christian.koenig@amd.com> | 2016-09-16 05:46:23 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-28 16:16:21 -0400 |
commit | 0fc8683e568f228c08321fd99756f6230c98651b (patch) | |
tree | 4332ec672ea7e76eab1f9c09f781417a734acc33 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 765e7fbf081d0e8bd22b35468a1c016358b46179 (diff) |
drm/amdgpu: allocate GTT space for shadow VM page tables
We need to access those with the system domain.
Fixes fallout from only allocating GTT space on demand.
Signed-off-by: Christian König <christian.koenig@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 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index c4985a727620..4ff285aae9f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -552,6 +552,10 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
552 | if (r) | 552 | if (r) |
553 | goto error; | 553 | goto error; |
554 | 554 | ||
555 | r = amdgpu_ttm_bind(&bo->tbo, &bo->tbo.mem); | ||
556 | if (r) | ||
557 | goto error; | ||
558 | |||
555 | addr = amdgpu_bo_gpu_offset(bo); | 559 | addr = amdgpu_bo_gpu_offset(bo); |
556 | entries = amdgpu_bo_size(bo) / 8; | 560 | entries = amdgpu_bo_size(bo) / 8; |
557 | 561 | ||
@@ -625,6 +629,11 @@ static int amdgpu_vm_update_pd_or_shadow(struct amdgpu_device *adev, | |||
625 | 629 | ||
626 | if (!pd) | 630 | if (!pd) |
627 | return 0; | 631 | return 0; |
632 | |||
633 | r = amdgpu_ttm_bind(&pd->tbo, &pd->tbo.mem); | ||
634 | if (r) | ||
635 | return r; | ||
636 | |||
628 | pd_addr = amdgpu_bo_gpu_offset(pd); | 637 | pd_addr = amdgpu_bo_gpu_offset(pd); |
629 | ring = container_of(vm->entity.sched, struct amdgpu_ring, sched); | 638 | ring = container_of(vm->entity.sched, struct amdgpu_ring, sched); |
630 | 639 | ||
@@ -650,6 +659,14 @@ static int amdgpu_vm_update_pd_or_shadow(struct amdgpu_device *adev, | |||
650 | if (bo == NULL) | 659 | if (bo == NULL) |
651 | continue; | 660 | continue; |
652 | 661 | ||
662 | if (bo->shadow) { | ||
663 | struct amdgpu_bo *shadow = bo->shadow; | ||
664 | |||
665 | r = amdgpu_ttm_bind(&shadow->tbo, &shadow->tbo.mem); | ||
666 | if (r) | ||
667 | return r; | ||
668 | } | ||
669 | |||
653 | pt = amdgpu_bo_gpu_offset(bo); | 670 | pt = amdgpu_bo_gpu_offset(bo); |
654 | if (!shadow) { | 671 | if (!shadow) { |
655 | if (vm->page_tables[pt_idx].addr == pt) | 672 | if (vm->page_tables[pt_idx].addr == pt) |