]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:34:03 +0000 (09:34 +0200)
commit f6f49dda49db72e7a0b4ca32c77391d5ff5ce232 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

index 23651a9738cc85528092d13cc30939839102503c..6521d06c7e4e72e0ed5fe81575362543a521dc1a 100644 (file)
@@ -399,7 +399,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;