summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-09-25 13:56:16 -0500
committerAlex Deucher <alexander.deucher@amd.com>2023-09-28 15:37:34 -0400
commited1c1053cd00739eed2a96b5e19dd0b5e91477b9 (patch)
tree9ae54fa9935355054de6c9eadc2ac4ce0c2094cd /drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
parent0c3601a2fbfb265ce283651480e30c8e60459112 (diff)
downloadlinux-ed1c1053cd00739eed2a96b5e19dd0b5e91477b9.tar.gz
linux-ed1c1053cd00739eed2a96b5e19dd0b5e91477b9.tar.bz2
linux-ed1c1053cd00739eed2a96b5e19dd0b5e91477b9.zip
drm/amd: Move microcode init from sw_init to early_init for SDMA v5.0
As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 7e837acffa6e..c1ff5eda8961 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1336,6 +1336,11 @@ static void sdma_v5_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
static int sdma_v5_0_early_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+ int r;
+
+ r = sdma_v5_0_init_microcode(adev);
+ if (r)
+ return r;
sdma_v5_0_set_ring_funcs(adev);
sdma_v5_0_set_buffer_funcs(adev);
@@ -1367,10 +1372,6 @@ static int sdma_v5_0_sw_init(void *handle)
if (r)
return r;
- r = sdma_v5_0_init_microcode(adev);
- if (r)
- return r;
-
for (i = 0; i < adev->sdma.num_instances; i++) {
ring = &adev->sdma.instance[i].ring;
ring->ring_obj = NULL;