]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdgpu/atomfirmware: fix parsing of vram_info
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 17:48:26 +0000 (13:48 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jun 2024 18:11:46 +0000 (14:11 -0400)
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.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

index 108003bdf1e91156d3a5af46591eb5f279e1af1c..2e13c7c4b2b411c7e34957e0ef5d973225668ca5 100644 (file)
@@ -400,7 +400,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;