Commit 9d26e0cf authored by Yang Wang's avatar Yang Wang Committed by Alex Deucher

drm/amdgpu: refine gfx7 firmware loading

refine gfx7 firmware loading
Signed-off-by: default avatarYang Wang <kevinyang.wang@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 26c56049
...@@ -909,7 +909,6 @@ static void gfx_v7_0_free_microcode(struct amdgpu_device *adev) ...@@ -909,7 +909,6 @@ static void gfx_v7_0_free_microcode(struct amdgpu_device *adev)
static int gfx_v7_0_init_microcode(struct amdgpu_device *adev) static int gfx_v7_0_init_microcode(struct amdgpu_device *adev)
{ {
const char *chip_name; const char *chip_name;
char fw_name[30];
int err; int err;
DRM_DEBUG("\n"); DRM_DEBUG("\n");
...@@ -934,38 +933,38 @@ static int gfx_v7_0_init_microcode(struct amdgpu_device *adev) ...@@ -934,38 +933,38 @@ static int gfx_v7_0_init_microcode(struct amdgpu_device *adev)
BUG(); BUG();
} }
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_pfp.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw, fw_name); "amdgpu/%s_pfp.bin", chip_name);
if (err) if (err)
goto out; goto out;
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_me.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.me_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.me_fw, fw_name); "amdgpu/%s_me.bin", chip_name);
if (err) if (err)
goto out; goto out;
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ce.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw, fw_name); "amdgpu/%s_ce.bin", chip_name);
if (err) if (err)
goto out; goto out;
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.mec_fw, fw_name); "amdgpu/%s_mec.bin", chip_name);
if (err) if (err)
goto out; goto out;
if (adev->asic_type == CHIP_KAVERI) { if (adev->asic_type == CHIP_KAVERI) {
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec2.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.mec2_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.mec2_fw, fw_name); "amdgpu/%s_mec2.bin", chip_name);
if (err) if (err)
goto out; goto out;
} }
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name); err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, fw_name); "amdgpu/%s_rlc.bin", chip_name);
out: out:
if (err) { if (err) {
pr_err("gfx7: Failed to load firmware \"%s\"\n", fw_name); pr_err("gfx7: Failed to load firmware %s gfx firmware\n", chip_name);
gfx_v7_0_free_microcode(adev); gfx_v7_0_free_microcode(adev);
} }
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment