AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Wang <kevinyang.wang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <hawking.zhang@amd.com>, <alexander.deucher@amd.com>
Subject: [PATCH 16/18] drm/amdgpu: refine gfx10 firmware loading
Date: Fri, 31 May 2024 14:52:47 +0800	[thread overview]
Message-ID: <20240531065249.1746350-16-kevinyang.wang@amd.com> (raw)
In-Reply-To: <20240531065249.1746350-1-kevinyang.wang@amd.com>

refine gfx10 firmware loading

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 632061b25867..84189bc15ea1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4116,7 +4116,6 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev)
 
 static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
 {
-	char fw_name[53];
 	char ucode_prefix[30];
 	const char *wks = "";
 	int err;
@@ -4131,27 +4130,27 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
 		wks = "_wks";
 	amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix, sizeof(ucode_prefix));
 
-	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp%s.bin", ucode_prefix, wks);
-	err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw, fw_name);
+	err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
+				   "amdgpu/%s_pfp%s.bin", ucode_prefix, wks);
 	if (err)
 		goto out;
 	amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_PFP);
 
-	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me%s.bin", ucode_prefix, wks);
-	err = amdgpu_ucode_request(adev, &adev->gfx.me_fw, fw_name);
+	err = amdgpu_ucode_request(adev, &adev->gfx.me_fw,
+				   "amdgpu/%s_me%s.bin", ucode_prefix, wks);
 	if (err)
 		goto out;
 	amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_ME);
 
-	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce%s.bin", ucode_prefix, wks);
-	err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw, fw_name);
+	err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw,
+				   "amdgpu/%s_ce%s.bin", ucode_prefix, wks);
 	if (err)
 		goto out;
 	amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_CE);
 
 	if (!amdgpu_sriov_vf(adev)) {
-		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
-		err = request_firmware(&adev->gfx.rlc_fw, fw_name, adev->dev);
+		err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
+					   "amdgpu/%s_rlc.bin", ucode_prefix);
 		if (err)
 			goto out;
 
@@ -4166,15 +4165,15 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
 			goto out;
 	}
 
-	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec%s.bin", ucode_prefix, wks);
-	err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw, fw_name);
+	err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
+				   "amdgpu/%s_mec%s.bin", ucode_prefix, wks);
 	if (err)
 		goto out;
 	amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC1);
 	amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC1_JT);
 
-	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2%s.bin", ucode_prefix, wks);
-	err = amdgpu_ucode_request(adev, &adev->gfx.mec2_fw, fw_name);
+	err = amdgpu_ucode_request(adev, &adev->gfx.mec2_fw,
+				   "amdgpu/%s_mec2%s.bin", ucode_prefix, wks);
 	if (!err) {
 		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2);
 		amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2_JT);
-- 
2.34.1


  parent reply	other threads:[~2024-05-31  6:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  6:52 [PATCH 01/18] drm/amdgpu: enhance amdgpu_ucode_request() function flexibility Yang Wang
2024-05-31  6:52 ` [PATCH 02/18] drm/amdgpu: refine gpu_info firmware loading Yang Wang
2024-05-31  6:52 ` [PATCH 03/18] drm/amdgpu: refine isp " Yang Wang
2024-05-31  6:52 ` [PATCH 04/18] drm/amdgpu: refine mes " Yang Wang
2024-05-31 14:24   ` Deucher, Alexander
2024-05-31 14:49     ` Wang, Yang(Kevin)
2024-05-31  6:52 ` [PATCH 05/18] drm/amdgpu: refine psp " Yang Wang
2024-05-31  6:52 ` [PATCH 06/18] drm/amdgpu: refine sdma " Yang Wang
2024-05-31  6:52 ` [PATCH 07/18] drm/amdgpu: refine imu " Yang Wang
2024-05-31  6:52 ` [PATCH 08/18] drm/amdgpu: refine pmfw/smu " Yang Wang
2024-05-31  6:52 ` [PATCH 09/18] drm/amdgpu: refine gmc " Yang Wang
2024-05-31  6:52 ` [PATCH 10/18] drm/amdgpu: refine vcn " Yang Wang
2024-05-31  6:52 ` [PATCH 11/18] drm/amdgpu: refine vpe " Yang Wang
2024-05-31  6:52 ` [PATCH 12/18] drm/amdgpu: refine gfx6 " Yang Wang
2024-05-31  6:52 ` [PATCH 13/18] drm/amdgpu: refine gfx7 " Yang Wang
2024-05-31  6:52 ` [PATCH 14/18] drm/amdgpu: refine gfx8 " Yang Wang
2024-05-31  6:52 ` [PATCH 15/18] drm/amdgpu: refine gfx9 " Yang Wang
2024-05-31  6:52 ` Yang Wang [this message]
2024-05-31  6:52 ` [PATCH 17/18] drm/amdgpu: refine gfx11 " Yang Wang
2024-05-31  6:52 ` [PATCH 18/18] drm/amdgpu: refine gfx12 " Yang Wang
2024-06-03 11:05 ` [PATCH 01/18] drm/amdgpu: enhance amdgpu_ucode_request() function flexibility Christian König
  -- strict thread matches above, loose matches on Subject: below --
2024-06-03  1:41 [PATCH 00/18] Enhance amdgpu_firmware_request() to improve " Yang Wang
2024-06-03  1:42 ` [PATCH 16/18] drm/amdgpu: refine gfx10 firmware loading Yang Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240531065249.1746350-16-kevinyang.wang@amd.com \
    --to=kevinyang.wang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=hawking.zhang@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox