Skip to contentSkip to conversation

drm/amdgpu/atomfirmware: fix LPDDR5 width reporting

PATCH In review Alex Deucher 2 participants 2 messages Jun 15, 2023

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/atomfirmware: fix LPDDR5 width reporting

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

---
 .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c   | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +12 -6
index ef4b9a41f20a..0b7f4c4d58e5 100644
@@ -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;
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Regards,
Hawking

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: amd-gfx <[email protected]> on behalf of Alex Deucher <[email protected]>
Sent: Friday, June 16, 2023 6:13:17 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/atomfirmware: fix LPDDR5 width reporting

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

---
 .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c   | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +12 -6
index ef4b9a41f20a..0b7f4c4d58e5 100644
@@ -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;

--
2.40.1