Skip to content

Commit 74a353f

Browse files
raykwok1150alexdeucher
authored andcommitted
drm/amdgpu/gfx9: Fix incorrect firmware size calculation
[WHY] The memcpy() function copies n bytes from memory area src to memory area dest. So specify the firmware size in bytes. [How] Correct the calculation. Acked-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Lei Guo <raykwok1150@163.com> Reviewed-by: Junwei Zhang <zjunweihit@163.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f503fe6 commit 74a353f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ static int gfx_v9_0_mec_init(struct amdgpu_device *adev)
19601960
fw_data = (const __le32 *)
19611961
(adev->gfx.mec_fw->data +
19621962
le32_to_cpu(mec_hdr->header.ucode_array_offset_bytes));
1963-
fw_size = le32_to_cpu(mec_hdr->header.ucode_size_bytes) / 4;
1963+
fw_size = le32_to_cpu(mec_hdr->header.ucode_size_bytes);
19641964

19651965
r = amdgpu_bo_create_reserved(adev, mec_hdr->header.ucode_size_bytes,
19661966
PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,

0 commit comments

Comments
 (0)