]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu/gmc12: Init vram_size for A + A
authorHawking Zhang <Hawking.Zhang@amd.com>
Wed, 28 Jan 2026 11:18:28 +0000 (19:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:32:54 +0000 (10:32 -0400)
Calculate vram_size using the XGMI node segment size
and node count for A+A configurations

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c

index 2b5f01f15fac3b428550e5d2611c3270e76ec2a3..ac39011d1268c0d6148a50d16ebbfef26248f094 100644 (file)
@@ -728,9 +728,13 @@ static int gmc_v12_0_mc_init(struct amdgpu_device *adev)
 {
        int r;
 
-       /* size in MB on si */
-       adev->gmc.mc_vram_size =
-               adev->nbio.funcs->get_memsize(adev) * 1024ULL * 1024ULL;
+       if (adev->gmc.xgmi.connected_to_cpu)
+               adev->gmc.mc_vram_size =
+                       adev->gmc.xgmi.node_segment_size * adev->gmc.xgmi.num_physical_nodes;
+       else
+               adev->gmc.mc_vram_size =
+                       adev->nbio.funcs->get_memsize(adev) * 1024ULL * 1024ULL;
+
        adev->gmc.real_vram_size = adev->gmc.mc_vram_size;
 
        if (!(adev->flags & AMD_IS_APU) &&