[PATCH 2/2] drm/amd: Skip not used microcode loading in SRIOV

Jingwen Chen Jingwen.Chen2 at amd.com
Fri Sep 18 05:55:41 UTC 2020


smc, sdma, sos and asd fw is not used in SRIOV. Skip them to
accelerate sw_init.

Signed-off-by: Jingwen Chen <Jingwen.Chen2 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c         | 16 +++++++++-------
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c         |  3 +++
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c |  3 +++
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 6c5d9612abcb..11252f41ab12 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -109,15 +109,17 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
 		BUG();
 	}
 
-	err = psp_init_sos_microcode(psp, chip_name);
-	if (err)
-		return err;
-
-	if (adev->asic_type != CHIP_SIENNA_CICHLID &&
-	    adev->asic_type != CHIP_NAVY_FLOUNDER) {
-		err = psp_init_asd_microcode(psp, chip_name);
+	if (!amdgpu_sriov_vf(adev)) {
+		err = psp_init_sos_microcode(psp, chip_name);
 		if (err)
 			return err;
+
+		if (adev->asic_type != CHIP_SIENNA_CICHLID &&
+			adev->asic_type != CHIP_NAVY_FLOUNDER) {
+			err = psp_init_asd_microcode(psp, chip_name);
+			if (err)
+				return err;
+		}
 	}
 
 	switch (adev->asic_type) {
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 48c95a78a173..d2c26b5fa00c 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -219,6 +219,9 @@ static int sdma_v5_0_init_microcode(struct amdgpu_device *adev)
 		BUG();
 	}
 
+	if(amdgpu_sriov_vf(adev))
+		return 0;
+
 	for (i = 0; i < adev->sdma.num_instances; i++) {
 		if (i == 0)
 			snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sdma.bin", chip_name);
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index d8ca6d968813..85860e08c198 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -114,6 +114,9 @@ int smu_v11_0_init_microcode(struct smu_context *smu)
 		return -EINVAL;
 	}
 
+	if (amdgpu_sriov_vf(adev))
+		return 0;
+
 	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_smc.bin", chip_name);
 
 	err = request_firmware(&adev->pm.fw, fw_name, adev->dev);
-- 
2.25.1



More information about the amd-gfx mailing list