提交 0410c5e5 编写于 作者: C Christian König 提交者: Alex Deucher

drm/amdgpu: fix amdgpu_vm_num_entries

The block size only affects the leave nodes, everything else is fixed.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 50783147
......@@ -166,17 +166,17 @@ static unsigned amdgpu_vm_level_shift(struct amdgpu_device *adev,
static unsigned amdgpu_vm_num_entries(struct amdgpu_device *adev,
unsigned level)
{
unsigned shift = amdgpu_vm_level_shift(adev, 0);
if (level == 0)
/* For the root directory */
return adev->vm_manager.max_pfn >>
(adev->vm_manager.block_size *
adev->vm_manager.num_level);
else if (level == adev->vm_manager.num_level)
return round_up(adev->vm_manager.max_pfn, 1 << shift) >> shift;
else if (level != adev->vm_manager.num_level)
/* Everything in between */
return 512;
else
/* For the page tables on the leaves */
return AMDGPU_VM_PTE_COUNT(adev);
else
/* Everything in between */
return 1 << adev->vm_manager.block_size;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册