drm/amd/display: fix the white screen issue when >= 64GB DRAM
authorjsg <jsg@openbsd.org>
Mon, 25 Sep 2023 03:16:49 +0000 (03:16 +0000)
committerjsg <jsg@openbsd.org>
Mon, 25 Sep 2023 03:16:49 +0000 (03:16 +0000)
From Yifan Zhang
4422080e777e3fa740e2920fe4de53cfad7fcef2 in linux-6.1.y/6.1.55
ef064187a9709393a981a56cce1e31880fd97107 in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 572c3c8..6d5c0a0 100644 (file)
@@ -1267,11 +1267,15 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_
 
        pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
 
-       page_table_start.high_part = (u32)(adev->gmc.gart_start >> 44) & 0xF;
-       page_table_start.low_part = (u32)(adev->gmc.gart_start >> 12);
-       page_table_end.high_part = (u32)(adev->gmc.gart_end >> 44) & 0xF;
-       page_table_end.low_part = (u32)(adev->gmc.gart_end >> 12);
-       page_table_base.high_part = upper_32_bits(pt_base) & 0xF;
+       page_table_start.high_part = upper_32_bits(adev->gmc.gart_start >>
+                                                  AMDGPU_GPU_PAGE_SHIFT);
+       page_table_start.low_part = lower_32_bits(adev->gmc.gart_start >>
+                                                 AMDGPU_GPU_PAGE_SHIFT);
+       page_table_end.high_part = upper_32_bits(adev->gmc.gart_end >>
+                                                AMDGPU_GPU_PAGE_SHIFT);
+       page_table_end.low_part = lower_32_bits(adev->gmc.gart_end >>
+                                               AMDGPU_GPU_PAGE_SHIFT);
+       page_table_base.high_part = upper_32_bits(pt_base);
        page_table_base.low_part = lower_32_bits(pt_base);
 
        pa_config->system_aperture.start_addr = (uint64_t)logical_addr_low << 18;