From: Hawking Zhang <[email protected]>

Initialize page table depth and page table block
size for 2-level gart table construction on A + A
platform

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
index a68a398afebec..f5a328bb421db 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
@@ -765,6 +765,14 @@ static int gmc_v12_0_gart_init(struct amdgpu_device *adev)
                return 0;
        }
 
+       if (amdgpu_gmc_is_pdb0_enabled(adev)) {
+               adev->gmc.vmid0_page_table_depth = 1;
+               adev->gmc.vmid0_page_table_block_size = 12;
+       } else {
+               adev->gmc.vmid0_page_table_depth = 0;
+               adev->gmc.vmid0_page_table_block_size = 0;
+       }
+
        /* Initialize common gart structure */
        r = amdgpu_gart_init(adev);
        if (r)
-- 
2.53.0

Reply via email to