diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c index d7895885fe0c..a988dfb1d394 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | |||
@@ -121,6 +121,7 @@ static int sdma_v2_4_init_microcode(struct amdgpu_device *adev) | |||
121 | int err, i; | 121 | int err, i; |
122 | struct amdgpu_firmware_info *info = NULL; | 122 | struct amdgpu_firmware_info *info = NULL; |
123 | const struct common_firmware_header *header = NULL; | 123 | const struct common_firmware_header *header = NULL; |
124 | const struct sdma_firmware_header_v1_0 *hdr; | ||
124 | 125 | ||
125 | DRM_DEBUG("\n"); | 126 | DRM_DEBUG("\n"); |
126 | 127 | ||
@@ -142,6 +143,9 @@ static int sdma_v2_4_init_microcode(struct amdgpu_device *adev) | |||
142 | err = amdgpu_ucode_validate(adev->sdma[i].fw); | 143 | err = amdgpu_ucode_validate(adev->sdma[i].fw); |
143 | if (err) | 144 | if (err) |
144 | goto out; | 145 | goto out; |
146 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; | ||
147 | adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version); | ||
148 | adev->sdma[i].feature_version = le32_to_cpu(hdr->ucode_feature_version); | ||
145 | 149 | ||
146 | if (adev->firmware.smu_load) { | 150 | if (adev->firmware.smu_load) { |
147 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; | 151 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; |
@@ -541,8 +545,6 @@ static int sdma_v2_4_load_microcode(struct amdgpu_device *adev) | |||
541 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; | 545 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; |
542 | amdgpu_ucode_print_sdma_hdr(&hdr->header); | 546 | amdgpu_ucode_print_sdma_hdr(&hdr->header); |
543 | fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4; | 547 | fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4; |
544 | adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version); | ||
545 | |||
546 | fw_data = (const __le32 *) | 548 | fw_data = (const __le32 *) |
547 | (adev->sdma[i].fw->data + | 549 | (adev->sdma[i].fw->data + |
548 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); | 550 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); |