diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 7bb37b93993f..2b86569b18d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |||
@@ -159,6 +159,7 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev) | |||
159 | int err, i; | 159 | int err, i; |
160 | struct amdgpu_firmware_info *info = NULL; | 160 | struct amdgpu_firmware_info *info = NULL; |
161 | const struct common_firmware_header *header = NULL; | 161 | const struct common_firmware_header *header = NULL; |
162 | const struct sdma_firmware_header_v1_0 *hdr; | ||
162 | 163 | ||
163 | DRM_DEBUG("\n"); | 164 | DRM_DEBUG("\n"); |
164 | 165 | ||
@@ -183,6 +184,9 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev) | |||
183 | err = amdgpu_ucode_validate(adev->sdma[i].fw); | 184 | err = amdgpu_ucode_validate(adev->sdma[i].fw); |
184 | if (err) | 185 | if (err) |
185 | goto out; | 186 | goto out; |
187 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; | ||
188 | adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version); | ||
189 | adev->sdma[i].feature_version = le32_to_cpu(hdr->ucode_feature_version); | ||
186 | 190 | ||
187 | if (adev->firmware.smu_load) { | 191 | if (adev->firmware.smu_load) { |
188 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; | 192 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; |
@@ -630,8 +634,6 @@ static int sdma_v3_0_load_microcode(struct amdgpu_device *adev) | |||
630 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; | 634 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma[i].fw->data; |
631 | amdgpu_ucode_print_sdma_hdr(&hdr->header); | 635 | amdgpu_ucode_print_sdma_hdr(&hdr->header); |
632 | fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4; | 636 | fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4; |
633 | adev->sdma[i].fw_version = le32_to_cpu(hdr->header.ucode_version); | ||
634 | |||
635 | fw_data = (const __le32 *) | 637 | fw_data = (const __le32 *) |
636 | (adev->sdma[i].fw->data + | 638 | (adev->sdma[i].fw->data + |
637 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); | 639 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); |