Skip to contentSkip to conversation

drm/amdgpu/atomfirmware: fix parsing of vram_info

PATCH In review Alex Deucher 3 participants 3 messages Jun 14, 2024 – Jun 19, 2024

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/atomfirmware: fix parsing of vram_info

v3.x changed the how vram width was encoded. The previous implementation actually worked correctly for most boards. Fix the implementation to work correctly everywhere.

This fixes the vram width reported in the kernel log on some boards.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 -1
index f932bec6e534..f873dd3cae16 100644
@@ -433,7 +433,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
 						mem_channel_number = vram_info->v30.channel_num;
 						mem_channel_width = vram_info->v30.channel_width;
 						if (vram_width)
-							*vram_width = mem_channel_number * (1 << mem_channel_width);
+							*vram_width = mem_channel_number * 16;
 						break;
 					default:
 						return -EINVAL;
Signature · 1 line
2.45.1
#1 lore raw

Ping?

Alex

Quoted 29 lines · Alex Deucher

v3.x changed the how vram width was encoded. The previous implementation actually worked correctly for most boards. Fix the implementation to work correctly everywhere.

This fixes the vram width reported in the kernel log on some boards.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 -2
index f932bec6e534..f873dd3cae16 100644
@@ -433,7 +433,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
                                                mem_channel_number = vram_info->v30.channel_num;
                                                mem_channel_width = vram_info->v30.channel_width;
                                                if (vram_width)
-                                                       *vram_width = mem_channel_number * (1 << mem_channel_width);
+                                                       *vram_width = mem_channel_number * 16;
                                                break;
                                        default:
                                                return -EINVAL;
--

2.45.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Deucher

[AMD Official Use Only - AMD Internal Distribution Only]

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, June 15, 2024 01:55
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/atomfirmware: fix parsing of vram_info

v3.x changed the how vram width was encoded. The previous implementation actually worked correctly for most boards. Fix the implementation to work correctly everywhere.

This fixes the vram width reported in the kernel log on some boards.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 -1
index f932bec6e534..f873dd3cae16 100644
@@ -433,7 +433,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
                                                mem_channel_number = vram_info->v30.channel_num;
                                                mem_channel_width = vram_info->v30.channel_width;
                                                if (vram_width)
-                                                       *vram_width = mem_channel_number * (1 << mem_channel_width);
+                                                       *vram_width = mem_channel_number * 16;
                                                break;
                                        default:
                                                return -EINVAL;

--
2.45.1