Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
··· 433 433 mem_channel_number = vram_info->v30.channel_num; 434 434 mem_channel_width = vram_info->v30.channel_width; 435 435 if (vram_width) 436 - *vram_width = mem_channel_number * (1 << mem_channel_width); 436 + *vram_width = mem_channel_number * 16; 437 437 break; 438 438 default: 439 439 return -EINVAL;