diff options
author | Christian König <christian.koenig@amd.com> | 2018-08-22 10:44:56 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-27 16:19:49 -0400 |
commit | 284dec4317c8e76f45d3ce922f673c80331812f1 (patch) | |
tree | 52fb2d23d36a9ee30c47142d4e1a4d2c0820fca4 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 24a8d289d532003a167b8f52f97c50430db76ca3 (diff) |
drm/amdgpu: enable GTT PD/PT for raven v3
Should work on Vega10 as well, but with an obvious performance hit.
Older APUs can be enabled as well, but will probably be more work.
v2: fix error checking
v3: use more general check
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@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 | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index f17fb3c63f43..25b390dc8636 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -342,6 +342,9 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
342 | list_move(&bo_base->vm_status, &vm->moved); | 342 | list_move(&bo_base->vm_status, &vm->moved); |
343 | spin_unlock(&vm->moved_lock); | 343 | spin_unlock(&vm->moved_lock); |
344 | } else { | 344 | } else { |
345 | r = amdgpu_ttm_alloc_gart(&bo->tbo); | ||
346 | if (r) | ||
347 | break; | ||
345 | list_move(&bo_base->vm_status, &vm->relocated); | 348 | list_move(&bo_base->vm_status, &vm->relocated); |
346 | } | 349 | } |
347 | } | 350 | } |
@@ -417,6 +420,10 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
417 | if (r) | 420 | if (r) |
418 | goto error; | 421 | goto error; |
419 | 422 | ||
423 | r = amdgpu_ttm_alloc_gart(&bo->tbo); | ||
424 | if (r) | ||
425 | return r; | ||
426 | |||
420 | r = amdgpu_job_alloc_with_ib(adev, 64, &job); | 427 | r = amdgpu_job_alloc_with_ib(adev, 64, &job); |
421 | if (r) | 428 | if (r) |
422 | goto error; | 429 | goto error; |
@@ -482,7 +489,12 @@ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
482 | bp->size = amdgpu_vm_bo_size(adev, level); | 489 | bp->size = amdgpu_vm_bo_size(adev, level); |
483 | bp->byte_align = AMDGPU_GPU_PAGE_SIZE; | 490 | bp->byte_align = AMDGPU_GPU_PAGE_SIZE; |
484 | bp->domain = AMDGPU_GEM_DOMAIN_VRAM; | 491 | bp->domain = AMDGPU_GEM_DOMAIN_VRAM; |
485 | bp->flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; | 492 | if (bp->size <= PAGE_SIZE && adev->asic_type >= CHIP_VEGA10 && |
493 | adev->flags & AMD_IS_APU) | ||
494 | bp->domain |= AMDGPU_GEM_DOMAIN_GTT; | ||
495 | bp->domain = amdgpu_bo_get_preferred_pin_domain(adev, bp->domain); | ||
496 | bp->flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS | | ||
497 | AMDGPU_GEM_CREATE_CPU_GTT_USWC; | ||
486 | if (vm->use_cpu_for_update) | 498 | if (vm->use_cpu_for_update) |
487 | bp->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; | 499 | bp->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; |
488 | else | 500 | else |