diff options
| author | Likun Gao <Likun.Gao@amd.com> | 2025-03-11 14:53:05 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2025-12-08 14:11:49 -0500 |
| commit | e5fc897b076e0bd0bab9c32154fdb1bba6566127 (patch) | |
| tree | 3189b9d7c6e725c331639ae8a947446c5cf7f6a8 /drivers/gpu/drm/amd | |
| parent | 3e22786128e5c822abecdd4fc9444b6b8ca38c32 (diff) | |
drm/amdgpu: skip SDMA autoload copy if not initialized
Skip SDMA firmware copy for rlc autoload if SDMA not enabled.
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c index fe903170db8c..8d281fb54b6b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c @@ -994,14 +994,16 @@ gfx_v12_1_rlc_backdoor_autoload_copy_sdma_ucode(struct amdgpu_device *adev) uint32_t fw_size; const struct sdma_firmware_header_v3_0 *sdma_hdr; - sdma_hdr = (const struct sdma_firmware_header_v3_0 *) - adev->sdma.instance[0].fw->data; - fw_data = (const __le32 *) (adev->sdma.instance[0].fw->data + - le32_to_cpu(sdma_hdr->ucode_offset_bytes)); - fw_size = le32_to_cpu(sdma_hdr->ucode_size_bytes); + if (adev->sdma.instance[0].fw) { + sdma_hdr = (const struct sdma_firmware_header_v3_0 *) + adev->sdma.instance[0].fw->data; + fw_data = (const __le32 *) (adev->sdma.instance[0].fw->data + + le32_to_cpu(sdma_hdr->ucode_offset_bytes)); + fw_size = le32_to_cpu(sdma_hdr->ucode_size_bytes); - gfx_v12_1_rlc_backdoor_autoload_copy_ucode(adev, SOC24_FIRMWARE_ID_SDMA_UCODE_TH0, - fw_data, fw_size); + gfx_v12_1_rlc_backdoor_autoload_copy_ucode(adev, SOC24_FIRMWARE_ID_SDMA_UCODE_TH0, + fw_data, fw_size); + } } static void |
