]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/amdgpu: Correct VRAM width for APUs with GMC9
authorTom St Denis <tom.stdenis@amd.com>
Mon, 26 Feb 2018 14:09:26 +0000 (09:09 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Feb 2018 04:09:47 +0000 (23:09 -0500)
DDR4 has a 64-bit width not 128-bits.  It was reporting
twice the width.  Tested with my Ryzen 2400G.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index bc4bd5e7ac9424012e6f48ed8d86bb0978b3f16c..4dd469188e2b46b6b6d5a3e025153592f2aa5b4e 100644 (file)
@@ -722,7 +722,10 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
                adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
        if (!adev->gmc.vram_width) {
                /* hbm memory channel size */
-               chansize = 128;
+               if (adev->flags & AMD_IS_APU)
+                       chansize = 64;
+               else
+                       chansize = 128;
 
                tmp = RREG32_SOC15(DF, 0, mmDF_CS_AON0_DramBaseAddress0);
                tmp &= DF_CS_AON0_DramBaseAddress0__IntLvNumChan_MASK;