]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu/atomfirmware: fix LPDDR5 width reporting
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Jun 2023 16:43:30 +0000 (12:43 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Jun 2023 19:35:16 +0000 (15:35 -0400)
LPDDR5 channels are 32 bit rather than 64, report the width properly
in the log.

v2: Only LPDDR5 are 32 bits per channel.  DDR5 is 64 bits per channel

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2468
Acked-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

index ef4b9a41f20ad4b134bb565388be3779999d73a3..0b7f4c4d58e58828d48f5a1435fb99b263e5cf35 100644 (file)
@@ -327,10 +327,13 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
                                        mem_channel_number = igp_info->v11.umachannelnumber;
                                        if (!mem_channel_number)
                                                mem_channel_number = 1;
-                                       /* channel width is 64 */
-                                       if (vram_width)
-                                               *vram_width = mem_channel_number * 64;
                                        mem_type = igp_info->v11.memorytype;
+                                       if (mem_type == LpDdr5MemType)
+                                               mem_channel_width = 32;
+                                       else
+                                               mem_channel_width = 64;
+                                       if (vram_width)
+                                               *vram_width = mem_channel_number * mem_channel_width;
                                        if (vram_type)
                                                *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
                                        break;
@@ -345,10 +348,13 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
                                        mem_channel_number = igp_info->v21.umachannelnumber;
                                        if (!mem_channel_number)
                                                mem_channel_number = 1;
-                                       /* channel width is 64 */
-                                       if (vram_width)
-                                               *vram_width = mem_channel_number * 64;
                                        mem_type = igp_info->v21.memorytype;
+                                       if (mem_type == LpDdr5MemType)
+                                               mem_channel_width = 32;
+                                       else
+                                               mem_channel_width = 64;
+                                       if (vram_width)
+                                               *vram_width = mem_channel_number * mem_channel_width;
                                        if (vram_type)
                                                *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
                                        break;