summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-09-25 22:02:10 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-09-28 22:38:11 +0300
commit751e293f2c998eda03004f9b351b0b6bdc335bd9 (patch)
tree89ceadd50caf8b469bc86a2d78b9b3d0128a79d0 /drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
parentcc766304833d1b44a705330383bf2ccee80ab554 (diff)
downloadlinux-751e293f2c998eda03004f9b351b0b6bdc335bd9.tar.xz
drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4
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_v2_4.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index 4dd944a93cf1..b58a13bd75db 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -816,6 +816,11 @@ static void sdma_v2_4_ring_emit_wreg(struct amdgpu_ring *ring,
static int sdma_v2_4_early_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+ int r;
+
+ r = sdma_v2_4_init_microcode(adev);
+ if (r)
+ return r;
adev->sdma.num_instances = SDMA_MAX_INSTANCE;
@@ -851,10 +856,6 @@ static int sdma_v2_4_sw_init(void *handle)
if (r)
return r;
- r = sdma_v2_4_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;