<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div>
<div>
<div dir="ltr">
<div>Acked-by: Hawking Zhang <Hawking.Zhang@amd.com></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Regards,</div>
<div dir="ltr">Hawking</div>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div><br>
</div>
Get <a href="https://aka.ms/o0ukef">Outlook for iOS</a></div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Alex Deucher <alexander.deucher@amd.com><br>
<b>Sent:</b> Friday, June 16, 2023 6:13:17 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu/atomfirmware: fix LPDDR5 width reporting</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">LPDDR5 channels are 32 bit rather than 64, report the width properly<br>
in the log.<br>
<br>
v2: Only LPDDR5 are 32 bits per channel. DDR5 is 64 bits per channel<br>
<br>
Link: <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/2468">https://gitlab.freedesktop.org/drm/amd/-/issues/2468</a><br>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com><br>
---<br>
.../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 18 ++++++++++++------<br>
1 file changed, 12 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c<br>
index ef4b9a41f20a..0b7f4c4d58e5 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c<br>
@@ -327,10 +327,13 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,<br>
mem_channel_number = igp_info->v11.umachannelnumber;<br>
if (!mem_channel_number)<br>
mem_channel_number = 1;<br>
- /* channel width is 64 */<br>
- if (vram_width)<br>
- *vram_width = mem_channel_number * 64;<br>
mem_type = igp_info->v11.memorytype;<br>
+ if (mem_type == LpDdr5MemType)<br>
+ mem_channel_width = 32;<br>
+ else<br>
+ mem_channel_width = 64;<br>
+ if (vram_width)<br>
+ *vram_width = mem_channel_number * mem_channel_width;<br>
if (vram_type)<br>
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);<br>
break;<br>
@@ -345,10 +348,13 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,<br>
mem_channel_number = igp_info->v21.umachannelnumber;<br>
if (!mem_channel_number)<br>
mem_channel_number = 1;<br>
- /* channel width is 64 */<br>
- if (vram_width)<br>
- *vram_width = mem_channel_number * 64;<br>
mem_type = igp_info->v21.memorytype;<br>
+ if (mem_type == LpDdr5MemType)<br>
+ mem_channel_width = 32;<br>
+ else<br>
+ mem_channel_width = 64;<br>
+ if (vram_width)<br>
+ *vram_width = mem_channel_number * mem_channel_width;<br>
if (vram_type)<br>
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);<br>
break;<br>
-- <br>
2.40.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>