From: Christian König Date: Fri, 7 Sep 2018 12:21:15 +0000 (+0200) Subject: drm/amdgpu: use the maximum possible fragment size on Vega/Raven X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1b1d5c43db58d236d4a6c9700ef9395b3fc129fb;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: use the maximum possible fragment size on Vega/Raven The fragment size controls only the L1 on Vega/Raven and we now don't have any extra overhead any more because of larger fragments. Signed-off-by: Christian König Reviewed-by: Huang Rui Reviewed-by: Felix Kuehling Acked-by: Junwei Zhang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 45343501c1f3..2d2d6197c3dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1540,8 +1540,16 @@ static void amdgpu_vm_fragment(struct amdgpu_pte_update_params *params, * larger. Thus, we try to use large fragments wherever possible. * Userspace can support this by aligning virtual base address and * allocation size to the fragment size. + * + * Starting with Vega10 the fragment size only controls the L1. The L2 + * is now directly feed with small/huge/giant pages from the walker. */ - unsigned max_frag = params->adev->vm_manager.fragment_size; + unsigned max_frag; + + if (params->adev->asic_type < CHIP_VEGA10) + max_frag = params->adev->vm_manager.fragment_size; + else + max_frag = 31; /* system pages are non continuously */ if (params->src || !(flags & AMDGPU_PTE_VALID)) {