summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-09-25 14:02:02 -0500
committerAlex Deucher <alexander.deucher@amd.com>2023-09-28 15:38:05 -0400
commitcc766304833d1b44a705330383bf2ccee80ab554 (patch)
tree79167df00140ca093b3bcdc6ddd5852326f66fd0 /drivers/gpu/drm/amd/amdgpu
parente0d4fbb58c4c0cd381089a6a083a4fa4662f007c (diff)
downloadlinux-stable-cc766304833d1b44a705330383bf2ccee80ab554.tar.gz
linux-stable-cc766304833d1b44a705330383bf2ccee80ab554.tar.bz2
linux-stable-cc766304833d1b44a705330383bf2ccee80ab554.zip
drm/amd: Move microcode init from sw_init to early_init for SDMA v3.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')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index dc7aab68ed66..c5ea32687eb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -1087,6 +1087,7 @@ static void sdma_v3_0_ring_emit_wreg(struct amdgpu_ring *ring,
static int sdma_v3_0_early_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+ int r;
switch (adev->asic_type) {
case CHIP_STONEY:
@@ -1097,6 +1098,10 @@ static int sdma_v3_0_early_init(void *handle)
break;
}
+ r = sdma_v3_0_init_microcode(adev);
+ if (r)
+ return r;
+
sdma_v3_0_set_ring_funcs(adev);
sdma_v3_0_set_buffer_funcs(adev);
sdma_v3_0_set_vm_pte_funcs(adev);
@@ -1129,10 +1134,6 @@ static int sdma_v3_0_sw_init(void *handle)
if (r)
return r;
- r = sdma_v3_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;